cancel
Showing results for 
Search instead for 
Did you mean: 

question Webscript and portal

kocoubb
Champ in-the-making
Champ in-the-making
Hello,

Someone has had some experience with the integration of Alfresco and jboss portal, more specifically, using webscripts of Alfresco as jboss portal portlets.

Someone who can share their experiences and some data for those like me (novice) we can make this integration.

thanks.
11 REPLIES 11

openpj
Elite Collaborator
Elite Collaborator
You can create a webscript and you can expose it on a portal modifying the Alfresco portlet.xml in Alfresco's WEB-INF directory:

<portlet>
   <description>Your portlet description</description>
   <portlet-name>YourPortletName</portlet-name>
   <portlet-class>org.alfresco.web.scripts.portlet.WebScriptPortlet</portlet-class>

   <init-param>
      <name>authenticator</name>
      <value>webscripts.authenticator.jsr168.webclient</value>
   </init-param>

   <init-param>
      <name>scriptUrl</name>
      <value>/alfresco/168s/yourwebscriptpackage/yourwebscript</value>
   </init-param>
   <expiration-cache>0</expiration-cache>
   
   <supports>
      <mime-type>text/html</mime-type>
      <portlet-mode>VIEW</portlet-mode>
   </supports>
   <portlet-info>
      <title>YourPortletTitle</title>
      <short-title>YourPortletShortTitle</short-title>
   </portlet-info>
</portlet>

In this way you can use the Authenticator to access the webscript but if you don't need it you can remove it from portlet.xml.
When you redeploy Alfresco your webscript will be expose to JBoss Portal and you can create instances of your webscript as portlets.

Hope this helps.

cerberos
Champ in-the-making
Champ in-the-making
Hi all,
I'm trying to make Alfresco Labs  work with JBoss Portal 2.6.7. I've written some webscript and now i want to include them as portlet in Jboss Portal. I edited the portlet.xml file under alfresco.war/WEB-INF as described http://wiki.alfresco.com/wiki/3.0_Web_Scripts_Framework#Available_Runtimes but with no success. I can't see any new portlet definition in JBoss portal administration console. No errors deploying the alfresco war (except one regarding win32netbios.dll). Webscripts are avaible and responding under /alfresco/service/portlet/*.

Thank you all.

jdbrown
Champ in-the-making
Champ in-the-making
cerberos,

For JBoss Portal, you need a JBoss-specific file under WEB-INF as well.  jboss-portlet.xml. 

<portlet-app>
   <portlet>
      <portlet-name>samplePortletName</portlet-name>
      <header-content></header-content>
   </portlet>
</portlet-app>
    
The samplePortletName must exactly match the <portlet-name> in your portlet.xml file.

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

We just released our latest contribution called AWPr (Alfresco Web script Portlet rivet) which is a portlet that exposes Web scripts even if they are hosted in a remote Alfresco instance. That way you wouldn't have to deploy Alfresco and JBoss Portal in the same application server.

If you want to read more about this portlet you can visit its wiki pages here:

http://wiki.rivetlogic.com/display/AWPr/Home

Note though that AWPr was just released and so far only supports JBoss Portal 2.7.x.

Hope this helps,

–Alaaeldin

blazer
Champ in-the-making
Champ in-the-making
I also try to use the webscript-framework as supposed. I use liferay 5.2.2 with Alfresco 3 (stable).
I deployed the alfresco.war into the liferay portal and both applications work. I can access alfresco by using the CMIS-Example (http://www.liferay.com/web/guest/community/wiki/-/wiki/Main/Alfresco+integration).

But the "easy" way of using "org.alfresco.web.scripts.portlet.WebScriptPortlet" as a wrapper to the Alfresco-Webscripts and deploying those portlets to liferay does not work.

One reason was, that WebScriptPortlet had no spring WebApplicationContext. This is needed because of this code in WebScriptPortlet:

WebApplicationContext context = (WebApplicationContext)portletCtx.getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE);
container = (RuntimeContainer)context.getBean("webscripts.container");
So I wrote a wrapper to org.alfresco.web.scripts.portlet.WebScriptPortlet and created the Context:
- added a contextConfigLocation to web.xml that pointed to webscript-framework-application-context.xml (copy from alfresco.war)
- added the spring ContextLoaderListener
- added the webscript-framework-config.xml (copy from alfresco.war)
- added all dependencies (.jar files from alfresco and liferay)
- added the webscripts to WEB-INF/classes/alfresco/webscripts/

Now I can execute the scripts ("helloworld" works) but those webscripts can not access the alfresco content repository.

