use of com.dexels.navajo.document.Method in project navajo by Dexels.
the class VersionedNavajoMap method setDoSend.
@Override
public void setDoSend(String method) throws UserException, ConditionErrorException, SystemException {
super.setDoSend(method);
logger.debug("in VersionedNavajoMap store()");
if (!this.isEqual) {
logger.debug("ABOUT TO CONSTRUCT MESSAGES!");
try {
Navajo currentOutDoc = super.access.getOutputDoc();
Message confirm = NavajoFactory.getInstance().createMessage(currentOutDoc, "DataHasChanged");
currentOutDoc.addMessage(confirm);
Property b = NavajoFactory.getInstance().createProperty(currentOutDoc, "Overwrite", Property.BOOLEAN_PROPERTY, "false", 1, "", Property.DIR_IN);
confirm.addProperty(b);
List<Method> allMethods = inMessage.getAllMethods();
for (int i = 0; i < allMethods.size(); i++) {
Method m = allMethods.get(i);
logger.debug("Adding method: {}", m.getName());
Method a = NavajoFactory.getInstance().createMethod(currentOutDoc, m.getName(), "");
List<String> required = m.getRequiredMessages();
for (int j = 0; j < required.size(); j++) {
String name = required.get(j);
logger.debug("Adding required message: {}", name);
a.addRequired(name);
}
currentOutDoc.addMethod(a);
}
List<Message> allMessages = inMessage.getAllMessages();
for (int i = 0; i < allMessages.size(); i++) {
Message m = allMessages.get(i);
logger.debug("Adding message: " + m.getName());
Message a = inMessage.copyMessage(m, currentOutDoc);
currentOutDoc.addMessage(a);
}
} catch (NavajoException ne) {
throw new UserException(-1, ne.getMessage(), ne);
}
}
}
Aggregations