How to display Alfresco Documents on Activiti form by passing the nodeRef - alfresco

I have an Activiti process with a Start Event. How can I show the Alfresco Document on the Form on a the Start Event by entering the nodeRef?
In production it will not be manual entering the nodeRef though but by passing it using the Activiti REST API. I need to be able to show the Alfresco document using the 'Display value' field on a form (on the Start event or maybe on a User Task which flows from it)

In the Enterprise version, there is in fact a feature to link Documents uploaded in Activiti with Alfresco using the share connector.
In the community version, you'll have to implement your custom logic to store documents in alfresco and retrieve documents. a neat way would be to use Alfresco's Restv1 APIs.
Using these APIs you should be able to create your custom code in Activiti to interact with your repository.

Related

Publish to Alfresco task programmatically

I am using Activiti 1.9.03 and Alfresco 5.2.4 enterprise versions. I have a requirement where I have to maintain the version of the generated report document and also uploaded document (if user edits it). Right now After each user tasks, I am adding two Publish to Alfresco tasks. This is making the workflow diagram unreadable.
I want to know the following things.
Is there any other way to handle versioning in Activiti instead of pushing the content to the Alfresco?
How can I upload the content programatically using JAVA or Javascript task in a listener, so that I don't have to keep the Publish to Alfresco tasks in the workflow definition. OR
Is there any way to hide the Publish to Alfresco tasks on the workflow diagram?
Any help will be appreciated...
Thank you
In APS,There are Services like AlfrescoService,AlfrescoContentService.
You can autowire those services in your Listner and you can use REST Call.

Custom Report in alfresco?

Currently i am generating a report (we are getting files are uploaded within a time stamp).
I am getting all files and folders.Iterating the result and checking created date one by one.That is taking too much time approx 8 min to revert with resuls.Can anyone tell me is there any alfresco report api that i can use? or using solr how to fetch the result?
I like to follow an approach which is maybe not really orthodox. Usually, you don't want to report on all documents, only document using a specific type or aspect. So, what I do is to create a Java behaviour on onCreate, onUpdate and onDelete that updates a custom database with only the metadata that I'm interested in. Then, I can connect any OOTB reporting tools such as Pentaho, Jasper or Tableau. You have of couse some other traditional alternatives, such as:
Using this module developed by a community member: http://fcorti.com/alfresco-audit-analysis-reporting/
Or using the module provided by Alfresco: http://docs.alfresco.com/analytics/concepts/analytics-using.html
SOLR/Lucene is not an option, querying DB directly is not an option either (performance wise).
I would suggest using one of the options available (AAAR for instance) or developing something on your own following the same principles.
I did little bit investigation on this and found below link.
http://docs.alfresco.com/4.0/tasks/audit-recording-values.html
I think you can user auditService in alfresco and get your things done.There are few alfresco webservices(related to audit) already available which will allow you to filter response.In case if you need to customize it , than you can create webscript and use auditService in it.
You can use below url for browsing all your alfresco webservice.
http://localhost:8080/alfresco/service/index

Get property of object Alfresco

I'm using Alfresco 5.1 Community, and i'm trying to get a property of an object for example, in the user we have:
"{http://www.alfresco.org/model/content/1.0}companytelephone"
If I want to get the value of this property, how can I obtain this in javascript?
It depends where you're trying to do this, if you're doing this in a JavaScript controller for a WebScript on the Repository then you will be able to find most of the information in this Wiki page: https://wiki.alfresco.com/wiki/JavaScript_API_Cookbook
If you're doing it in the JavaScript controller of a WebScript running on Share then for most objects you'll need to request the full metadata for the node by calling a REST API on the Repository.
In the case of the user, there is a "user" object available in WebScripts running on the Share tier.
There is lots of information on getting this kind of data with some basic Googling, I'd also recommend launching the Rhino debugger via the WebScripts index page so you can try evaluating JavaScript code (this works for both the Repository and for Share).

Howto recognize documents in Alfresco 5.0 and filing them according content?

I have following use case:
Existing scanner scans documents and stores them via WebDAV or a shared network drive to Alfresco
Documents are separated with a barcode to identify the customer and document type (e.g. bill)
If a document arrives in the shared drive, Alfresco should analyse it and move it (according customer and document type) to the suitable internal folder structure.
Example of a folder structure:
/scans/
/customers/ExampleCustomer1/bills
/customers/ExampleCustomer1/emails
/customers/ExampleCustomer1/hr
/customers/ExampleCustomer2/bills
/customers/ExampleCustomer2/emails
/customers/ExampleCustomer2/hr
Question:
What do I need in Alfresco to process step 3) to automatically recognize documents and file them?
P.s. I know there exists applications like Ephesoft/Kofax but I would like to have a module inside Alfresco which does the job for me without external dependencies.
I would suggest the following sequence:
1)Your scanner or other (OCR) software needs to interprete the barcode and save the customer and type somewhere in the document, for example in docx metadata.( I am not aware of an alfresco module doing ocr or barcode reading)
2)After upload via webdav, you have to run alfresco metadata extract action, which will have to extract the customer and type from the documents metadata into alfresco metadata by using an alfresco rule script or behaviour.
Using a rule, you can choose the action "extract common metadata fields"
Using a java behaviour, you can call the same action like this:
Action action = actionService.createAction("extract-metadata");
actionService.executeAction(action, node);
This extract action is described here : https://wiki.alfresco.com/wiki/Metadata_Extraction . You may have to add custom code for your barcode requirement. (https://wiki.alfresco.com/wiki/Content_Transformation_and_Metadata_Extraction_with_Apache_Tika )
3)an alfresco rule script or behaviour is now able to move your document by reading this alfresco metadata property.
This is a very good howto about custom types and let me deep dive into Alfresco:
http://ecmarchitect.com/alfresco-developer-series-tutorials/content/tutorial/tutorial.html
Alfresco Developer Tutorials: http://ecmarchitect.com/alfresco-developer-series

Interface for transfering files between alfresco and fedena

I want to make an interface between Alfresco and Fedena which takes a corresponding document from the Fedena and puts it into Alfresco (and can also go from Alfresco to Fedena).
How would I do this?
I am not aware of fedena.But in case of alfresco e can do this using 2 days.Both of them are as below.
1.Using CMIS API which is provided by alfresco
Below are some use full links for that.
http://wiki.alfresco.com/wiki/CMIS
http://docs.alfresco.com/5.0/pra/1/topics/cmis-welcome.html
2.Rest Api using webscript
For this you need to create webscript on your own.Basic details regarding webscript can be found on below link
https://wiki.alfresco.com/wiki/Web_Scripts
http://docs.alfresco.com/4.1/tasks/ws-hello-world-create.html

Resources