cancel
Showing results for 
Search instead for 
Did you mean: 

Get the prefix for the URI

deepacp
Champ in-the-making
Champ in-the-making
Hi,

I have written a webscript that retrieves the properties of a node. However, it displays the property name in URI format ("{http://www.alfresco.org/model/content/1.0}creator"). I would like to display it as prefix:localname. Could you please guide me how to retrieve the prefix for the given URI using java backed webscripts.

Thanks
Deepa
2 REPLIES 2

mitpatoliya
Star Collaborator
Star Collaborator
You should be able to get it through one of the service api.
org > alfresco > service > namespace > NamespacePrefixResolver




/**
      * Gets the registered prefixes for the given namespace URI      *
     * @param namespaceURI namespace URI to lookup
      * @return the prefixes (or empty collection, if no prefixes registered against URI)
      * @throws NamespaceException if URI has not been registered
      */
    public Collection<String> getPrefixes(String namespaceURI)
        throws NamespaceException;

deepacp
Champ in-the-making
Champ in-the-making
Thanks a lot!
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.