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

aferraro
Champ in-the-making
Champ in-the-making
Hi sumer,

Of course YES! It would be much appreciated if you can provide me access to this TX code!  Smiley Happy
So maybe we could help port it into RAAr and into our application ( that I think will use RAAr too).


Thank you very much again, I'm waiting for this.
Antonio.

P.S. this TX code that you are developing for what version of Alfresco is compatible? (Alfresco 3.0 labs or/and Enterprise?   🙂  )

rivetlogic
Champ on-the-rise
Champ on-the-rise
Here is the source repository: https://svn.rivetlogic.com/repos/rivets/crafter/transaction/

You'll note that it's in two parts, one for Alfresco (webscripts really), and the other is a Java library. I believe it'll work with the latest labs release.

Give it a try and let me know how it goes.

–sumer

aferraro
Champ in-the-making
Champ in-the-making
Ok!

I'll write to you soon.
Thank you very much, sumer.

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

My name is Alfonso Vásquez. I'm in charge of developing the transaction support API for Crafter. As Sumer said, we're thinking of moving it to RAAr too, so you can be a great help during the adaptation to RAAr and beta testing. Right now, I'm changing a lot the code, so it's quite unstable, but I think I'll have a somewhat stable version soon, that we can use for RAAr. If you want, you can send a private message to this forum user (RivetLogic) with your email address, and I can ping you when I have something we could use.

Best regards,

Alfonso

aferraro
Champ in-the-making
Champ in-the-making
Thank you very much Alfonso.
you can find my email address in the private message. I will be happy to receive your future communication.

For now we have downloaded the code and we are studying it. Of course I will write you as soon as we will be clarified ideas about it. Smiley Happy

Best Regards, I hope talk to you soon.

Antonio.

rivetlogic
Champ on-the-rise
Champ on-the-rise
Support for Alfresco 3.3.g Community, and 3.3.1 Enterprise is now ready. You can download it here: http://raar.rivetlogic.com

–sumer

chantren
Champ in-the-making
Champ in-the-making
Hello,

I installed your amp file on my Alfresco and was trying to run the following code :


private static final String APPLICATION_CONTEXT = "classpath*:core/cma-core-context.xml";
  
   ConfigurableApplicationContext configurationApplicationContext;
   AuthenticationService authenticationService;
   WorkflowService workflowService;
   
   Ticket ticket;
   
   public void getTasks()
   {
      try {
         connect();
         
         List<WorkflowTask> lwt = workflowService.getAssignedTasks(ticket, "nchantrenne", WorkflowTaskState.IN_PROGRESS);
                  
         for(WorkflowTask wt : lwt)
         {
            System.out.println(wt.id);
         }

      } catch (InvalidTicketException e) {
         e.printStackTrace();
      } catch (CmaRuntimeException e) {
         e.printStackTrace();
      }
   }

   private void connect()
   {
      String repositoryUri = "http://localhost/alfsfprod/service";
      String password = "pass";
      String userid= "admin";
     
      configurationApplicationContext = new ClassPathXmlApplicationContext(APPLICATION_CONTEXT);

      authenticationService = (AuthenticationService) configurationApplicationContext.getBean("authenticationService");
      workflowService = (WorkflowService) configurationApplicationContext.getBean("workflowService");
      
      try
      {
         ticket = authenticationService.authenticate(repositoryUri, userid, password.toCharArray());
      }
      catch (Exception e)
      {
         e.printStackTrace();
      }
   }

and I get the following error :


com.rivetlogic.core.cma.exception.CmaRuntimeException: org.exolab.castor.xml.MarshalException: Invalid byte 2 of 3-byte UTF-8 sequence.{File: [not available]; line: 2; column: 267}
   at com.rivetlogic.core.cma.mapping.impl.CmaCastorUnmarshaller.unmarshal(CmaCastorUnmarshaller.java:57)
   at com.rivetlogic.core.cma.rest.impl.RestExecuterImpl.processResponse(RestExecuterImpl.java:403)
   at com.rivetlogic.core.cma.rest.impl.RestExecuterImpl.processResponse(RestExecuterImpl.java:331)
   at com.rivetlogic.core.cma.rest.impl.RestExecuterImpl.execute(RestExecuterImpl.java:113)
   at com.rivetlogic.core.cma.rest.impl.RestExecuterImpl.execute(RestExecuterImpl.java:95)
   at com.rivetlogic.core.cma.impl.WorkflowServiceImpl.execute(WorkflowServiceImpl.java:564)
   at com.rivetlogic.core.cma.impl.WorkflowServiceImpl.getAssignedTasks(WorkflowServiceImpl.java:261)
   at com.forge.corp.sopra.AlfrescoService.getTasks(AlfrescoService.java:68)
   at com.forge.corp.sopra.Main.main(Main.java:9)
Caused by: org.exolab.castor.xml.MarshalException: Invalid byte 2 of 3-byte UTF-8 sequence.{File: [not available]; line: 2; column: 267}
   at org.exolab.castor.xml.Unmarshaller.convertSAXExceptionToMarshalException(Unmarshaller.java:761)
   at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:727)
   at com.rivetlogic.core.cma.mapping.impl.CmaCastorUnmarshaller.unmarshal(CmaCastorUnmarshaller.java:55)
   … 8 more
Caused by: org.xml.sax.SAXParseException: Invalid byte 2 of 3-byte UTF-8 sequence.
   at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
   at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
   at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
   at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
   at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
   at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
   at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
   at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
   at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
   at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
   at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
   at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:715)
   … 9 more

But when I access a single Task using getTaskById(…) I don't have any problem..

Do you know where that could come from ? I use Alfresco 3.1, cma-impl-3.1.0-E-0.jar and cma-api-3.1.0-E-0.jar.

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

It's a bug that has been fixed in later releases. We're now back-porting the fix to the version you're using, the JIRA for that is here: http://issues.rivetlogic.com/browse/CMA-51

Once the new JARs are released, I'll reply again to this thread and you'll see the release at http://raar.rivetlogic.com.

–sumer

chantren
Champ in-the-making
Champ in-the-making
Ok thank you very much

rivetlogic
Champ on-the-rise
Champ on-the-rise
All fixed and ready to go. You can get 3.1.0-E-1 from http://raar.rivetlogic.com.

Cheers.

–sumer