cancel
Showing results for 
Search instead for 
Did you mean: 

Workdesk Integration into Java/J2EE webapp

cancerian1978
Champ in-the-making
Champ in-the-making
Hi Alfresco Gurus, I am doing some research on the ways to integrate our java based webapp with Alfresco repo and provide the user some kind of UI so that they can browse/add/edit documents. During this I came across Alfresco Workdesk and the UI seems to be perfect for our needs. I downloaded trial version of Alfresco Workdesk and I am impressed with it. Is there a way to integrate this Alfresco workdesk into our application. The solution we are looking for is, we provide a link from our application and pass some parameters which shud open up the workdesk UI with the related search results. Any ideas are welcome and much appreciated.

Regards.
12 REPLIES 12

unknown-user
Champ on-the-rise
Champ on-the-rise
Hi Deko,
I am working with Cancerian1978 on this integration. Currently when we use the remote control URL and open Workdesk we have to login. We would like to make the login happen behind the scenes in our own code instead of asking our users to login each time. I did see something about writing Login Interceptors but not sure how to go about it. Or like we connect to Alfresco and can create a Session Object, can we do something similar in Workdesk?
Thanks in advance for all your help.

d_evil
Champ in-the-making
Champ in-the-making
Hi mt,

basically you would need to implement the
<blockcode>
package com.wewebu.ow.server.ecmimpl.opencmis.auth;
interface OwCMISAuthenticationInterceptor
{
    /**
     * Initialization of AuthProviderFactory instance
     * with corresponding configuration.
     * @param configNode OwXMLUtil node which represents AuthProviderFactory configuration
     * @throws OwException
     */
    void init(OwXMLUtil configNode) throws OwException;

    /**
     * Called to create a new Authentication provider which should be used in
     * communication between CMIS client and server.
     * @param information Map current available informations for OpenCMIS Session creation
     * @return AuthenticationProvider which should be used for session creation
     * @throws OwException
     */
    AuthenticationProvider createAuthenticationProvider(Map<String, ?> information) throws OwException;

    /**
     * Called before login page is rendered, can be used for redirect or preparation
     * of this instance. The return value defines if the process sequence should be processed as
     * defined, or if it should stop because the response was created by this instance.
     * <p>If true is returned, by default a login is processed through network.
     * The login will call the {@link #createAuthenticationProvider(Map)} and
     * verify against back-end if login was successful.</p>
     * @param req HttpServletRequest
     * @param resp HttpServletResponse
     * @return boolean true process sequence as defined, false stop processing
     * @throws OwException
     */
    public boolean onRequest(HttpServletRequest req, HttpServletResponse resp) throws OwException, IOException;
}
</blockcode>

The important parts are onRequest and createAuthenticationProvider, the onRequest will be handled when Workdesk is accessed, you may extract some information from HttpServletRequest here to do some kind of SSO magic. If the method return true, it will be progressed as Authentication.

So after you got all information and the login is processed, at some point the createAuthenticationProvider is called and will get the current OpenCMIS Session setting in a parameter Map.
That method is creating the OpneCMIS AuthenticationProvider, responsible for authentication and creation of OpenCMIS Session (for more information see: http://chemistry.apache.org/java/opencmis.html)

Hope that helps,
D.evil

PS: Configuring your Authentication Interceptor see the configuration files owbootstrap.xml
<blockcode>
<EcmAdapter>
<AuthInterceptor className="com.wewebu.ow.server.ecmimpl.opencmis.alfresco.OwCMISAlfrescoOAuthInterceptor">
<!– any nodes defined here are provided as OwXMLUtil in init method –>
</AuthInterceptor>
</blockcode>

cancerian1978
Champ in-the-making
Champ in-the-making
Yes D.evil, that is how we were able to login programmatically.

Thank you.