📄 availableservices.bsh
字号:
dispArrList = new ArrayList();dispArrList.add("accounting");dispArrList.add("content");dispArrList.add("ecommerce");dispArrList.add("manufacturing");dispArrList.add("marketing");dispArrList.add("order");dispArrList.add("partymgr");dispArrList.add("catalog");dispArrList.add("facility");dispArrList.add("workeffort");dispArrList.add("example");dispArrList.add("WFDispatcher");dispArrList.add("webtools");dispArrList.add("wholesale");dispArrList.add("salesrep");dispArrList.add("hotelbackend");dispArrList.add("community");Collections.sort(dispArrList);context.put("dispArrList", dispArrList);selDisp = request.getParameter("selDisp");selDisp = selDisp == null || selDisp.length() == 0 ? request.getAttribute("selDisp") : selDisp;//default disptacher is partymgrselDisp = selDisp == null || selDisp.length() == 0 ? "partymgr" : selDisp;curDispatcher = request.getAttribute("dispatcher");curLocalDispatcher = curDispatcher.getLocalDispatcher(selDisp, request.getAttribute("delegator"));curDispatchContext = curLocalDispatcher.getDispatchContext();context.put("dispatcherName", curLocalDispatcher.getName());selectedService = request.getParameter("sel_service_name");if(selectedService == null || selectedService.length() == 0){ selectedService = request.getAttribute("sel_service_name");}if(selectedService != null && selectedService.length() > 0){ HashMap curServiceMap = new HashMap(); curServiceMap.put("serviceName", selectedService); curServiceModel = curDispatchContext.getModelService(selectedService); curServiceMap.put("description", curServiceModel.description); if(curServiceModel != null){ engineName = curServiceModel.engineName; defaultEntityName = curServiceModel.defaultEntityName; export = curServiceModel.export ? "True" : "False"; permissionGroups = curServiceModel.permissionGroups; implServices = curServiceModel.implServices; overrideParameters = curServiceModel.overrideParameters; useTrans = curServiceModel.useTransaction ? "True" : "False"; maxRetry = curServiceModel.maxRetry; //Test for ECA's ecaMapList = getEcaListForService(selectedService); if(ecaMapList != null){ context.put("ecaMapList", ecaMapList); } //End Test for ECA's invoke = curServiceModel.invoke; location = curServiceModel.location; requireNewTransaction = curServiceModel.requireNewTransaction ? "True" : "False"; engineName = engineName != null && engineName.length() > 0 ? engineName : "NA"; defaultEntityName = defaultEntityName != null && defaultEntityName.length() > 0 ? defaultEntityName : "NA"; invoke = invoke != null && invoke.length() > 0 ? invoke : "NA"; location = location != null && location.length() > 0 ? location : "NA"; permissionGroups = permissionGroups != null && permissionGroups.size() > 0 ? permissionGroups : "NA"; implServices = implServices != null && implServices.size() > 0 ? implServices : "NA"; curServiceMap.put("engineName", engineName); curServiceMap.put("defaultEntityName", defaultEntityName); curServiceMap.put("invoke", invoke); curServiceMap.put("location", location); curServiceMap.put("requireNewTransaction", requireNewTransaction); curServiceMap.put("export", export); if(permissionGroups != null && !permissionGroups.equals("NA") && permissionGroups.size() > 0){ permIter = permissionGroups.iterator(); permList = new ArrayList(permissionGroups.size()); while(permIter.hasNext()){ curPerm = (ModelPermGroup)permIter.next();//This is a ModelPermGroup curIter = curPerm.permissions.size() > 0 ? curPerm.permissions.iterator() : null; while(curIter != null && curIter.hasNext()){ curPermObj = curIter.next(); permObj = new HashMap(); permObj.put("action" , curPermObj.action); permType = curPermObj.permissionType; if(permType == 1){ permType = "Simple Permission"; }else if(permType == 2){ permType = "Entity Permission"; }else if(permType == 3){ permType = "Role Member"; } permObj.put("permType" , permType); permObj.put("nameOrRole" , curPermObj.nameOrRole); permList.add(permObj); } } curServiceMap.put("permissionGroups", permList); }else{ curServiceMap.put("permissionGroups", permissionGroups); } curServiceMap.put("implServices", implServices); curServiceMap.put("useTrans", useTrans); curServiceMap.put("maxRetry", maxRetry); allParamsList = new ArrayList(3); inParams = curServiceModel.getInParamNames(); if(inParams != null){ inParamsList = new ArrayList(inParams.size()); inParamsIter = inParams.iterator(); while(inParamsIter.hasNext()){ curParam = curServiceModel.getParam(inParamsIter.next()); curInParam = new HashMap(); curInParam.put("entityName", curParam.entityName); curInParam.put("fieldName", curParam.fieldName); curInParam.put("internal", curParam.internal ? "True" : "False"); curInParam.put("mode", curParam.mode); curInParam.put("name", curParam.name); curInParam.put("optional", curParam.optional ? "True" : "False"); curInParam.put("type", curParam.type); inParamsList.add(curInParam); } inParamMap = new HashMap(); inParamMap.put("title", "In parameters"); inParamMap.put("paramList", inParamsList); allParamsList.add(inParamMap); } outParams = curServiceModel.getOutParamNames(); if(outParams != null){ outParamsList = new ArrayList(outParams.size()); outParamsIter = outParams.iterator(); while(outParamsIter.hasNext()){ curParam = curServiceModel.getParam(outParamsIter.next()); curOutParam = new HashMap(); curOutParam.put("entityName", curParam.entityName); curOutParam.put("fieldName", curParam.fieldName); curOutParam.put("internal", curParam.internal ? "True" : "False"); curOutParam.put("mode", curParam.mode); curOutParam.put("name", curParam.name); curOutParam.put("optional", curParam.optional ? "True" : "False"); curOutParam.put("type", curParam.type); outParamsList.add(curOutParam); } outParamMap = new HashMap(); outParamMap.put("title", "Out parameters"); outParamMap.put("paramList", outParamsList); allParamsList.add(outParamMap); } if(overrideParameters != null && overrideParameters.size() > 0){ ovrPrmList = new ArrayList(overrideParameters.size()); ovrPrmIter = overrideParameters.iterator(); while(ovrPrmIter.hasNext()){ curParam = ovrPrmIter.next(); curOvrPrm = new HashMap(); curOvrPrm.put("entityName", curParam.entityName); curOvrPrm.put("fieldName", curParam.fieldName); curOvrPrm.put("internal", curParam.internal ? "True" : "False"); curOvrPrm.put("mode", curParam.mode); curOvrPrm.put("name", curParam.name); curOvrPrm.put("optional", curParam.optional ? "True" : "False"); curOvrPrm.put("type", curParam.type); ovrPrmList.add(curOvrPrm); } ovrParamMap = new HashMap(); ovrParamMap.put("title", "Override parameters"); ovrParamMap.put("paramList", ovrPrmList); allParamsList.add(ovrParamMap); } curServiceMap.put("allParamsList", allParamsList); } showWsdl = request.getParameter("show_wsdl"); if(showWsdl == null || showWsdl.length() == 0){ showWsdl = request.getAttribute("show_wsdl"); } if(showWsdl != null && showWsdl.equals("true")) { try { wsdl = curServiceModel.toWSDL("http://" + request.getServerName() + ":" + UtilProperties.getPropertyValue("url.properties", "port.http", "80") + (String) request.getAttribute("_CONTROL_PATH_") + "/SOAPService"); curServiceMap.put("wsdl", UtilXml.writeXmlDocument(wsdl)); } catch (WSDLException ex) { curServiceMap.put("wsdl", ex.getLocalizedMessage()); } context.put("showWsdl", Boolean.TRUE); } context.put("selectedServiceMap", curServiceMap);}if(selectedService == null || selectedService.length() == 0){ //get constraints if any constraint = request.getParameter("constraint"); if(constraint == null || constraint.length() == 0){ constraint = request.getAttribute("constraint"); } serviceNames = curDispatchContext.getAllServiceNames(); serviceNamesAlphaList = new ArrayList(26); servicesIter = serviceNames.iterator(); servicesList = new ArrayList(serviceNames.size()); servicesFoundCount = 0; while(servicesIter.hasNext()){ serviceName = servicesIter.next(); //add first char of service name to list if(serviceName.length() > 0){ serviceCharAt1 = serviceName.charAt(0); if(!serviceNamesAlphaList.contains(serviceCharAt1)){ serviceNamesAlphaList.add(serviceCharAt1); } } //create basic service def HashMap curServiceMap = new HashMap(); curServiceMap.put("serviceName", serviceName); curServiceModel = curDispatchContext.getModelService(serviceName); canIncludeService = true; if(constraint != null && constraint.length() > 0 && curServiceModel != null){ consArr = constraint.split("@"); constraintName = consArr[0]; constraintVal = consArr[1]; if(canIncludeService && constraintName.equals("engine_name")){ canIncludeService = curServiceModel.engineName.equals(constraintVal); if(constraintVal.equals("NA")){ canIncludeService = curServiceModel.engineName == null ||curServiceModel.engineName.equals(""); } } if(canIncludeService && constraintName.equals("default_entity_name")){ canIncludeService = curServiceModel.defaultEntityName.equals(constraintVal); if(constraintVal.equals("NA")){ canIncludeService = curServiceModel.defaultEntityName == null ||curServiceModel.defaultEntityName.equals(""); } } if(canIncludeService && constraintName.equals("location")){ canIncludeService = curServiceModel.location.equals(constraintVal); if(constraintVal.equals("NA")){ canIncludeService = curServiceModel.location == null ||curServiceModel.location.equals(""); } } if(canIncludeService && constraintName.equals("alpha")){ canIncludeService = (serviceName.charAt(0)+"").equals(constraintVal); if(constraintVal.equals("NA")){ canIncludeService = true; } } } if(curServiceModel != null && canIncludeService){ engineName = curServiceModel.engineName; defaultEntityName = curServiceModel.defaultEntityName; invoke = curServiceModel.invoke; location = curServiceModel.location; requireNewTransaction = curServiceModel.requireNewTransaction; engineName = engineName != null && engineName.length() > 0 ? engineName : "NA"; defaultEntityName = defaultEntityName != null && defaultEntityName.length() > 0 ? defaultEntityName : "NA"; invoke = invoke != null && invoke.length() > 0 ? invoke : "NA"; location = location != null && location.length() > 0 ? location : "NA"; curServiceMap.put("engineName", engineName); curServiceMap.put("defaultEntityName", defaultEntityName); curServiceMap.put("invoke", invoke); curServiceMap.put("location", location); curServiceMap.put("requireNewTransaction", requireNewTransaction); servicesList.add(curServiceMap); servicesFoundCount++; } } context.put("servicesList", servicesList); context.put("serviceNamesAlphaList", serviceNamesAlphaList); context.put("servicesFoundCount", servicesFoundCount);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -