cancel
Showing results for 
Search instead for 
Did you mean: 

Implement Alfresco funtionalities as portlets

tiennd
Champ in-the-making
Champ in-the-making
Hi,
I plan to develop some portlets which make use of alfresco services (not web services).
My porlets need to access to node service, search service and other alfresco services. I will deploy these portlets in liferay. I wonder if my portlets would have access to alfresco services, will liferay block these access? Of course alfresco is already deployed as portlet in liferay to provide these services.
If I can, the question is: the way to access alfresco services in portlet is the same as in alfresco web client? Do I need to package alfresco jar files along with my portlet?

Thank you,
Regards
8 REPLIES 8

rdanner
Champ in-the-making
Champ in-the-making
Hi,
I plan to develop some portlets which make use of alfresco services (not web services).
My porlets need to access to node service, search service and other alfresco services. I will deploy these portlets in liferay. I wonder if my portlets would have access to alfresco services, will liferay block these access? Of course alfresco is already deployed as portlet in liferay to provide these services.
If I can, the question is: the way to access alfresco services in portlet is the same as in alfresco web client? Do I need to package alfresco jar files along with my portlet?

Thank you,
Regards

Liferay will *not* block any use of alfresco (or any other cms for that matter.)

How much of alfresco you  need to package depends on how you intend to access alfresco.  Since it sounds like you are interested in using the local alfresco services (instead of RMI, alfresco web services, etc) your class loader will need access to alfresco classes.

Prior to liferay 4.0 the portal required that it (the portal) be loaded in a shared classloader.  This caused all kinds of issues with portlets that used jars that the portal used (but needed different versions), examples : spring, hibernate, velocity etc. 

4.0, and beyond are based on a kernel style architecture and do not have this "problem". 

If you need to implement alfresco local services, my recomendation is to load the repository in one context, export the repository services you are interested in to JNDI.  In your application package the alfresco API libraries with you application.  Unfortunately Alfresco is not publishing its APIs as a separate JAR.  I might consider pulling out these APIs and JARing them up so they alone can be packaged with your application.

As a note to the alfresco guys,  maybe it would not be a bad idea to package your public API level code as separate jars.

Your application can then pick up the afresco repository and the services from JNDI.  Otherwise you are going to be in a painful place where every application needs to load its own copy of the repository. You will duplicating code, and conguration all over the place. not advisable.

just my .002 cents 

The applications you want to make require the specialized capabilites of the alfresco services?  If not i'd recommend building on top of JCR rather then the alfresco APIs because it is more portable.  My personal take on alfresco is that I always want to consume alfresco (the best CMS out there) from behind standards based interfaces.  By doing this we help increase the importance of standards at alfresco ensuring that it is the best implementation available.

tiennd
Champ in-the-making
Champ in-the-making
Thank you,
Could you please give me some more explaination:

If you need to implement alfresco local services, my recomendation is to load the repository in one context, export the repository services you are interested in to JNDI. In your application package the alfresco API libraries with you application. Unfortunately Alfresco is not publishing its APIs as a separate JAR. I might consider pulling out these APIs and JARing them up so they alone can be packaged with your application.

I already deploy alfresco as a portlet, do I need to package it again in my own portlet? Is it able to write a portlet that access code deployed by other portlet? I also want to reuse alfresco tablib in my portlet, do I need to package the descriptor in my own portlet?
I will have to modify alfresco code to put the public services to JNDI, that's what I don't want because the upgrade  problem.

The applications you want to make require the specialized capabilites of the alfresco services? If not i'd recommend building on top of JCR rather then the alfresco APIs because it is more portable. My personal take on alfresco is that I always want to consume alfresco (the best CMS out there) from behind standards based interfaces. By doing this we help increase the importance of standards at alfresco ensuring that it is the best implementation available.

Does the JCR standards cover Alfresco services such as Node service, search service, Checkin/checkout service..?

Regards,

rdanner
Champ in-the-making
Champ in-the-making
I already deploy alfresco as a portlet, do I need to package it again in my own portlet? Is it able to write a portlet that access code deployed by other portlet? I also want to reuse alfresco tablib in my portlet, do I need to package the descriptor in my own portlet?
I will have to modify alfresco code to put the public services to JNDI, that's what I don't want because the upgrade  problem.

My understanding is that you want to develop "alfresco like" applications as portlets.  You already have the repository/webclient deployed in the /alfresco context and running as portlet.

If you want to use the alfresco tag libraries you are going to need to leverage the "local alfresco services".  The alfresco specific API jar can not be used to back up the tag libraries.