I guess it should be much easier to use the portlet-webscript wrapper but I might miss something. Maybe my knowledge about spring and portlets is just not good enoug.

Any hints what would be the best way accessing webscripts as portlets? Will AWPr be available for liferay?

thx,
Florent

rivetlogic
Champ on-the-rise
Champ on-the-rise
Good news. We just released AWPr for Liferay 5.1.1+ and 5.2.2+.

Here's the download page on our wiki: http://wiki.rivetlogic.com/display/AWPr/Downloads

Enjoy  Smiley Happy

–Alaaeldin

blazer
Champ in-the-making
Champ in-the-making
hey, thats really cool! some hello-world-stuff works ootb Smiley Happy
I'll try some more complex stuff later.

thanks for the update!

nowhere
Champ in-the-making
Champ in-the-making
Hi all,
I read this topic, but I'm not sure on what do and if it's the same as my problem, so if anyone of you has a minute, I would show my troubles  Smiley Surprisedops:

I would integrate alfresco 3.0 with liferay but at the point I'm I get the following error and I don''t know how proceed:

10:11:17,906 ERROR [PortletHotDeployListener:596] java.lang.NullPointerException

java.lang.NullPointerException
        at org.alfresco.web.scripts.portlet.WebScriptPortlet.init(WebScriptPortl
et.java:86)
        at com.liferay.portlet.InvokerPortletImpl.init(InvokerPortletImpl.java:2
50)
        at com.liferay.portlet.PortletInstanceFactoryImpl.init(PortletInstanceFa
ctoryImpl.java:245)
        at com.liferay.portlet.PortletInstanceFactoryImpl.create(PortletInstance
FactoryImpl.java:135)
        at com.liferay.portlet.PortletInstanceFactoryUtil.create(PortletInstance
FactoryUtil.java:47)
        at com.liferay.portal.deploy.hot.PortletHotDeployListener.initPortlet(Po
rtletHotDeployListener.java:593)
        at com.liferay.portal.deploy.hot.PortletHotDeployListener.doInvokeDeploy
(PortletHotDeployListener.java:242)

Firstly alfresco starts…then unregister 6 alfresco portlets and alfresco shutdown as all server Smiley Sad

10:13:31,484  INFO  [domain.schema.SchemaBootstrap] No changes were made to the
schema.
10:13:38,500 UserSmiley Frustratedystem ERROR [util.exec.RuntimeExecBootstrapBean] Bootstrap co
mmand failed:
Execution result:
   os:         Windows XP
   command:    [soffice, -accept=socket,host=localhost,port=8100;urp;StarOffice.
ServiceManager, -env:UserInstallation=file:///C:/liferay-portal-tomcat-6.0-5.2.2
/liferay-portal-5.2.2/tomcat-6.0.18/bin/alf_data/oouser, -nologo, -headless, -no
firststartwizard, -nocrashrep, -norestore]
   succeeded:  false
   exit code:  2
   out:
   err:        Cannot run program "soffice": CreateProcess error=2, Impossibile
trovare il file specificato
10:13:39,484 UserSmiley Frustratedystem INFO  [alfresco.config.JndiPropertyPlaceholderConfigure
r] Loading properties file from class path resource [alfresco/alfresco-shared.pr
operties]
10:13:39,531 UserSmiley Frustratedystem ERROR [transform.magick.AbstractImageMagickContentTrans
formerWorker] ImageMagickContentTransformerWorker not available: 04230000 Failed
to perform ImageMagick transformation:
Execution result:
   os:         Windows XP
   command:    [./ImageMagick/bin/convert, C:\liferay-portal-tomcat-6.0-5.2.2\li
feray-portal-5.2.2\tomcat-6.0.18\temp\Alfresco\ImageMagickContentTransformerWork
er_init_source_8753417715111386950.gif[0], C:\liferay-portal-tomcat-6.0-5.2.2\li
feray-portal-5.2.2\tomcat-6.0.18\temp\Alfresco\ImageMagickContentTransformerWork
er_init_target_8125526665560216998.png]
   succeeded:  false
   exit code:  1
   out:
   err:        Cannot run program "./ImageMagick/bin/convert": CreateProcess err
or=2, Impossibile trovare il file specificato
10:13:40,671 UserSmiley Frustratedystem ERROR [content.transform.RuntimeExecutableContentTransf
ormerWorker] Failed to start a runtime executable content transformer:
Execution result:
   os:         Windows XP
   command:    [./bin/pdf2swf, -V]
   succeeded:  false
   exit code:  1
   out:
   err:        Cannot run program "./bin/pdf2swf": CreateProcess error=2, Imposs
