Share Site namespace constants in Java
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-10-2013 08:17 AM
The NamespaceService Java interface includes constants for common namespaces and namespace prefixes such as CONTENT_MODEL_1_0_URI and CONTENT_MODEL_PREFIX but nothing for the Share site namespace "http://www.alfresco.org/model/site/1.0" and prefix "st".
I have found
Does anyone understand the convention of where and how these namespace constants are supposed to be defined?
(NB in the first version of this there was a mistake in the package org.alfresco.repo.site which I have corrected..)
I have found
org.alfresco.repo.site.SiteModel
which defines SITE_MODEL_PREFIX as "st" but confusingly rather than SITE_MODEL_1_0_URI as might be extrapolated it has SITE_MODEL_URL for "http://www.alfresco.org/model/site/1.0".Does anyone understand the convention of where and how these namespace constants are supposed to be defined?
(NB in the first version of this there was a mistake in the package org.alfresco.repo.site which I have corrected..)
Labels:
- Labels:
-
Archive
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2013 05:53 AM
I don't know why that constant is missing from the NamespaceService interface. That SiteModel class you found appears to be in a proprietary package–it is not an Alfresco class. So someone created those constants and didn't use the same naming convention for the constant names.
You may already know, but just in case, the namespaces are defined in the content model. For example, the one you are identifying here is defined in $TOMCAT_HOME/webapps/alfresco/WEB-INF/classes/alfresco/model/siteModel.xml.
Jeff
You may already know, but just in case, the namespaces are defined in the content model. For example, the one you are identifying here is defined in $TOMCAT_HOME/webapps/alfresco/WEB-INF/classes/alfresco/model/siteModel.xml.
Jeff
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2013 06:31 AM
Thanks! Yes, I just noticed that SiteModel class is our own code! I look at tidying it up so that it at least uses the same naming convention. (Edit: NB it turned out that there was a typo in the package name i originally quoted, and that SiteModel is an Alfresco interface after all.)
I presume it was created because the values aren't defined in NamespaceService.
I am aware of the classes/alfresco/model XML files but I need to access these values in Java. Is there a straightforward way to do this? Presumably they are read by the Alfresco system at start-up and should be available programmatically somehow?
I presume it was created because the values aren't defined in NamespaceService.
I am aware of the classes/alfresco/model XML files but I need to access these values in Java. Is there a straightforward way to do this? Presumably they are read by the Alfresco system at start-up and should be available programmatically somehow?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-13-2013 11:52 AM
Actually that was a typo in the package I quoted..
It should have been
It should have been
org.alfresco.repo.site.SiteModel
, so it is an Alfresco interface rather than a proprietary class.
