on 2007 Mar 22 1:31 AM
Hi guys
I need to create an IPropertyName object, in order to do that i need the property ID and the Namespace url related to the property, the problem is that right now i have the Namespace alias but i can't find a way to retrieve the Namespace the Url.
Any suggestions?
thanks in advance!
Hi Luis,
navigate to following path in KM config:
Content Management -> Global Services -> Property Metadata -> Properties
Now search your Property and open it for view.
Klick on the Namespace Alias and in this part you can get the "URL" for this Namespace.
Regards,
Gerhard
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Rui
This is the complete method i'm using to retrieve some of the property data, i get the namespace alias, but i actually need is the URL.
This is part of a Webservices that allows a Webdynpro Iview to access the KM property list.
public WSIMetaNameArray getFullPropertyList(String localeName) {
String method = "getFullPropertyList(String localeName)";
logger.entering(method);
ArrayList propertyList = new ArrayList();
String description = "";
String id = "";
String label = "";
String name = "";
String namespace = "";
String arrayData = "";
boolean docPatterns = false;
WSIMetaNameArray metanameArray = new WSIMetaNameArray();
try {
Class locatorClass =
Class.forName(
"com.sapportals.config.fwk.data.ConfigurationLocator");
IConfigurationLocator icl =
(IConfigurationLocator) locatorClass.newInstance();
locatorClass =
Class.forName(
"com.sapportals.portal.prt.service.config.PortalConfigurationLocator");
icl = (IConfigurationLocator) locatorClass.newInstance();
IConfigClientContext confContext =
IConfigClientContext.createContext(
ConfigCrutch.getConfigServiceUser());
IConfigurationAccess icAccess = Configuration.getInstance();
IConfigManager icManager = icAccess.getConfigManager(confContext);
IConfigPlugin icPlugin =
icManager.getConfigPlugin("/cm/services/properties_metadata");
IMutableConfigurable[] imc = icPlugin.getConfigurables();
for (int x = 0; x < imc.length; x++) {
WSIMetaName propertyData = new WSIMetaName();
IConfigProperty[] configProp = imc[x].getProperties();
description = imc[x].getProperty("description").getValueAsString();
if (description == null)
description = "";
id = imc[x].getIdValue();
if (id == null)
id = "";
label = imc[x].getProperty("bundlekey").getValueAsString();
if (label == null)
label = "";
name = imc[x].getProperty("property_id").getValueAsString();
if (name == null)
name = "";
namespace = imc[x].getProperty("namespace_alias").getUri().getPath();
if (namespace == null)
namespace = "";
if (imc[x].getProperty("document_patterns").getValueAsString() != null)
docPatterns = true;
else
docPatterns = false;
propertyData.setDescription(description);
propertyData.setId(id);
propertyData.setLabel(label);
propertyData.setName(name);
propertyData.setNamespace(namespace);
propertyData.setDocumentPatterns(docPatterns);
propertyList.add(propertyData);
}
} catch (InitialConfigException e) {
logger.fatalT("initialconfigexception");
logger.fatalT(method, e.getMessage());
} catch (CannotAccessConfigException e) {
logger.fatalT("CannotAccessConfigException");
logger.fatalT(method, e.getMessage());
} catch (Throwable e) {
logger.fatalT("Throwable");
logger.fatalT(method, e.getMessage());
}
metanameArray.setPropertyList(propertyList);
logger.exiting(method);
return metanameArray;
}
Any ideas of how can i get the namespace url?
Thanks in advance
Hi,
first of all, you do realize you're using non-public APIs that are not guaranteed to function in next releases, right?
If you do realize that, this is what you can try:
namespace = imc[x].getProperty("namespace_alias").getValueAsString();
if (namespace == null)
namespace = "";
else {
IConfigPlugin icPluginNamespaces = icManager.getConfigPlugin("/cm/services/properties_metadata/namespaces");
IMutableConfigurable[] imcNamespaces = icPluginNamespaces.getConfigurables();
for (int y = 0; y < imcNamespaces.length; y++) {
IConfigProperty[] configProp = imcNamespaces[y].getProperties();
String namespaceURI = imcNamespaces[y].getProperty("namespace").getValueAsString();
}
}
Hi
Thanks for your quickly response, i haven't test but if it works you'll get the point!
I actually got this part of this code from another post, i didn't realize that this APIs are going to be out in next releases, this is the only option i got, so i never thought about changing it, do you have another suggestion?
Also could you please tell me which APIs are going to be out, in order to not to use them again.
Hi,
I think you misunderstood me. I don't know if they are going to be out in next releases, I really don't think that will happen at least for some time.
It was just to alert you that it <b>might</b> happen. Anyway, that is the only way I know of accessing the KM configuration, so just take notice in the next upgrade to test if everything works.
User | Count |
---|---|
58 | |
10 | |
7 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.