public String processRequest(String strActionValue) throws ProcessingException { FrameworkDefaultLogger.debug("Inside S_FrameWork_Query_OperationWorkerBean::processRequest()."); String sReturnValue = null; javax.transaction.UserTransaction userTransaction = UserTransactionService.getUserTransaction(); try { userTransaction.begin(); sReturnValue = callProcessRequest(strActionValue); userTransaction.commit(); } catch (Exception exc) { try { userTransaction.rollback(); } catch (Exception ex) { sReturnValue = "DATA_VALIDATION_ERROR"; FrameworkDefaultLogger.error( "Inside S_FrameWork_Query_OperationWorkerBean:" + ErrorService.errorStackToString(ex)); } FrameworkDefaultLogger.error( "Inside S_FrameWork_Query_OperationWorkerBean:" + ErrorService.errorStackToString(exc)); throw new ProcessingException( "S_FrameWork_Query_OperationWorkerBean:processRequest() - " + exc); } return sReturnValue; }
/** * Loads all S_FrameWork_Query_OperationValueObjects through the business facade using information * in the HttpServletRequest. * * @return String as result * @exception ProcessingException */ public String loadAllS_FrameWork_Query_Operations() throws ProcessingException { String sReturnValue = null; FrameworkDefaultLogger.debug( "Inside S_FrameWork_Query_OperationWorkerBean::loadAllS_FrameWork_Query_Operations"); try { // load the PADJBValueObject // Collection coll = S_FrameWork_Query_OperationProxy.getS_FrameWork_Query_Operations(); Collection coll = S_FrameWork_Query_OperationProxy.getS_FrameWork_Query_OperationsInSelectSql( "select * from S_FrameWork_Query_Operation", null); ApplicationUSOM objectManager = (ApplicationUSOM) getUSOM(); objectManager.setS_FrameWork_Query_Operations(coll); } catch (Exception exc) { FrameworkDefaultLogger.error( "Inside S_FrameWork_Query_OperationWorkerBean:loadS_FrameWork_Query_Operations() - " + ErrorService.errorStackToString(exc)); throw new ProcessingException( "PADJBWorkerBean:loadAllS_FrameWork_Query_Operations() - successfully loaded all S_FrameWork_Query_OperationValueObjects - " + exc); } return (sReturnValue); }
/** * Deletes a S_FrameWork_Query_OperationValueObject through the business facade using information * in the HttpServletRequest. * * @return String as result * @exception ProcessingException */ public String deleteS_FrameWork_Query_Operation() throws ProcessingException { String sReturnValue = null; FrameworkDefaultLogger.debug( "Inside S_FrameWork_Query_OperationWorkerBean::deleteS_FrameWork_Query_Operation"); ApplicationUSOM objectManager = (ApplicationUSOM) getUSOM(); try { // S_FrameWork_Query_OperationPrimaryKey primaryKey = getPrimaryKeyFromServletRequest(); S_FrameWork_Query_OperationPrimaryKey primaryKey = new S_FrameWork_Query_OperationPrimaryKey( this.getServletRequestParameter("queryoperationid")); IS_FrameWork_Query_OperationValueObject valueObject = S_FrameWork_Query_OperationProxy.getS_FrameWork_Query_Operation(primaryKey); // delete the S_FrameWork_Query_OperationValueObject if (valueObject != null) { new S_FrameWork_Query_OperationProxy(valueObject).delete(); FrameworkDefaultLogger.debug( "S_FrameWork_Query_OperationWorkerBean:deleteS_FrameWork_Query_Operation() - successfully delete S_FrameWork_Query_OperationValueObject with key field(s) - " + primaryKey.toString()); // write the log PublicFunction.writeSystemLog( this.currentUser, new Long(2), valueObject, this.beforeSaveValueObject); // update the cached list ValueObjectListProxy voList = objectManager.getS_FrameWork_Query_Operations(); if (voList != null) { Collection coll = voList.getDataValues(); Iterator tempIterator = coll.iterator(); ArrayList tmpColl = new ArrayList(); while (tempIterator.hasNext()) { S_FrameWork_Query_OperationValueObject tmpObj = (S_FrameWork_Query_OperationValueObject) tempIterator.next(); if (!(tmpObj.getS_FrameWork_Query_OperationPrimaryKey()) .equals(valueObject.getS_FrameWork_Query_OperationPrimaryKey())) { tmpColl.add(tmpObj); } } objectManager.setS_FrameWork_Query_Operations(tmpColl); } } } catch (Exception exc) { String sErrorMsg = " S_FrameWork_Query_OperationWorkerBean:deleteS_FrameWork_Query_Operation() - " + exc; FrameworkDefaultLogger.error(sErrorMsg); PublicFunction.CustomProcessingException(objectManager, "删除记录时出错,请重新操作!", sErrorMsg, exc); // throw new // ProcessingException("S_FrameWork_Query_OperationWorkerBean:saveS_FrameWork_Query_Operation() - " + // sErrorMsg); } return (sReturnValue); }
/** * Creates a S_FrameWork_Query_OperationValueObject through the business facade using information * in the HttpServletRequest. * * @return String as result * @exception ProcessingException */ public String createS_FrameWork_Query_Operation() throws ProcessingException { String sReturnValue = null; FrameworkDefaultLogger.debug( "Inside S_FrameWork_Query_OperationWorkerBean::createS_FrameWork_Query_Operation"); ApplicationUSOM objectManager = (ApplicationUSOM) getUSOM(); try { // Create the S_FrameWork_Query_OperationValueObject by calling the // static createS_FrameWork_Query_Operation method on S_FrameWork_Query_OperationProxy this.m_S_FrameWork_Query_OperationValueObject = setDefault( (S_FrameWork_Query_OperationValueObject) this.m_S_FrameWork_Query_OperationValueObject, "CreateEdit", "CREATE_S_FrameWork_Query_Operation"); IS_FrameWork_Query_OperationValueObject valueObject = S_FrameWork_Query_OperationProxy.createS_FrameWork_Query_Operation( this.m_S_FrameWork_Query_OperationValueObject); if (valueObject != null) { FrameworkDefaultLogger.debug( "S_FrameWork_Query_OperationWorkerBean:createS_FrameWork_Query_Operation() - successfully created S_FrameWork_Query_OperationValueObject - " + valueObject.toString()); // assign the S_FrameWork_Query_OperationValueObject to the ApplicationUSOM objectManager.setCurrentS_FrameWork_Query_Operation(valueObject); // update the cached usom ValueObjectListProxy voList = objectManager.getS_FrameWork_Query_Operations(); if (voList != null) { Collection coll = voList.getDataValues(); coll.add(valueObject); objectManager.setS_FrameWork_Query_Operations(coll); } // log the action PublicFunction.writeSystemLog( this.currentUser, new Long(1), valueObject, this.beforeSaveValueObject); sReturnValue = loadAllS_FrameWork_Query_Operations(); } } catch (Exception exc) { String sErrorMsg = " Inside WorkerBean:createS_FrameWork_Query_Operation() - " + exc; FrameworkDefaultLogger.error(sErrorMsg); PublicFunction.CustomProcessingException(objectManager, "保存新增记录时出错,请重新操作!", sErrorMsg, exc); // throw new // ProcessingException("S_FrameWork_Query_OperationWorkerBean:createS_FrameWork_Query_Operation() - " + // sErrorMsg); } return (sReturnValue); }
/** * Loads a S_FrameWork_Query_OperationValueObject through the business facade using information in * the HttpServletRequest. * * @return String as result * @exception ProcessingException */ public String loadS_FrameWork_Query_Operation() throws ProcessingException { String sReturnValue = null; FrameworkDefaultLogger.debug( "Inside S_FrameWork_Query_OperationWorkerBean::loadS_FrameWork_Query_Operation"); ApplicationUSOM objectManager = (ApplicationUSOM) getUSOM(); IS_FrameWork_Query_OperationValueObject valueObject = null; try { // load the S_FrameWork_Query_OperationValueObject S_FrameWork_Query_OperationPrimaryKey primaryKey = getPrimaryKeyFromServletRequest(); valueObject = S_FrameWork_Query_OperationProxy.getS_FrameWork_Query_Operation(primaryKey); if (valueObject != null) { FrameworkDefaultLogger.debug( "S_FrameWork_Query_OperationWorkerBean:loadS_FrameWork_Query_Operation() - successfully loaded - " + valueObject.toString()); // assign the S_FrameWork_Query_OperationValueObject to the ApplicationUSOM objectManager.setCurrentS_FrameWork_Query_Operation(valueObject); // write the log PublicFunction.writeSystemLog( this.currentUser, new Long(5), valueObject, this.beforeSaveValueObject); } } catch (Exception exc) { String sErrorMsg = " S_FrameWork_Query_OperationWorkerBean:loadS_FrameWork_Query_Operation() - " + exc; FrameworkDefaultLogger.error(sErrorMsg); PublicFunction.CustomProcessingException(objectManager, "读取记录时出错,请重新操作!", sErrorMsg, exc); throw new ProcessingException( "S_FrameWork_Query_OperationWorkerBean:saveS_FrameWork_Query_Operation() - " + sErrorMsg); } return (sReturnValue); }
/** * Processes request on behalf of the provided action * * @param String strActionValue * @return String the result of processing, return null if processing went OK. * @exception ProcessingException Thrown if there was a problem executing the request. */ public String callProcessRequest(String strActionValue) throws ProcessingException { FrameworkDefaultLogger.debug("Inside S_FrameWork_Query_OperationWorkerBean::processRequest()."); m_strActionType = strActionValue; String sReturnValue = null; ApplicationUSOM usom = (ApplicationUSOM) getUSOM(); // get current Authorized user currentUser = (IUSERBValueObject) usom.getCurrentAuthorizedUser(); // delete by zht // extend interface left for later use,to check users permission based on the action String retStr = PublicFunction.beforeAction( usom, currentUser, strActionValue, "S_FrameWork_Query_Operation"); if (retStr != null) { return retStr; } // Now validate the request if (isFormValid(strActionValue) == false) { return "DATA_VALIDATION_ERROR"; } // Based on the incoming action, determine what internal method to call if (Init_S_FrameWork_Query_Operation.equalsIgnoreCase(strActionValue.trim())) { sReturnValue = initS_FrameWork_Query_Operation(); } else if (Create_S_FrameWork_Query_Operation.equalsIgnoreCase(strActionValue.trim())) { sReturnValue = createS_FrameWork_Query_Operation(); } else if (Save_S_FrameWork_Query_Operation.equalsIgnoreCase(strActionValue.trim())) { sReturnValue = saveS_FrameWork_Query_Operation(); } else if (Delete_S_FrameWork_Query_Operation.equalsIgnoreCase(strActionValue.trim())) { sReturnValue = deleteS_FrameWork_Query_Operation(); } else if (Load_S_FrameWork_Query_Operation.equalsIgnoreCase(strActionValue.trim())) { sReturnValue = loadS_FrameWork_Query_Operation(); } else if (LoadAll_S_FrameWork_Query_Operations.equalsIgnoreCase(strActionValue.trim())) { sReturnValue = loadAllS_FrameWork_Query_Operations(); } else if (Query_S_FrameWork_Query_Operation.equalsIgnoreCase(strActionValue.trim())) { sReturnValue = queryS_FrameWork_Query_Operation(); } else if (GetXML_S_FrameWork_Query_Operation.equalsIgnoreCase(strActionValue.trim())) { sReturnValue = this.getS_FrameWork_Query_OperationXMLData(); } else if (CREATE_S_FrameWork_Query_Operation_XML.equalsIgnoreCase(strActionValue.trim())) { sReturnValue = createS_FrameWork_Query_OperationXML(); } else if (SAVE_S_FrameWork_Query_Operation_XML.equalsIgnoreCase(strActionValue.trim())) { sReturnValue = saveS_FrameWork_Query_OperationXML(); } else if (QUERY_S_FrameWork_Query_Operation.equalsIgnoreCase(strActionValue.trim())) { // sReturnValue = loadS_FrameWork_Query_Operationb(); } return sReturnValue; }
/** * 构造查询页面,如果不需要初始化其他的工作,不需要修改改函数 * * @return * @throws ProcessingException */ public String queryS_FrameWork_Query_Operation() throws ProcessingException { String sReturnValue = null; Document doc = null; FrameworkDefaultLogger.debug( "Inside S_FrameWork_Query_OperationWorkerBean.queryS_FrameWork_Query_Operation(...)."); String xmlTemplateName = "Query" + "S_FrameWork_Query_Operation" + ".xml"; doc = DomService.createDomFromFile(DomService.getXMLFilesPath() + xmlTemplateName); // 所有的保存到attribute中的dom都命名为:dom this.getHttpServletRequest().setAttribute("dom", doc); return sReturnValue; }
public String saveS_FrameWork_Query_OperationXML() throws ProcessingException { String sReturnValue = null; FrameworkDefaultLogger.debug( "Inside S_FrameWork_Query_OperationWorkerBean::saveS_FrameWork_Query_OperationXML"); try { /** * String systemid = this.getServletRequestParameter("systemid"); String txm = * this.getServletRequestParameter("txm"); IS_FrameWork_Query_OperationValueObject valueObject * = S_FrameWork_Query_OperationProxy.getS_FrameWork_Query_Operation(new * S_FrameWork_Query_OperationPrimaryKey(systemid)); * * <p>ApplicationUSOM objectManager = (ApplicationUSOM)getUSOM(); * objectManager.setCurrentS_FrameWork_Query_Operation(valueObject); * * <p>// String fileName = "EditS_FrameWork_Query_Operation.xml"; String fileName = ""; * if(xmlb.trim().equals("01")){ fileName="EditS_FrameWork_Query_Operation.xml";} * if(xmlb.trim().equals("02")){ fileName="Editzdpjjbxxb.xml";} * * <p>DocumentMaker dm = new DocumentMaker(fileName); HashMap map= new HashMap(); // * ApplicationUSOM objectManager = (ApplicationUSOM)getUSOM(); IUSERBValueObject usVO = * objectManager.getCurrentUSERB(); /* //定义变量用于设置字典范围 Document zdbXML; //设置使用部门的范围 //zdbXML = * ZDBWorkerBean.retrieveXJDeptDoc(usVO.getDept(), "02"); //map.put("sybmdm", zdbXML); * //dm.setEmbeddedDictionary(map); */ Document zdbXML; // 设置单位名称的范围 // zdbXML = ZDBWorkerBean.retrieveXJDeptDoc(usVO.getDept(), "01"); // map.put("dwmc", zdbXML); // dm.setEmbeddedDictionary(map); // if (xmlb.trim().equals("01")) { // zdbXML = ZDBWorkerBean.retrieveXJDeptDoc(usVO.getDept(), "02"); // map.put("sybm", zdbXML); // dm.setEmbeddedDictionary(map); } // map = null; // Document doc = dm.createDocument(map, (FrameworkValueObject) valueObject); // this.getHttpServletRequest().setAttribute("dom", doc); } catch (Exception exc) { throw new ProcessingException( "S_FrameWork_Query_OperationWorkerBean:saveS_FrameWork_Query_OperationXML() - " + exc); } return (sReturnValue); }
public String createS_FrameWork_Query_OperationXML() throws ProcessingException { String sReturnValue = null; FrameworkDefaultLogger.debug( "Inside yxS_FrameWork_Query_OperationbWorkerBean::createS_FrameWork_Query_OperationXML"); try { /** * ApplicationUSOM objectManager = (ApplicationUSOM)getUSOM(); IUSERBValueObject usVO = * objectManager.getCurrentUSERB(); IS_FrameWork_Query_OperationValueObject valueObject = new * S_FrameWork_Query_OperationValueObject(); String bh = * this.getServletRequestParameter("bh"); * * <p>valueObject = new S_FrameWork_Query_OperationValueObject(); * * <p>valueObject.setBh(bh); * * <p>// String fileName = "CreateS_FrameWork_Query_Operation.xml"; String fileName = ""; * if(xmlb.trim().equals("01")){ fileName="CreateS_FrameWork_Query_Operation.xml";} * if(xmlb.trim().equals("02")){ fileName="Createzdpjjbxxb.xml";} * * <p>DocumentMaker dm = new DocumentMaker(fileName); HashMap map= new HashMap(); * * <p>//定义变量用于设置字典范围 Document zdbXML; //设置设备名称的范围 // zdbXML = * ZDBWorkerBean.retrieveXJDeptDoc("01", "03"); // map.put("sbdm", zdbXML); //设置单位名称的范围 zdbXML * = ZDBWorkerBean.retrieveXJDeptDoc(usVO.getDept(), "01"); // map.put("dwdm", zdbXML); * map.put("dwmc", zdbXML); //设置使用部门的范围 // zdbXML = * ZDBWorkerBean.retrieveXJDeptDoc(usVO.getDept(), "02"); // map.put("sybmdm", zdbXML); * dm.setEmbeddedDictionary(map); // if(xmlb.trim().equals("01")) { zdbXML = * ZDBWorkerBean.retrieveXJDeptDoc(usVO.getDept(), "02"); map.put("sybm", zdbXML); * dm.setEmbeddedDictionary(map); } * * <p>map = null; * * <p>Document doc = dm.createDocument(map, (FrameworkValueObject) valueObject); * dm.setElementDefaultValue("dwdm",usVO.getDept()); * this.getHttpServletRequest().setAttribute("dom", doc); */ } catch (Exception exc) { throw new ProcessingException( "S_FrameWork_Query_OperationWorkerBean:createSBJBXXXML() - " + exc); } return (sReturnValue); }
public String getS_FrameWork_Query_OperationXMLData() throws ProcessingException { String sReturnValue = null; FrameworkDefaultLogger.debug( "Inside S_FrameWork_Query_OperationWorkerBean.getS_FrameWork_Query_OperationXMLData() - get XML for S_FrameWork_Query_Operation."); Document doc = null; String formName = null; formName = "CreateEdit"; ApplicationUSOM objectManager = (ApplicationUSOM) getUSOM(); S_FrameWork_Query_OperationValueObject tempVO = (S_FrameWork_Query_OperationValueObject) objectManager.getCurrentS_FrameWork_Query_Operation(); if (tempVO != null) { DomBuilder domBuilder = new DomBuilder("S_FrameWork_Query_Operation", formName); doc = domBuilder.createDomByValueObect(tempVO); } else { doc = DomService.getXMLDocFromEntity("S_FrameWork_Query_Operation", formName); } // 所有的保存到attribute中的dom都命名为:dom this.getHttpServletRequest().setAttribute("dom", doc); return sReturnValue; }
/** * 一些根据业务员规则产生的数据项目在initS_FrameWork_Query_Operation()赋值 * * @return * @throws ProcessingException */ public String initS_FrameWork_Query_Operation() throws ProcessingException { String sReturnValue = null; FrameworkDefaultLogger.debug( "Inside S_FrameWork_Query_OperationWorkerBean.initS_FrameWork_Query_Operation(...)."); S_FrameWork_Query_OperationValueObject tempVO = new S_FrameWork_Query_OperationValueObject(); // 存储过程初始化 String objID1 = getServletRequestParameter("ID"); // 只针对主键 if (objID1 != null && !objID1.trim().equalsIgnoreCase("")) { Vector vPara = new Vector(); // 存储过程参数 Parameter para = null; // 存储过程传入传出参数 Collection coll = null; // 返回集合 para = new Parameter(objID1, true); vPara.addElement(para); coll = S_FrameWork_Query_OperationProxy.executeStoredProcedure( "i_S_FrameWork_Query_Operation", vPara, true); if (coll != null) { if (coll.size() > 0) { Iterator it = coll.iterator(); while (it.hasNext()) { tempVO = (S_FrameWork_Query_OperationValueObject) it.next(); } } } } tempVO = setDefault(tempVO, "CreateEdit", "INIT_S_FrameWork_Query_Operation"); if (tempVO != null) { ApplicationUSOM objectManager = (ApplicationUSOM) getUSOM(); objectManager.setCurrentS_FrameWork_Query_Operation(tempVO); } return sReturnValue; }
/** * Saves a S_FrameWork_Query_OperationValueObject through the business facade using information in * the HttpServletRequest. * * @return String as result * @exception ProcessingException */ public String saveS_FrameWork_Query_Operation() throws ProcessingException { String sReturnValue = null; FrameworkDefaultLogger.debug( "Inside S_FrameWork_Query_OperationWorkerBean::saveS_FrameWork_Query_Operation"); ApplicationUSOM objectManager = (ApplicationUSOM) getUSOM(); try { // save the S_FrameWork_Query_OperationValueObject this.m_S_FrameWork_Query_OperationValueObject = setDefault( (S_FrameWork_Query_OperationValueObject) this.m_S_FrameWork_Query_OperationValueObject, "CreateEdit", "save_S_FrameWork_Query_Operation"); // added by wzp IS_FrameWork_Query_OperationProxy proxy = new S_FrameWork_Query_OperationProxy(this.m_S_FrameWork_Query_OperationValueObject); IS_FrameWork_Query_OperationValueObject valueObject = proxy.saveS_FrameWork_Query_Operation(); if (valueObject != null) { FrameworkDefaultLogger.debug( "S_FrameWork_Query_OperationWorkerBean:save() - successfully saved S_FrameWork_Query_OperationValueObject - " + valueObject.toString()); // assign the S_FrameWork_Query_OperationValueObject to the ApplicationUSOM objectManager.setCurrentS_FrameWork_Query_Operation(valueObject); // write the sytem log PublicFunction.writeSystemLog( this.currentUser, new Long(3), valueObject, this.beforeSaveValueObject); // update the cached list ValueObjectListProxy voList = objectManager.getS_FrameWork_Query_Operations(); if (voList != null) { Collection coll = voList.getDataValues(); Iterator tempIterator = coll.iterator(); ArrayList tmpColl = new ArrayList(); while (tempIterator.hasNext()) { S_FrameWork_Query_OperationValueObject tmpObj = (S_FrameWork_Query_OperationValueObject) tempIterator.next(); if ((tmpObj.getS_FrameWork_Query_OperationPrimaryKey()) .equals(beforeSaveValueObject.getS_FrameWork_Query_OperationPrimaryKey())) { tmpColl.add(valueObject); } else { tmpColl.add(tmpObj); } } objectManager.setS_FrameWork_Query_Operations(tmpColl); } } } catch (Exception exc) { String sErrorMsg = " S_FrameWork_Query_OperationWorkerBean:saveS_FrameWork_Query_Operation() - " + exc; FrameworkDefaultLogger.error(sErrorMsg); PublicFunction.CustomProcessingException(objectManager, "保存记录时出错,请重新操作!", sErrorMsg, exc); // throw new // ProcessingException("S_FrameWork_Query_OperationWorkerBean:saveS_FrameWork_Query_Operation() - " + // sErrorMsg); } return (sReturnValue); }