Skip to Content
author's profile photo Former Member
Former Member

Configurable repository service

Hello, I am doing a repository service that needs to be configurable from the SystemAdministration>systemConfiguration>contentManagement>RepositoryService Menu at the portal, just like all the standard repository services that I can see there..¿Is it possible?

I have tried with the service-profile tag in the portalapp.xml (like with the IViews), but it does not work..I have also tried with the *.co.xml and *.cc.xml, but I do not know the structure of the xml nor the tags to use...

Finally I do not know how to access to the service properties declared, in my code...

thanks

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Nov 22, 2007 at 11:35 AM

    Hi,

    After you created repository service you can add attribute in cc.xml file:

    <ConfigClass name="com.epam.test.repservice.MyRepositoryService"  extends="RepositoryService">
     <attribute name="class" type="class" constant="com.epam.test.repservice.MyRepositoryService"/>
      <attribute name="myattr1" type="string" /> 
     </ConfigClass>
    

    and in co.xml:

    <Configurable configclass="com.epam.test.repservice.MyRepositoryService">
     <property name="name" value="com.epam.test.repservice.MyRepositoryService" />
     <property name="active" value="true" />
     <property name="description" />
     <property name="myattr1" value="myvalue1" /> 
     </Configurable>
    

    It's an example of getting properties:

      protected void startUpImpl(Collection repositoryManagers) throws ConfigurationException, StartupException {
        
        try  {
    		Properties props = convertConfigToProperties(config);
    		if(props!=null) {
    			Set keys = props.keySet();
    			
    			for(Iterator it = keys.iterator(); it.hasNext(); ) {
    				Object key = it.next();
    				Object value = props.get(key);
    				
    				System.out.println("key = " + key + " value = " + value);
    			}
    			
    		}
        }
        catch (Exception e) {
          throw new StartupException(e.getMessage(), e);
        }
        
      }
    
    

    Also you can add some debug in reconfigure(IConfiguration config) method and see your properties.

    Regards,

    Andrei

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.