This Java scenario describes a two-component Job which aims at creating two document files with the related metadata in an Alfresco server, the java-based Enterprise Control Management system.
Drop the tFileInputDelimited and tAlfrescoOutput components from the Palette onto the design workspace.
Connect the two components together using a Main > Row connection.
In the design workspace, double-click tFileInputDelimited to display its basic settings.
Set the File Name path and all related properties. Note that if you have already stored your input schemas locally in the Repository, you can simply drop the relevant file item from the Metadata folder onto the design workspace and the delimited file settings will automatically display in the relevant fields in the component Basic settings view.
For more information about metadata, see Setting up a File Delimited schema in Talend Studio User Guide.
In this scenario, the delimited file provides the metadata and path of two documents we want to create in the Alfresco server. The input schema for the documents consists of four columns: file_name, destination_folder name, source_path, and author.
And therefore the input schema of the delimited file will be as the following:
In the design workspace, double-click tAlfrescoOutput to display its basic settings.
In the Alfresco Server area, enter the Alfresco server URL and user authentication information in the corresponding fields.
In the TargetLocation area, either type in the base name where to put the document in the server, or Select the Map... check box and then in the Column list, select the target location column,
destination_folder_namein this scenario.
When you type in the base name, make sure to use the double backslash (\\) escape character.
In the Document Mode list, select the mode you want to use for the created documents.
In the Container Mode list, select the mode you want to use for the destination folder in Alfresco.
Click the Define Document Type three-dot button to open the tAlfrescoOutput editor.
Click the Add button to browse and select the xml file that holds the metadata according to which you want to save the documents in Alfresco.
All available aspects in the selected model file display in the Available Aspects list.
You can browse for this model folder locally or on the network. After defining the aspects to use for the document to be created in Alfresco, this model folder is not needed any more.
If needed, select in the Available Aspects list the aspect(s) to be included in the metadata to write in the Alfresco server. In this scenario we want the author name to be part of the metadata registered in Alfresco.
Click the drop-down arrow at the top of the editor to select from the list the type to give to the created document in Alfresco,
Contentin this scenario.
All the defined aspects used to select the metadata to write in the Alfresco server display in the Property Mapping list in the Basic Settings view of tAlfrescoOutput, three aspects in this scenario, two basic for the
name) and an additional one (
Click Sync columns to auto propagate all the columns of the delimited file.
If needed, click Edit schema to view the output data structure of tAlfrescoOutput.
Click the three-dot button next to the Result Log File Name field and browse to the file where you want to save any logs after Job execution.
Save your Job, and press F6 to execute it.
The two documents are created in Alfresco using the metadata provided in the input schemas.