import java.io.*; import java.net.URL; import java.util.*; import org.xml.sax.*; import com.concerto.cm.initialization.*; import com.concerto.cm.managing.*; /** * This type was created in VisualAge. */ public class ConceptManagerActionHandler extends HandlerBase { int state; int intCondition; ConceptManagerInitialization init = null; String result = new String(); String row = new String(); /** * IntercettaEvento constructor comment. */ public ConceptManagerActionHandler() { state = 0; } /** * This method was created in VisualAge. * @param fileNameInput java.lang.String * @param instanceInit com.concerto.cm.initialization.ConceptManagerInitialization * @exception java.lang.Exception The exception description. */ public ConceptManagerActionHandler(java.lang.String fileNameInput, ConceptManagerInitialization instanceInit) throws Exception { this.state = 0; this.init = instanceInit; String prolog = new String(); prolog += "\n"; prolog += "\n"; prolog += "\n"; this.inizia(fileNameInput); this.result += "\n"; this.result = prolog + this.result; } /** * This method was created in VisualAge. * @param name java.lang.String * @exception org.xml.sax.SAXException The exception description. */ public void endElement(java.lang.String name) throws SAXException { if (name.equals("CMIL-ACTION")) { state = 0; this.intCondition = 0; this.row = new String(); } } /** * This method was created in VisualAge. * @return java.lang.String */ public String getResult() { return this.result; } /** * This method was created in VisualAge. * @param args java.lang.String[] */ public void inizia(java.lang.String way) throws Exception{ // get class object for SAX Driver Class c = Class.forName("com.ibm.xml.parsers.SAXParser"); // create instance of the class Parser parser = (Parser)c.newInstance(); // create document handler and register it parser.setDocumentHandler(this); // parse the document parser.parse(way); } /** * This method was created in VisualAge. */ public void startElement(java.lang.String name, org.xml.sax.AttributeList alist) throws SAXException { String piece = new String(); String serialNumber = new String(); String methodName = new String(); String parameterLeft = new String(); String parameterRight = new String(); Vector calling = new Vector(); Vector parameter = new Vector(); ConceptManagerResponse resp = new ConceptManagerResponse(); ConceptManager action = new ConceptManager(); boolean flag = false; boolean emptyFile = false; if (name.equals("CMIL-SESSION")||name.equals("CMIL-ACTION-GROUP")) {} else if (name.equals("CMIL-ACTION")) { state = Integer.valueOf(alist.getValue(0)).intValue(); this.row += alist.getValue(0)+"|"; } else { this.row += name; for (int i = 0; i < alist.getLength(); i++) { this.row += "|"+alist.getName(i)+"="+alist.getValue(i); } if (!this.row.equals("")) { StringTokenizer st = new StringTokenizer(this.row,"|"); while(st.hasMoreTokens()) { piece = st.nextToken(); calling.addElement(piece); } serialNumber = (String) calling.elementAt(0); methodName = (String) calling.elementAt(1); parameter = new Vector(); for (int i=2; i\n"; if (!flag) { String msg = new String(); if (resp.getResponse().elementAt(0).equals("CMERR000")) msg = "The Operation is done"; else if (resp.getResponse().elementAt(0).equals("CMERR001")) msg = "The Class/Individual name is already defined in the Concept Manager Repository"; else if (resp.getResponse().elementAt(0).equals("CMERR002")) msg = "The Class/Individual name is not defined in the Concept Manager Repository"; else if (resp.getResponse().elementAt(0).equals("CMERR003")) msg = "The Class/Individual OID is already defined in the Concept Manager Repository"; else if (resp.getResponse().elementAt(0).equals("CMERR004")) msg = "The Class/Individual OID is not defined in the Concept Manager Repository"; else if (resp.getResponse().elementAt(0).equals("CMERR005")) msg = "The Slot Name is already defined in the specified Class/Individual"; else if (resp.getResponse().elementAt(0).equals("CMERR006")) msg = "The Slot Name is not defined in the specified Class/Individual"; else if (resp.getResponse().elementAt(0).equals("CMERR007")) msg = "The Facet Type is not valid"; else if (resp.getResponse().elementAt(0).equals("CMERR008")) msg = "The value supplied doesn't respect the constraint defined from the facets associated to the slot"; else if (resp.getResponse().elementAt(0).equals("CMERR009")) msg = "The Retract type value is not valid"; else if (resp.getResponse().elementAt(0).equals("CMERR010")) msg = "The Individual Name is not unique in the Concept Manager Repository"; else if (resp.getResponse().elementAt(0).equals("CMERR011")) msg = "The specified relation between Frames is not defined in the Concept Manager Repository"; else if (resp.getResponse().elementAt(0).equals("CMERR012")) msg = "The Slot Value is not defined for the specified Slot name"; else if (resp.getResponse().elementAt(0).equals("CMERR013")) msg = "The specified relation between Frames is already defined in the Concept Manager Repository"; this.result += " "+msg+"\n"; this.result += " \n"; } else { if (resp.getResponse() != null) { if (resp.response.size() > 0) { for (int i=0; i\n"; } this.result += " \n"; } else { this.result += " "+"NO VALUES RETRIEVED"+"\n"; this.result += " \n"; } } } } } } }