It might be interesting to have the possibility to download a low resolution or a high resolution JPEG/PNG/... version of the artwork file you are viewing available for download. By default, WebCenter doesn't allow you to download files from within the viewer, but with the use of document references and Automation Engine we can provide a solution for this problem.
We need a few different components to be able to create such a setup.
Document attribute category extended with document references for the documents you want to enable a download.
If you don't use an attribute category for your documents, you can create a new one.
If you already use an attribute category, you will need to extend it with some extra document references.
A WebCenter (sub)workflow that is executed to start a workflow in Automation Engine and sends over the graphic files.
An Automation Engine workflow that will generate thumbnails, uploads and attaches them to the document reference attributes.
For example, I will be starting from a blank attribute category that will be applied to a document.
The Document Attribute Category
Depending on the requirement, you can choose to either use one or more document references. You might want to have both a low resolution and a high resolution image available for download.
This can be done in two ways, either you use a single document reference attribute, allowing multiple values. Or you choose a different document reference attribute for each of the possible download types.
Next, we disable all document sources, we don't want anyone to be able to change the possible sources. only Automation Engine should be responsible for uploading a file.
Next, we setup the document rendering options, we basically disable all options except the download possibility, the thumbnail and document name.
Finally, we create a Viewer view that will allow you to show the document attributes in the Viewer. You can also extend this by creating dedicated views for specific roles. This will allow you to only enable the download for people fulfilling a dedicated role.
You can also extend the category with a "read only" String attribute that we can use to update the status, notifying the user that the download is available.
The WebCenter workflow can be dependent on how you want to use the setup. It can be a standalone workflow that is triggered via the rule engine, the Document Types setup or a sub workflow that will be called from within an existing WebCenter workflow.
I am going to start from the assumption that this workflow will be started from the Document Type section. If a graphic file is uploaded, this workflow will be launched. This is a similar workflow that could be used via the rule engine. The input to this workflow is a document.
It splits off all non supported file types, assigns the created document attribute category, sets the text attribute to Waiting download and submits the files to an Automation Engine workflow. Once the workflow is finished, the text attribute is set to Download available.
When using an existing workflow, it might be sufficient to select the necessary documents and send those to Automation Engine.
Automation Engine Workflow
This depicts the scenario where there is one document reference which contains multiple downloadable files.
The Automation Engine workflow has three major steps:
Generate a low/high resolution file
Upload it to WebCenter
Link the uploaded file into the document reference attribute.
The router checks if the input files are normalized PDF files, if not we normalize them first. This is needed as the we use the Create PAF task to generate the PNG files for download. If you prefer other types of downloadable files, you can use the script runner. Have a look at the following article to get you started:
Next, we upload the generated files to WebCenter using the Integrate with WebCenter Ticket. When the workflow was started, WebCenter sends over the Project ID as a workflow parameter. We reuse this parameter to upload to the correct project.
Next, we want a return from WebCenter when the document was successfully uploaded, this return needs to contain the Document Version ID. The ID can be obtained using the output parameters, these will be converted to workflow parameters. This needs to be done for each download type you want. In this example, we do it for both a high and a low resolution.
The datacollector will wait until both files are uploaded.
A next important step is the select file task. This task is configured to only select one of all the incoming files, this is needed as we only want to trigger the following integrate with WebCenter task once! It doesn't matter which file you choose, in this example I choose the low resolution version.
Next we attach the uploaded document to the document reference using the Document Version ID parameter we got back after uploading. Here we need to combine multiple values as we need to attach both the low and the high resolution version to the same document reference!
We can obtain this by putting both values together, separated by a pipe: e.g: value1 | value2
WebCenter is clever enough to understand that the pipe separates the values and both need to be inserted in the document reference.
An important part here is the Attribute ID that needs to be filled in. The Attribute ID is what WebCenter uses to identify the attribute value which you want to modify. The ID can be obtained by going to the attribute in the browser. Either hovering over the attribute in the Attributes section, which will show the ID in the footer of the browser. Or by inspecting the element in the attribute category.
The result can, depending on the styling, look like this: