Modified: ofbiz/trunk/framework/webtools/groovyScripts/entity/ViewRelations.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/groovyScripts/entity/ViewRelations.groovy?rev=1767764&r1=1767763&r2=1767764&view=diff ============================================================================== --- ofbiz/trunk/framework/webtools/groovyScripts/entity/ViewRelations.groovy (original) +++ ofbiz/trunk/framework/webtools/groovyScripts/entity/ViewRelations.groovy Wed Nov 2 19:09:13 2016 @@ -16,44 +16,44 @@ * specific language governing permissions and limitations * under the License. */ -import org.apache.ofbiz.entity.Delegator; -import org.apache.ofbiz.security.Security; -import org.apache.ofbiz.entity.model.ModelReader; -import org.apache.ofbiz.entity.model.ModelEntity; -import org.apache.ofbiz.entity.model.ModelRelation; -import org.apache.ofbiz.entity.model.ModelKeyMap; +import org.apache.ofbiz.entity.Delegator +import org.apache.ofbiz.security.Security +import org.apache.ofbiz.entity.model.ModelReader +import org.apache.ofbiz.entity.model.ModelEntity +import org.apache.ofbiz.entity.model.ModelRelation +import org.apache.ofbiz.entity.model.ModelKeyMap -entityName = parameters.entityName; -context.entityName = entityName; +entityName = parameters.entityName +context.entityName = entityName -reader = delegator.getModelReader(); -modelEntity = reader.getModelEntity(entityName); +reader = delegator.getModelReader() +modelEntity = reader.getModelEntity(entityName) -context.plainTableName = modelEntity.getPlainTableName(); +context.plainTableName = modelEntity.getPlainTableName() -hasViewPermission = security.hasEntityPermission("ENTITY_DATA", "_VIEW", session) || security.hasEntityPermission(modelEntity.getPlainTableName(), "_VIEW", session); -context.hasViewPermission = hasViewPermission; +hasViewPermission = security.hasEntityPermission("ENTITY_DATA", "_VIEW", session) || security.hasEntityPermission(modelEntity.getPlainTableName(), "_VIEW", session) +context.hasViewPermission = hasViewPermission -relations = []; +relations = [] for (rit = modelEntity.getRelationsIterator(); rit.hasNext();) { - mapRelation = [:]; + mapRelation = [:] - modelRelation = rit.next(); - relFields = []; + modelRelation = rit.next() + relFields = [] for (kit = modelRelation.getKeyMaps().iterator(); kit.hasNext();) { - mapFields = [:]; - keyMap = kit.next(); - mapFields.fieldName = keyMap.getFieldName(); - mapFields.relFieldName = keyMap.getRelFieldName(); + mapFields = [:] + keyMap = kit.next() + mapFields.fieldName = keyMap.getFieldName() + mapFields.relFieldName = keyMap.getRelFieldName() - relFields.add(mapFields); + relFields.add(mapFields) } - mapRelation.relFields = relFields; - mapRelation.title = modelRelation.getTitle(); - mapRelation.relEntityName = modelRelation.getRelEntityName(); - mapRelation.type = modelRelation.getType(); - mapRelation.fkName = modelRelation.getFkName(); + mapRelation.relFields = relFields + mapRelation.title = modelRelation.getTitle() + mapRelation.relEntityName = modelRelation.getRelEntityName() + mapRelation.type = modelRelation.getType() + mapRelation.fkName = modelRelation.getFkName() - relations.add(mapRelation); + relations.add(mapRelation) } -context.relations = relations; +context.relations = relations Modified: ofbiz/trunk/framework/webtools/groovyScripts/entity/XmlDsDump.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/groovyScripts/entity/XmlDsDump.groovy?rev=1767764&r1=1767763&r2=1767764&view=diff ============================================================================== --- ofbiz/trunk/framework/webtools/groovyScripts/entity/XmlDsDump.groovy (original) +++ ofbiz/trunk/framework/webtools/groovyScripts/entity/XmlDsDump.groovy Wed Nov 2 19:09:13 2016 @@ -17,310 +17,310 @@ * under the License. */ -import java.util.*; -import java.io.*; -import org.apache.ofbiz.base.util.*; -import org.apache.ofbiz.entity.model.*; -import org.apache.ofbiz.entity.util.*; -import org.apache.ofbiz.entity.transaction.*; -import org.apache.ofbiz.entity.condition.*; - -outpath = parameters.outpath; -filename = parameters.filename; -maxRecStr = parameters.maxrecords; -entitySyncId = parameters.entitySyncId; -passedEntityNames = null; -if (parameters.entityName) passedEntityNames = parameters.entityName instanceof Collection ? parameters.entityName as TreeSet : [parameters.entityName] as TreeSet; +import java.util.* +import java.io.* +import org.apache.ofbiz.base.util.* +import org.apache.ofbiz.entity.model.* +import org.apache.ofbiz.entity.util.* +import org.apache.ofbiz.entity.transaction.* +import org.apache.ofbiz.entity.condition.* + +outpath = parameters.outpath +filename = parameters.filename +maxRecStr = parameters.maxrecords +entitySyncId = parameters.entitySyncId +passedEntityNames = null +if (parameters.entityName) passedEntityNames = parameters.entityName instanceof Collection ? parameters.entityName as TreeSet : [parameters.entityName] as TreeSet // get the max records per file setting and convert to a int -maxRecordsPerFile = 0; +maxRecordsPerFile = 0 if (maxRecStr) { try { - maxRecordsPerFile = Integer.parseInt(maxRecStr); + maxRecordsPerFile = Integer.parseInt(maxRecStr) } catch (Exception e) { } } -preConfiguredSetName = parameters.preConfiguredSetName; +preConfiguredSetName = parameters.preConfiguredSetName if ("Product1".equals(preConfiguredSetName)) { - passedEntityNames = new LinkedHashSet(); - passedEntityNames.add("DataResource"); - passedEntityNames.add("Facility"); - passedEntityNames.add("ProdCatalog"); - passedEntityNames.add("Product"); - passedEntityNames.add("ProductCategory"); - passedEntityNames.add("ProductFeatureCategory"); - passedEntityNames.add("ProductFeatureType"); - passedEntityNames.add("ProductPriceRule"); - passedEntityNames.add("ProductPromo"); + passedEntityNames = new LinkedHashSet() + passedEntityNames.add("DataResource") + passedEntityNames.add("Facility") + passedEntityNames.add("ProdCatalog") + passedEntityNames.add("Product") + passedEntityNames.add("ProductCategory") + passedEntityNames.add("ProductFeatureCategory") + passedEntityNames.add("ProductFeatureType") + passedEntityNames.add("ProductPriceRule") + passedEntityNames.add("ProductPromo") } else if ("Product2".equals(preConfiguredSetName)) { - passedEntityNames = new LinkedHashSet(); - passedEntityNames.add("Content"); - passedEntityNames.add("ElectronicText"); - passedEntityNames.add("FacilityLocation"); - passedEntityNames.add("ProdCatalogCategory"); - passedEntityNames.add("ProdCatalogRole"); - passedEntityNames.add("ProductAssoc"); - passedEntityNames.add("ProductAttribute"); - passedEntityNames.add("ProductCategoryMember"); - passedEntityNames.add("ProductCategoryRollup"); - passedEntityNames.add("ProductFacility"); - passedEntityNames.add("ProductFeature"); - passedEntityNames.add("ProductFeatureCategoryAppl"); - passedEntityNames.add("ProductKeyword"); - passedEntityNames.add("ProductPrice"); - passedEntityNames.add("ProductPriceAction"); - passedEntityNames.add("ProductPriceCond"); - passedEntityNames.add("ProductPromoCode"); - passedEntityNames.add("ProductPromoCategory"); - passedEntityNames.add("ProductPromoProduct"); - passedEntityNames.add("ProductPromoRule"); + passedEntityNames = new LinkedHashSet() + passedEntityNames.add("Content") + passedEntityNames.add("ElectronicText") + passedEntityNames.add("FacilityLocation") + passedEntityNames.add("ProdCatalogCategory") + passedEntityNames.add("ProdCatalogRole") + passedEntityNames.add("ProductAssoc") + passedEntityNames.add("ProductAttribute") + passedEntityNames.add("ProductCategoryMember") + passedEntityNames.add("ProductCategoryRollup") + passedEntityNames.add("ProductFacility") + passedEntityNames.add("ProductFeature") + passedEntityNames.add("ProductFeatureCategoryAppl") + passedEntityNames.add("ProductKeyword") + passedEntityNames.add("ProductPrice") + passedEntityNames.add("ProductPriceAction") + passedEntityNames.add("ProductPriceCond") + passedEntityNames.add("ProductPromoCode") + passedEntityNames.add("ProductPromoCategory") + passedEntityNames.add("ProductPromoProduct") + passedEntityNames.add("ProductPromoRule") } else if ("Product3".equals(preConfiguredSetName)) { - passedEntityNames = new LinkedHashSet(); - passedEntityNames.add("ProdCatalogInvFacility"); - passedEntityNames.add("ProductContent"); - passedEntityNames.add("ProductFacilityLocation"); - passedEntityNames.add("ProductFeatureAppl"); - passedEntityNames.add("ProductFeatureDataResource"); - passedEntityNames.add("ProductFeatureGroup"); - passedEntityNames.add("ProductPriceChange"); - passedEntityNames.add("ProductPromoAction"); - passedEntityNames.add("ProductPromoCodeEmail"); - passedEntityNames.add("ProductPromoCodeParty"); - passedEntityNames.add("ProductPromoCond"); + passedEntityNames = new LinkedHashSet() + passedEntityNames.add("ProdCatalogInvFacility") + passedEntityNames.add("ProductContent") + passedEntityNames.add("ProductFacilityLocation") + passedEntityNames.add("ProductFeatureAppl") + passedEntityNames.add("ProductFeatureDataResource") + passedEntityNames.add("ProductFeatureGroup") + passedEntityNames.add("ProductPriceChange") + passedEntityNames.add("ProductPromoAction") + passedEntityNames.add("ProductPromoCodeEmail") + passedEntityNames.add("ProductPromoCodeParty") + passedEntityNames.add("ProductPromoCond") } else if ("Product4".equals(preConfiguredSetName)) { - passedEntityNames = new LinkedHashSet(); - passedEntityNames.add("InventoryItem"); - passedEntityNames.add("ProductFeatureCatGrpAppl"); - passedEntityNames.add("ProductFeatureGroupAppl"); + passedEntityNames = new LinkedHashSet() + passedEntityNames.add("InventoryItem") + passedEntityNames.add("ProductFeatureCatGrpAppl") + passedEntityNames.add("ProductFeatureGroupAppl") } else if ("CatalogExport".equals(preConfiguredSetName)) { - passedEntityNames = new LinkedHashSet(); - passedEntityNames.add("ProdCatalogCategoryType"); - passedEntityNames.add("ProdCatalog"); - passedEntityNames.add("ProductCategoryType"); - passedEntityNames.add("ProductCategory"); - passedEntityNames.add("ProductCategoryRollup"); - passedEntityNames.add("ProdCatalogCategory"); - passedEntityNames.add("ProductFeatureType"); - passedEntityNames.add("ProductFeatureCategory"); - - passedEntityNames.add("DataResource"); - passedEntityNames.add("Content"); - passedEntityNames.add("ElectronicText"); - - passedEntityNames.add("ProductType"); - passedEntityNames.add("Product"); - passedEntityNames.add("ProductAttribute"); - passedEntityNames.add("GoodIdentificationType"); - passedEntityNames.add("GoodIdentification"); - passedEntityNames.add("ProductPriceType"); - passedEntityNames.add("ProductPrice"); - - passedEntityNames.add("ProductPriceRule"); - passedEntityNames.add("ProductPriceCond"); - passedEntityNames.add("ProductPriceAction"); - //passedEntityNames.add("ProductPriceChange"); - - passedEntityNames.add("ProductPromo"); - passedEntityNames.add("ProductPromoCode"); - passedEntityNames.add("ProductPromoCategory"); - passedEntityNames.add("ProductPromoProduct"); - passedEntityNames.add("ProductPromoRule"); - passedEntityNames.add("ProductPromoAction"); - passedEntityNames.add("ProductPromoCodeEmail"); - passedEntityNames.add("ProductPromoCodeParty"); - passedEntityNames.add("ProductPromoCond"); - - passedEntityNames.add("ProductCategoryMember"); - passedEntityNames.add("ProductAssoc"); - passedEntityNames.add("ProductContent"); - - passedEntityNames.add("ProductFeature"); - passedEntityNames.add("ProductFeatureCategoryAppl"); - passedEntityNames.add("ProductFeatureAppl"); - passedEntityNames.add("ProductFeatureDataResource"); - passedEntityNames.add("ProductFeatureGroup"); - passedEntityNames.add("ProductFeatureCatGrpAppl"); - passedEntityNames.add("ProductFeatureGroupAppl"); + passedEntityNames = new LinkedHashSet() + passedEntityNames.add("ProdCatalogCategoryType") + passedEntityNames.add("ProdCatalog") + passedEntityNames.add("ProductCategoryType") + passedEntityNames.add("ProductCategory") + passedEntityNames.add("ProductCategoryRollup") + passedEntityNames.add("ProdCatalogCategory") + passedEntityNames.add("ProductFeatureType") + passedEntityNames.add("ProductFeatureCategory") + + passedEntityNames.add("DataResource") + passedEntityNames.add("Content") + passedEntityNames.add("ElectronicText") + + passedEntityNames.add("ProductType") + passedEntityNames.add("Product") + passedEntityNames.add("ProductAttribute") + passedEntityNames.add("GoodIdentificationType") + passedEntityNames.add("GoodIdentification") + passedEntityNames.add("ProductPriceType") + passedEntityNames.add("ProductPrice") + + passedEntityNames.add("ProductPriceRule") + passedEntityNames.add("ProductPriceCond") + passedEntityNames.add("ProductPriceAction") + //passedEntityNames.add("ProductPriceChange") + + passedEntityNames.add("ProductPromo") + passedEntityNames.add("ProductPromoCode") + passedEntityNames.add("ProductPromoCategory") + passedEntityNames.add("ProductPromoProduct") + passedEntityNames.add("ProductPromoRule") + passedEntityNames.add("ProductPromoAction") + passedEntityNames.add("ProductPromoCodeEmail") + passedEntityNames.add("ProductPromoCodeParty") + passedEntityNames.add("ProductPromoCond") + + passedEntityNames.add("ProductCategoryMember") + passedEntityNames.add("ProductAssoc") + passedEntityNames.add("ProductContent") + + passedEntityNames.add("ProductFeature") + passedEntityNames.add("ProductFeatureCategoryAppl") + passedEntityNames.add("ProductFeatureAppl") + passedEntityNames.add("ProductFeatureDataResource") + passedEntityNames.add("ProductFeatureGroup") + passedEntityNames.add("ProductFeatureCatGrpAppl") + passedEntityNames.add("ProductFeatureGroupAppl") - //passedEntityNames.add("ProductKeyword"); + //passedEntityNames.add("ProductKeyword") } if (entitySyncId) { - passedEntityNames = org.apache.ofbiz.entityext.synchronization.EntitySyncContext.getEntitySyncModelNamesToUse(dispatcher, entitySyncId); + passedEntityNames = org.apache.ofbiz.entityext.synchronization.EntitySyncContext.getEntitySyncModelNamesToUse(dispatcher, entitySyncId) } -checkAll = "true".equals(parameters.checkAll); -tobrowser = parameters.tobrowser != null; -context.tobrowser = tobrowser; - -entityFromCond = null; -entityThruCond = null; -entityDateCond = null; +checkAll = "true".equals(parameters.checkAll) +tobrowser = parameters.tobrowser != null +context.tobrowser = tobrowser + +entityFromCond = null +entityThruCond = null +entityDateCond = null if (entityFrom) { - entityFromCond = EntityCondition.makeCondition("lastUpdatedTxStamp", EntityComparisonOperator.GREATER_THAN, entityFrom); + entityFromCond = EntityCondition.makeCondition("lastUpdatedTxStamp", EntityComparisonOperator.GREATER_THAN, entityFrom) } if (entityThru) { - entityThruCond = EntityCondition.makeCondition("lastUpdatedTxStamp", EntityComparisonOperator.LESS_THAN, entityThru); + entityThruCond = EntityCondition.makeCondition("lastUpdatedTxStamp", EntityComparisonOperator.LESS_THAN, entityThru) } if (entityFromCond && entityThruCond) { - entityDateCond = EntityCondition.makeCondition(entityFromCond, EntityJoinOperator.AND, entityThruCond); + entityDateCond = EntityCondition.makeCondition(entityFromCond, EntityJoinOperator.AND, entityThruCond) } else if (entityFromCond) { - entityDateCond = entityFromCond; + entityDateCond = entityFromCond } else if (entityThruCond) { - entityDateCond = entityThruCond; + entityDateCond = entityThruCond } -reader = delegator.getModelReader(); -modelEntities = reader.getEntityCache().values() as TreeSet; -context.modelEntities = modelEntities; +reader = delegator.getModelReader() +modelEntities = reader.getEntityCache().values() as TreeSet +context.modelEntities = modelEntities if (passedEntityNames) { if (tobrowser) { - session.setAttribute("xmlrawdump_entitylist", passedEntityNames); - session.setAttribute("entityDateCond", entityDateCond); + session.setAttribute("xmlrawdump_entitylist", passedEntityNames) + session.setAttribute("entityDateCond", entityDateCond) } else { - efo = new EntityFindOptions(true, EntityFindOptions.TYPE_SCROLL_INSENSITIVE, EntityFindOptions.CONCUR_READ_ONLY, true); - numberOfEntities = passedEntityNames?.size() ?: 0; - context.numberOfEntities = numberOfEntities; - numberWritten = 0; + efo = new EntityFindOptions(true, EntityFindOptions.TYPE_SCROLL_INSENSITIVE, EntityFindOptions.CONCUR_READ_ONLY, true) + numberOfEntities = passedEntityNames?.size() ?: 0 + context.numberOfEntities = numberOfEntities + numberWritten = 0 // single file if (filename && numberOfEntities) { - writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(new FileOutputStream(filename), "UTF-8"))); - writer.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); - writer.println("<entity-engine-xml>"); + writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(new FileOutputStream(filename), "UTF-8"))) + writer.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>") + writer.println("<entity-engine-xml>") passedEntityNames.each { curEntityName -> if (entityFrom) { - curModelEntity = reader.getModelEntity(curEntityName); + curModelEntity = reader.getModelEntity(curEntityName) if (curModelEntity instanceof ModelViewEntity) { - return; + return } } - beganTransaction = TransactionUtil.begin(3600); + beganTransaction = TransactionUtil.begin(3600) try { - me = reader.getModelEntity(curEntityName); + me = reader.getModelEntity(curEntityName) if (me.getNoAutoStamp() || me instanceof ModelViewEntity) { - values = delegator.find(curEntityName, null, null, null, me.getPkFieldNames(), efo); + values = delegator.find(curEntityName, null, null, null, me.getPkFieldNames(), efo) } else { - values = delegator.find(curEntityName, entityDateCond, null, null, UtilMisc.toList("-createdTxStamp"), efo); + values = delegator.find(curEntityName, entityDateCond, null, null, UtilMisc.toList("-createdTxStamp"), efo) } - curNumberWritten = 0; + curNumberWritten = 0 while (value = values.next()) { - value.writeXmlText(writer, ""); - numberWritten++; - curNumberWritten++; + value.writeXmlText(writer, "") + numberWritten++ + curNumberWritten++ if (curNumberWritten % 500 == 0 || curNumberWritten == 1) { - Debug.log("Records written [$curEntityName]: $curNumberWritten Total: $numberWritten"); + Debug.log("Records written [$curEntityName]: $curNumberWritten Total: $numberWritten") } } - values.close(); - Debug.log("Wrote [$curNumberWritten] from entity : $curEntityName"); - TransactionUtil.commit(beganTransaction); + values.close() + Debug.log("Wrote [$curNumberWritten] from entity : $curEntityName") + TransactionUtil.commit(beganTransaction) } catch (Exception e) { - errMsg = "Error reading data for XML export:"; - Debug.logError(e, errMsg, "JSP"); - TransactionUtil.rollback(beganTransaction, errMsg, e); + errMsg = "Error reading data for XML export:" + Debug.logError(e, errMsg, "JSP") + TransactionUtil.rollback(beganTransaction, errMsg, e) } } - writer.println("</entity-engine-xml>"); - writer.close(); - Debug.log("Total records written from all entities: $numberWritten"); - context.numberWritten = numberWritten; + writer.println("</entity-engine-xml>") + writer.close() + Debug.log("Total records written from all entities: $numberWritten") + context.numberWritten = numberWritten } // multiple files in a directory - results = []; - fileNumber = 1; - context.results = results; + results = [] + fileNumber = 1 + context.results = results if (outpath) { - outdir = new File(outpath); + outdir = new File(outpath) if (!outdir.exists()) { - outdir.mkdir(); + outdir.mkdir() } if (outdir.isDirectory() && outdir.canWrite()) { passedEntityNames.each { curEntityName -> - numberWritten = 0; - fileName = preConfiguredSetName ? UtilFormatOut.formatPaddedNumber((long) fileNumber, 3) + "_" : ""; - fileName = fileName + curEntityName; + numberWritten = 0 + fileName = preConfiguredSetName ? UtilFormatOut.formatPaddedNumber((long) fileNumber, 3) + "_" : "" + fileName = fileName + curEntityName - values = null; - beganTransaction = false; + values = null + beganTransaction = false try { - beganTransaction = TransactionUtil.begin(3600); + beganTransaction = TransactionUtil.begin(3600) - me = delegator.getModelEntity(curEntityName); + me = delegator.getModelEntity(curEntityName) if (me instanceof ModelViewEntity) { - results.add("[$fileNumber] [vvv] $curEntityName skipping view entity"); - return; + results.add("[$fileNumber] [vvv] $curEntityName skipping view entity") + return } if (me.getNoAutoStamp() || me instanceof ModelViewEntity) { - values = delegator.find(curEntityName, null, null, null, me.getPkFieldNames(), efo); + values = delegator.find(curEntityName, null, null, null, me.getPkFieldNames(), efo) } else { - values = delegator.find(curEntityName, entityDateCond, null, null, me.getPkFieldNames(), efo); + values = delegator.find(curEntityName, entityDateCond, null, null, me.getPkFieldNames(), efo) } - isFirst = true; - writer = null; - fileSplitNumber = 1; + isFirst = true + writer = null + fileSplitNumber = 1 while (value = values.next()) { //Don't bother writing the file if there's nothing //to put into it if (isFirst) { - writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(new FileOutputStream(new File(outdir, fileName +".xml")), "UTF-8"))); - writer.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); - writer.println("<entity-engine-xml>"); - isFirst = false; + writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(new FileOutputStream(new File(outdir, fileName +".xml")), "UTF-8"))) + writer.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>") + writer.println("<entity-engine-xml>") + isFirst = false } - value.writeXmlText(writer, ""); - numberWritten++; + value.writeXmlText(writer, "") + numberWritten++ // split into small files if (maxRecordsPerFile > 0 && (numberWritten % maxRecordsPerFile == 0)) { - fileSplitNumber++; + fileSplitNumber++ // close the file - writer.println("</entity-engine-xml>"); - writer.close(); + writer.println("</entity-engine-xml>") + writer.close() // create a new file - splitNumStr = UtilFormatOut.formatPaddedNumber((long) fileSplitNumber, 3); - writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(new FileOutputStream(new File(outdir, fileName + "_" + splitNumStr +".xml")), "UTF-8"))); - writer.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); - writer.println("<entity-engine-xml>"); + splitNumStr = UtilFormatOut.formatPaddedNumber((long) fileSplitNumber, 3) + writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(new FileOutputStream(new File(outdir, fileName + "_" + splitNumStr +".xml")), "UTF-8"))) + writer.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>") + writer.println("<entity-engine-xml>") } if (numberWritten % 500 == 0 || numberWritten == 1) { - Debug.log("Records written [$curEntityName]: $numberWritten"); + Debug.log("Records written [$curEntityName]: $numberWritten") } } if (writer) { - writer.println("</entity-engine-xml>"); - writer.close(); - String thisResult = "[$fileNumber] [$numberWritten] $curEntityName wrote $numberWritten records"; - Debug.log(thisResult); - results.add(thisResult); + writer.println("</entity-engine-xml>") + writer.close() + String thisResult = "[$fileNumber] [$numberWritten] $curEntityName wrote $numberWritten records" + Debug.log(thisResult) + results.add(thisResult) } else { - thisResult = "[$fileNumber] [---] $curEntityName has no records, not writing file"; - Debug.log(thisResult); - results.add(thisResult); + thisResult = "[$fileNumber] [---] $curEntityName has no records, not writing file" + Debug.log(thisResult) + results.add(thisResult) } - values.close(); + values.close() } catch (Exception ex) { if (values != null) { - values.close(); + values.close() } - thisResult = "[$fileNumber] [xxx] Error when writing $curEntityName: $ex"; - Debug.log(thisResult); - results.add(thisResult); - TransactionUtil.rollback(beganTransaction, thisResult, ex); + thisResult = "[$fileNumber] [xxx] Error when writing $curEntityName: $ex" + Debug.log(thisResult) + results.add(thisResult) + TransactionUtil.rollback(beganTransaction, thisResult, ex) } finally { // only commit the transaction if we started one... this will throw an exception if it fails - TransactionUtil.commit(beganTransaction); + TransactionUtil.commit(beganTransaction) } - fileNumber++; + fileNumber++ } } } Modified: ofbiz/trunk/framework/webtools/groovyScripts/geo/GetGeoLocation.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/groovyScripts/geo/GetGeoLocation.groovy?rev=1767764&r1=1767763&r2=1767764&view=diff ============================================================================== --- ofbiz/trunk/framework/webtools/groovyScripts/geo/GetGeoLocation.groovy (original) +++ ofbiz/trunk/framework/webtools/groovyScripts/geo/GetGeoLocation.groovy Wed Nov 2 19:09:13 2016 @@ -17,6 +17,6 @@ * under the License. */ -context.geoPointId = geoPoint.geoPointId; -context.latitude = geoPoint.latitude; -context.longitude = geoPoint.longitude; \ No newline at end of file +context.geoPointId = geoPoint.geoPointId +context.latitude = geoPoint.latitude +context.longitude = geoPoint.longitude \ No newline at end of file Modified: ofbiz/trunk/framework/webtools/groovyScripts/labelmanager/LabelManager.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/groovyScripts/labelmanager/LabelManager.groovy?rev=1767764&r1=1767763&r2=1767764&view=diff ============================================================================== --- ofbiz/trunk/framework/webtools/groovyScripts/labelmanager/LabelManager.groovy (original) +++ ofbiz/trunk/framework/webtools/groovyScripts/labelmanager/LabelManager.groovy Wed Nov 2 19:09:13 2016 @@ -17,23 +17,23 @@ * under the License. */ -import org.apache.ofbiz.entity.Delegator; -import org.apache.ofbiz.webtools.labelmanager.*; +import org.apache.ofbiz.entity.Delegator +import org.apache.ofbiz.webtools.labelmanager.* -LabelManagerFactory factory = LabelManagerFactory.getInstance(); -context.factory = factory; +LabelManagerFactory factory = LabelManagerFactory.getInstance() +context.factory = factory factory.findMatchingLabels(parameters.labelComponentName, parameters.labelFileName, parameters.labelKey, parameters.labelLocaleName, "Y".equals(parameters.onlyNotUsedLabels)) -context.labels = factory.getLabels(); -context.labelsList = factory.getLabelsList(); -context.localesFound = factory.getLocalesFound(); -context.filesFound = factory.getFilesFound(); -context.componentNamesFound = factory.getComponentNamesFound(); -context.duplicatedLocalesLabels = factory.getDuplicatedLocalesLabels(); -context.duplicatedLocalesLabelsList = factory.getDuplicatedLocalesLabelsList(); -context.keySeparator = factory.keySeparator; +context.labels = factory.getLabels() +context.labelsList = factory.getLabelsList() +context.localesFound = factory.getLocalesFound() +context.filesFound = factory.getFilesFound() +context.componentNamesFound = factory.getComponentNamesFound() +context.duplicatedLocalesLabels = factory.getDuplicatedLocalesLabels() +context.duplicatedLocalesLabelsList = factory.getDuplicatedLocalesLabelsList() +context.keySeparator = factory.keySeparator if ("Y".equals(parameters.onlyNotUsedLabels)) { - LabelReferences refsObject = new LabelReferences(delegator, factory); - Map references = refsObject.getLabelReferences(); - context.references = references; - context.referencesList = references.keySet(); + LabelReferences refsObject = new LabelReferences(delegator, factory) + Map references = refsObject.getLabelReferences() + context.references = references + context.referencesList = references.keySet() } Modified: ofbiz/trunk/framework/webtools/groovyScripts/labelmanager/UpdateManager.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/groovyScripts/labelmanager/UpdateManager.groovy?rev=1767764&r1=1767763&r2=1767764&view=diff ============================================================================== --- ofbiz/trunk/framework/webtools/groovyScripts/labelmanager/UpdateManager.groovy (original) +++ ofbiz/trunk/framework/webtools/groovyScripts/labelmanager/UpdateManager.groovy Wed Nov 2 19:09:13 2016 @@ -17,17 +17,17 @@ * under the License. */ -import org.apache.ofbiz.entity.Delegator; -import org.apache.ofbiz.webtools.labelmanager.*; +import org.apache.ofbiz.entity.Delegator +import org.apache.ofbiz.webtools.labelmanager.* -LabelManagerFactory factory = LabelManagerFactory.getInstance(); +LabelManagerFactory factory = LabelManagerFactory.getInstance() factory.findMatchingLabels(null, parameters.sourceFileName, parameters.sourceKey, null, false) -context.labels = factory.getLabels(); -context.localesFound = factory.getLocalesFound(); -context.filesFound = factory.getFilesFound(); -context.componentNamesFound = factory.getComponentNamesFound(); +context.labels = factory.getLabels() +context.localesFound = factory.getLocalesFound() +context.filesFound = factory.getFilesFound() +context.componentNamesFound = factory.getComponentNamesFound() if (parameters.sourceKey && parameters.sourceFileName) { - context.label = context.labels.get(parameters.sourceKey + LabelManagerFactory.keySeparator + parameters.sourceFileName); - context.titleProperty = "WebtoolsLabelManagerUpdate"; + context.label = context.labels.get(parameters.sourceKey + LabelManagerFactory.keySeparator + parameters.sourceFileName) + context.titleProperty = "WebtoolsLabelManagerUpdate" } Modified: ofbiz/trunk/framework/webtools/groovyScripts/labelmanager/ViewFile.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/groovyScripts/labelmanager/ViewFile.groovy?rev=1767764&r1=1767763&r2=1767764&view=diff ============================================================================== --- ofbiz/trunk/framework/webtools/groovyScripts/labelmanager/ViewFile.groovy (original) +++ ofbiz/trunk/framework/webtools/groovyScripts/labelmanager/ViewFile.groovy Wed Nov 2 19:09:13 2016 @@ -16,25 +16,25 @@ * specific language governing permissions and limitations * under the License. */ -import java.net.URI; -import org.apache.ofbiz.base.util.*; -import org.w3c.dom.*; -import java.io.ByteArrayOutputStream; -import org.apache.commons.lang.StringEscapeUtils; +import java.net.URI +import org.apache.ofbiz.base.util.* +import org.w3c.dom.* +import java.io.ByteArrayOutputStream +import org.apache.commons.lang.StringEscapeUtils -fileString = ""; +fileString = "" if (parameters.fileName) { - file = new File(parameters.fileName); + file = new File(parameters.fileName) if (parameters.fileName.endsWith(".xml")) { - Document document = UtilXml.readXmlDocument(file.toURL(), false); - ByteArrayOutputStream os = new ByteArrayOutputStream(); - UtilXml.writeXmlDocument(document, os, "UTF-8", true, true, 4); - os.close(); - fileString = os.toString(); + Document document = UtilXml.readXmlDocument(file.toURL(), false) + ByteArrayOutputStream os = new ByteArrayOutputStream() + UtilXml.writeXmlDocument(document, os, "UTF-8", true, true, 4) + os.close() + fileString = os.toString() } else { - fileString = FileUtil.readString("UTF-8", file); + fileString = FileUtil.readString("UTF-8", file) } - rows = fileString.split(System.getProperty("line.separator")); - context.rows = rows.size(); + rows = fileString.split(System.getProperty("line.separator")) + context.rows = rows.size() } -context.fileString = fileString; +context.fileString = fileString Modified: ofbiz/trunk/framework/webtools/groovyScripts/labelmanager/ViewReferences.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/groovyScripts/labelmanager/ViewReferences.groovy?rev=1767764&r1=1767763&r2=1767764&view=diff ============================================================================== --- ofbiz/trunk/framework/webtools/groovyScripts/labelmanager/ViewReferences.groovy (original) +++ ofbiz/trunk/framework/webtools/groovyScripts/labelmanager/ViewReferences.groovy Wed Nov 2 19:09:13 2016 @@ -17,21 +17,21 @@ * under the License. */ -import org.apache.ofbiz.entity.Delegator; -import org.apache.ofbiz.webtools.labelmanager.*; +import org.apache.ofbiz.entity.Delegator +import org.apache.ofbiz.webtools.labelmanager.* -LabelManagerFactory factory = LabelManagerFactory.getInstance(); -context.factory = factory; +LabelManagerFactory factory = LabelManagerFactory.getInstance() +context.factory = factory factory.findMatchingLabels(parameters.labelComponentName, parameters.labelFileName, parameters.sourceKey, parameters.labelLocaleName, false) -context.labels = factory.getLabels(); -context.labelsList = factory.getLabelsList(); -context.localesFound = factory.getLocalesFound(); -context.filesFound = factory.getFilesFound(); -context.componentNamesFound = factory.getComponentNamesFound(); -context.duplicatedLocalesLabels = factory.getDuplicatedLocalesLabels(); -context.duplicatedLocalesLabelsList = factory.getDuplicatedLocalesLabelsList(); -context.keySeparator = factory.keySeparator; -LabelReferences refsObject = new LabelReferences(delegator, factory); -Map references = refsObject.getLabelReferences(); -context.references = references; -context.referencesList = references.keySet(); +context.labels = factory.getLabels() +context.labelsList = factory.getLabelsList() +context.localesFound = factory.getLocalesFound() +context.filesFound = factory.getFilesFound() +context.componentNamesFound = factory.getComponentNamesFound() +context.duplicatedLocalesLabels = factory.getDuplicatedLocalesLabels() +context.duplicatedLocalesLabelsList = factory.getDuplicatedLocalesLabelsList() +context.keySeparator = factory.keySeparator +LabelReferences refsObject = new LabelReferences(delegator, factory) +Map references = refsObject.getLabelReferences() +context.references = references +context.referencesList = references.keySet() Modified: ofbiz/trunk/framework/webtools/groovyScripts/log/FetchLogs.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/groovyScripts/log/FetchLogs.groovy?rev=1767764&r1=1767763&r2=1767764&view=diff ============================================================================== --- ofbiz/trunk/framework/webtools/groovyScripts/log/FetchLogs.groovy (original) +++ ofbiz/trunk/framework/webtools/groovyScripts/log/FetchLogs.groovy Wed Nov 2 19:09:13 2016 @@ -17,53 +17,53 @@ * under the License. */ -import org.apache.ofbiz.base.util.FileUtil; -import org.apache.ofbiz.base.util.UtilProperties; +import org.apache.ofbiz.base.util.FileUtil +import org.apache.ofbiz.base.util.UtilProperties -String ofbizLogDir = UtilProperties.getPropertyValue("debug", "log4j.appender.css.dir", "runtime/logs/"); +String ofbizLogDir = UtilProperties.getPropertyValue("debug", "log4j.appender.css.dir", "runtime/logs/") if (!ofbizLogDir.startsWith("/")) { - ofbizLogDir = System.getProperty("ofbiz.home") + "/" + ofbizLogDir; + ofbizLogDir = System.getProperty("ofbiz.home") + "/" + ofbizLogDir } if (!ofbizLogDir.endsWith("/")) { - ofbizLogDir = ofbizLogDir.concat("/"); + ofbizLogDir = ofbizLogDir.concat("/") } -File runTimeLogDir = FileUtil.getFile(ofbizLogDir); -File[] listLogFiles = runTimeLogDir.listFiles(); -String ofbizLogRegExp = UtilProperties.getPropertyValue("debug", "log4j.appender.css.fileNameRegExp", "[(ofbiz)|(error)].*"); -List listLogFileNames = []; +File runTimeLogDir = FileUtil.getFile(ofbizLogDir) +File[] listLogFiles = runTimeLogDir.listFiles() +String ofbizLogRegExp = UtilProperties.getPropertyValue("debug", "log4j.appender.css.fileNameRegExp", "[(ofbiz)|(error)].*") +List listLogFileNames = [] for (int i = 0; i < listLogFiles.length; i++) { if (listLogFiles[i].isFile()) { - logFileName = listLogFiles[i].getName(); + logFileName = listLogFiles[i].getName() if (logFileName.matches(ofbizLogRegExp)) { - listLogFileNames.add(logFileName); + listLogFileNames.add(logFileName) } } } -context.listLogFileNames = listLogFileNames; +context.listLogFileNames = listLogFileNames if (parameters.logFileName) { - List logLines = []; + List logLines = [] try { - File logFile = FileUtil.getFile(ofbizLogDir.concat(parameters.logFileName)); + File logFile = FileUtil.getFile(ofbizLogDir.concat(parameters.logFileName)) logFile.eachLine { line -> if (parameters.searchString) { if (!line.contains(parameters.searchString)) { - return; + return } } - type = ''; + type = '' if (line.contains(" |I| ")) { - type = 'INFO'; + type = 'INFO' } else if (line.contains(" |W| ")) { - type = 'WARN'; + type = 'WARN' } else if (line.contains(" |E| ")) { - type = 'ERROR'; + type = 'ERROR' } else if (line.contains(" |D| ")) { - type = 'DEBUG'; + type = 'DEBUG' } - logLines.add([type: type, line:line]); + logLines.add([type: type, line:line]) } } catch (Exception exc) {} - context.logLines = logLines; + context.logLines = logLines } Modified: ofbiz/trunk/framework/webtools/groovyScripts/log/LogConfiguration.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/groovyScripts/log/LogConfiguration.groovy?rev=1767764&r1=1767763&r2=1767764&view=diff ============================================================================== --- ofbiz/trunk/framework/webtools/groovyScripts/log/LogConfiguration.groovy (original) +++ ofbiz/trunk/framework/webtools/groovyScripts/log/LogConfiguration.groovy Wed Nov 2 19:09:13 2016 @@ -17,7 +17,7 @@ * under the License. */ -import org.apache.ofbiz.base.util.Debug; +import org.apache.ofbiz.base.util.Debug context.activeDebugLevel = [fatal : Debug.fatalOn() ? "Y" : "N", error : Debug.errorOn() ? "Y" : "N", @@ -25,4 +25,4 @@ context.activeDebugLevel = [fatal : Debu important : Debug.importantOn() ? "Y" : "N", info : Debug.infoOn() ? "Y" : "N", timing : Debug.timingOn() ? "Y" : "N", - verbose : Debug.verboseOn() ? "Y" : "N"]; + verbose : Debug.verboseOn() ? "Y" : "N"] Modified: ofbiz/trunk/framework/webtools/groovyScripts/service/AvailableServices.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/groovyScripts/service/AvailableServices.groovy?rev=1767764&r1=1767763&r2=1767764&view=diff ============================================================================== --- ofbiz/trunk/framework/webtools/groovyScripts/service/AvailableServices.groovy (original) +++ ofbiz/trunk/framework/webtools/groovyScripts/service/AvailableServices.groovy Wed Nov 2 19:09:13 2016 @@ -17,559 +17,559 @@ * under the License. */ -import java.util.*; -import javax.wsdl.WSDLException; -import org.apache.ofbiz.base.util.Debug; -import org.apache.ofbiz.base.util.UtilXml; -import org.apache.ofbiz.base.util.UtilProperties; -import org.apache.ofbiz.service.eca.ServiceEcaUtil; -import org.apache.ofbiz.service.ModelPermGroup; -import org.apache.ofbiz.service.ModelPermission; -import org.apache.ofbiz.service.ServiceContainer; -import org.apache.ofbiz.base.util.UtilHttp; -import org.apache.ofbiz.base.util.UtilProperties; -import org.apache.ofbiz.entity.util.EntityUtilProperties; +import java.util.* +import javax.wsdl.WSDLException +import org.apache.ofbiz.base.util.Debug +import org.apache.ofbiz.base.util.UtilXml +import org.apache.ofbiz.base.util.UtilProperties +import org.apache.ofbiz.service.eca.ServiceEcaUtil +import org.apache.ofbiz.service.ModelPermGroup +import org.apache.ofbiz.service.ModelPermission +import org.apache.ofbiz.service.ServiceContainer +import org.apache.ofbiz.base.util.UtilHttp +import org.apache.ofbiz.base.util.UtilProperties +import org.apache.ofbiz.entity.util.EntityUtilProperties List getEcaListForService(String selectedService) { - ecaMap = org.apache.ofbiz.service.eca.ServiceEcaUtil.getServiceEventMap(selectedService); + ecaMap = org.apache.ofbiz.service.eca.ServiceEcaUtil.getServiceEventMap(selectedService) - if (!ecaMap) return null; + if (!ecaMap) return null //ecaMap is a HashMap so get keyset & iterate - ecaMapList = []; + ecaMapList = [] ecaMap.each { ecaKey, ecaValue -> ecaValue.each { curRule -> - curRuleMap = [:]; + curRuleMap = [:] - curRuleMap.ruleKey = ecaKey; + curRuleMap.ruleKey = ecaKey - curRuleClass = curRule.getClass(); + curRuleClass = curRule.getClass() //event name for rule - eventName = curRuleClass.getDeclaredField("eventName"); - eventName.setAccessible(true); - eventNameVal = eventName.get(curRule); + eventName = curRuleClass.getDeclaredField("eventName") + eventName.setAccessible(true) + eventNameVal = eventName.get(curRule) if (eventNameVal) { - curRuleMap.eventName = eventNameVal as String; + curRuleMap.eventName = eventNameVal as String } - eventName.setAccessible(false); + eventName.setAccessible(false) //runOnError - runOnError = curRuleClass.getDeclaredField("runOnError"); - runOnError.setAccessible(true); - runOnErrorVal = runOnError.get(curRule); + runOnError = curRuleClass.getDeclaredField("runOnError") + runOnError.setAccessible(true) + runOnErrorVal = runOnError.get(curRule) if (runOnErrorVal) { - curRuleMap.runOnError = runOnErrorVal as String; + curRuleMap.runOnError = runOnErrorVal as String } - runOnError.setAccessible(false); + runOnError.setAccessible(false) //runOnFailure - runOnFailure = curRuleClass.getDeclaredField("runOnFailure"); - runOnFailure.setAccessible(true); - runOnFailureVal = runOnFailure.get(curRule); + runOnFailure = curRuleClass.getDeclaredField("runOnFailure") + runOnFailure.setAccessible(true) + runOnFailureVal = runOnFailure.get(curRule) if (runOnFailureVal) { - curRuleMap.runOnFailure = runOnFailureVal as String; + curRuleMap.runOnFailure = runOnFailureVal as String } - runOnFailure.setAccessible(false); + runOnFailure.setAccessible(false) //extract actions - actions = curRuleClass.getDeclaredField("actionsAndSets"); - actions.setAccessible(true); - actionsVal = actions.get(curRule); + actions = curRuleClass.getDeclaredField("actionsAndSets") + actions.setAccessible(true) + actionsVal = actions.get(curRule) if (actionsVal) { - actionsList = new ArrayList(); - setsList = new ArrayList(); + actionsList = new ArrayList() + setsList = new ArrayList() actionsVal.each { curAction -> - actionClass = curAction.getClass(); + actionClass = curAction.getClass() if (org.apache.ofbiz.service.eca.ServiceEcaAction.equals(actionClass)) { - actionMap = [:]; + actionMap = [:] //eventName - eventName = actionClass.getDeclaredField("eventName"); - eventName.setAccessible(true); - eventNameVal = eventName.get(curAction); + eventName = actionClass.getDeclaredField("eventName") + eventName.setAccessible(true) + eventNameVal = eventName.get(curAction) if (eventNameVal) { - actionMap.eventName = eventNameVal as String; + actionMap.eventName = eventNameVal as String } - eventName.setAccessible(false); + eventName.setAccessible(false) //ignoreError - ignoreError = actionClass.getDeclaredField("ignoreError"); - ignoreError.setAccessible(true); - ignoreErrorVal = ignoreError.get(curAction); + ignoreError = actionClass.getDeclaredField("ignoreError") + ignoreError.setAccessible(true) + ignoreErrorVal = ignoreError.get(curAction) if (ignoreErrorVal) { - actionMap.ignoreError = ignoreErrorVal as String; + actionMap.ignoreError = ignoreErrorVal as String } - ignoreError.setAccessible(false); + ignoreError.setAccessible(false) //ignoreFailure - ignoreFailure = actionClass.getDeclaredField("ignoreFailure"); - ignoreFailure.setAccessible(true); - ignoreFailureVal = ignoreFailure.get(curAction); + ignoreFailure = actionClass.getDeclaredField("ignoreFailure") + ignoreFailure.setAccessible(true) + ignoreFailureVal = ignoreFailure.get(curAction) if (ignoreFailureVal) { - actionMap.ignoreFailure = ignoreFailureVal as String; + actionMap.ignoreFailure = ignoreFailureVal as String } - ignoreFailure.setAccessible(false); + ignoreFailure.setAccessible(false) //persist - persist = actionClass.getDeclaredField("persist"); - persist.setAccessible(true); - persistVal = persist.get(curAction); + persist = actionClass.getDeclaredField("persist") + persist.setAccessible(true) + persistVal = persist.get(curAction) if (persistVal) { - actionMap.persist = persistVal as String; + actionMap.persist = persistVal as String } - persist.setAccessible(false); + persist.setAccessible(false) //resultMapName - resultMapName = actionClass.getDeclaredField("resultMapName"); - resultMapName.setAccessible(true); - resultMapNameVal = resultMapName.get(curAction); + resultMapName = actionClass.getDeclaredField("resultMapName") + resultMapName.setAccessible(true) + resultMapNameVal = resultMapName.get(curAction) if (resultMapNameVal) { - actionMap.resultMapName = resultMapNameVal as String; + actionMap.resultMapName = resultMapNameVal as String } - resultMapName.setAccessible(false); + resultMapName.setAccessible(false) //resultToContext - resultToContext = actionClass.getDeclaredField("resultToContext"); - resultToContext.setAccessible(true); - resultToContextVal = resultToContext.get(curAction); + resultToContext = actionClass.getDeclaredField("resultToContext") + resultToContext.setAccessible(true) + resultToContextVal = resultToContext.get(curAction) if (resultToContextVal) { - actionMap.resultToContext = resultToContextVal as String; + actionMap.resultToContext = resultToContextVal as String } - resultToContext.setAccessible(false); + resultToContext.setAccessible(false) //resultToResult - resultToResult = actionClass.getDeclaredField("resultToResult"); - resultToResult.setAccessible(true); - resultToResultVal = resultToResult.get(curAction); + resultToResult = actionClass.getDeclaredField("resultToResult") + resultToResult.setAccessible(true) + resultToResultVal = resultToResult.get(curAction) if (resultToResultVal) { - actionMap.resultToResult = resultToResultVal as String; + actionMap.resultToResult = resultToResultVal as String } - resultToResult.setAccessible(false); + resultToResult.setAccessible(false) //serviceMode - serviceMode = actionClass.getDeclaredField("serviceMode"); - serviceMode.setAccessible(true); - serviceModeVal = serviceMode.get(curAction); + serviceMode = actionClass.getDeclaredField("serviceMode") + serviceMode.setAccessible(true) + serviceModeVal = serviceMode.get(curAction) if (serviceModeVal) { - actionMap.serviceMode = serviceModeVal as String; + actionMap.serviceMode = serviceModeVal as String } - serviceMode.setAccessible(false); + serviceMode.setAccessible(false) //serviceName - serviceName = actionClass.getDeclaredField("serviceName"); - serviceName.setAccessible(true); - serviceNameVal = serviceName.get(curAction); + serviceName = actionClass.getDeclaredField("serviceName") + serviceName.setAccessible(true) + serviceNameVal = serviceName.get(curAction) if (serviceNameVal) { - actionMap.serviceName = serviceNameVal as String; + actionMap.serviceName = serviceNameVal as String } - serviceName.setAccessible(false); + serviceName.setAccessible(false) - actionsList.add(actionMap); + actionsList.add(actionMap) } else { // FIXME : we should also show field-names and values for set operation - setMap = [:]; + setMap = [:] // fieldName - fieldName = actionClass.getDeclaredField("fieldName"); - fieldName.setAccessible(true); - fieldNameVal = fieldName.get(curAction); + fieldName = actionClass.getDeclaredField("fieldName") + fieldName.setAccessible(true) + fieldNameVal = fieldName.get(curAction) if (fieldNameVal) { - setMap.fieldName = fieldNameVal as String; + setMap.fieldName = fieldNameVal as String } - fieldName.setAccessible(false); + fieldName.setAccessible(false) // envName - envName = actionClass.getDeclaredField("envName"); - envName.setAccessible(true); - envNameVal = envName.get(curAction); + envName = actionClass.getDeclaredField("envName") + envName.setAccessible(true) + envNameVal = envName.get(curAction) if (envNameVal) { - setMap.envName = envNameVal as String; + setMap.envName = envNameVal as String } - envName.setAccessible(false); + envName.setAccessible(false) // value - value = actionClass.getDeclaredField("value"); - value.setAccessible(true); - valueVal = value.get(curAction); + value = actionClass.getDeclaredField("value") + value.setAccessible(true) + valueVal = value.get(curAction) if (valueVal) { - setMap.value = valueVal as String; + setMap.value = valueVal as String } - value.setAccessible(false); + value.setAccessible(false) // format - format = actionClass.getDeclaredField("format"); - format.setAccessible(true); - formatVal = format.get(curAction); + format = actionClass.getDeclaredField("format") + format.setAccessible(true) + formatVal = format.get(curAction) if (formatVal) { - setMap.format = formatVal as String; + setMap.format = formatVal as String } - format.setAccessible(false); + format.setAccessible(false) - setsList.add(setMap); + setsList.add(setMap) } } - curRuleMap.actions = actionsList; - curRuleMap.sets= setsList; + curRuleMap.actions = actionsList + curRuleMap.sets= setsList } - actions.setAccessible(true); + actions.setAccessible(true) //extract conditions - conditions = curRuleClass.getDeclaredField("conditions"); - conditions.setAccessible(true); - conditionsVal = conditions.get(curRule); + conditions = curRuleClass.getDeclaredField("conditions") + conditions.setAccessible(true) + conditionsVal = conditions.get(curRule) if (conditionsVal) { - curRuleMap.conditions = runOnFailureVal as String; - condList = new ArrayList(conditionsVal.size()); + curRuleMap.conditions = runOnFailureVal as String + condList = new ArrayList(conditionsVal.size()) conditionsVal.each { condVal -> - condValClass = condVal.getClass(); - condMap = [:]; + condValClass = condVal.getClass() + condMap = [:] //compareType - compareType = condValClass.getDeclaredField("compareType"); - compareType.setAccessible(true); - compareTypeVal = compareType.get(condVal); + compareType = condValClass.getDeclaredField("compareType") + compareType.setAccessible(true) + compareTypeVal = compareType.get(condVal) if (compareTypeVal) { - condMap.compareType = compareTypeVal as String; + condMap.compareType = compareTypeVal as String } - compareType.setAccessible(false); + compareType.setAccessible(false) //conditionService - conditionService = condValClass.getDeclaredField("conditionService"); - conditionService.setAccessible(true); - conditionServiceVal = conditionService.get(condVal); + conditionService = condValClass.getDeclaredField("conditionService") + conditionService.setAccessible(true) + conditionServiceVal = conditionService.get(condVal) if (conditionServiceVal) { - condMap.conditionService = conditionServiceVal as String; + condMap.conditionService = conditionServiceVal as String } - conditionService.setAccessible(false); + conditionService.setAccessible(false) //format - format = condValClass.getDeclaredField("format"); - format.setAccessible(true); - formatVal = format.get(condVal); + format = condValClass.getDeclaredField("format") + format.setAccessible(true) + formatVal = format.get(condVal) if (formatVal) { - condMap.format = formatVal as String; + condMap.format = formatVal as String } - format.setAccessible(false); + format.setAccessible(false) //isConstant - isConstant = condValClass.getDeclaredField("isConstant"); - isConstant.setAccessible(true); - isConstantVal = isConstant.get(condVal); + isConstant = condValClass.getDeclaredField("isConstant") + isConstant.setAccessible(true) + isConstantVal = isConstant.get(condVal) if (isConstantVal) { - condMap.isConstant = isConstantVal as String; + condMap.isConstant = isConstantVal as String } - isConstant.setAccessible(false); + isConstant.setAccessible(false) //isService - isService = condValClass.getDeclaredField("isService"); - isService.setAccessible(true); - isServiceVal = isService.get(condVal); + isService = condValClass.getDeclaredField("isService") + isService.setAccessible(true) + isServiceVal = isService.get(condVal) if (isServiceVal) { - condMap.isService = isServiceVal as String; + condMap.isService = isServiceVal as String } - isService.setAccessible(false); + isService.setAccessible(false) //lhsMapName - lhsMapName = condValClass.getDeclaredField("lhsMapName"); - lhsMapName.setAccessible(true); - lhsMapNameVal = lhsMapName.get(condVal); + lhsMapName = condValClass.getDeclaredField("lhsMapName") + lhsMapName.setAccessible(true) + lhsMapNameVal = lhsMapName.get(condVal) if (lhsMapNameVal) { - condMap.lhsMapName = lhsMapNameVal as String; + condMap.lhsMapName = lhsMapNameVal as String } - lhsMapName.setAccessible(false); + lhsMapName.setAccessible(false) //lhsValueName - lhsValueName = condValClass.getDeclaredField("lhsValueName"); - lhsValueName.setAccessible(true); - lhsValueNameVal = lhsValueName.get(condVal); + lhsValueName = condValClass.getDeclaredField("lhsValueName") + lhsValueName.setAccessible(true) + lhsValueNameVal = lhsValueName.get(condVal) if (lhsValueNameVal) { - condMap.lhsValueName = lhsValueNameVal as String; + condMap.lhsValueName = lhsValueNameVal as String } - lhsValueName.setAccessible(false); + lhsValueName.setAccessible(false) //operator - operator = condValClass.getDeclaredField("operator"); - operator.setAccessible(true); - operatorVal = operator.get(condVal); + operator = condValClass.getDeclaredField("operator") + operator.setAccessible(true) + operatorVal = operator.get(condVal) if (operatorVal) { - condMap.operator = operatorVal as String; + condMap.operator = operatorVal as String } - operator.setAccessible(false); + operator.setAccessible(false) //rhsMapName - rhsMapName = condValClass.getDeclaredField("rhsMapName"); - rhsMapName.setAccessible(true); - rhsMapNameVal = rhsMapName.get(condVal); + rhsMapName = condValClass.getDeclaredField("rhsMapName") + rhsMapName.setAccessible(true) + rhsMapNameVal = rhsMapName.get(condVal) if (rhsMapNameVal) { - condMap.rhsMapName = rhsMapNameVal as String; + condMap.rhsMapName = rhsMapNameVal as String } - rhsMapName.setAccessible(false); + rhsMapName.setAccessible(false) //rhsValueName - rhsValueName = condValClass.getDeclaredField("rhsValueName"); - rhsValueName.setAccessible(true); - rhsValueNameVal = rhsValueName.get(condVal); + rhsValueName = condValClass.getDeclaredField("rhsValueName") + rhsValueName.setAccessible(true) + rhsValueNameVal = rhsValueName.get(condVal) if (rhsValueNameVal) { - condMap.rhsValueName = rhsValueNameVal as String; + condMap.rhsValueName = rhsValueNameVal as String } - rhsValueName.setAccessible(false); + rhsValueName.setAccessible(false) - condList.add(condMap); + condList.add(condMap) } - curRuleMap.conditions = condList; + curRuleMap.conditions = condList } - conditions.setAccessible(false); + conditions.setAccessible(false) - ecaMapList.add(curRuleMap); + ecaMapList.add(curRuleMap) } } - return ecaMapList; + return ecaMapList } //Local Dispatchers -dispArrList = new TreeSet(); -dispArrList.addAll(ServiceContainer.getAllDispatcherNames()); -context.dispArrList = dispArrList; +dispArrList = new TreeSet() +dispArrList.addAll(ServiceContainer.getAllDispatcherNames()) +context.dispArrList = dispArrList -uiLabelMap = UtilProperties.getResourceBundleMap("WebtoolsUiLabels", locale); -uiLabelMap.addBottomResourceBundle("CommonUiLabels"); +uiLabelMap = UtilProperties.getResourceBundleMap("WebtoolsUiLabels", locale) +uiLabelMap.addBottomResourceBundle("CommonUiLabels") -curDispatchContext = dispatcher.getDispatchContext(); -context.dispatcherName = dispatcher.getName(); +curDispatchContext = dispatcher.getDispatchContext() +context.dispatcherName = dispatcher.getName() -selectedService = parameters.sel_service_name; +selectedService = parameters.sel_service_name if (selectedService) { - curServiceMap = [:]; + curServiceMap = [:] - curServiceMap.serviceName = selectedService; - curServiceModel = curDispatchContext.getModelService(selectedService); + curServiceMap.serviceName = selectedService + curServiceModel = curDispatchContext.getModelService(selectedService) if (curServiceModel != null) { - curServiceMap.description = curServiceModel.description; - engineName = curServiceModel.engineName ?: "NA"; - defaultEntityName = curServiceModel.defaultEntityName ?: "NA"; - export = curServiceModel.export ? uiLabelMap.CommonTrue : uiLabelMap.CommonFalse; - exportBool = curServiceModel.export ? "true" : "false"; - permissionGroups = curServiceModel.permissionGroups ?: "NA"; - implServices = curServiceModel.implServices ?: "NA"; - overrideParameters = curServiceModel.overrideParameters; - useTrans = curServiceModel.useTransaction ? uiLabelMap.CommonTrue : uiLabelMap.CommonFalse; - maxRetry = curServiceModel.maxRetry; + curServiceMap.description = curServiceModel.description + engineName = curServiceModel.engineName ?: "NA" + defaultEntityName = curServiceModel.defaultEntityName ?: "NA" + export = curServiceModel.export ? uiLabelMap.CommonTrue : uiLabelMap.CommonFalse + exportBool = curServiceModel.export ? "true" : "false" + permissionGroups = curServiceModel.permissionGroups ?: "NA" + implServices = curServiceModel.implServices ?: "NA" + overrideParameters = curServiceModel.overrideParameters + useTrans = curServiceModel.useTransaction ? uiLabelMap.CommonTrue : uiLabelMap.CommonFalse + maxRetry = curServiceModel.maxRetry //Test for ECA's - ecaMapList = getEcaListForService(selectedService); + ecaMapList = getEcaListForService(selectedService) if (ecaMapList) { - context.ecaMapList = ecaMapList; + context.ecaMapList = ecaMapList } //End Test for ECA's - invoke = curServiceModel.invoke ?: "NA"; - location = curServiceModel.location ?: "NA"; - requireNewTransaction = curServiceModel.requireNewTransaction ? uiLabelMap.CommonTrue : uiLabelMap.CommonFalse; - - curServiceMap.engineName = engineName; - curServiceMap.defaultEntityName = defaultEntityName; - curServiceMap.invoke = invoke; - curServiceMap.location = location; - curServiceMap.definitionLocation = curServiceModel.definitionLocation.replaceFirst("file:/" + System.getProperty("ofbiz.home") + "/", ""); - curServiceMap.requireNewTransaction = requireNewTransaction; - curServiceMap.export = export; - curServiceMap.exportBool = exportBool; + invoke = curServiceModel.invoke ?: "NA" + location = curServiceModel.location ?: "NA" + requireNewTransaction = curServiceModel.requireNewTransaction ? uiLabelMap.CommonTrue : uiLabelMap.CommonFalse + + curServiceMap.engineName = engineName + curServiceMap.defaultEntityName = defaultEntityName + curServiceMap.invoke = invoke + curServiceMap.location = location + curServiceMap.definitionLocation = curServiceModel.definitionLocation.replaceFirst("file:/" + System.getProperty("ofbiz.home") + "/", "") + curServiceMap.requireNewTransaction = requireNewTransaction + curServiceMap.export = export + curServiceMap.exportBool = exportBool if (permissionGroups && !permissionGroups.equals("NA")) { - permList = new ArrayList(permissionGroups.size()); + permList = new ArrayList(permissionGroups.size()) permissionGroups.each { curPerm -> //This is a ModelPermGroup curPerm.permissions.each { curPermObj -> - permObj = [:]; - permObj.action = curPermObj.action; - permType = curPermObj.permissionType; + permObj = [:] + permObj.action = curPermObj.action + permType = curPermObj.permissionType if (permType == 1) { - permType = "Simple Permission"; + permType = "Simple Permission" } else if (permType == 2) { - permType = "Entity Permission"; + permType = "Entity Permission" } else if (permType == 3) { - permType = "Role Member"; + permType = "Role Member" } - permObj.permType = permType; - permObj.nameOrRole = curPermObj.nameOrRole; - permList.add(permObj); + permObj.permType = permType + permObj.nameOrRole = curPermObj.nameOrRole + permList.add(permObj) } } - curServiceMap.permissionGroups = permList; + curServiceMap.permissionGroups = permList } else { - curServiceMap.permissionGroups = permissionGroups; + curServiceMap.permissionGroups = permissionGroups } - curServiceMap.implServices = implServices; - curServiceMap.useTrans = useTrans; - curServiceMap.maxRetry = maxRetry; + curServiceMap.implServices = implServices + curServiceMap.useTrans = useTrans + curServiceMap.maxRetry = maxRetry - allParamsList = new ArrayList(3); + allParamsList = new ArrayList(3) - inParams = curServiceModel.getInParamNames(); - inParamsList = new ArrayList(inParams.size()); + inParams = curServiceModel.getInParamNames() + inParamsList = new ArrayList(inParams.size()) inParams.each { paramName -> - curParam = curServiceModel.getParam(paramName); - curInParam = [:]; - curInParam.entityName = curParam.entityName; - curInParam.fieldName = curParam.fieldName; - curInParam.internal = curParam.internal ? uiLabelMap.CommonTrue : uiLabelMap.CommonFalse; - curInParam.mode = curParam.mode; - curInParam.name = curParam.name; - curInParam.description = curParam.description; - curInParam.optional = curParam.optional ? uiLabelMap.CommonTrue : uiLabelMap.CommonFalse; - curInParam.type = curParam.type; - inParamsList.add(curInParam); + curParam = curServiceModel.getParam(paramName) + curInParam = [:] + curInParam.entityName = curParam.entityName + curInParam.fieldName = curParam.fieldName + curInParam.internal = curParam.internal ? uiLabelMap.CommonTrue : uiLabelMap.CommonFalse + curInParam.mode = curParam.mode + curInParam.name = curParam.name + curInParam.description = curParam.description + curInParam.optional = curParam.optional ? uiLabelMap.CommonTrue : uiLabelMap.CommonFalse + curInParam.type = curParam.type + inParamsList.add(curInParam) } - inParamMap = [:]; - inParamMap.title = uiLabelMap.WebtoolsInParameters; - inParamMap.paramList = inParamsList; - allParamsList.add(inParamMap); + inParamMap = [:] + inParamMap.title = uiLabelMap.WebtoolsInParameters + inParamMap.paramList = inParamsList + allParamsList.add(inParamMap) - outParams = curServiceModel.getOutParamNames(); - outParamsList = new ArrayList(outParams.size()); + outParams = curServiceModel.getOutParamNames() + outParamsList = new ArrayList(outParams.size()) outParams.each { paramName -> - curParam = curServiceModel.getParam(paramName); - curOutParam = [:]; - curOutParam.entityName = curParam.entityName; - curOutParam.fieldName = curParam.fieldName; - curOutParam.internal = curParam.internal ? uiLabelMap.CommonTrue : uiLabelMap.CommonFalse; - curOutParam.mode = curParam.mode; - curOutParam.name = curParam.name; - curOutParam.description = curParam.description; - curOutParam.optional = curParam.optional ? uiLabelMap.CommonTrue : uiLabelMap.CommonFalse; - curOutParam.type = curParam.type; - outParamsList.add(curOutParam); + curParam = curServiceModel.getParam(paramName) + curOutParam = [:] + curOutParam.entityName = curParam.entityName + curOutParam.fieldName = curParam.fieldName + curOutParam.internal = curParam.internal ? uiLabelMap.CommonTrue : uiLabelMap.CommonFalse + curOutParam.mode = curParam.mode + curOutParam.name = curParam.name + curOutParam.description = curParam.description + curOutParam.optional = curParam.optional ? uiLabelMap.CommonTrue : uiLabelMap.CommonFalse + curOutParam.type = curParam.type + outParamsList.add(curOutParam) } - outParamMap = [:]; - outParamMap.title = uiLabelMap.get("WebtoolsOutParameters"); - outParamMap.paramList = outParamsList; - allParamsList.add(outParamMap); + outParamMap = [:] + outParamMap.title = uiLabelMap.get("WebtoolsOutParameters") + outParamMap.paramList = outParamsList + allParamsList.add(outParamMap) if (overrideParameters) { - ovrPrmList = new ArrayList(overrideParameters.size()); + ovrPrmList = new ArrayList(overrideParameters.size()) overrideParameters.each { curParam -> - curOvrPrm = [:]; - curOvrPrm.entityName = curParam.entityName; - curOvrPrm.fieldName = curParam.fieldName; - curOvrPrm.internal = curParam.internal ? uiLabelMap.CommonTrue : uiLabelMap.CommonFalse; - curOvrPrm.mode = curParam.mode; - curOvrPrm.name = curParam.name; - curOvrPrm.description = curParam.description; - curOvrPrm.optional = curParam.optional ? uiLabelMap.CommonTrue : uiLabelMap.CommonFalse; - curOvrPrm.type = curParam.type; - ovrPrmList.add(curOvrPrm); - } - ovrParamMap = [:]; - ovrParamMap.title = "Override parameters"; - ovrParamMap.paramList = ovrPrmList; - allParamsList.add(ovrParamMap); + curOvrPrm = [:] + curOvrPrm.entityName = curParam.entityName + curOvrPrm.fieldName = curParam.fieldName + curOvrPrm.internal = curParam.internal ? uiLabelMap.CommonTrue : uiLabelMap.CommonFalse + curOvrPrm.mode = curParam.mode + curOvrPrm.name = curParam.name + curOvrPrm.description = curParam.description + curOvrPrm.optional = curParam.optional ? uiLabelMap.CommonTrue : uiLabelMap.CommonFalse + curOvrPrm.type = curParam.type + ovrPrmList.add(curOvrPrm) + } + ovrParamMap = [:] + ovrParamMap.title = "Override parameters" + ovrParamMap.paramList = ovrPrmList + allParamsList.add(ovrParamMap) } - curServiceMap.allParamsList = allParamsList; + curServiceMap.allParamsList = allParamsList } - showWsdl = parameters.show_wsdl; + showWsdl = parameters.show_wsdl if (showWsdl?.equals("true")) { try { - wsdl = curServiceModel.toWSDL("http://${request.getServerName()}:${EntityUtilProperties.getPropertyValue("url", "port.http", "80", delegator)}${parameters._CONTROL_PATH_}/SOAPService"); - curServiceMap.wsdl = UtilXml.writeXmlDocument(wsdl); + wsdl = curServiceModel.toWSDL("http://${request.getServerName()}:${EntityUtilProperties.getPropertyValue("url", "port.http", "80", delegator)}${parameters._CONTROL_PATH_}/SOAPService") + curServiceMap.wsdl = UtilXml.writeXmlDocument(wsdl) } catch (WSDLException ex) { - curServiceMap.wsdl = ex.getLocalizedMessage(); + curServiceMap.wsdl = ex.getLocalizedMessage() } - context.showWsdl = true; + context.showWsdl = true } - context.selectedServiceMap = curServiceMap; + context.selectedServiceMap = curServiceMap } if (!selectedService) { //get constraints if any - constraint = parameters.constraint; + constraint = parameters.constraint - serviceNames = curDispatchContext.getAllServiceNames(); - serviceNamesAlphaList = new ArrayList(26); - servicesList = new ArrayList(serviceNames.size()); - servicesFoundCount = 0; + serviceNames = curDispatchContext.getAllServiceNames() + serviceNamesAlphaList = new ArrayList(26) + servicesList = new ArrayList(serviceNames.size()) + servicesFoundCount = 0 serviceNames.each { serviceName -> //add first char of service name to list if (serviceName) { - serviceCharAt1 = serviceName[0]; + serviceCharAt1 = serviceName[0] if (!serviceNamesAlphaList.contains(serviceCharAt1)) { - serviceNamesAlphaList.add(serviceCharAt1); + serviceNamesAlphaList.add(serviceCharAt1) } } //create basic service def - curServiceMap = [:]; - curServiceMap.serviceName = serviceName; - curServiceModel = curDispatchContext.getModelService(serviceName); + curServiceMap = [:] + curServiceMap.serviceName = serviceName + curServiceModel = curDispatchContext.getModelService(serviceName) - canIncludeService = true; + canIncludeService = true if (constraint && curServiceModel != null) { - consArr = constraint.split("@"); - constraintName = consArr[0]; - constraintVal = consArr[1]; + consArr = constraint.split("@") + constraintName = consArr[0] + constraintVal = consArr[1] if (constraintName.equals("engine_name")) { - canIncludeService = curServiceModel.engineName.equals(constraintVal); + canIncludeService = curServiceModel.engineName.equals(constraintVal) if (constraintVal.equals("NA")) { - canIncludeService = curServiceModel.engineName ? false : true; + canIncludeService = curServiceModel.engineName ? false : true } } if (canIncludeService && constraintName.equals("default_entity_name")) { - canIncludeService = curServiceModel.defaultEntityName.equals(constraintVal); + canIncludeService = curServiceModel.defaultEntityName.equals(constraintVal) if (constraintVal.equals("NA")) { - canIncludeService = curServiceModel.defaultEntityName ? false : true; + canIncludeService = curServiceModel.defaultEntityName ? false : true } } if (canIncludeService && constraintName.equals("location")) { - canIncludeService = curServiceModel.location.equals(constraintVal); + canIncludeService = curServiceModel.location.equals(constraintVal) if (constraintVal.equals("NA")) { - canIncludeService = curServiceModel.location ? false : true; + canIncludeService = curServiceModel.location ? false : true } } if (canIncludeService && constraintName.equals("definitionLocation")) { - canIncludeService = curServiceModel.definitionLocation.equals(constraintVal); + canIncludeService = curServiceModel.definitionLocation.equals(constraintVal) } if (canIncludeService && constraintName.equals("alpha")) { - canIncludeService = (serviceName[0]).equals(constraintVal); + canIncludeService = (serviceName[0]).equals(constraintVal) if (constraintVal.equals("NA")) { - canIncludeService = true; + canIncludeService = true } } } if (curServiceModel != null && canIncludeService) { - engineName = curServiceModel.engineName ?: "NA"; - defaultEntityName = curServiceModel.defaultEntityName ?: "NA"; - invoke = curServiceModel.invoke ?: "NA"; - location = curServiceModel.location ?: "NA"; - requireNewTransaction = curServiceModel.requireNewTransaction; - - curServiceMap.engineName = engineName; - curServiceMap.defaultEntityName = defaultEntityName; - curServiceMap.invoke = invoke; - curServiceMap.location = location; - curServiceMap.definitionLocation = curServiceModel.definitionLocation.replaceFirst("file:/" + System.getProperty("ofbiz.home") + "/", ""); - curServiceMap.requireNewTransaction = requireNewTransaction; + engineName = curServiceModel.engineName ?: "NA" + defaultEntityName = curServiceModel.defaultEntityName ?: "NA" + invoke = curServiceModel.invoke ?: "NA" + location = curServiceModel.location ?: "NA" + requireNewTransaction = curServiceModel.requireNewTransaction + + curServiceMap.engineName = engineName + curServiceMap.defaultEntityName = defaultEntityName + curServiceMap.invoke = invoke + curServiceMap.location = location + curServiceMap.definitionLocation = curServiceModel.definitionLocation.replaceFirst("file:/" + System.getProperty("ofbiz.home") + "/", "") + curServiceMap.requireNewTransaction = requireNewTransaction - servicesList.add(curServiceMap); - servicesFoundCount++; + servicesList.add(curServiceMap) + servicesFoundCount++ } } - context.servicesList = servicesList; - context.serviceNamesAlphaList = serviceNamesAlphaList; - context.servicesFoundCount = servicesFoundCount; + context.servicesList = servicesList + context.serviceNamesAlphaList = serviceNamesAlphaList + context.servicesFoundCount = servicesFoundCount } Modified: ofbiz/trunk/framework/webtools/groovyScripts/service/JobDetails.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/groovyScripts/service/JobDetails.groovy?rev=1767764&r1=1767763&r2=1767764&view=diff ============================================================================== --- ofbiz/trunk/framework/webtools/groovyScripts/service/JobDetails.groovy (original) +++ ofbiz/trunk/framework/webtools/groovyScripts/service/JobDetails.groovy Wed Nov 2 19:09:13 2016 @@ -17,10 +17,10 @@ * under the License. */ -import org.apache.ofbiz.entity.Delegator; +import org.apache.ofbiz.entity.Delegator import org.apache.ofbiz.entity.GenericValue import org.apache.ofbiz.base.util.UtilGenerics -import org.apache.ofbiz.entity.serialize.XmlSerializer; +import org.apache.ofbiz.entity.serialize.XmlSerializer GenericValue job = ((Delegator)delegator).findOne("JobSandbox", [jobId:parameters.jobId], false) context.job = job |
Free forum by Nabble | Edit this page |