How to connect OTRS with Alfresco (Part 1)

Robert Ullrich06. Oct 2017 | ConsultingUse cases

Because I need a new challenge every month, I thought about an integration between OTRS and Alfresco to store documents, which are sent to customers via OTRS, also in Alfresco. I call this integration AlfrescoConnector. Because this integration will become very complex, I’ll split this how-to into several blog articles, which will be released regularly. In this article, I’ll show you how to create, delete sites and how to create, delete folders in Alfresco.

To complete this how-to, you need at first a running OTRS and an Alfresco system. For some operations, you need special privileges in Alfresco (e.g. administrator privileges). The REST/JSON API of Alfresco is activated by default.

Use case for this connector

The AlfrescoConnector can be useful in companies who are sending documents to their customers via OTRS and have to upload them to Alfresco. To improve this workflow and to prevent agents of manually uploading documents to Alfresco, you can use the connector if this article.

OTRS Requirements for this How-To

OTRS Framework

  • at least OTRS 5.0.x

OTRS Packages

You need the following Freely selectable Features of the OTRS Business Solution5s :

  • OTRSGenericInterfaceInvokerTicket
(Adds new invoker for TicketCreate and TicketUpdate in the GenericInterface.)
  • OTRSGenericInterfaceInvokerEventFilter
(Contains additional functionalities to add conditions to events of invokers.)

Third Party Software

You need this third-party software:

  • XML::Simple
  • XML::LibXML
  • XML::LibXSLT

DynamicFields

  • “AlfrescoSiteID” of type „TEXT“ to store the id of a site (e.g.: 1)
  • “AlfrescoSiteName” of type “TEXT”
  • “AlfrescoSiteVisibility” of type “DROPDOWN” with the following values:
    • PRIVATE: PRIVATE
    • PUBLIC:PUBLIC
  • “AlfrescoFolderName” of type “TEXT”
  • “AlfrescoFolderID” of type “TEXT” to store the id of a folder

Configuring the AlfrescoConnector in OTRS

Now we can start with the configuration. The name of the new web service is “AlfrescoConnector”. Afterwards, you have to set up the needed invokers.

AlfrescoConnector General Configuration

Configuring the Invoker “SiteCreate”

Now you’re ready to start the configuration of the Invokers. At first, we’ll create an Invoker for adding new sites to Alfresco. Set up an Invoker called “SiteCreate” and select all the needed data for your outgoing requests and use “XSLT” as mapping for your outgoing and incoming response data.

AlfrescoConnector Invoker SiteCreate

For the incoming response data, you have to select the dynamic field “SiteID”, which you created before.

AlfrescoConnector Invoker SiteCreate1

Now you can configure your outgoing XSLT-mapping. If you need a working XSLT-mapping, you can use the following example:

AlfrescoConnector Invoker SiteCreate Outgoing Mapping

You also need a XSLT-mapping for the incoming response data, because you have to store the Site ID:

AlfrescoConnector Invoker SiteCreate Incoming Mapping

The used “Event trigger” is the last point for this invoker. Just select one and you’re done with the first Invoker.

Configuring the Invoker “SiteDelete”

The next invoker is “SiteDelete”.  Select all the needed data for your outgoing requests (please don’t forget the dynamic field “AlfrescoSiteID” in the “Ticket dynamic fields” drop-down) and use “XSLT” as a mapping for your outgoing data.

AlfrescoConnector Invoker SiteDelete

As outgoing XSLT-mapping, you can use my example.

AlfrescoConnector Invoker SiteDelete Outgoing Mapping

A mapping for the incoming response data is not necessary because Alfresco sends an empty response.

The used “Event Trigger” is the last point for this Invoker. Just select one and you’re done with the second Invoker. In my example, I’m using a “TicketSubscribe” Event.

AlfrescoConnector Invoker SiteDelete 1

Configuring the Invoker “NodeCreate”

The next Invoker is “NodeCreate”.  Select all the needed data for your outgoing requests and use “XSLT” as a mapping for your outgoing request and incoming response data.

Use my example as outgoing XSLT-mapping:

AlfrescoConnector Invoker NodeCreate Outgoing Mapping

Furthermore, we want to store the NodeID of the response, for that reason we have to use the following mapping for incoming response data:

AlfrescoConnector Invoker NodeCreate Incoming MappingThis mapping stores the NodeID in the dynamic field “AlfrescoFolderID”.

The  “Event trigger” is the last point. Select one and you’re done with the next Invoker.

AlfrescoConnector Invoker NodeCreate General Configuration 1

Configuring the Invoker “NodeDelete”

The next invoker is “NodeDelete”.  Select all the needed data for your outgoing requests (please don’t forget the dynamic field “AlfrescoFolderID” in the “Ticket dynamic fields” drop-down) and use “XSLT” as a mapping for your outgoing data.

Use my example as outgoing XSLT-mapping:

Because the answer is empty if it was successful, you don’t need a mapping for the incoming response data.

The used “Event trigger” is the last point. Select a trigger of your choice and you’re done with the last Invoker of my tutorial.

AlfrescoConnector Invoker NodeDelete General Configuration 1

Configuring the AlfrescoConnector “Network Transport”

Requester configuration

It’s necessary to configure the network transport for the Invokers because we’ve to use the right requests commands towards Alfresco. Otherwise, we’ll receive errors. It’s quite easy as you can see:

AlfrescoConnector Transport_Configuration

Please select “BasicAuth” for authentication and use a valid user.

Afterward just click on “Save and finish”.

Next time

In the next blog article for the AlfrescoConnector, I’ll show you how to create files and additional users in Alfresco.

More information about the Alfresco API

You can also use other resources which are provided by the Alfresco API.

If you need more information, please go to the following website: https://api-explorer.alfresco.com/api-explorer/

Your email address will not be published. Required fields are marked *

This site uses cookies. By continuing to use the site, you agree to the use of cookies. More information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close