Wednesday 1 August 2012

How to create Custom Service Component in Oracle UCM 11g

1. Open Component Wizard from {domain_home}/ucm/cs/bin/ComponentWizard
2. Click on Add button will show up new popup window.
     a. Name the component "HelloWorld"
     b.Click Ok.
3. Click on Add on Resource Window
     a. Select Service & Click Next.
4. Give the service name "Hello_World".
     Class name - Give class path
     Template- MSG_PAGE

5. Click on ADD button
6. Click Ok.

7. Click On Finish.
8. Open Jdeveloper/ Eclipse framework Create Java class name "Custom Service"
package project1;
import intradoc.common.ServiceException;
import intradoc.common.SystemUtils;
import intradoc.data.DataException;
import intradoc.server.Service;
public class CustomService extends Service {


public void helloworld_sayHello()throws DataException,ServiceException{
SystemUtils.info("inside Method");
m_binder.putLocal("StatusMessage", "Hello World Sample ");
String statusmessage=m_binder.getLocal("StatusMessage");
SystemUtils.info("statusmessage:"+statusmessage);
}


}
 

a. Create folder structure at your custom component location & put java and Class file to appropriate location:
/ucm/cs/custom/HelloWorld/src/project1/CustomService.java
/ucm/cs/custom/HelloWorld/classes/project1/CustomService.class

9. Add class Path to {Custom_Component_Home}/HelloWorld.hda
 10. Open Component Wizard Click on "Enable" by selectin "HelloWorld" component.
 11. Restart the content server.
       Now hit the URL:http://localhost:16200/cs/idcplg?IdcService=HELLO_WORLD