cancel
Showing results for 
Search instead for 
Did you mean: 

Remote Alfresco API rivet

rivetlogic
Champ on-the-rise
Champ on-the-rise
RAAr

RAAr is an abstraction layer for remote communication with Alfresco ECM. RAAr provides a simple, Java-based local library that may be used by one or more content rich applications and allows these applications to interface to Alfresco (including multiple Alfresco repositories from the same application). RAAr's lower layers handle communication to remote Alfresco instances over ReSTful calls to Alfresco that get mapped to calls to the Alfresco Foundation Services (AFS) API.

Motivation for RAAr

Certain classes of content rich applications require one or more of the following:

    * Remote full coverage of the AFS API (e.g., version management and version history traversal, dictionary services for model introspection, multi-store access, etc.)
    * Streaming content directly from the application and not from Alfresco (i.e., not using download servlet)
    * SSO support
    * Middle-tier business logic within the application where not all processing is done on Alfresco app server
    * Support for un-marshalling of result sets
RAAr lives here:
http://wiki.rivetlogic.org/display/RAAR/

Feel free to ask questions about RAAr in this thread.

–Sumer
112 REPLIES 112

rivetlogic
Champ on-the-rise
Champ on-the-rise
Hi,

It seems that there was some sort of error that happened during your batch process that caused nodes to be created with content URLs that point to file system locations that do not exist. Normally if the content upload process failed your transactions would have rolled back.

It's hard to tell what kind of error(s) you have in the batch process without debugging it in detail.

I would suggest that you start there and see how that process failed, but from what I've seen so far this doesn't seem to be a RAAr or Alfresco issue.

Hope this helps,

–Alaaeldin

klwalker
Champ in-the-making
Champ in-the-making
I don't believe the failure was caused by Alfresco or RAAR.  I'm pretty sure it happened after we switched the indexing configuration from sync to async, and then the batch job which runs in multiple threads started throwing errors when creating spaces on the fly.  I think we have fixed the batch job with some synchronized code and NodeRef caching, but now I'm just trying to write a job to go through and re-upload any missing content.  Is there a way to try to access the content with the contentUrl, such as "store://2009/3/26/11/29/0a6ea243-9347-4a7b-a2c1-bf44e8a88dcf.bin" and have it fail if that file doesn't exist in the repository?

The problem is that I can use the download servlet to get the content, but when it's missing, it returns the following text rather than throwing an exception or something, so I'm just wondering how to best detect this situation, rather than relying on the size returned, which is 315 due to the message below, or reading the first few bytes and seeing if they equal "The node's content is missing" or something like that, since that's a hack which might just stop working someday since that message is not generated by our code:

The node's content is missing:
   node: workspace://SpacesStore/b1f00e04-e4fe-4607-8d35-181c1b770a91
   reader: ContentAccessor[ contentUrl=store://2009/3/26/11/29/0a6ea243-9347-4a7b-a2c1-bf44e8a88dcf.bin, mimetype=application/pdf, size=0, encoding=UTF-8, locale=en_US] 
Please contact your system administrator.

rivetlogic
Champ on-the-rise
Champ on-the-rise
One thing that you could do is, write a job that will get the contentUrl and do a simple java i/o file operation to see if the file exists.
If there is no file, either you can update the node with new content or delete the node and trying uploading the content again.

Best Regards,
Shagul

klwalker
Champ in-the-making
Champ in-the-making
I'm not sure how I can check whether the file exists or not though because it's running remotely.  The Alfresco server which is storing the content is not on the same machine as the JBoss server which is making the call.

klwalker
Champ in-the-making
Champ in-the-making
When do you plan to support Alfresco v3.1?

rivetlogic
Champ on-the-rise
Champ on-the-rise
I created a JIRA to track this issue:

http://issues.rivetlogic.com/browse/CMA-43

I'll update the ticket with estimates and prioritize soon.

Cheers.

–Sumer

simkoj
Champ in-the-making
Champ in-the-making
I am currently evaluating CMA 1.11.0.
SearchService contains 4 methods which are not deprecated.
Following method does not return properties even if flag returnAllProperties=true
searchService.query(ticket, storeRef, lucene, query, true, true, true, true, true, null, maxResults, null);

Method SearchServiceWebScript.createNode … contains code which could be source of the problem:

            Map<QName, Serializable> propertyMap = null;
      // set properties of node
      if (returnAllProperties) {
         node.setProperties(bareNodeService.getProperties(nodeRef));
      } else if (properties != null) {
         propertyMap = new HashMap<QName, Serializable>(properties.size());
         for (QName property : properties) {
            propertyMap.put(property, bareNodeService.getProperty(nodeRef, property));
         }
      }
      node.setProperties(propertyMap); // here is set null in the case returnAllProperties=true

olivierdelcroix
Champ in-the-making
Champ in-the-making
Hello,

Is the last version of Raar (1.11.x) compatible with the last Alfresco Enterprise Edition (3.1)  ?

If not, have you an idea when the next release will support it?

Best Regards

Olivier

itsard
Champ in-the-making
Champ in-the-making
When I am trying to validate the user am getting this error.I could not find this class anywhere.

com.rivetlogic.core.cma.exception.AuthenticationFailure: java.lang.NoClassDefFoundError: com/rivetlogic/crypto/Base64
   at com.rivetlogic.core.cma.impl.AuthenticationServiceImpl.authenticate(AuthenticationServiceImpl.java:118)
   at com.alfresco.RivetContent.main(RivetContent.java:22)
Caused by: java.lang.NoClassDefFoundError: com/rivetlogic/crypto/Base64
   at com.rivetlogic.core.cma.rest.impl.RestExecuterImpl.serializeToString(RestExecuterImpl.java:570)
   at com.rivetlogic.core.cma.rest.impl.RestExecuterImpl.createPostMethod(RestExecuterImpl.java:499)
   at com.rivetlogic.core.cma.rest.impl.RestExecuterImpl.createHttpMethod(RestExecuterImpl.java:438)
   at com.rivetlogic.core.cma.rest.impl.RestExecuterImpl.execute(RestExecuterImpl.java:131)
   at com.rivetlogic.core.cma.rest.impl.RestExecuterImpl.execute(RestExecuterImpl.java:124)
   at com.rivetlogic.core.cma.impl.AuthenticationServiceImpl.authenticate(AuthenticationServiceImpl.java:113)
   … 1 more
 ConfigurableApplicationContext configurationApplicationContext = null;
            AuthenticationServiceImpl authenticationService = null;
            Ticket ticket = null;
            configurationApplicationContext = new ClassPathXmlApplicationContext(APPLICATION_CONTEXT);
            authenticationService = (AuthenticationServiceImpl) configurationApplicationContext.getBean("authenticationService");
            ticket = authenticationService.authenticate("http://localhost:8080/alfresco/service", "admin", "admin".toCharArray());
       
Kindly let me know wheres the problem in the above code

rivetlogic
Champ on-the-rise
Champ on-the-rise