ibile trovare il file specificato
10:13:40,671 UserSmiley Frustratedystem ERROR [util.exec.RuntimeExecBootstrapBean] Bootstrap co
mmand failed:
Execution result:
   os:         Windows XP
   command:    [soffice, -accept=socket,host=localhost,port=8100;urp;StarOffice.
ServiceManager, -env:UserInstallation=file:///C:/liferay-portal-tomcat-6.0-5.2.2
/liferay-portal-5.2.2/tomcat-6.0.18/bin/alf_data/oouser, -nologo, -headless, -no
firststartwizard, -nocrashrep, -norestore]
   succeeded:  false
   exit code:  2
   out:
   err:        Cannot run program "soffice": CreateProcess error=2, Impossibile
trovare il file specificato
10:13:41,671 UserSmiley Frustratedystem WARN  [alfresco.util.OpenOfficeConnectionTester] An ini
tial OpenOffice connection could not be established.
10:13:42,000 UserSmiley Frustratedystem INFO  [repo.admin.ConfigurationChecker] The Alfresco ro
ot data directory ('dir.root') is: C:\liferay-portal-tomcat-6.0-5.2.2\liferay-po
rtal-5.2.2\tomcat-6.0.18\bin\alf_data
10:13:42,093 UserSmiley Frustratedystem INFO  [admin.patch.PatchExecuter] Checking for patches
to apply …
10:13:42,406 UserSmiley Frustratedystem INFO  [admin.patch.PatchExecuter] No patches were requi
red.
10:13:42,406 UserSmiley Frustratedystem INFO  [repo.module.ModuleServiceImpl] Found 0 module(s)
.
10:13:42,437 UserSmiley Frustratedystem INFO  [alfresco.config.JndiPropertyPlaceholderConfigure
r] Loading properties file from class path resource [alfresco/alfresco-shared.pr
operties]
10:13:42,812 UserSmiley Frustratedystem INFO  [alfresco.config.JndiPropertyPlaceholderConfigure
r] Loading properties file from class path resource [alfresco/alfresco-shared.pr
operties]
10:13:43,281 UserSmiley Frustratedystem INFO  [service.descriptor.DescriptorService] Alfresco J
VM - v1.6.0_12-b04; maximum heap size 1016,125MB
10:13:43,281 UserSmiley Frustratedystem INFO  [service.descriptor.DescriptorService] Alfresco s
tarted (Labs): Current version 3.2.0 (_Preview2_dev @build-number@) schema 2011
- Installed version 3.2.0 (_Preview2_dev @build-number@) schema 2011
10:13:46,687 INFO  [PluginPackageUtil:1148] Reloading repositories
23-mag-2009 10.14.04 org.apache.catalina.core.StandardContext start
GRAVE: Error filterStart
23-mag-2009 10.14.04 org.apache.catalina.core.StandardContext start
GRAVE: Context [/alfresco] startup failed due to previous errors
10:14:06,515 INFO  [PortletHotDeployListener:333] Unregistering portlets for alf
resco
10:14:06,531 INFO  [PortletHotDeployListener:367] 6 portlets for alfresco was un
registered

and some rows down in console…

10:18:30,578 DEBUG [Init:?]   XX_configure_reg_resourceresolver 15 ms
10:18:30,593 DEBUG [Init:?]   XX_configure_reg_sigalgos         94 ms
10:18:30,593 DEBUG [Init:?]   XX_configure_reg_transforms       47 ms
10:18:36,640  ERROR [repo.shutdown.ShutdownBackstop] Alfresco terminating via Sh
utdown Backstop
10:18:43,281  ERROR [repo.shutdown.ShutdownBackstop] Alfresco terminated
23-mag-2009 10.18.43 org.apache.coyote.http11.Http11Protocol pause
INFO: Pausing Coyote HTTP/1.1 on http-8080
23-mag-2009 10.18.44 org.apache.catalina.core.StandardService stop
INFO: Stopping service Catalina
23-mag-2009 10.18.44 org.apache.coyote.http11.Http11Protocol destroy
INFO: Stopping Coyote HTTP/1.1 on http-8080

I don't know what else info can be useful to you, so let me know what else I can say you to explain the problem.
Hoping in some help…meanwhile have a good day Smiley Happy

mim
Champ in-the-making
Champ in-the-making
Hi
I need to integrate Alfresco Labs 3 with JbossPortal and I am using AWPr for that.

I managed to display a WebScript: /ui/myspaces?p=%2FCompany%20Home/children , in portlet, but links point outside the portal. When I click anything (except AJAX invocations) I am redirected into Alfresco Web Client.
Is there any solution to make links to stay within the portlet?