Developing a Custom Handler 
You can develop your own custom handler for determining valid namespaces. The handler is called whenever an administrator creates or changes the ID of a PCD object, and the handler returns an array of strings of valid namespaces.
A handler is deployed in an application that contains the handler class and a service for registering the handler.
Create the handler, as follows:
Create a class that implements INamespacesHandler (com.sap.portal.pcm.namingconventions package).
Implement the getHandlerID() method, which returns the handler ID. This ID identifies the handler, and is used in the service configuration to indicate the handler for the naming conventions service.
The following is the method's signature:
Syntax
public String getHandlerID() {}
Implement the getAvailableNamespaces() method. This method returns an array of strings to be displayed to the administrator as valid namespaces.
The following is the method's signature:
Syntax
public String[] getAvailableNamespaces(String configuration,
IPrincipal user, String path) throws OperationFailedException {}
The method is passed the following:
configuration: The mode parameter in the service configuration. For more information, see Configuring the Service.
user: The current user.
path: The path of the parent folder that contains the object to be created or changed.
Create a service for registering your handler with the naming conventions service, as follows:
Create a portal service.
In the afterInit() method, register the service by getting the naming conventions service and passing the registerHandler() an instance of your handler.
Syntax
INamingConventionsSrv srv = (INamingConventionsSrv)
PortalRuntime.getRuntimeResources().getService(
INamingConventionsSrv.KEY);
try
{srv.registerHandler(new myHandler());
}
catch (RegistrationException e)
{e.printStackTrace();
}
In the portalapp.xml for your application, set the service to start on deployment, by setting the startup property in the <service-config> element to true.
To use your handler instead of the default handler, enter the handler ID in the handler parameter of the naming conventions service. For more information, see Configuring the Service.