Repository Service - Checking a custom property!

Hi All
I am trying to create repository that will check a custom property 'RepGroup' and then act on it if the the property contains a certan value. However I am not sure how to do this - does anyone have an example I could see?
Many Thanks
Phil

Hi Phil,
I understand that the information from:
Creating Repository Services advice!
wasn't enough.
What exactly are you missing?
Yoav.

Similar Messages

  • Repository service implementation: custom property

    Hi,
    Is there any sample implementation of repository service for custom properties?
    I tried with eclipse PDK plug-in to create and deploy. but no success. Any pointers for repository service implementation docs ?
    thanks in advance for any help in this regard.
    John

    Hi John,
    there is no deep doc on RepServices. Primarily, search on the forums. Maybe Permissions on XML Forms resources is a good starting point for you?!
    Additionally, to add custom properties (I think you think about configuration properties?!) you'll have to understand the config framework and it's file structure.
    For this, have a look under src.config of you project created by the wizards; watch how they are deployed; and compare other configurations you can find within CM with their corresponding configuration files. That's the best way to get behind the secrets
    Hope it helps
    Detlev

  • Custom property for file in File System Repository

    Hi,
    I have create a folder on KM using File system Repository access a network path, but facing a problems that the folder can't support custom property and can't classifiable.

    hi
    http://help.sap.com/saphelp_nw04/helpdata/en/69/d96b83a84611d5993600508b6b8b11/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/43/2e6868c6ce72408d982213e314fda1/content.htm.<b>please don,t forget points</b>
    with regards
    subrato kundu

  • CM Repository stops after assigning custom repository service

    Dear all,
    I have created a repository service which sets the document creator as the permission owner of the document.
    This service is deployed in DEV & QA systems and is working fine. But when I moved the same to Production and assigned this service to the documents repository, it started giving error (before the restart itself)
    I am getting the following error.
    Item not found
    /documents
    The item you are attempting to access is not available. Check that the name or link is correct. You might also check whether the associated repository is currently accessible.
    Note: Our production & QA systems have 2 server nodes and DEV has only one server node. We are on EP 7.0 SP 16.
    Please help!
    Best Regards,
    Aparnna

    Hi Yoga,
    The error from the default trace is given below
    Due to this error we removed the Par from Portal now. Isn't there a solution for this?
    unexpected exception - java.lang.NullPointerException
    at com.sapportals.wcm.repository.manager.cm.CmRepositoryManager.getResource(CmRepositoryManager.java:995)
    at com.sapportals.wcm.repository.RMAdapter.getResource(RMAdapter.java:228)
    at com.sapportals.wcm.repository.runtime.CmAdapter.findResource(CmAdapter.java:1349)
    at com.sapportals.wcm.repository.runtime.CmAdapter.findManagerAndResource(CmAdapter.java:1322)
    at com.sapportals.wcm.repository.runtime.CmAdapter.getResourceImpl(CmAdapter.java:979)
    at com.sapportals.wcm.repository.runtime.CmAdapter.getResource(CmAdapter.java:192)
    at com.sapportals.wcm.rendering.control.cm.WdfProxy.createResource(WdfProxy.java:2267)
    at com.sapportals.wcm.rendering.control.cm.WdfProxy.createResource(WdfProxy.java:2249)
    at com.sapportals.wcm.rendering.control.cm.WdfProxy.getUnsafeResource(WdfProxy.java:2222)
    at com.sapportals.wcm.rendering.control.cm.WdfProxy.getLayoutController(WdfProxy.java:2202)
    at com.sapportals.wcm.rendering.control.cm.WdfProxy.isPreviewEnabled(WdfProxy.java:2618)
    at sun.reflect.GeneratedMethodAccessor840.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:62)
    at java.lang.reflect.Method.invoke(Method.java:391)
    at com.sapportals.wdf.serialize.PersistenceManager.createPropertyTable(PersistenceManager.java:83)
    at com.sapportals.wdf.serialize.PersistenceManager.store(PersistenceManager.java:48)
    at com.sapportals.wdf.serialize.PersistenceComponentManager.store(PersistenceComponentManager.java:79)
    at com.sapportals.wdf.stack.Control.renderPersistentProperties(Control.java:315)
    at com.sapportals.wdf.stack.Pane.renderPersistentControls(Pane.java:127)
    at com.sapportals.wdf.stack.PaneStack.renderPersistentControls(PaneStack.java:112)
    at com.sapportals.wdf.stack.Pane.renderPersistentControls(Pane.java:121)
    at com.sapportals.wdf.stack.PaneStack.renderPersistentControls(PaneStack.java:112)
    at com.sapportals.wdf.stack.Pane.renderPersistentControls(Pane.java:121)
    at com.sapportals.wdf.stack.PaneStack.renderPersistentControls(PaneStack.java:112)
    at com.sapportals.wdf.stack.Pane.renderPersistentControls(Pane.java:121)
    at com.sapportals.wdf.stack.PaneStack.renderPersistentControls(PaneStack.java:112)
    at com.sapportals.wdf.stack.PaneStack.renderPersistentGrid(PaneStack.java:89)
    at com.sapportals.wdf.WdfCompositeController.doInitialization(WdfCompositeController.java:308)
    at com.sapportals.wdf.WdfCompositeController.buildComposition(WdfCompositeController.java:660)
    at com.sapportals.htmlb.AbstractCompositeComponent.preRender(AbstractCompositeComponent.java:33)
    at com.sapportals.htmlb.Container.preRender(Container.java:120)
    at com.sapportals.htmlb.Container.preRender(Container.java:120)
    at com.sapportals.htmlb.Container.preRender(Container.java:120)
    at com.sapportals.portal.htmlb.PrtContext.render(PrtContext.java:406)
    at com.sapportals.htmlb.page.DynPage.doOutput(DynPage.java:237)
    at com.sapportals.wcm.portal.component.base.KMControllerDynPage.doOutput(KMControllerDynPage.java:134)
    at com.sapportals.htmlb.page.PageProcessor.handleRequest(PageProcessor.java:129)
    at com.sapportals.portal.htmlb.page.PageProcessorComponent.doContent(PageProcessorComponent.java:134)
    at com.sapportals.wcm.portal.component.base.ControllerComponent.doContent(ControllerComponent.java:77)
    at com.sapportals.portal.prt.component.AbstractPortalComponent.serviceDeprecated(AbstractPortalComponent.java:209)
    at com.sapportals.portal.prt.component.AbstractPortalComponent.service(AbstractPortalComponent.java:114)
    at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:328)
    at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:136)
    at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:189)
    at com.sapportals.portal.prt.component.PortalComponentResponse.include(PortalComponentResponse.java:215)
    at com.sapportals.portal.prt.pom.PortalNode.service(PortalNode.java:645)
    at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:328)
    at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:136)
    at com.sapportals.portal.prt.core.PortalRequestManager.dispatchRequest(PortalRequestManager.java:189)
    at com.sapportals.portal.prt.core.PortalRequestManager.runRequestCycle(PortalRequestManager.java:753)
    at com.sapportals.portal.prt.connection.ServletConnection.handleRequest(ServletConnection.java:240)
    at com.sapportals.portal.prt.dispatcher.Dispatcher$doService.run(Dispatcher.java:524)
    at java.security.AccessController.doPrivileged(AccessController.java:246)
    at com.sapportals.portal.prt.dispatcher.Dispatcher.service(Dispatcher.java:407)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.sap.engine.services.servlets_jsp.server.servlet.InvokerServlet.service(InvokerServlet.java:156)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
    at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
    at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
    at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:386)
    at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:364)
    at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:1039)
    at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:265)
    at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
    at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
    at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
    at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
    at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
    at java.security.AccessController.doPrivileged(AccessController.java:219)
    at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:102)
    at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:172)
    Best Regards,
    Aparnna

  • Activating subscription service on a custom developed read only repository

    Hi Experts,
         We have a custom implementation of a read only KM repository manager which just expose documents, but does not have any editing functionality. Now the client wants to activate subscriptions on that repository manager. The current implementation of the manager is not sending any emails. Do you know what should be implemented by the manager in order to get the subscription service to work? We are looking for a daily notification as it is clear that because it is a read only manager there is no way to get notification for all events.
    Regards,
         Tania

    Hi,
    See the Javadoc package description com.sapportals.wcm.repository.service.subscription for:
    Detailed explanation of the API and underlying concepts
    UML diagram of interfaces
    Code sample: Creating a subscription
    https://media.sdn.sap.com/javadocs/NW04/SPS15/km/com/sapportals/wcm/repository/service/subscription/package-summary.html
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/kmc/Knowledge%20Management%20and%20Collaboration%20Developers%20Guide.html
    Patricio

  • KM Repository Service for creating a folder structure

    Hi All,
       We have a requirement in KM. Whenever a folder is created inside a folder (say '/documents/testFolder') ... .. a couple of subFolders need to be created inside this new folder.
    For example, if the new folder's name being created is <i>parentFolder1</i> then, the following structure shud be created inside this folder.
    parentFolder1
      |--> subFolder1
                 |--> subFolder11
                 |--> subFolder12
      |--> subFolder2
                 |--> subFolder21
    I tried to implement a KM repository service::
    My Rep Service code::
    package com.test;
    import java.util.Collection;
    import java.util.Iterator;
    import com.sap.tc.logging.Location;
    import com.sapportals.config.fwk.CannotAccessConfigException;
    import com.sapportals.config.fwk.Configuration;
    import com.sapportals.config.fwk.IConfigClientContext;
    import com.sapportals.config.fwk.IConfigManager;
    import com.sapportals.config.fwk.IConfigPlugin;
    import com.sapportals.config.fwk.IMutableConfigurable;
    import com.sapportals.config.fwk.InitialConfigException;
    import com.sapportals.portal.security.usermanagement.UserManagementException;
    import com.sapportals.wcm.WcmException;
    import com.sapportals.wcm.crt.component.IReconfigurable;
    import com.sapportals.wcm.crt.component.StartupException;
    import com.sapportals.wcm.crt.configuration.ConfigurationException;
    import com.sapportals.wcm.crt.configuration.IConfiguration;
    import com.sapportals.wcm.repository.AccessDeniedException;
    import com.sapportals.wcm.repository.ICollection;
    import com.sapportals.wcm.repository.IResource;
    import com.sapportals.wcm.repository.NotSupportedException;
    import com.sapportals.wcm.repository.Property;
    import com.sapportals.wcm.repository.ResourceException;
    import com.sapportals.wcm.repository.manager.IRepositoryManager;
    import com.sapportals.wcm.repository.manager.IResourceEvent;
    import com.sapportals.wcm.repository.manager.IResourceEventReceiver;
    import com.sapportals.wcm.repository.manager.ResourceEvent;
    import com.sapportals.wcm.repository.service.AbstractRepositoryService;
    import com.sapportals.wcm.repository.service.ServiceNotAvailableException;
    import com.sapportals.wcm.util.config.ConfigCrutch;
    import com.sapportals.wcm.util.events.IEvent;
    // implements IMyNewRepositoryService interface
      Note: IReconfigurable and IResourceEventReceiver interfaces are optional
    public class MytestRepositoryService extends AbstractRepositoryService implements IReconfigurable, IResourceEventReceiver {
      private static final String TYPE = "com.test.MytestRepositoryService";
      private Collection repositoryManagers;
      private static final Location log = Location.getLocation(MytestRepositoryService.class);
      //variables
           private static final String PLUGIN_FOLDERCREATION_SERVICE = "/cm/repository_services";
           private static final String CONFIGCLASS_FOLDERCREATION_SERVICE = "com.test.MytestRepositoryService";
           private static final String readPlugins[] = { PLUGIN_FOLDERCREATION_SERVICE };
    public static final String PROP_MYFOLDER = "myFolder";
      public MytestRepositoryService() {
        super();
        // Do not add code here. Add it to startUpImpl() instead
      public String getServiceType() {
        return MytestRepositoryService.TYPE;
      protected void startUpImpl(Collection repositoryManagers) throws ConfigurationException, StartupException {
        // implement this method as follows:
        // - Verify configuration data
        // - Get references to other needed (global) services
        // - Check whether other repository services (this service depends on) are also assigned to the repository managers
        // - Usually the service registers itself for certain events at all repository managers
        try  {
        catch (Exception e) {
          throw new StartupException(e.getMessage(), e);
         this.repositoryManagers = repositoryManagers;
         Iterator it = repositoryManagers.iterator();
         while (it.hasNext()){
           try {
              addRepositoryAssignment((IRepositoryManager) it.next());
           } catch (ServiceNotAvailableException e) {
              e.printStackTrace();
      protected void shutDownImpl() {
         Iterator it = repositoryManagers.iterator();
         while (it.hasNext()){
           try {
              removeRepositoryAssignment((IRepositoryManager) it.next());
           } catch (WcmException e) {
              e.printStackTrace();
      protected void addRepositoryAssignment(IRepositoryManager mgr) throws ServiceNotAvailableException {
        // Implement this method: Usually the service registers itself for certain events at the repository manager.
         try {
    //       mgr.getEventBroker().register(this, ResourceEvent.ALL_TEMPLATE);
           mgr.getEventBroker().register(this, new ResourceEvent(ResourceEvent.CREATE_COLLECTION, null));
         } catch (WcmException e) {
           e.printStackTrace();
      protected void removeRepositoryAssignment(IRepositoryManager mgr) throws WcmException {
        // Implement this method: Usually the service must unregister itself as an event handler.
    //     mgr.getEventBroker().unregister(this, ResourceEvent.ALL_TEMPLATE);
         mgr.getEventBroker().unregister(this, new ResourceEvent(ResourceEvent.CREATE_COLLECTION, null));
      public void reconfigure(IConfiguration config) throws ConfigurationException {
        this.stateHandler.preReconfigure();
        // check the new configuration data
        try {
        catch (ConfigurationException ex) {
          this.stateHandler.postReconfigure(ex);
          throw ex;
        this.config = config;
        this.stateHandler.postReconfigure();
      public void received(IEvent event) {
         IResourceEvent myEvent = (IResourceEvent) event;
         IResource resource = (IResource) myEvent.getParameter();
         String repositoryPath = "";
         String parentPath = "";
                //get the configuration...
                try {
                       IConfigClientContext context = IConfigClientContext.createContext(ConfigCrutch.getConfigServiceUser());
                     IConfigManager cfg = Configuration.getInstance().getConfigManager(context);
                     IConfigPlugin configPlugin = cfg.getConfigPlugin(PLUGIN_FOLDERCREATION_SERVICE);
                     if (configPlugin != null) {
                          IMutableConfigurable[] configurables = configPlugin.getConfigurables(CONFIGCLASS_FOLDERCREATION_SERVICE, false);
                          for (int i = 0; i < configurables.length; i++) {
                               IMutableConfigurable configurable = configurables<i>;
                               if (configurable.getConfigClass().getName().equals(CONFIGCLASS_FOLDERCREATION_SERVICE)) {
                                    // now get the attribute value...
                                    repositoryPath = configurable.getPropertyValue(PROP_MYFOLDER);  //// "documents/parentFolder1"
              } catch (InitialConfigException e2) {
                   e2.printStackTrace();
              } catch (CannotAccessConfigException e2) {
                   e2.printStackTrace();
              } catch (UserManagementException e2) {
                   e2.printStackTrace();
              try {
                   parentPath = resource.getParentCollection().getRID().toString();
              } catch (AccessDeniedException e1) {
                   e1.printStackTrace();
              } catch (ResourceException e1) {
                   e1.printStackTrace();
              if(repositoryPath.equals(parentPath))
                   //write my code here
                   if (resource != null && (resource.isCollection()) )
                        ICollection parentFolder = (ICollection) resource;
                        try {
                             <b>parentFolder.createCollection("subFolder1",null);</b>
                        } catch (NotSupportedException e) {
                             e.printStackTrace();
                        } catch (AccessDeniedException e) {
                             e.printStackTrace();
                        } catch (ResourceException e) {
                             e.printStackTrace();
    <b>...MytestRepositoryService.co.xml:</b>
    - <Configurable configclass="com.test.MytestRepositoryService">
      <property name="name" value="com.test.MytestRepositoryService" />
      <property name="active" value="true" />
    <i>  <property name="myFolder" value="/documents/parentFolder1" /></i>
      <property name="description" />
      </Configurable>
    <b>...MytestRepositoryService.cc.xml:</b>
    - <ConfigClass name="com.test.MytestRepositoryService" extends="RepositoryService">
      <attribute name="class" type="class" constant="com.test.MytestRepositoryService" />
      </ConfigClass>
    Have i done it right?? Where am i going wrong??? Plz advice.
    I need to 'myFolder' as a configurable property in KM's <i>Content Management --> Repository Services</i> section.
    Thanks!
    Regards,
    SK.

    Hi,
    I haven't check your code but you know that you can archive the same without writing a portal componente by using the template feature. It is a simple customizing. See http://help.sap.com/saphelp_nw70/helpdata/en/55/83bd402b8d8031e10000000a1550b0/frameset.htm
    Best Regards
    Frank

  • EJB called via JNDI in a Repository Service :: ClassCastException

    Hi SDN,
    I've got a problem in calling an EJB from a Repository Service...
    Here the steps I've follow:
      -  An EJB has been created with some Business Methods in it; it has been packaged in an EAR and deployed;
      -  This EJB is looked up succesfully via JNDI in a WDJ application and also in an Abstract Portal Component; I use the following guides:
    [Accessing EJB Apps using JNDI|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/0736159e-0301-0010- 9ea4-c63d83d0797b?QuickLink=index&overridelayout=true]
    [Referencing an EJB in an Abstract Portal Component|http://wiki.sdn.sap.com/wiki/display/HOME/ConnectingEJBUsing ExternalJars]
      -  A Repository Service has been created and registered on "CREATE_CHILD_TEMPLATE" ResourceEvent; I can see from logs that this service works correctly;
       -  I've copied in the PAR lib and private/lib folders two jars (ejb20.jar and the JAR created building the EJB) and they are added to the build path;
      -  If I try to look up the EJB via JNDI in the received service method, I get a ClassCastException...
    Here some code:
    try {
         //I use System.err to see log in the Default Trace
         System.err.println("Initialize EJB");
         //TestJNDIHome class seems to be visible at runtime, following instruction does not throw any exception
         System.err.println("ToString TestJNDIHome: " + TestJNDIHome.class.toString());
         //EJB and PAR are on the same J2EE engine, so no InitialContext parameters, I'm right?
         InitialContext context = new InitialContext();
         Object jndiobj = context.lookup("altevie.com/testear/TestJNDIBean");
         System.err.println("Classe oggetto recuperato da lookup: " + jndiobj.getClass());
         TestJNDIHome home = (TestJNDIHome) javax.rmi.PortableRemoteObject.narrow(jndiobj, TestJNDIHome.class);
         testJNDI = home.create();
    } catch (NamingException ex) {
         System.err.println("NamingException :: " + ex.getLocalizedMessage());
    } catch (RemoteException ex) {
         System.err.println("RemoteException :: " + ex.getLocalizedMessage());
    } catch (CreateException ex) {
         System.err.println("CreateException :: " + ex.getLocalizedMessage());          
    Here the portalapp.xml (in the same PAR there are two objects, the Repository Service and an Abstract Portal Component, but I've got the same problem also removing the Abstract Portal Component...):
    <application>
      <application-config>
        <property name="com.sap.engine.interfaces.cross.ObjectReferenceImpl" value="SAPJ2EE::altevie.com/testEAR"/>
        <property name="SharingReference" value="usermanagement, knowledgemanagement, landscape, htmlb, exportalJCOclient, exportal"/>
        <property name="PrivateSharingReference" value="SAPJ2EE::altevie.com/testEAR"/>
      </application-config>
      <components>
        <component name="TestJSP">
          <component-config>
            <property name="ClassName" value="com.comer.eps.epcomp.TestJSP"/>
          </component-config>
          <component-profile/>
        </component>
      </components>
      <services>
        <service name="RFServiceWrapper">
          <service-config>
            <property name="className" value="com.sap.netweaver.rf.wrapper.RFServiceWrapper"/>
            <property name="startup" value="true"/>
          </service-config>
        </service>
      </services>
    </application>
    javax.rmi.PortableRemoteObject.narrow method call throws a ClassCastException...
    From the previous println I can see the lookup method returns a com.sap.engine.interfaces.cross.ObjectReferenceImpl object, I do not know if it is correct...
    I've tried to lookup the Local (localejbs/altevie.com/testear/TestJNDIBean) and Remote (altevie.com/testear/TestJNDIBean) JNDI Bean name, but I get the same error...
    I'm sure the JNDI name is correct (it works with WDJ and Abstract Portal Component... I've also tested via LOOKUP command using telnet to connect to J2EE AS and I've checked JNDI Registry and EJB Container services in Visual Admin)...
    Here the stack trace of the error:
    java.lang.ClassCastException: com.comer.eps.ejb.AccessiEJBHome
         at com.sap.engine.services.cross.PortableRemoteObjectContainer.narrow(PortableRemoteObjectContainer.java:179)
         at com.sap.engine.system.PortableRemoteObjectProxy.narrow(PortableRemoteObjectProxy.java:24)
         at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:134)
         at com.comer.eps.repsrv.onsave.RipubblicaByDE.initializeEJB(RipubblicaByDE.java:145)
    Can you help me? Why JNDI lookup works in an Abstract Portal Application and doesn't in a Repository Service (same code...)?
    Thank you so much and best regards,
    Manuel
    Text Formatted: Manuel Xiccato on Sep 27, 2011 12:29 PM

    Hi SDN,
    I've got a problem in calling an EJB from a Repository Service...
    Here the steps I've follow:
      -  An EJB has been created with some Business Methods in it; it has been packaged in an EAR and deployed;
      -  This EJB is looked up succesfully via JNDI in a WDJ application and also in an Abstract Portal Component; I use the following guides:
    [Accessing EJB Apps using JNDI|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/0736159e-0301-0010- 9ea4-c63d83d0797b?QuickLink=index&overridelayout=true]
    [Referencing an EJB in an Abstract Portal Component|http://wiki.sdn.sap.com/wiki/display/HOME/ConnectingEJBUsing ExternalJars]
      -  A Repository Service has been created and registered on "CREATE_CHILD_TEMPLATE" ResourceEvent; I can see from logs that this service works correctly;
       -  I've copied in the PAR lib and private/lib folders two jars (ejb20.jar and the JAR created building the EJB) and they are added to the build path;
      -  If I try to look up the EJB via JNDI in the received service method, I get a ClassCastException...
    Here some code:
    try {
         //I use System.err to see log in the Default Trace
         System.err.println("Initialize EJB");
         //TestJNDIHome class seems to be visible at runtime, following instruction does not throw any exception
         System.err.println("ToString TestJNDIHome: " + TestJNDIHome.class.toString());
         //EJB and PAR are on the same J2EE engine, so no InitialContext parameters, I'm right?
         InitialContext context = new InitialContext();
         Object jndiobj = context.lookup("altevie.com/testear/TestJNDIBean");
         System.err.println("Classe oggetto recuperato da lookup: " + jndiobj.getClass());
         TestJNDIHome home = (TestJNDIHome) javax.rmi.PortableRemoteObject.narrow(jndiobj, TestJNDIHome.class);
         testJNDI = home.create();
    } catch (NamingException ex) {
         System.err.println("NamingException :: " + ex.getLocalizedMessage());
    } catch (RemoteException ex) {
         System.err.println("RemoteException :: " + ex.getLocalizedMessage());
    } catch (CreateException ex) {
         System.err.println("CreateException :: " + ex.getLocalizedMessage());          
    Here the portalapp.xml (in the same PAR there are two objects, the Repository Service and an Abstract Portal Component, but I've got the same problem also removing the Abstract Portal Component...):
    <application>
      <application-config>
        <property name="com.sap.engine.interfaces.cross.ObjectReferenceImpl" value="SAPJ2EE::altevie.com/testEAR"/>
        <property name="SharingReference" value="usermanagement, knowledgemanagement, landscape, htmlb, exportalJCOclient, exportal"/>
        <property name="PrivateSharingReference" value="SAPJ2EE::altevie.com/testEAR"/>
      </application-config>
      <components>
        <component name="TestJSP">
          <component-config>
            <property name="ClassName" value="com.comer.eps.epcomp.TestJSP"/>
          </component-config>
          <component-profile/>
        </component>
      </components>
      <services>
        <service name="RFServiceWrapper">
          <service-config>
            <property name="className" value="com.sap.netweaver.rf.wrapper.RFServiceWrapper"/>
            <property name="startup" value="true"/>
          </service-config>
        </service>
      </services>
    </application>
    javax.rmi.PortableRemoteObject.narrow method call throws a ClassCastException...
    From the previous println I can see the lookup method returns a com.sap.engine.interfaces.cross.ObjectReferenceImpl object, I do not know if it is correct...
    I've tried to lookup the Local (localejbs/altevie.com/testear/TestJNDIBean) and Remote (altevie.com/testear/TestJNDIBean) JNDI Bean name, but I get the same error...
    I'm sure the JNDI name is correct (it works with WDJ and Abstract Portal Component... I've also tested via LOOKUP command using telnet to connect to J2EE AS and I've checked JNDI Registry and EJB Container services in Visual Admin)...
    Here the stack trace of the error:
    java.lang.ClassCastException: com.comer.eps.ejb.AccessiEJBHome
         at com.sap.engine.services.cross.PortableRemoteObjectContainer.narrow(PortableRemoteObjectContainer.java:179)
         at com.sap.engine.system.PortableRemoteObjectProxy.narrow(PortableRemoteObjectProxy.java:24)
         at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:134)
         at com.comer.eps.repsrv.onsave.RipubblicaByDE.initializeEJB(RipubblicaByDE.java:145)
    Can you help me? Why JNDI lookup works in an Abstract Portal Application and doesn't in a Repository Service (same code...)?
    Thank you so much and best regards,
    Manuel
    Text Formatted: Manuel Xiccato on Sep 27, 2011 12:29 PM

  • Trigger mail on Custom Property Change event

    Dear All,
    We have few license documents stored into our KM Repository and it has few custom properties attached to it such as Document Priority, Expiry Date, Document Status, description and so on... now We have already configure schedular task in km to check for document Expiry Date and generates few E-mail notification to responsible persons intimating the expiry..
    Now what i require is, the custom property Document Status has statuses Renewed, Renewal In Process, Expired and Not to be Renewed so, i want mail notification on the event of Custom Property Document Status is changed...so, is there any standard API for that or anyway other alternative to achieve this.
    Regards,
    Tushar Dave

    Hi,
    Could you kindly tell me, how the first part was done.
    I am in a requirement as follows.
    'Sending Mail notification to the document owner when the document is about to expire. and the expiry data is a custom property for us.'
    your help would be really supportive.
    Thanks,
    SK

  • Writing a Custom Property Renderer

    Hello all,
    I am new to KMC development.  I want to know how to go about writing a custom property renderer.  Detail step by step instructions as to where to start and what are the configurations, etc. would be a great help for me.
    Thanks in advance.
    Vicky R.

    Hello Vicky,
    Step by Step guide to creating Property renderer is:
    1. Program an implementation of AbstractPropertyRenderer.
    2. Implement a RFServerWrapper service to register your property renderer with CrtClassLoaderRegistry.
    CrtClassLoaderRegistry.addClassLoader(this.getClass().getClassLoader());
    3. Technical mapping to your coding in the Property Metadata service.
    4.Restart your server for the changes to take effect.
    Check this link for more infos:
    https://forums.sdn.sap.com/thread.jspa?threadID=41619
    Also check the implementations of RFServerWrapper service in examples at this link:
    http://sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/c739e546-0701-0010-53a9-a370e39a5a20
    Greetings,
    Praveen Gudapati

  • Consuming a web service within a repository service

    Is it possible to consume a web service within a custom KM repository service ? If so, please provide an overview of how I might accomplish this within the NWDS.
    Thanks!

    Hi David,
    Two answers:
    (a) Yes, of course this is possible, there is no technical restriction. For your convenience, you can create a portal service from a WSDL file, see https://fortress.wa.gov/dop/portal/irj/portalapps/com.sap.portal.pdk.util.developmenttools/docs/newportalservicefromwsdl.html for details (not really up to date, but in case of questions, also check http://help.sap.com/saphelp_nw04/helpdata/en/df/a08340d990ce62e10000000a155106/frameset.htm and around). This way, you can access the portal service as a proxy to the webservice and have the WS-implementation seperated.
    (b) Consider performance impacts!!! Depending on the event you are listening to, this can very easily lead to serious problems. At least, consider caching possibilities...
    Hope it helps
    Detlev

  • Custom Property Renderer - class not found error?

    Hi,
    I am trying to create a custom property renderer in KM - just a basic Hello World for now, as in some of the other threads on SDN.
    When I use the renderer for a property in my layout set, nothing is displayed.
    My code is as follows:
    public class SBPCPropertyRenderer extends AbstractPropertyRenderer
         public Component renderProperty(IProperty property, IResource res, int maxLength)
              throws WcmException
              TextView t = new TextView();
              t.setText("Hello World");
              return t;// renders a property
    public interface IRFServiceWrapper extends IService
        public static final String KEY = "com.company.project.km.SBPCPropertyRenderer";
    public class RFServiceWrapper implements IRFServiceWrapper
         private IServiceContext mm_serviceContext;
          * Generic init method of the service. Will be called by the portal runtime.
          * @param serviceContext
         public void init(IServiceContext serviceContext)
              mm_serviceContext = serviceContext;
                CrtClassLoaderRegistry.addClassLoader(this.getKey(), this.getClass().getClassLoader());
          * This method is called after all services in the portal runtime have already been initialized.
         public void afterInit()
          * configure the service : @param configuration
         public void configure(IServiceConfiguration configuration)
          * This method is called by the portal runtime when the service is destroyed.
         public void destroy()
          * This method is called by the portal runtime when the service is released.
         public void release()
         * @return the context of the service, which was previously set by the portal runtime
         public IServiceContext getContext()
                return mm_serviceContext;
          * This method should return a string that is unique to this service amongst all
          * other services deployed in the portal runtime.
          * @return a unique key of the service
         public String getKey()
                return KEY;
    However, when I try to render using this bespoke renderer, I get the following error in the Default Trace:
    #1.5#000BCDEE0DD8005600000082000006C00004497AFED42BF7
    #1206692517085
    #com.sapportals.wcm.rendering.property.PropertyRendererUtil
    #sap.com/irj
    #com.sapportals.wcm.rendering.property.PropertyRendererUtil
    #username
    #6737
    #ITNSAPNT06_J2E_4316950
    #username
    #9cf6bb00fc9e11dcbc54000bcdee0dd8
    #SAPEngine_Application_Thread[impl:3]_34
    #0
    #0
    #Error
    #Plain
    #Either the class com.company.project.km.SBPCPropertyRenderer could not be found oder the following error occurs while rendering: java.lang.ClassNotFoundException: com.company.project.km.SBPCPropertyRenderer
         at com.sapportals.wcm.crt.CrtClassLoaderRegistry.findClass(CrtClassLoaderRegistry.java:176)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
         at java.lang.Class.forName0(Native Method)
         at java.lang.Class.forName(Class.java:219)
         at com.sapportals.wcm.rendering.property.PropertyRendererUtil.renderProperty(PropertyRendererUtil.java:122)
         at
    My PortalApp.xml is as follows:
    <?xml version="1.0" encoding="utf-8"?>
    <application>
      <application-config>
        <property name="SharingReference" value="usermanagement, knowledgemanagement, landscape, htmlb, exportalJCOclient, exportal"/>
      </application-config>
      <components/>
      <services>
        <service name="default">
          <service-config>
            <property name="className" value="com.company.project.km.SBPCPropertyRenderer"/>
            <property name="startup" value="true"/>
          </service-config>
        </service>
        <service name="RFServiceWrapper">
          <service-config>
            <property name="className" value="com.company.project.km.RFServiceWrapper"/>
            <property name="startup" value="true"/>
          </service-config>
        </service>
      </services>
    </application>
    Can anyone spot what I am doing wrong?
    Thanks,
      Tom

    Hi Tom,
    I've implemented similar behaviour but with the state of resource. The code is following:
    private static final class URLs {
              private static final String BEFORE_APPROVAL = "/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/etc/public/mimes/images/s_s_ledr.gif";
              private static final String APPROVAL = "/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/etc/public/mimes/images/s_s_ledy.gif";
              private static final String PUBLISHED = "/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/etc/public/mimes/images/s_s_ledg.gif";
              private static final String     ARCHIVED = "/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/etc/public/mimes/images/s_s_ledi.gif";
         public Component renderProperty(IProperty property, IResource res, int maxLength){
              Image image = null;
              try {
                   IRepositoryServiceFactory factory = ResourceFactory.getInstance().getServiceFactory();
                   IURLGeneratorService ug = (IURLGeneratorService)factory.getService(IServiceTypesConst.URLGENERATOR_SERVICE);
                   IStatemanagementManager stateManager = (IStatemanagementManager) factory.getRepositoryService(res,IWcmConst.STATEMANAGEMENT_SERVICE);
                   IStatemanagementUtilsResource sResource = stateManager.getStatemangementResource(res).getUtils();
                   Locale locale = res.getContext().getLocale();
                   IState state = sResource.readState();
                   if (state.getID().equalsIgnoreCase(States.BEFORE_APPROVAL))
                        image = new Image(ug.createAbsoluteUri(new UriReference(URLs.BEFORE_APPROVAL,null,null)).getPath(), state.getDescription(locale));
                   if (state.getID().equalsIgnoreCase(States.ARCHIVED))
                        image = new Image(ug.createAbsoluteUri(new UriReference(URLs.ARCHIVED,null,null)).getPath(), state.getDescription(locale));
                   if (state.getID().equalsIgnoreCase(States.APPROVAL))
                        image = new Image(ug.createAbsoluteUri(new UriReference(URLs.APPROVAL,null,null)).getPath(), state.getDescription(locale));
                   if (state.getID().equalsIgnoreCase(States.PUBLISHED))
                        image = new Image(ug.createAbsoluteUri(new UriReference(URLs.PUBLISHED,null,null)).getPath(), state.getDescription(locale));
                   return image;
              } catch (Exception e) {
                   StatePropertyRenderer.log.fatalT(e.getMessage());
                   return image;
    But you can simply take one of the properties of your resource with the method res.getProperty(<IPropertyName>) instead of state and check the value of this IProperty. I took images from KM but you can also add necessary images to your project and use them.
    Regards
    Pavel

  • Is it possible to show a custom property in a notification email?

    Hi all
    I would like to know if it is possible to display a custom property in a notification email? As I can understand from Darin Krasles answer here: https://forums.sdn.sap.com/click.jspa?searchID=3062750&messageID=1284727 and his article here: https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/90626697-0901-0010-2ca7-86e2a50ce70d there does not seem to be an (easy) answer to this question. But perhaps Detlev, Patricio, Robert or you could help me with this question?
    Where can one by the way find the java/class file relating to the email notifications? Is it com.sapportals.wcm.repository.service.subscription.wcm.SubscriptionEventMapStandard?
    Kind regards,
    Martin Søgaard

    Hi Martin,
    would you have some updates on this question. i am also facing one similar requirement.
    1. users wants a mail notification based on expiry date(custom property) before expiring.
    2. In the mail notification, they need some custom properties like document number and other information.
    could you please help me in some directions on this? any standard or way to custom part?
    thanks,
    SK

  • Error while creating Repository Service in informatica

    Hi Guys,
    When i try to create repository service informatica8.1.1.I'm getting the below error
    driverconnect.exe has encountered a problem and needs to close.We are sorry for the inconvenience.

    since your error message is not completely represented over here,my guess is you are not providing the exact repository name as what you mentioned during the installation.please chek the repository name that you provided
    for example : during installation the defualt repository name might been 'PowerCenter' and you might be entering some other repository name while connecting i.e 'Oracle_BI_DW_Base' .
    check this and let me known.

  • Getting WCMException while configuring a repository service

    Hi KM Experts,
    I wrote a program to create a repository service, to start the approval process automatically, and select it for the required repository manager. I restarted the servlet engine, but still the status of newly added document is 'In Progress' and when I tried to submit it manually its throwing the following exception -
    Could not execute command 'com.sapportals.wcm.rendering.uicommand.cm.UIStatemanagementCommand'
    Below is the program written by me -
    package com.infy.autoapprove;
    import com.sapportals.wcm.repository.IResource;
    import com.sapportals.wcm.repository.ResourceFactory;
    import com.sapportals.wcm.repository.service.AbstractRepositoryService;
    import com.sapportals.wcm.repository.service.IRepositoryServiceFactory;
    import com.sapportals.wcm.repository.service.ServiceNotAvailableException;
    import com.sapportals.wcm.repository.service.statemanagement.IResourceTransition;
    import com.sapportals.wcm.repository.service.statemanagement.IStatemanagementManager;
    import com.sapportals.wcm.repository.service.statemanagement.IStatemanagementResource;
    import com.sapportals.wcm.repository.manager.IResourceEventReceiver;
    import com.sapportals.wcm.repository.manager.IRepositoryManager;
    import com.sapportals.wcm.repository.manager.ResourceEvent;
    import com.sapportals.wcm.util.events.IEvent;
    import com.sapportals.wcm.crt.component.*;
    import com.sapportals.wcm.crt.configuration.*;
    import com.sapportals.wcm.IWcmConst;
    import com.sapportals.wcm.WcmException;
    import java.util.Collection;
    // implements IMyNewRepositoryService interface
      Note: IReconfigurable and IResourceEventReceiver interfaces are optional
    public class AutoApprove extends AbstractRepositoryService implements IReconfigurable, IResourceEventReceiver {
      private static final String TYPE = "AutoApprove";
      public AutoApprove() {
        super();
        // Do not add code here. Add it to startUpImpl() instead
      public String getServiceType() {
        return AutoApprove.TYPE;
      protected void startUpImpl(Collection repositoryManagers) throws ConfigurationException, StartupException {
        // implement this method as follows:
        // - Verify configuration data
        // - Get references to other needed (global) services
        // - Check whether other repository services (this service depends on) are also assigned to the repository managers
        // - Usually the service registers itself for certain events at all repository managers
        try  {
        catch (Exception e) {
          throw new StartupException(e.getMessage(), e);
      protected void shutDownImpl() { }
      protected void addRepositoryAssignment(IRepositoryManager mgr) throws ServiceNotAvailableException {
        // Implement this method: Usually the service registers itself for certain events at the repository manager.
         try
               mgr.getEventBroker().register(this, new ResourceEvent(ResourceEvent.CREATE_CHILD, null));
         catch(WcmException e)
      protected void removeRepositoryAssignment(IRepositoryManager mgr) throws WcmException {
        // Implement this method: Usually the service must unregister itself as an event handler.
      public void reconfigure(IConfiguration config) throws ConfigurationException {
        this.stateHandler.preReconfigure();
        // check the new configuration data
        try {
        catch (ConfigurationException ex) {
          this.stateHandler.postReconfigure(ex);
          throw ex;
        this.config = config;
        this.stateHandler.postReconfigure();
      public void received(IEvent event) {
                   IResource resource = (IResource)event.getParameter();
                   try
                      //     get the statemanagement service from the resource
                      String rid = resource.getRID().toString();
                      if(rid.equals("/documents/TestScenario/XML Form Content/"+resource.getName()))
                           IRepositoryServiceFactory factory = ResourceFactory.getInstance().getServiceFactory();
                            IStatemanagementManager statemanagement = (IStatemanagementManager)factory.getRepositoryService(resource, IWcmConst.STATEMANAGEMENT_SERVICE);
                            IStatemanagementResource sResource = statemanagement.getStatemangementResource(resource);
                            IResourceTransition transition = sResource.getTransition("lbl.submit");
                           //  if everything is correct than transition is not null
                           if (transition != null)
                                     transition.execute();
                   }catch(Exception e){
                        e.printStackTrace();
    Kindly help me out as I am not able to figure out the issue.
    Thanks in Advance,
    Saurabh

    Hi Experts,
    Any help on this ?
    Regards,
    Saurabh

  • Add custom property restrictions in advanced search web part

    hi,
     I am having the default advanced search box web part in my ent.search center site collec. but as per my requirement i need to a  few items in the property restrictions dropdown in my advanced search web part.
    is this possible in sp 2013 e.t serach center  site collection?
    any help is  highly appreciated!

    Hi,
    Check this
    http://technet.microsoft.com/en-us/library/ff621097.aspx
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/c25d418d-d4a2-47a3-9abe-c27656764843/how-to-add-custom-property-in-advanced-search-page?forum=sharepointgeneralprevious

Maybe you are looking for

  • Battery Life is Very Short Recently

    Hi, my MacBook Pro battery life has been really dying quickly in the past couple weeks. My MacBook Pro is new as of December, and has only gone through 107 cycles. I am only running Chrome and Microsoft Word and a couple of other applications (Mail a

  • How do I make my ActiveX Control behave like a LabVIEW native control?

    When a user drops my ActiveX control onto a Front Panel and then views the Diagram, I would like him to see a terminal outputting a specific property value instead of the reference number. In short, I don't want him to have to go to the extra step of

  • Manual Check Deposit

    I have done with all settings of Bank Accounting; Created House Bank Created Check Deposit Account Crated Account Symbols and assigned GL accounts Created Keys and defined Posting Rules Created and Assigned Business Transactions Defined Variant for M

  • HT4906 iWeb needs to move?  Also, iCloud asks for iPhoto 9--

    I have iPhoto 9 and iCloud is asking me to upgrade my iPhoto.  This is very confusing to me...any suggestions?  Also, what step to I need to take for iWeb? Thanks...deb

  • Serious camera problems with the Lumia 800

    Hello everyone, I just want to share my experience with you. I've been using an unlocked Lumia 800 for a week now and I actually like the phone, however these camera problems are just unacceptable. The camera has SERIOUS white balance problems, and,