Friday 10 February 2012

ECM 11g in JDeveloper

Configuring UCM 11g in JDeveloper to ease in Developing ECM 11g component and Testing
Those who were familiar with starting UCM 10g from eclipse or JDeveloper may be wondering on how we do the same thing in ECM 11g as the architecture has changed.
Even I was wondering, but now I found a solution being provided by one of my colleague.
So, I will be going through the step by step process of configuring in JDeveloper for ECM 11g.
I will first start with prerequisites required for configuring in JDeveloper.
i) Oracle XE Database or Oracle Database 11g
ii) RCU for ECM 11g
iii) Weblogic
IV) ECM 11g
V) Oracle JDeveloper
Just follow the oracle documentation to install all the software. Install the JDeveloper and test the integrated weblogic server is running or not.
Now it’s time to start the configuration and extend the ECM domain to be started from JDeveloper.
1) Locate the “config.cmd” to start extending the Domain. In our case this was located in
C: \Oracle\Middleware\Oracle_ECM1\common\bin




2) Select the 2nd Option called “Extend an existing Weblogic Domain” as shown below screen

3) Before we extend the integrated weblogic domain of JDeveloper we need to get the location of the Integrated JDeveloper Weblogic server default domain. For our case this was located in the below location:
C:\Documents and Settings\Oracle.XP_ONE\ApplicationData\JDeveloper\system11.1.1.4.37.59.23\DefaultDomain
The location is a hidden folder which is not visible until we make it extensible visible.


















4) Once the folder is made is visible we can select the folder to extension of the domain.















5) Select the products which we need the extended domain to include and then it will create the tables for that domain. For our case we had selected IBR and IDC and it will automatically select the other related technology.















6)Once the products have been selected click next to test the Database connection and proceed with the Domain extension.















Inputting all the required parameters and clicking next will test the database connection and you will see a success page.















7) Click next and Select the "Managed Servers, Clusters and Machines" option.















8) Click next  and we see already 2 configured server ECM and IBR with the default port. Just delete those 2 entries and click next.















9)Leave other screens as default and go on clicking next till you arrive at this screen. On this screen just click on “Extend” and wait for completion.















10) Now once the domain is extended now its time to start the JDeveloper and see if the “Webcenter Content” is loading or not.

















For the first time it will fail as there is one web application which is conflicting with ecm deployment.From the above screen shot we see there is one FMW home page application which is conflicting.So, we need to undeploy the application and restart the server. 
 Browse to the following URL http://ecm-base:7101/console with credentials as “weblogic/weblogic1”.




















On the weblogic home page select the "Deployments" section and identify the web application which is conflicting with the ecm deployment.


















Select the application and delete the application and restart the weblogic server.
Now, this will load all the server and will start successfully.
















11) Once the UCM is loaded just login to the UCM  i.e http://ecm-base:7101/cs and configure the Oracle Content Server. Accept all the default configuration for Content Server and restart the node. Once all the configuration is done just login to UCM and we should see the login page. Pass the username and password as “weblogic/weblogic1” and we should see the home page.






































Since that we have successfully extended the domain and UCM server is running fine.

Developing UCM Component from JDeveloper

So, it’s time to create the First UCM component from JDeveloper. I will take you now through the step by step process to create a sample UCM component.

1)Open the JDeveloper for which you extended the weblogic domain.

2) Create a new application, for our case it is called “SampleComponent” and under Application Template select “Generic Application”.



















3) Create a project and provide a name of your choice and under Technologies select “Java” as technologies and provide the package as you like.




















Don’t hit finish now as we have to change the “Java Source path” and “Output Directory”.


















The Java source path can be any but the Output Directory should be path to you custom component location .For our case this was in the following location:

C:\Documents and Settings\Oracle.XP_ONE\Application Data\JDeveloper\system11.1.1.4.37.59.23\DefaultDomain\ucm\cs\custom\SampleCustom\classes

3) Add the” IdcServer.jar” to the project for building any component in ucm.

















4) Now we have add a Python script to our which can be used to just redeploy the custom component after any changes we make. The “.py” script look like the below:

connect ('weblogic', 'weblogic1', 't3://localhost:7101')
redeploy ('Oracle Universal Content Management - Content Server')

