cancel
Showing results for 
Search instead for 
Did you mean: 

Accessing WCM content using an API

leviter
Champ in-the-making
Champ in-the-making
Hi,

I noticed that there are a lot of different APIs available to access the repository. Some of them embedded, others remote.

Is there an up-to-date overview of APIs and when to use which one?

From what I read from various locations (wiki, forum, API docs) is that when I want to access the WCM repository I need to access it using AVM (what does it stand for by the way?) or via webservices. With other APIs I would get into trouble accessing eg sandboxes….

Am I right on this?
7 REPLIES 7

rivetlogic
Champ on-the-rise
Champ on-the-rise
AVM == Alfresco Versioning Model

See http://forums.alfresco.com/viewtopic.php?t=5779

regarding some simple examples that use the WCM APIs.

–Mike

spdaly
Champ in-the-making
Champ in-the-making
I am trying to write an app that will pull content from the AVM.  The app runs outside of the Alfresco context.  Is this possible?  Is there a web service client for this?

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

Your best bet is to use RMI to access the AVM repo remotely. The AVMRemote service can be used for that purpose.

Hope this helps,

–Aladdin

uh7415
Champ in-the-making
Champ in-the-making
Hi

Thanks in advance!

Pls. suggest on how to configure AVMRemote and associated classes out of the virtualization server.
I want to setup tomcat with the application war accessing the Alfresco Runtime repository.

My application is using wsf1.5 (i.e. tag libs to access the content from the repository).
> Simple hosting of war on tomcat generates null pointers as JNDI content/AVMRemote  is not properly set/initialized.
> Virtual server does all this using AVMHost and the AVMValve classes.

I have thoughts on accessing the repository by using the context file (refer below). This approach basically requires having a custom implementation of WSF tag lib functions. – But that's a patch!!.

Is it only way to configure the production tomcat?
In that scenario it means one cannot deploy WSF based application in production environment and you need to have a custom/patch tag lib to get it working.

<bean id="avmRemote" class="org.alfresco.repo.remote.AVMRemoteImpl">
        <property name="avmRemoteTransport">
            <ref bean="avmRemoteTransport"/>
        </property>
       
        <property name="clientTicketHolder">
            <ref bean="clientTicketHolder"/>
        </property>
       
    </bean>

    <!– Re-authenticating transport for AVMRemote –>
    <bean id="avmRemoteTransport"
          class="org.springframework.aop.framework.ProxyFactoryBean">
        <property name="proxyInterfaces">
            <list>
                <value>org.alfresco.service.cmr.remote.AVMRemoteTransport</value>
            </list>
        </property>
        <property name="target">
            <ref bean="avmRemoteTransportRaw"/>
        </property>
        <property name="interceptorNames">
            <list>
                <value>avmReauthenticatingAdvisor</value>
            </list>
        </property>
    </bean>
   
    <!– Raw transport for AVMRemote –>     
    <bean id="avmRemoteTransportRaw" class="org.springframework.remoting.rmi.RmiProxyFactoryBean">
        <property name="serviceUrl">
            <value>rmi://localhost:50500/avm</value>
        </property>
        <property name="serviceInterface">
            <value>org.alfresco.service.cmr.remote.AVMRemoteTransport</value>
        </property>
        <property name="refreshStubOnConnectFailure">
            <value>true</value>
        </property>
    </bean>
    <!– Client Ticket Holder. –>
    <bean id="clientTicketHolder"
          class="org.alfresco.repo.remote.ClientTicketHolderGlobal"/>
………….

Thoughts/View points will be appreciated!

Regards
//uh7415

pmonks
Star Contributor
Star Contributor
Since v2.1, the recommended approach for accessing both DM and WCM content and functionality is Web Scripts (http://wiki.alfresco.com/wiki/Web_Scripts).  Web Scripts are not only more powerful than AVMRemote (there are some key APIs that AVMRemote doesn't provide eg. content querying and search), they're also likely to be more performant, since you can design a REST API that precisely meets the needs of your web application.

Cheers,
Peter

uh7415
Champ in-the-making
Champ in-the-making
Hi Peter,

For us I think it will be difficult to switch now to WebScript mode. We have already committed to substantial effort towards WSF based site.

Fine that now Webscripts is a preferred model, but for applications built on 2.1/ealier version, there should a mechanism to configure WSF based application in production environment.

On Performance of WSF tag libs:
- We have observed that even for 3 articles (plus 13 odd renditions for each article) it takes about 300+ ms per execution of cl:getContentList(). 
(Environment: Alfresco2.9b, Virtual Server, multi-CPU Quad Core machine)
It there are mechanism to configure that too?

Thanks & Regards
// UH7415

pmonks
Star Contributor
Star Contributor
WSF is a sample application, and does not represent current (post Alfresco 2.0) best practices.  Since Alfresco 2.1 (where Web Scripts were first introduced), Web Scripts have supplanted all of the other remote APIs (including AVM Remote) as the remote API of choice, so I would urge you to reconsider them.

Cheers,
Peter