cancel
Showing results for 
Search instead for 
Did you mean: 

Alfresco Web Script Portlet rivet

rivetlogic
Champ on-the-rise
Champ on-the-rise
AWPr

AWPr is a JSR-168 portlet that can be used to expose remote Alfresco Web scripts, including those that need user authentication. With the help of a custom Alfresco authentication component that we wrote the portlet can carry the user credentials from the portal to Alfresco, authenticate the user in Alfresco and retrieve a ticket that can be used during all subsequent interactions between the end-user, the portlet and ultimately the Alfresco Web script itself.

Motivation for AWPr

When integrating Alfresco Web scripts with JBoss Portal or Liferay Portal AWPr alleviates the need for having to deploy all of Alfresco inside the portal as is the case when using Alfresco's OOTB (out-of-the-box) Web script portlet for Alfresco/Portal integration.

AWPr is also highly configurable. Through the use of portlet preferences you can create multiple instances of AWPr and configure each one with a different Web script URL and a set of parameters with default values if needed. The instance will then RESTfully fetch the result of the Web script's render phase and carry that over to the portlet finally rendering it on the screen within the confines of the portlet window.

It is hence possible to run two instances of AWPr on a single portal page where each instance is exposing a different Web script even if those Web scripts are hosted on two different Alfresco servers regardless of their geographic location.

AWPr lives here:
http://wiki.rivetlogic.org/display/AWPr/

Feel free to ask questions about AWPr in this thread.

–Alaaeldin
125 REPLIES 125

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

I think you might be running Alfresco 3.0 not 3.1. It seems that even though you clicked on Alfresco Labs 3.1 Stable on Alfresco's website it still downloads Alfresco Labs 3.0. Try the chaining configuration from the STAr wiki for Alfresco 3.0 and it should work.

Cheers,

–Alaaeldin

kr1stof
Champ in-the-making
Champ in-the-making
Thanks, that solved the exceptions, but something is still not right. I can't see anything in the AWPr MySpaces example web script. I amauthed as user "foo", who has the same e-mail, same password and name in Liferay and Alfresco.

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

Did you follow the proxy instructions on the wiki?

http://wiki.rivetlogic.com/display/AWPr/Example+Web+scripts

–Alaaeldin

bela
Champ in-the-making
Champ in-the-making
Hey,

I am trying to run a webscript from an alfresco 3.0 Labs installation on a 5.2.x Liferay portal using your portlet. On the webscript I have a form that sends data via GET. One of these parameters also has a default value, which I set in the portlet preferences in Liferay, according to your documentation. My problem is that after I submit the form, I see the parameters in the URL just fine, but the webscript sees null values in all of the parameters, except for the one with the default value, because there it sees the default value. Just like if I called the webscript the first time. I am using your latest version as of this moment, so i take it I don't have to configure any parameters in the preferences setup. I tried to anyways, no change. I tried to use POST, still no change. Somehow my webscript doesn't get the parameters sent to it.

Any help would be appreciated!

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

AWPr only relays parameters that have the pattern "awpr.paramname". This is one of the latest changes and will soon be documented.
Please give it a try.

Best Regards,
Shagul

bela
Champ in-the-making
Champ in-the-making
Nope, still doesn't work Smiley Frustrated

I added a hidden input field:

<input type=hidden name=awpr.abc value="none" />

and tried to get it's values in the Java bean with
req.getParameter("awpr.abc") and req.getParameter("abc")

but both times I gott null values.

Update: I succeeded with using POST, but GET still doesn't work.

Update #2: It also seems, that the parameters get "stuck" somehow. I have a sitemap portlet on my liferay page, and when I click the same page, it seems as if the same parameters are sent again via POST, even if I don't do anything. The only way to undo them is if I log out and log back in.

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

According to the portlet spec, forms that use GET is not supported. You should use POST for all your forms.

Regarding the other problem you're having, we found an issue with AWPr where the parameters from an action URL or POST method are remembered unless the scriptUrl request parameter is included in the request. Thanks for pointing that out.

We will change this behavior in the next AWPr release (1.5.0) to make every request only deliver the parameters in the request (URL params + hidden params). We will also add a new preference called Constant Script Params. All the parameters you set there will be sent with every request. On the other hand the Script Params preference's value will be used as a default only the first time the Web script is rendered. This behavior will be experienced per portlet session. Meaning that when the user logs out and logs back in the defaults will be used again only the first time the portlet is viewed throughout that session. The only other time the defaults will be used during the same session is when the portlet preferences are changed (i.e. the user clicked the Save button in the preferences page of the AWPr portlet instance).

Hope this helps,

–Alaaeldin

urbanj
Champ in-the-making
Champ in-the-making
Hi,
.. i'm trying to get AWPr working in a JBoss Portal 2.7 and labs 3.1 (3 - 1526). Everything seems to
work (accepted the dll error on startup), but when i create an instance of AWPr and try to access the
portlet i get following error output:

[HttpMethodBase] Going to buffer response body of large or unknown size. Using getResponseBodyAsStream instead is recommended.
17:43:27,661 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/portlet_2_0 cannot be resolved in either web.xml or the jar files deployed with this application
   at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:51)
   at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:409)
   at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:116)
   at org.apache.jasper.compiler.TagLibraryInfoImpl.generateTLDLocation(TagLibraryInfoImpl.java:312)
   at org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:147)
   at org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:420)
   at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:476)

.. appreciate for hints!!

thx j

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

Try changing the version of Jboss portal. We have tested  AWPr on jboss portal 2.7.2.

AWPr is JSR 286 portlet and uses appropriate taglib uri as recommended below.

http://www.jboss.org/community/wiki/UpgradingJSR-168PortletstoJSR-286

Best Regards,
Shagul

rivetlogic
Champ on-the-rise
Champ on-the-rise
AWPr 1.5.0 has been released and has some new features to address HTML forms specifically: (see the wiki for more details)

Check here and here for explanations of those features (look for where it says Versions >= 1.5.0).

You can download AWPr 1.5.0 here.

Please use this forum if you have any questions about the new features.

Thanks,

–Alaaeldin