People Need to Collaborate…

You have probably encountered this situation: people need to collaborate on a document. Yet, they do not have access to each others space for security or confidentiality matters. You haven’t? Then you should read this blog post too! This is bound to happen to you at some point.

…so Why Should We Restrain Them?

In such a situation, we often see some (bad) solutions:

  • Create a specific space for these users: It’s hard to keep track of what has been done, and to maintain. It also forces them to create a structure that has no other particular reason to exist.
  • Give access to the whole space where the document is located: If access was not granted in the first place, there was a reason for that.
  • Create several copies and merging them manually: Collaborating shouldn’t be that difficult.

So what should you do? Use Nuxeo Studio to create a basic workflow creating a document shortcut. If you are new to this, you can opt for a free 30 day Nuxeo Studio trial.

A Shortcut, You Say?

Shortcuts in the Nuxeo Platform are also called proxies. They can point to an archived version of a document, or to the document’s current version (in this case, we call it a live proxy).

How Does a Live Proxy Work?

  • Whenever you edit the original document or the proxy live, both are modified at the same time.
  • A live proxy inherits the access rights of the space where it is currently located. It doesn’t take into account the rights of the original document’s space. That allows people with access to different spaces to work together, and that’s the whole point of this post.
  • If the live proxy is deleted, it has no impact on the original document.

How Do I Implement That?

We will use a workflow to ask your user where they want to have a live proxy created, from a predefined options list. The result in Studio is the following:

Create shortcut workflow graph

Looks easy, right? On to the recipe now!

Define Where the Proxy Can Be Created

We will start by creating the options list for the proxy creation.

  1. In Nuxeo Studio, add a new vocabulary.
  2. Choose “simple vocabulary”. In this example, I named it “spaces”.
  3. When you add entries:

    1. In the id: put a relative or absolute path. This will point to the space where the proxy can be created. In the capture below I put a relative path starting from the domain.
    2. In the label, type what the user should see in his options list.

Destination spaces vocabulary

We are using a vocabulary to achieve this for two reasons:

  1. If we provided the user with a document suggestion, he would only see spaces where he has access to.
  2. It gives us better control over what we want to display.

Create Your Workflow

  1. In Nuxeo Studio, create a new workflow and name it.

Create shortcut workflow - variables

  1. In the variables tab, add a String variable named destination. This will store the user’s choice.
  2. In the availability tab, define when you should be able to use your workflow. Make sure you choose “Current document is: Regular Document“ to avoid people launching the workflow on a proxy. For more details, have a look at the filtering options reference page.
  3. In the graph tab, drag and drop a “start” node, a “stop” node, and an “approve” node from the node library on your left. Link them together. Your setup should look like this:

Create shortcut workflow graph

Setup the User’s Choice

The user should be presented with the list of destination spaces. Here’s how.

Create shortcut workflow - Destination selection form

  1. Hover your mouse on the “approve” node and edit it.
  2. Go to the form tab.
  3. In the drop down list on your right, choose your workflow variables (var_yourWorkflowId).
  4. Drag and drop the “destination” variable to the form in the middle of the screen.
  5. A popup will appear to let you choose the display properties.
  6. Use a single directory suggestion widget “Nuxeo suggestion widget types”), and use your “spaces” vocabulary. You can also setup the “minimum characters” property to 0.
  7. Make sure you save these properties before continuing.

Implement the Business Logic

  1. In the node’s “general” tab, you can setup the properties as follows:
    Create shortcut workflow - General properties

As you can see, I am using an automation chain in the node’s output to create the shortcut. Click on the Create button to add it, and don’t worry: this will save your workflow automatically.

  1. You can build your chain as follows:
    Create shortcut workflow - Create live proxy chain

Create shortcut workflow - Create live proxy chain destination details

The destination path for my live proxy is based on the current domain’s path, to which I add the user chosen option. You could build it differently of course.

Try It Out

You are all done! Now deploy your changes and try them out:

  1. In your local Nuxeo instance, go to the admin center.
  2. Choose the update center menu on the left.
  3. Click on the “Nuxeo Studio” tab, then on the “update” button.
  4. And this is the final result:
    Create shortcut workflow - Final result

Create shortcut workflow - Final result - task

My next post will explain how to delegate temporary access to a document. See you soon!