5) For using the Python we have to create a build file. To create a build file just select the project and create a build file. Below is the script of ant build file which is used for compiling and deploying the component.

















<?xml version="1.0" encoding="windows-1252" ?>
<!--Ant buildfile generated by Oracle JDeveloper-->
<!--Generated Feb 7, 2012 9:12:29 AM-->
<project name="SampleCustom" default="all" basedir=".">
  <property file="build.properties"/>
  <property name="wlst" value="C:/Oracle/Middleware/oracle_common/common/bin/wlst.cmd"/>
  <path id="library.Idcserver.jar">
    <pathelement location="../../../../Oracle/Middleware/Oracle_ECM1/ucm/idc/jlib/idcserver.jar"/>
  </path>
  <path id="classpath">
<path refid="library.Idcserver.jar"/>
  </path>
  <target name="init">
    <tstamp/>
    <mkdir dir="${output.dir}"/>
  </target>
  <target name="all" description="Build the project" depends="compile,copy"/>
  <target name="clean" description="Clean the project">
    <delete includeemptydirs="true" quiet="true">
      <fileset dir="${output.dir}" includes="**/*"/>
    </delete>
  </target>
  <target name="compile" description="Compile Java source files" depends="init">
    <javac destdir="${output.dir}" classpathref="classpath"
           debug="${javac.debug}" nowarn="${javac.nowarn}"
           deprecation="${javac.deprecation}" encoding="Cp1252" source="1.6"  target="1.6">
      <src path="../../../../Documents and Settings/Oracle.XP_ONE/Application Data/JDeveloper/system11.1.1.4.37.59.23/DefaultDomain/ucm/cs/custom/SampleCustom/classes"/>
    </javac>
  </target>
  <target name="copy" description="Copy files to output directory"
          depends="init">
    <patternset id="copy.patterns">
      <include name="**/*.gif"/>
      <include name="**/*.jpg"/>
      <include name="**/*.jpeg"/>
      <include name="**/*.png"/>
      <include name="**/*.properties"/>
      <include name="**/*.xml"/>
      <include name="**/*.ejx"/>
      <include name="**/*.xcfg"/>
      <include name="**/*.cpx"/>
      <include name="**/*.dcx"/>
      <include name="**/*.sva"/>
      <include name="**/*.wsdl"/>
      <include name="**/*.ini"/>
      <include name="**/*.tld"/>
      <include name="**/*.tag"/>
      <include name="**/*.xlf"/>
      <include name="**/*.xsl"/>
      <include name="**/*.xsd"/>
    </patternset>
    <copy todir="${output.dir}">
      <fileset dir="../../../../Documents and Settings/Oracle.XP_ONE/Application Data/JDeveloper/system11.1.1.4.37.59.23/DefaultDomain/ucm/cs/custom/SampleCustom/classes">
        <patternset refid="copy.patterns"/>
      </fileset>
    </copy>
  </target>
    <target name="redeploy" description="Redeploy Content Server application">
    <exec executable="${wlst}">
         <arg value="./redeployCS.py"/>
    </exec>
  </target>
</project>

The lines which are in bold above needs to be just added to your existing “build.xml” file. In the property named “wlst” edit the wlst location as per your location.

6) We need to edit the hda  file from the “component wizard” to give the right location of the class file. In our case we build a custom filter so we edited the “hda” file as follows:
Please mark the changes in bold letter.

<?hda version="11gR1-11.1.1.4.0-idcprod1-101229T001824" jcharset=UTF8 encoding=utf-8?>
@Properties LocalData
blFieldTypes=
blDateFormat=M/d{/yy}{ h:mm[:ss]{ a}}!mAM,PM!tAmerica/New_York
@end
@ResultSet ClassAliases
3
classname
location
loadOrder
@end
@ResultSet Filters
4
type
location
parameter
loadOrder
afterInitLocale
samplecustom.Test
null
1
@end
@ResultSet ResourceDefinition
4
type
filename
tables
loadOrder
@end
@ResultSet MergeRules
4
fromTable
toTable
column
loadOrder
@end

7) Redeploy the component and you are good to go.

Enjoy building the component using JDeveloper.










No comments:

Post a Comment