use of com.amalto.workbench.webservices.WSCategoryData in project tmdm-studio-se by Talend.
the class LocalTreeObjectRepository method startUp.
public void startUp(String ur, String user, String pwd) {
TMDMService service = null;
Document doc = null;
SAXReader saxReader = new SAXReader();
try {
service = Util.getMDMService(new URL(ur), user, pwd);
WSCategoryData category = service.getMDMCategory(null);
doc = saxReader.read(new StringReader(category.getCategorySchema()));
saveCredential(ur, user, pwd, doc, service, true);
doUpgrade(UnifyUrl(ur));
} catch (Exception e) {
log.error(e.getMessage(), e);
// $NON-NLS-1$
String empty = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
// $NON-NLS-1$//$NON-NLS-2$
empty += "<" + ICoreConstants.DEFAULT_CATEGORY_ROOT + "/>";
WSCategoryData newData = new WSCategoryData();
newData.setCategorySchema(empty);
try {
newData = service.getMDMCategory(newData);
doc = saxReader.read(new StringReader(newData.getCategorySchema()));
saveCredential(ur, user, pwd, doc, service, true);
} catch (Exception e1) {
saveCredential(ur, user, pwd, doc, service, false);
}
}
}
use of com.amalto.workbench.webservices.WSCategoryData in project tmdm-studio-se by Talend.
the class LocalTreeObjectRepository method saveDocument.
private void saveDocument(String url) {
if (credentials.get(url) != null) {
TMDMService service = credentials.get(url).service;
Document doc = credentials.get(url).doc;
if (doc != null) {
service.getMDMCategory(new WSCategoryData(doc.asXML()));
}
}
}
Aggregations