I assume you want all of your portlets to access the same repository. This means you need to find a way to share the repository with all of the apps or (I dont even know if this is advisable) load the repository over and over connecting to the same database and content store – my advices.. don't do that.

Here are the steps I would take:

1. Modify the alfresco spring configuration to export the beans that you need into JNDI.  You will not need to modify alfresco source code – just spring configuration (examples are available for this at springframework.org)

2. Add respository and webclient jars to your code (The current build does not pull out public APIs our make the JSF code easy to extract)

3. Build a Spring configuration that provides the beans that the webclient code expects but that pulls them from JNDI rather than coposes them itself.

Depending on the depth of functionality you want to mimic this could be a lot of work or a little. 

I would first develop my functionality as part of the alfresco web client so I could learn exactly what beans i was going to leverage and then pull it out in the fashion i described. 

Basically the system is not set up natively to support this kind of development at the moment.  Alfresco is working on a plan to make a remotable web client … when this is done your work would be based on that and it would not be as difficult to accomplish.

Does the JCR standards cover Alfresco services such as Node service, search service, Checkin/checkout service..?

It covers the basics like checkin checkout  what you loose by using JCR is the ability to leverage alfresco value like the UI components and access to some of the behavior in the repository.  This functionality is needed if you are making an comprehensive application like the webclient but not if you are making a content browser or other such simple applications which access and minipulate the content.

bindiya
Champ in-the-making
Champ in-the-making
Hi

How can i develop remote web client?
I want to develop portlet which runs on remote server, while it access the contents of alfresco.

Thanks,
Bindiya

rdanner
Champ in-the-making
Champ in-the-making
Hi

How can i develop remote web client?
I want to develop portlet which runs on remote server, while it access the contents of alfresco.

Thanks,
Bindiya

Bindya

There are many options to remotely acccessing an alfresco repository:

http://wiki.alfresco.com/wiki/Is_JCR-RMI_Right_for_Me%3F

You have your pick of mechanism.  Each has its ups and downs.

Hope this helps

bindiya
Champ in-the-making
Champ in-the-making
I am successful in accessing contents remotely using Webservices api. But i was trying to create JSF portlet using alfresco taglibs.
And i get this exception

org.apache.jasper.JasperException: Exception in JSP: /browse.jsp:16

13: <body>
14:
15:
16: <rSmiley Tongueage titleId="browse_new">
17:     <f:view >
18:             <h:form id="new">
19:             <hSmiley SurprisedutputLabel id="hello" value="HELLO WORLD New"></hSmiley SurprisedutputLabe
l>


Stacktrace:
        at org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspSer
vletWrapper.java:504)
        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper
.java:375)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:3
14)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:252)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:173)
        at org.jboss.portal.portlet.impl.PortletRequestDispatcherImpl.execute(Po
rtletRequestDispatcherImpl.java:77)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
…..
……
……

16:59:25,711 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
java.lang.NoClassDefFoundError: org/alfresco/error/AlfrescoRuntimeException
        at org.alfresco.web.app.Application.getBundle(Application.java:587)
        at org.alfresco.web.app.Application.getMessage(Application.java:566)
        at org.alfresco.web.ui.repo.tag.PageTag.doStartTag(PageTag.java:128)
        at org.apache.jsp.browse_jsp._jspx_meth_r_page_0(browse_jsp.java:110)
        at org.apache.jsp.browse_jsp._jspService(browse_jsp.java:83)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper
.java:332)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:3
14)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:252)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:173)
        at org.jboss.portal.portlet.impl.PortletRequestDispatcherImpl.execute(Po
rtletRequestDispatcherImpl.java:77)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
….


Is it possible to use alfresco taglibs in remote client?

Thanks,
Bindiya

rdanner
Champ in-the-making
Champ in-the-making
Well… its a little complicated.  The alfresco tag lib assumes a certain amount of infrastructure is present and for the most part works on the alfresco foundation api which is not a remoted API.

Some of the JSF components can be easily reused outside the alfresco source base while others cannot.   I wouldn't call it trivial to "remote" the alfresco webclient.  It is doable (anything is doable) and I think making the webclient able to sit ontop of a remote client is something that will happen in the future (see roadmaps and proposed project in wiki) I dont think there are any short term plans for this (could be wrong).

If you have some specific component you want to use remotely maybe it would be easier to address that directly.

bindiya
Champ in-the-making
Champ in-the-making
I would like to use Nodeservice, Browse bean, authentication service, personservice, search service , etc..
Can you suggest me how can i go ahead with using this?
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.