cancel
Showing results for 
Search instead for 
Did you mean: 

ticket and portlet

Not applicable
i am trying to embed a portlet in a iframe for office intranet usage of alfresco cmis. I found a bug (or feature ?) when the browser is trying to request a frame url like :

http://server:8080/alfresco/service/ui/doclist?q=someQuery&alf_ticket=TICKET1234ABCD..7890XYZ
http://server:8080/alfresco/service/ui/doclist?alf_ticket=TICKET1234ABCD..7890XYZ&q=someQuery

the browser then ask again for credentials when loading.

With no ticket and no credentials we get the 401 status code which is expected behaviour but with the the ticket in URL and when clicking cancel to the credentials popup the browser displays the actual portlet whithout any document in the list which is a demonstration that the ticket has some effect but seem to be not enough to get trough. I tried with "ticket" instead of "alf_ticket" and it results to 401 status code.

Does the ticket is suppose to work with portlets like the standards dashlets doclist.get that is modular and can be exported ?
1 REPLY 1

openpj
Elite Collaborator
Elite Collaborator
Hi arames,

you must expose an Alfresco Webscript as a portlet in this way:

In the Alfresco portlet.xml you must add:

<portlet>
        <description>Alfresco Your Webscript Portlet</description>
        <portlet-name>YourWebscriptPortletName</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/service/ui/doclist</value>
        </init-param>
        <supported-locale>it</supported-locale>
        <expiration-cache>0</expiration-cache>
        <supports>
                <mime-type>text/html</mime-type>
                <portlet-mode>VIEW</portlet-mode>
        </supports>
        <portlet-info>
                <title>Your Webscript Title</title>
                <short-title>Your WebScript Short Title</short-title>
        </portlet-info>
</portlet>
In the scriptUrl value you can put your Webscript url that you would like to expose as a portlet in your portlet container, it must start with "/alfresco/service/etc..".
Then you can create an instance of this portlet directly on your portal admin console and then you can create a page with this portlet without using IFRAME Smiley Wink
In this way you have standard authenticator JSR168 so, the same user on the portal will be the same user used for authentication in your portlet.
I think that on Alfresco 3.0 the portlet class (org.alfresco.web.scripts.portlet.WebScriptPortlet) is not the same of this code that I posted here.

Hope this helps.