Adding a custom service in Correspondence Management Solution

- Mayank Gupta, Computer Scientist @ Adobe

Steps to add a custom service in Correspondence Management solution are as follows:

  1. The implementation for this user story involves code changes and rebuilt. So, one is required to setup the development environment via steps mentioned @ Setting up development environment.
  2. Add your sample custom service interface and implementation class in the CorrespondenceManagementSolutionTemplate/Services project for example @ com.adobe.icc package in the source code. See the sample @
  3. Now define your service as a spring bean. For this, add the following entry in your CorrespondenceManagementSolutionTemplateServicesresourcesMETA-INFspringcmadobe-cm-spring-config.xml file: <bean id=”sampleCustomService” class=”com.adobe.icc.SampleCustomServiceImpl” />
  4. Now expose your spring bean as a osgi-service. For this, add the following entry in your CorrespondenceManagementSolutionTemplateServicesresourcesMETA-INFspringosgi-context.xml file: <bp:service interface=”com.adobe.icc.SampleCustomService” ref=”sampleCustomService” > <bp:service-properties><entry key=”connectors.httpinvoker” value=”true” /> <entry key=”connectors.httpinvoker.alias” value=”/sampleCustomService” /> <entry key=”connectors.remoting” value=”true” /> <entry key=”” value=”sampleCustomService” /> </bp:service-properties> </bp:service>
  5. Rebuild and redeploy the Solution template to view the changes. For information on rebuilding and redeploying, see Building and deploying the Solution Template.