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

g9adm
Champ in-the-making
Champ in-the-making
Hi ..

Is this supported on Alfresco 3 ?

I get a Caused by: java.lang.NoSuchMethodError: com.rivetlogic.core.cma.alfresco.webscripts.bean.AuthenticationServiceWebScript.getRepositoryContext()Lorg/alfresco/web/scripts/WebScriptContext;

trying to run a sample app.

BR
Anders Monrad

rivetlogic
Champ on-the-rise
Champ on-the-rise
Nope, 2.2 is what's supported with RAAr 1.8.1.

Will make updates to support 3.0 this weekend and release again.

I'll post the announcement of the new version to this forum. I'll also include the supported Alfresco version(s) on the wiki/release notes.

–Sumer

mygol
Champ in-the-making
Champ in-the-making
waiting for support Alfresco 3

rivetlogic
Champ on-the-rise
Champ on-the-rise
This is going to take a bit more time. Stay tuned…

–Sumer

monitloth
Champ on-the-rise
Champ on-the-rise
If I understood it, after reading your website, there is now support for Labs 3.

I have a little question about the capabilities of your library.

I would like to navigate between directories. Is it possible?

As an example, I would like to run the following code (but then in Java):
roothome.childByNamePath("Company Home/Clients");

Many thanks.

rivetlogic
Champ on-the-rise
Champ on-the-rise
RAAr version 1.9.0 with support for Alfresco 3.0 is out. You can get it from here: http://wiki.rivetlogic.org/display/RAAR/Downloads

Cheers.

–Sumer

rivetlogic
Champ on-the-rise
Champ on-the-rise
Not sure if I understood your question, but if it means "get all the content in a particular directory" then

You need to write a lucene query and search using search service which will return the contents in that folder.


String query = "+PATH:\"/app:company_home/cm:Clients/*\"";

List<Node> nodes = searchService.query(ticket, new StoreRef(spacesStore), SearchService.QueryLanguage.lucene, query,
properties, true, true, true, true, requiredPermissions, 100, sortDefinitions);

if (nodes != null) {
   // file found
   System.out.println("Content in Clients folder");
   for (Node node: nodes) {
      System.out.println("node: " + node.getProperties().get(ContentModel.PROP_NAME));
   }
}

You can also restrict the type of content the search returns. For example get only the items of type folder then the lucene query looks like this:

String query = "+PATH:\"/app:company_home/cm:Clients/*\" + "AND +TYPE:\"cm:folder\"";

Bear in mind, however, that this query can be optimized if you define which properties you'd like returned (instead of everything).

You can check the Javadoc for more details at: http://docs.rivetlogic.org/projects/raar/current/javadocs

Let me know if you have any questions.

- Praveen C Elineni.

mesdocs
Champ in-the-making
Champ in-the-making
Hi,

I get an error when i try to install the cma-alfresco-1.9.0.amp in my alfresco server (Enterprise 3.0).

17:53:05,544  ERROR [context.support.XmlWebApplicationContext] Exception thrown from ApplicationListener handling ContextClosedEve
nt
org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session for transaction; nested excepti
on is org.hibernate.exception.GenericJDBCException: Cannot open connection
Caused by: org.hibernate.exception.GenericJDBCException: Cannot open connection
        at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
        at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
        at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
        at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)
        at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:426)
        at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
        at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:119)
        at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:57)
        at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1326)
        at org.springframework.orm.hibernate3.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:510)
        at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionMa
nager.java:350)
        at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupp
ort.java:262)
        at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupp
ort.java:219)
        at org.alfresco.util.transaction.SpringAwareUserTransaction.begin(SpringAwareUserTransaction.java:380)
        at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:309)
        at org.alfresco.repo.transaction.RetryingTransactionAdvice.invoke(RetryingTransactionAdvice.java:73)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
        at $Proxy151.onShutdown(Unknown Source)
        at org.alfresco.linkvalidation.LinkValidationServiceBootstrap.onShutdown(LinkValidationServiceBootstrap.java:54)
        at org.alfresco.util.AbstractLifecycleBean.onApplicationEvent(AbstractLifecycleBean.java:73)
        at org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:77)
        at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
        at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.ja
va:75)
        at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:246)
        at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:676)
        at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:651)
        at org.springframework.web.context.ContextLoader.closeWebApplicationContext(ContextLoader.java:336)
        at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:74)
        at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:3882)
        at org.apache.catalina.core.StandardContext.stop(StandardContext.java:4523)
        at org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:924)
        at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1006)
        at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1214)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:293)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
        at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337)
        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
        at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
        at java.lang.Thread.run(Thread.java:595)
Caused by: java.sql.SQLException: org.apache.derby.jdbc.EmbeddedDriver is not registered with the JDBC driver manager
        at org.apache.derby.jdbc.AutoloadedDriver.getDriverModule(Unknown Source)
        at org.apache.derby.jdbc.AutoloadedDriver.connect(Unknown Source)
        at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:37)
        at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:290)
        at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:974)
        at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:95)
        at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540)
        at org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider.getConnection(LocalDataSourceConnectionProvider.ja
va:81)
        at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:423)
        … 36 more
3 dÚc. 2008 17:53:10 org.apache.catalina.startup.HostConfig deployWAR
INFO: D´┐¢ploiement de l'archive alfresco.war de l'application web
Exception in thread "Thread-48" java.lang.IllegalStateException: The org.alfresco.cache.sysAdminCache Cache is not alive.
        at net.sf.ehcache.Cache.checkStatus(Cache.java:1588)
        at net.sf.ehcache.Cache.get(Cache.java:774)
        at net.sf.ehcache.Cache.get(Cache.java:755)
        at org.alfresco.repo.cache.EhCacheAdapter.get(EhCacheAdapter.java:87)
        at org.alfresco.repo.cache.TransactionalCache.get(TransactionalCache.java:348)
        at org.alfresco.linkvalidation.LinkValidationServiceImpl.isLinkValidationDisabled(LinkValidationServiceImpl.java:364)
        at org.alfresco.linkvalidation.LinkValidationServiceImpl.run(LinkValidationServiceImpl.java:592)
        at java.lang.Thread.run(Thread.java:595)

Do you have a solution ?

Mesdocs.

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

Looks like the database that you have is corrupt, can you cleanup or erase the whole database and start over. (Delete the alf_data folder at root location of alfresco and restart)

Also make sure Alfresco comes up before installing the RAAR amp into it.

Let me know if the DB cleanup didn't work.

- Praveen C Elineni.