cancel
Showing results for 
Search instead for 
Did you mean: 

Alfresco integration with oracle forms

rajesh4851
Champ in-the-making
Champ in-the-making
Dear friends,
I am trying to use alfresco DMS to my application which was built in Oracle Forms ( 10g application server).
Do we have any APIs provide this facility?
How can use single sign on with my application and alfresco?

Pls suggest me the solution.
3 REPLIES 3

jpotts
World-Class Innovator
World-Class Innovator
You've provided no details or examples of what you've tried so far, so all I can give you is very generic advice: Go grab OpenCMIS from Apache Chemistry and use it to call Alfresco remotely from your Oracle app.

Single sign-on is a broad and complex topic. If after reading the official documentation on authentication you still have questions, post the question with as much supporting detail as you can in the Authentication & SSO forum.

Jeff

rajesh4851
Champ in-the-making
Champ in-the-making
Dear Experts,

Sorry about the Delay for posting the details.

We are using the Alfresco Community Edition 4.0d in windows XP sp. 3.

We are in the beginning stage to complete the Proof of concept:

A perfect document management system along with a fully functional java compliant oracle Forms [32 Bit] Version 9.0.4.0.19 (Production)
We hope we found one alfresco document management system we are in the process of integrating into oracle forms

We would like to achieve the following:

1. We want to authenticate the user. ie logging into alfresco from oracle forms
2. We want to put some documents into it.
3. we want to get some documents from it.
4. Multiple versions of the same document may also be needed.

We are trying to use the following web services from the oracle forms.


http://hostname:8080/alfresco/api/AuthoringService?WSDL      -- stub generation is not working
http:...









I have Used oracle JDeveloper version 9.0.4.0 (Build 1407) to generate the webservice stub or skeleton
While creating it through the wizzard I have selected all the options in the Generation options:

(we are supposed to give any one of the URLs given above in the WSDL url text box)
and check the following option (mark as selected)
Generate client-side stubs
   Generate main methods into the stub
   Generate basic HTTP authentication code
Generate server-side skeletons
Import WSDL url into projects

While finishing the wizzard we get the code along with main() function in it.
We can modify and run the program.
It worked only for Authentication only. 

The idea here is to generate the stub skeleton code for calling it inside the oracle forms by creating a deployment jar file, and importing the jar file inside the oracle forms using import jar file option, the same jar file path has to be added to CLASSPATH in the ENVIRONMENT VARIABLE and the default.env file has one property it will be having the path of this jar file also. (i.e) we are adding this webservice call to make it available to use. For this i should not select the "Generate main methods into the stub" while making the stub code generation I believe.

But other than authentication WSDL url  Oracle JDeveloper did not generate any stub skeleton code.
So I can not proceed further.

If you have any other way to do the same stub generation (other tools other than jdeveloper)
use a different approach/Language/ in order to achieve the same functions chek-in, check-out, viewing, querying document through oracle
forms.

Can I use alfresco foundation api to consume this services? if so what are the steps to do that?  A good starting point will be helpful.

If you could suggest any books for reading that will also be helpful .

Kindly revert back with your expert advise.

Sample code generated for Authentication:

package mypackage1;
import oracle.soap.transport.http.OracleSOAPHTTPConnection;
import org.apache.soap.encoding.soapenc.BeanSerializer;
import org.apache.soap.encoding.SOAPMappingRegistry;
import org.apache.soap.util.xml.QName;
import java.util.Vector;
import org.w3c.dom.Element;
import java.net.URL;
import org.apache.soap.Body;
import org.apache.soap.Envelope;
import org.apache.soap.messaging.Message;
import oracle.jdeveloper.webservices.runtime.WrappedDocLiteralStub;
import java.util.Properties;

/**
* Generated by the Oracle9i JDeveloper Web Services Stub/Skeleton Generator.
* Date Created: Mon Jul 16 17:24:04 IST 2012
* WSDL URL: http://172.27.34.55:8080/alfresco/api/AuthenticationService?WSDL
*
*
* Provides simple authentication capability. 
*/

