Hi,
We are working on Cognos SDK code to publish package and successfully published package in Cognos
Connection.
After that while saving model,we are getting following error:
“BME-AS-0022 Model was not opened.”
setLocale.openProject(modelName);
setLocale.setActiveLocale(modelName,locale);
setLocale.publish(modelName);
setLocale.saveProject(modelName);
System.out.println(“Respone for SaveModel::”+getMetadataService().updateMetadata(new XmlEncodedXML
("<mdprovider type=“generic” " + “action=“saveModel” " + “model=”+modelName+”/>")).toString());
Please suggest on this
Thanks in Advance
Guru
March 1, 2012, 8:21pm
2
Hi,
i’m not sure what you exactly are trying to pull off with the metadatamanager service… :-
Why do you not publish with framework manager? btw which Cognos version do you use?
i found some simular sample code:
public void openProject(String modelName) {
projectAction(modelName, "openModel");
}
public void projectAction(String model, String action) {
String actionXML = "<mdprovider type=\"generic\" " + "action=\""
+ action + "\" " + "model=\"" + model + "\"/>";
updateMetadata(actionXML);
}
public void setActiveLocale(String model, String locale) {
updateMetadata(getTransactionHeader(model)
+ "<action seq=\"1\" type=\"SetActiveLocale\">"
+ "<inputparams>" + "<param seq=\"1\" type=\"i18nstring\">"
+ "<value>"locale"</value>" + "</param>" + "</inputparams>"
+ "<domchanges/>" + "<result success=\"t\">"
+ "<outputparams/>" + "</result>" + "</action>"
+ getTransactionTrailer());
}
public void updateMetadata(String actionXml) {
try {
String result=getMetadataService().updateMetadata(new XmlEncodedXML(actionXml)).toString();
System.out.println("results of the updateMetadata request \n\n"+result);
System.out.println("");
} catch (Exception e) {
e.printStackTrace();
}
}
Hi,
We are using Cognos 8.4 version…
Can i save model using Cognos SDK 8.4?