cancel
Showing results for 
Search instead for 
Did you mean: 

Simple question : Getting the prefix from NameSpaceURI

zomurn
Champ in-the-making
Champ in-the-making
I'am looking for the simple mapping which do :

Given the NameSpaceURI (for ex. http://www.alfresco.org/model/content/1.0) give me the corresponding prefix (here, it is cm).

That's a basic question, but I don't find the answer in all the Repository API.

Thanks.
4 REPLIES 4

zomurn
Champ in-the-making
Champ in-the-making
For information :

Collection<String> coll = new DynamicNamespacePrefixResolver()
            .getPrefixes( lChildAssocRef.get( 0 ).getQName()
                  .getNamespaceURI() );

with parameter equals to "http://www.alfresco.org/model/content/1.0" returns an empty collection….

dhalupa
Champ on-the-rise
Champ on-the-rise

serviceRegistry.getNamespaceService().getPrefixes("http://www.alfresco.org/model/content/1.0")

br,

Denis

zomurn
Champ in-the-making
Champ in-the-making
That's it ! Thank you  :!:

mjuarez
Champ in-the-making
Champ in-the-making
I need this for WebService(JAVA)

i don't understand this code:

lChildAssocRef.get( 0 ).getQName()
                  .getNamespaceURI()

Please help! Bye.