public class AuthenticationServiceStub extends WrappedDocLiteralStub
{
  public AuthenticationServiceStub()
  {
    System.setProperty("oracle.soap.transport.noHTTPClient", "true");
    m_httpConnection = new OracleSOAPHTTPConnection();
    Properties props = new Properties();
    props.put(OracleSOAPHTTPConnection.AUTH_TYPE, "basic");
    props.put(OracleSOAPHTTPConnection.USERNAME, "admin");
    props.put(OracleSOAPHTTPConnection.PASSWORD, "123456");
    m_httpConnection.setProperties(props);
  }

  public static void main(String[] args)
  {
    try
    {
      AuthenticationServiceStub stub = new AuthenticationServiceStub();
      // Add your own code here.
      System.out.println("Authenticated sucessfully into alfresco using admin");
    }
    catch(Exception ex)
    {
      ex.printStackTrace();
    }

  }

  public String endpoint = "http://172.27.34.55:8080/alfresco/api/AuthenticationService";
  private OracleSOAPHTTPConnection m_httpConnection = null;
  private SOAPMappingRegistry m_smr = null;

  public AuthenticationResult1 startSession(String username, String password) throws Exception
  {
    URL endpointURL = new URL(endpoint);

    Envelope requestEnv = new Envelope();
    Body requestBody = new Body();
    Vector requestBodyEntries = new Vector();

    String wrappingName = "startSession";
    String targetNamespace = "http://www.alfresco.org/ws/service/authentication/1.0";
    Vector requestData = new Vector();
    requestData.add(new Object[] {"username", username});
    requestData.add(new Object[] {"password", password});

    requestBodyEntries.addElement(toElement(wrappingName, targetNamespace, requestData));
    requestBody.setBodyEntries(requestBodyEntries);
    requestEnv.setBody(requestBody);

    Message msg = new Message();
    msg.setSOAPTransport(m_httpConnection);
    msg.send(endpointURL, "http://www.alfresco.org/ws/service/authentication/1.0/startSession", requestEnv);

    Envelope responseEnv = msg.receiveEnvelope();
    Body responseBody = responseEnv.getBody();
    Vector responseData = responseBody.getBodyEntries();

    return (AuthenticationResult1)fromElement((Element)responseData.elementAt(0), mypackage1.AuthenticationResult1.class);
  }

  public void endSession(String ticket) throws Exception
  {
    URL endpointURL = new URL(endpoint);

    Envelope requestEnv = new Envelope();
    Body requestBody = new Body();
    Vector requestBodyEntries = new Vector();

    String wrappingName = "endSession";
    String targetNamespace = "http://www.alfresco.org/ws/service/authentication/1.0";
    Vector requestData = new Vector();
    requestData.add(new Object[] {"ticket", ticket});

    requestBodyEntries.addElement(toElement(wrappingName, targetNamespace, requestData));
    requestBody.setBodyEntries(requestBodyEntries);
    requestEnv.setBody(requestBody);

    Message msg = new Message();
    msg.setSOAPTransport(m_httpConnection);
    msg.send(endpointURL, "http://www.alfresco.org/ws/service/authentication/1.0/endSession", requestEnv);

    Envelope responseEnv = msg.receiveEnvelope();
    Body responseBody = responseEnv.getBody();
    Vector responseData = responseBody.getBodyEntries();

    fromElement((Element)responseData.elementAt(0), null);
  }
}


Thanks in advance
sulaiman sheik/Rajesh (Alfresco Learning Team)

mrogers
Star Contributor
Star Contributor
Please don't waste your time with those old Web Services.     Especially from Orion or whatever Oracle forms runs on these days.

The preferred way to access alfresco is via CMIS.   As Jeff suggests above use Apache Chemistry.