Modified: ofbiz/branches/executioncontext20090812/framework/common/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/framework/common/servicedef/services.xml?rev=810248&r1=810247&r2=810248&view=diff ============================================================================== --- ofbiz/branches/executioncontext20090812/framework/common/servicedef/services.xml (original) +++ ofbiz/branches/executioncontext20090812/framework/common/servicedef/services.xml Tue Sep 1 21:33:41 2009 @@ -207,6 +207,7 @@ <attribute name="entityName" type="String" mode="IN" optional="false"/> <attribute name="fieldList" type="java.util.List" mode="IN" optional="true"/> <attribute name="orderByList" type="java.util.List" mode="IN" optional="true"/> + <attribute name="maxRows" mode="IN" type="Integer" optional="true"/> <attribute name="entityConditionList" type="org.ofbiz.entity.condition.EntityConditionList" mode="IN" optional="true"/> <attribute name="noConditionFind" type="String" mode="IN" optional="true"><!-- find with no condition (empty entityConditionList) only done when this is Y --></attribute> <attribute name="distinct" type="String" mode="IN" optional="true"><!-- distinct find only done when this is Y --></attribute> @@ -224,6 +225,8 @@ <attribute name="distinct" type="String" mode="IN" optional="true"><!-- distinct find only done when this is Y --></attribute> <attribute name="filterByDate" type="String" mode="IN" optional="true"/> <attribute name="filterByDateValue" type="Timestamp" mode="IN" optional="true"/> + <attribute name="viewIndex" type="Integer" mode="IN" optional="true"/> + <attribute name="viewSize" type="Integer" mode="IN" optional="true"/> <attribute name="listIt" type="org.ofbiz.entity.util.EntityListIterator" mode="OUT" optional="true"/> <attribute name="queryString" type="String" mode="OUT" optional="true"/> <attribute name="queryStringMap" type="java.util.Map" mode="OUT" optional="true"/> Modified: ofbiz/branches/executioncontext20090812/framework/common/src/org/ofbiz/common/FindServices.java URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/framework/common/src/org/ofbiz/common/FindServices.java?rev=810248&r1=810247&r2=810248&view=diff ============================================================================== --- ofbiz/branches/executioncontext20090812/framework/common/src/org/ofbiz/common/FindServices.java (original) +++ ofbiz/branches/executioncontext20090812/framework/common/src/org/ofbiz/common/FindServices.java Tue Sep 1 21:33:41 2009 @@ -367,22 +367,23 @@ * @param context * @return Map */ - public static Map<String, Object> performFindList(DispatchContext dctx, Map<String, ?> context) { - Map<String, Object> result = performFind(dctx,context); - + public static Map<String, Object> performFindList(DispatchContext dctx, Map<String, Object> context) { Integer viewSize = (Integer) context.get("viewSize"); if (viewSize == null) viewSize = Integer.valueOf(20); // default + context.put("viewSize", viewSize); Integer viewIndex = (Integer) context.get("viewIndex"); if (viewIndex == null) viewIndex = Integer.valueOf(0); // default + context.put("viewIndex", viewIndex); + + Map<String, Object> result = performFind(dctx,context); int start = viewIndex.intValue() * viewSize.intValue(); List<GenericValue> list = null; Integer listSize = null; try { EntityListIterator it = (EntityListIterator) result.get("listIt"); - list = it.getPartialList(start+1, viewSize.intValue()); // list starts at '1' - it.last(); - listSize = Integer.valueOf(it.currentIndex()); + list = it.getPartialList(start+1, viewSize); // list starts at '1' + listSize = it.getResultsSizeAfterPartialList(); it.close(); } catch (Exception e) { Debug.logInfo("Problem getting partial list" + e,module); @@ -423,15 +424,22 @@ } Timestamp filterByDateValue = (Timestamp) context.get("filterByDateValue"); + Integer viewSize = (Integer) context.get("viewSize"); + Integer viewIndex = (Integer) context.get("viewIndex"); + Integer maxRows = null; + if (viewSize != null && viewIndex != null) { + maxRows = viewSize * (viewIndex + 1); + } + LocalDispatcher dispatcher = dctx.getDispatcher(); Map<String, Object> prepareResult = null; try { - prepareResult = dispatcher.runSync("prepareFind", UtilMisc.toMap("entityName", entityName, - "orderBy", orderBy, "inputFields", inputFields, "filterByDate", filterByDate, - "filterByDateValue", filterByDateValue, "userLogin", userLogin, - "locale", context.get("locale"), "timeZone", context.get("timeZone"), - "executionContext", context.get("executionContext"))); + prepareResult = dispatcher.runSync("prepareFind", UtilMisc.toMap("entityName", entityName, "orderBy", orderBy, + "inputFields", inputFields, "filterByDate", filterByDate, + "filterByDateValue", filterByDateValue, "userLogin", userLogin, + "locale", context.get("locale"), "timeZone", context.get("timeZone"), + "executionContext", context.get("executionContext"))); } catch (GenericServiceException gse) { return ServiceUtil.returnError("Error preparing conditions: " + gse.getMessage()); } @@ -440,8 +448,11 @@ Map<String, Object> executeResult = null; try { - executeResult = dispatcher.runSync("executeFind", UtilMisc.toMap("entityName", entityName, "orderByList", orderByList, "fieldList", fieldList, "entityConditionList", exprList, "noConditionFind", noConditionFind, "distinct", distinct, "locale", context.get("locale"), "timeZone", context.get("timeZone"), - "executionContext", context.get("executionContext"))); + executeResult = dispatcher.runSync("executeFind", UtilMisc.toMap("entityName", entityName, "orderByList", orderByList, + "fieldList", fieldList, "entityConditionList", exprList, + "noConditionFind", noConditionFind, "distinct", distinct, + "locale", context.get("locale"), "timeZone", context.get("timeZone"), + "maxRows", maxRows, "executionContext", context.get("executionContext"))); } catch (GenericServiceException gse) { return ServiceUtil.returnError("Error finding iterator: " + gse.getMessage()); } @@ -553,13 +564,15 @@ if (fieldList != null) { fieldSet = UtilMisc.makeSetWritable(fieldList); } + Integer maxRows = (Integer) context.get("maxRows"); + maxRows = maxRows != null ? maxRows : -1; GenericDelegator delegator = dctx.getDelegator(); // Retrieve entities - an iterator over all the values EntityListIterator listIt = null; try { if (noConditionFind || (entityConditionList != null && entityConditionList.getConditionListSize() > 0)) { listIt = delegator.find(entityName, entityConditionList, null, fieldSet, orderByList, - new EntityFindOptions(true, EntityFindOptions.TYPE_SCROLL_INSENSITIVE, EntityFindOptions.CONCUR_READ_ONLY, distinct)); + new EntityFindOptions(true, EntityFindOptions.TYPE_SCROLL_INSENSITIVE, EntityFindOptions.CONCUR_READ_ONLY, -1, maxRows, distinct)); } } catch (GenericEntityException e) { return ServiceUtil.returnError("Error running Find on the [" + entityName + "] entity: " + e.getMessage()); @@ -652,6 +665,7 @@ } return normalizedFields; } + /** * Returns the first generic item of the service 'performFind' * Same parameters as performFind service but returns a single GenericValue @@ -660,7 +674,9 @@ * @param context * @return */ - public static Map<String, Object> performFindItem(DispatchContext dctx, Map<String, ?> context) { + public static Map<String, Object> performFindItem(DispatchContext dctx, Map<String, Object> context) { + context.put("viewSize", 1); + context.put("viewIndex", 0); Map<String, Object> result = org.ofbiz.common.FindServices.performFind(dctx,context); List<GenericValue> list = null; Modified: ofbiz/branches/executioncontext20090812/framework/common/widget/LookupForms.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/framework/common/widget/LookupForms.xml?rev=810248&r1=810247&r2=810248&view=diff ============================================================================== --- ofbiz/branches/executioncontext20090812/framework/common/widget/LookupForms.xml (original) +++ ofbiz/branches/executioncontext20090812/framework/common/widget/LookupForms.xml Tue Sep 1 21:33:41 2009 @@ -43,6 +43,8 @@ <field-map field-name="inputFields" from-field="parameters"/> <field-map field-name="entityName" value="Geo"/> <field-map field-name="orderBy" value="geoName"/> + <field-map field-name="viewIndex" from-field="viewIndex"/> + <field-map field-name="viewSize" from-field="viewSize"/> </service> </actions> <field name="geoId" widget-style="buttontext" title="${uiLabelMap.CommonSegmentGroupGeoId}"> Modified: ofbiz/branches/executioncontext20090812/framework/entity/src/org/ofbiz/entity/finder/ListFinder.java URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/framework/entity/src/org/ofbiz/entity/finder/ListFinder.java?rev=810248&r1=810247&r2=810248&view=diff ============================================================================== --- ofbiz/branches/executioncontext20090812/framework/entity/src/org/ofbiz/entity/finder/ListFinder.java (original) +++ ofbiz/branches/executioncontext20090812/framework/entity/src/org/ofbiz/entity/finder/ListFinder.java Tue Sep 1 21:33:41 2009 @@ -193,6 +193,17 @@ EntityFindOptions options = new EntityFindOptions(); options.setDistinct(distinct); options.setResultSetType(resultSetType); + if (outputHandler instanceof LimitRange) { + LimitRange limitRange = (LimitRange) outputHandler; + int start = limitRange.getStart(context); + int size = limitRange.getSize(context); + options.setMaxRows(start + size); + } else if (outputHandler instanceof LimitView) { + LimitView limitView = (LimitView) outputHandler; + int index = limitView.getIndex(context); + int size = limitView.getSize(context); + options.setMaxRows(size * (index + 1)); + } boolean beganTransaction = false; try { if (useTransaction) { Modified: ofbiz/branches/executioncontext20090812/framework/entity/src/org/ofbiz/entity/jdbc/SQLProcessor.java URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/framework/entity/src/org/ofbiz/entity/jdbc/SQLProcessor.java?rev=810248&r1=810247&r2=810248&view=diff ============================================================================== --- ofbiz/branches/executioncontext20090812/framework/entity/src/org/ofbiz/entity/jdbc/SQLProcessor.java (original) +++ ofbiz/branches/executioncontext20090812/framework/entity/src/org/ofbiz/entity/jdbc/SQLProcessor.java Tue Sep 1 21:33:41 2009 @@ -26,8 +26,6 @@ import java.sql.*; import java.util.ArrayList; import java.util.List; -import java.util.Map; - import org.ofbiz.base.util.Debug; import org.ofbiz.entity.GenericDataSourceException; import org.ofbiz.entity.GenericEntityException; @@ -37,7 +35,7 @@ import org.ofbiz.entity.transaction.TransactionUtil; /** - * SQLProcessor - provides utitlity functions to ease database access + * SQLProcessor - provides utility functions to ease database access * */ public class SQLProcessor { @@ -60,9 +58,6 @@ private PreparedStatement _ps = null; // / The database resources to be used - private Statement _stmt = null; - - // / The database resources to be used private ResultSet _rs = null; private ResultSetMetaData _rsmd = null; @@ -79,9 +74,6 @@ // / true in case the connection shall be closed. private boolean _bDeleteConnection = false; - private Map<String, String> _needClobWorkAroundWrite = null; - private Map<String, String> _needBlobWorkAroundWrite = null; - /** * Construct an object based on the helper/datasource * @@ -218,17 +210,6 @@ _ps = null; } - if (_stmt != null) { - try { - _stmt.close(); - if (Debug.verboseOn()) Debug.logVerbose("SQLProcessor:close() statement close : _manualTX=" + _manualTX, module); - } catch (SQLException sqle) { - Debug.logWarning(sqle.getMessage(), module); - } - - _stmt = null; - } - if ((_connection != null) && _bDeleteConnection) { try { _connection.close(); @@ -404,7 +385,7 @@ } /** - * Execute a query baed ont SQL string given + * Execute a query based on the SQL string given * * @param sql The SQL string to be executed * @return The result set of the query @@ -476,7 +457,7 @@ } /** - * Getter: get the currently activ ResultSet + * Getter: get the currently active ResultSet * * @return ResultSet */ @@ -708,7 +689,7 @@ if (field != null) { _ps.setBoolean(_ind, field.booleanValue()); } else { - _ps.setNull(_ind, Types.NULL); // TODO: really should be Types.BOOLEAN, but that wasn't introduced until Java 1.4... hmmm what to do? + _ps.setNull(_ind, Types.BOOLEAN); } _ind++; } @@ -850,7 +831,7 @@ // do not set fetch size when using the cursor connection if (_connection instanceof CursorConnection) return; - // check if the statement was called with a specific fetchsize, if not grab the default from the datasource + // check if the statement was called with a specific fetch size, if not grab the default from the datasource if (fetchSize < 0) { DatasourceInfo ds = EntityConfigUtil.getDatasourceInfo(helperName); if (ds != null) { Modified: ofbiz/branches/executioncontext20090812/framework/entity/src/org/ofbiz/entity/util/EntityListIteratorImpl.java URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/framework/entity/src/org/ofbiz/entity/util/EntityListIteratorImpl.java?rev=810248&r1=810247&r2=810248&view=diff ============================================================================== --- ofbiz/branches/executioncontext20090812/framework/entity/src/org/ofbiz/entity/util/EntityListIteratorImpl.java (original) +++ ofbiz/branches/executioncontext20090812/framework/entity/src/org/ofbiz/entity/util/EntityListIteratorImpl.java Tue Sep 1 21:33:41 2009 @@ -32,6 +32,8 @@ import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericResultSetClosedException; import org.ofbiz.entity.GenericValue; +import org.ofbiz.entity.condition.EntityCondition; +import org.ofbiz.entity.datasource.GenericDAO; import org.ofbiz.entity.jdbc.SQLProcessor; import org.ofbiz.entity.jdbc.SqlJdbcUtil; import org.ofbiz.entity.model.ModelEntity; @@ -55,15 +57,28 @@ protected boolean closed = false; protected boolean haveMadeValue = false; protected GenericDelegator delegator = null; + protected GenericDAO genericDAO = null; + protected EntityCondition whereCondition = null; + protected EntityCondition havingCondition = null; + protected boolean distinctQuery = false; private boolean haveShowHasNextWarning = false; + private Integer resultSize = null; public EntityListIteratorImpl(SQLProcessor sqlp, ModelEntity modelEntity, List<ModelField> selectFields, ModelFieldTypeReader modelFieldTypeReader) { + this(sqlp, modelEntity, selectFields, modelFieldTypeReader, null, null, null, false); + } + + public EntityListIteratorImpl(SQLProcessor sqlp, ModelEntity modelEntity, List<ModelField> selectFields, ModelFieldTypeReader modelFieldTypeReader, GenericDAO genericDAO, EntityCondition whereCondition, EntityCondition havingCondition, boolean distinctQuery) { this.sqlp = sqlp; this.resultSet = sqlp.getResultSet(); this.modelEntity = modelEntity; this.selectFields = selectFields; this.modelFieldTypeReader = modelFieldTypeReader; + this.genericDAO = genericDAO; + this.whereCondition = whereCondition; + this.havingCondition = havingCondition; + this.distinctQuery = distinctQuery; } public EntityListIteratorImpl(ResultSet resultSet, ModelEntity modelEntity, List<ModelField> selectFields, ModelFieldTypeReader modelFieldTypeReader) { @@ -74,16 +89,11 @@ this.modelFieldTypeReader = modelFieldTypeReader; } - /* (non-Javadoc) - * @see org.ofbiz.entity.util.EntityListIterator#setDelegator(org.ofbiz.entity.GenericDelegator) - */ public void setDelegator(GenericDelegator delegator) { this.delegator = delegator; } - /* (non-Javadoc) - * @see org.ofbiz.entity.util.EntityListIterator#afterLast() - */ + /** Sets the cursor position to just after the last result so that previous() will return the last result */ public void afterLast() throws GenericEntityException { try { resultSet.afterLast(); @@ -96,9 +106,7 @@ } } - /* (non-Javadoc) - * @see org.ofbiz.entity.util.EntityListIterator#beforeFirst() - */ + /** Sets the cursor position to just before the first result so that next() will return the first result */ public void beforeFirst() throws GenericEntityException { try { resultSet.beforeFirst(); @@ -111,9 +119,7 @@ } } - /* (non-Javadoc) - * @see org.ofbiz.entity.util.EntityListIterator#last() - */ + /** Sets the cursor position to last result; if result set is empty returns false */ public boolean last() throws GenericEntityException { try { return resultSet.last(); @@ -126,9 +132,7 @@ } } - /* (non-Javadoc) - * @see org.ofbiz.entity.util.EntityListIterator#first() - */ + /** Sets the cursor position to first result; if result set is empty returns false */ public boolean first() throws GenericEntityException { try { return resultSet.first(); @@ -141,9 +145,6 @@ } } - /* (non-Javadoc) - * @see org.ofbiz.entity.util.EntityListIterator#close() - */ public void close() throws GenericEntityException { if (closed) { //maybe not the best way: throw new GenericResultSetClosedException("This EntityListIterator has been closed, this operation cannot be performed"); @@ -165,9 +166,7 @@ } } - /* (non-Javadoc) - * @see org.ofbiz.entity.util.EntityListIterator#currentGenericValue() - */ + /** NOTE: Calling this method does return the current value, but so does calling next() or previous(), so calling one of those AND this method will cause the value to be created twice */ public GenericValue currentGenericValue() throws GenericEntityException { if (closed) throw new GenericResultSetClosedException("This EntityListIterator has been closed, this operation cannot be performed"); @@ -188,9 +187,6 @@ return value; } - /* (non-Javadoc) - * @see org.ofbiz.entity.util.EntityListIterator#currentIndex() - */ public int currentIndex() throws GenericEntityException { if (closed) throw new GenericResultSetClosedException("This EntityListIterator has been closed, this operation cannot be performed"); @@ -205,8 +201,10 @@ } } - /* (non-Javadoc) - * @see org.ofbiz.entity.util.EntityListIterator#absolute(int) + /** performs the same function as the ResultSet.absolute method; + * if rowNum is positive, goes to that position relative to the beginning of the list; + * if rowNum is negative, goes to that position relative to the end of the list; + * a rowNum of 1 is the same as first(); a rowNum of -1 is the same as last() */ public boolean absolute(int rowNum) throws GenericEntityException { if (closed) throw new GenericResultSetClosedException("This EntityListIterator has been closed, this operation cannot be performed"); @@ -222,8 +220,9 @@ } } - /* (non-Javadoc) - * @see org.ofbiz.entity.util.EntityListIterator#relative(int) + /** performs the same function as the ResultSet.relative method; + * if rows is positive, goes forward relative to the current position; + * if rows is negative, goes backward relative to the current position; */ public boolean relative(int rows) throws GenericEntityException { if (closed) throw new GenericResultSetClosedException("This EntityListIterator has been closed, this operation cannot be performed"); @@ -410,9 +409,6 @@ } } - /* (non-Javadoc) - * @see org.ofbiz.entity.util.EntityListIterator#setFetchSize(int) - */ public void setFetchSize(int rows) throws GenericEntityException { try { resultSet.setFetchSize(rows); @@ -425,9 +421,6 @@ } } - /* (non-Javadoc) - * @see org.ofbiz.entity.util.EntityListIterator#getCompleteList() - */ public List<GenericValue> getCompleteList() throws GenericEntityException { try { // if the resultSet has been moved forward at all, move back to the beginning @@ -457,8 +450,8 @@ } } - /* (non-Javadoc) - * @see org.ofbiz.entity.util.EntityListIterator#getPartialList(int, int) + /** Gets a partial list of results starting at start and containing at most number elements. + * Start is a one based value, ie 1 is the first element. */ public List<GenericValue> getPartialList(int start, int number) throws GenericEntityException { try { @@ -475,7 +468,7 @@ } } else { // if can't reposition to desired index, throw exception - if (!resultSet.absolute(start)) { + if (!this.absolute(start)) { // maybe better to just return an empty list here... return list; //throw new GenericEntityException("Could not move to the start position of " + start + ", there are probably not that many results for this find."); @@ -510,11 +503,18 @@ } } - /* (non-Javadoc) - * @see org.ofbiz.entity.util.EntityListIterator#getResultsSizeAfterPartialList() - */ public int getResultsSizeAfterPartialList() throws GenericEntityException { - if (this.last()) { + if (genericDAO != null) { + if (resultSize == null) { + EntityFindOptions efo = null; + if (distinctQuery) { + efo = new EntityFindOptions(); + efo.setDistinct(distinctQuery); + } + resultSize = (int) genericDAO.selectCountByCondition(modelEntity, whereCondition, havingCondition, efo); + } + return resultSize; + } else if (this.last()) { return this.currentIndex(); } else { // evidently no valid rows in the ResultSet, so return 0 Modified: ofbiz/branches/executioncontext20090812/framework/example/widget/example/ExampleFeatureForms.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/framework/example/widget/example/ExampleFeatureForms.xml?rev=810248&r1=810247&r2=810248&view=diff ============================================================================== --- ofbiz/branches/executioncontext20090812/framework/example/widget/example/ExampleFeatureForms.xml (original) +++ ofbiz/branches/executioncontext20090812/framework/example/widget/example/ExampleFeatureForms.xml Tue Sep 1 21:33:41 2009 @@ -35,6 +35,8 @@ <service service-name="performFind" result-map="result" result-map-list="listIt"> <field-map field-name="inputFields" from-field="exampleFeatureCtx"/> <field-map field-name="entityName" value="ExampleFeature"/> + <field-map field-name="viewIndex" from-field="viewIndex"/> + <field-map field-name="viewSize" from-field="viewSize"/> </service> </actions> <field name="exampleFeatureId" title="${uiLabelMap.ExampleExampleFeatureId}" widget-style="buttontext"> @@ -147,6 +149,8 @@ <field-map field-name="inputFields" from-field="parameters"/> <field-map field-name="orderBy" value="description"/> <field-map field-name="entityName" value="ExampleFeature"/> + <field-map field-name="viewIndex" from-field="viewIndex"/> + <field-map field-name="viewSize" from-field="viewSize"/> </service> </actions> <!--<auto-fields-entity entity-name="ExampleFeature" default-field-type="display"/>--> Modified: ofbiz/branches/executioncontext20090812/framework/example/widget/example/ExampleForms.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/framework/example/widget/example/ExampleForms.xml?rev=810248&r1=810247&r2=810248&view=diff ============================================================================== --- ofbiz/branches/executioncontext20090812/framework/example/widget/example/ExampleForms.xml (original) +++ ofbiz/branches/executioncontext20090812/framework/example/widget/example/ExampleForms.xml Tue Sep 1 21:33:41 2009 @@ -50,6 +50,8 @@ <field-map field-name="inputFields" from-field="exampleCtx"/> <field-map field-name="entityName" value="Example"/> <field-map field-name="orderBy" from-field="parameters.sortField"/> + <field-map field-name="viewIndex" from-field="viewIndex"/> + <field-map field-name="viewSize" from-field="viewSize"/> </service> </actions> <alt-row-style use-when=""EXST_APPROVED".equals(statusId)" style="Validate"/> Modified: ofbiz/branches/executioncontext20090812/framework/service/src/org/ofbiz/service/job/JobManager.java URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/framework/service/src/org/ofbiz/service/job/JobManager.java?rev=810248&r1=810247&r2=810248&view=diff ============================================================================== --- ofbiz/branches/executioncontext20090812/framework/service/src/org/ofbiz/service/job/JobManager.java (original) +++ ofbiz/branches/executioncontext20090812/framework/service/src/org/ofbiz/service/job/JobManager.java Tue Sep 1 21:33:41 2009 @@ -210,9 +210,11 @@ String instanceId = UtilProperties.getPropertyValue("general.properties", "unique.instanceId", "ofbiz0"); List<GenericValue> crashed = null; - List<EntityExpr> exprs = UtilMisc.toList(EntityCondition.makeCondition("finishDateTime", null)); - exprs.add(EntityCondition.makeCondition("cancelDateTime", null)); - exprs.add(EntityCondition.makeCondition("runByInstanceId", instanceId)); + List<EntityExpr> exprs = UtilMisc.toList(EntityCondition.makeCondition("runByInstanceId", instanceId)); + List<String> openStatuses = UtilMisc.toList("SERVICE_PENDING", + "SERVICE_QUEUED", + "SERVICE_RUNNING"); + exprs.add(EntityCondition.makeCondition("statusId", EntityOperator.IN, openStatuses)); EntityConditionList<EntityExpr> ecl = EntityCondition.makeCondition(exprs); try { Modified: ofbiz/branches/executioncontext20090812/framework/webtools/config/WebtoolsUiLabels.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/framework/webtools/config/WebtoolsUiLabels.xml?rev=810248&r1=810247&r2=810248&view=diff ============================================================================== --- ofbiz/branches/executioncontext20090812/framework/webtools/config/WebtoolsUiLabels.xml (original) +++ ofbiz/branches/executioncontext20090812/framework/webtools/config/WebtoolsUiLabels.xml Tue Sep 1 21:33:41 2009 @@ -1082,6 +1082,10 @@ <value xml:lang="th">à¹à¸à¸£à¸·à¹à¸à¸à¸¡à¸·à¸ Entity XML </value> <value xml:lang="zh">å®ä½XMLå·¥å ·</value> </property> + <property key="WebtoolsEnvName"> + <value xml:lang="en">Env Name</value> + <value xml:lang="fr">Nom de var. d'env.</value> + </property> <property key="WebtoolsErrorLogLevel"> <value xml:lang="en">Error</value> <value xml:lang="fr">Erreur</value> @@ -1386,7 +1390,7 @@ </property> <property key="WebtoolsInParameters"> <value xml:lang="en">In parameters</value> - <value xml:lang="fr">Dans les paramètres</value> + <value xml:lang="fr">Paramètres en entrée</value> <value xml:lang="it">Parametri in Ingresso</value> <value xml:lang="ro">Parametri de Intrare</value> <value xml:lang="th">à¸à¹à¸²à¸à¸±à¸§à¹à¸à¸£</value> @@ -2659,6 +2663,10 @@ <value xml:lang="th">รายà¸à¸²à¸£ Services สำหรัà¸</value> <value xml:lang="zh">æå¡å表ï¼</value> </property> + <property key="WebtoolsSet"> + <value xml:lang="en">Set</value> + <value xml:lang="fr">Affectation</value> + </property> <property key="WebtoolsShowShowWSDL"> <value xml:lang="en">Show wsdl</value> <value xml:lang="fr">Montrer WSDL</value> Modified: ofbiz/branches/executioncontext20090812/framework/webtools/webapp/webtools/WEB-INF/actions/entity/FindGeneric.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/framework/webtools/webapp/webtools/WEB-INF/actions/entity/FindGeneric.groovy?rev=810248&r1=810247&r2=810248&view=diff ============================================================================== --- ofbiz/branches/executioncontext20090812/framework/webtools/webapp/webtools/WEB-INF/actions/entity/FindGeneric.groovy (original) +++ ofbiz/branches/executioncontext20090812/framework/webtools/webapp/webtools/WEB-INF/actions/entity/FindGeneric.groovy Tue Sep 1 21:33:41 2009 @@ -150,14 +150,13 @@ } condition = EntityCondition.makeCondition(conditionList, EntityOperator.AND); - // DEJ 20080701 avoid using redundant query, will use eli.getResultsSizeAfterPartialList() below instead: arraySize = (int) delegator.findCountByCondition(entityName, condition, null, null); - if ((highIndex - lowIndex + 1) > 0) { boolean beganTransaction = false; try { beganTransaction = TransactionUtil.begin(); EntityFindOptions efo = new EntityFindOptions(); + efo.setMaxRows(highIndex); efo.setResultSetType(EntityFindOptions.TYPE_SCROLL_INSENSITIVE); EntityListIterator resultEli = null; fieldsToSelect = null; Modified: ofbiz/branches/executioncontext20090812/framework/webtools/webapp/webtools/WEB-INF/actions/service/AvailableServices.groovy URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/framework/webtools/webapp/webtools/WEB-INF/actions/service/AvailableServices.groovy?rev=810248&r1=810247&r2=810248&view=diff ============================================================================== --- ofbiz/branches/executioncontext20090812/framework/webtools/webapp/webtools/WEB-INF/actions/service/AvailableServices.groovy (original) +++ ofbiz/branches/executioncontext20090812/framework/webtools/webapp/webtools/WEB-INF/actions/service/AvailableServices.groovy Tue Sep 1 21:33:41 2009 @@ -77,96 +77,141 @@ actions.setAccessible(true); actionsVal = actions.get(curRule); if (actionsVal) { - actionsList = new ArrayList(actionsVal.size()); + actionsList = new ArrayList(); + setsList = new ArrayList(); actionsVal.each { curAction -> - actionMap = [:]; actionClass = curAction.getClass(); + if (org.ofbiz.service.eca.ServiceEcaAction.equals(actionClass)) { + actionMap = [:]; - //eventName - eventName = actionClass.getDeclaredField("eventName"); - eventName.setAccessible(true); - eventNameVal = eventName.get(curAction); - if (eventNameVal) { - actionMap.eventName = eventNameVal as String; - } - eventName.setAccessible(false); - - //ignoreError - ignoreError = actionClass.getDeclaredField("ignoreError"); - ignoreError.setAccessible(true); - ignoreErrorVal = ignoreError.get(curAction); - if (ignoreErrorVal) { - actionMap.ignoreError = ignoreErrorVal as String; - } - ignoreError.setAccessible(false); - - //ignoreFailure - ignoreFailure = actionClass.getDeclaredField("ignoreFailure"); - ignoreFailure.setAccessible(true); - ignoreFailureVal = ignoreFailure.get(curAction); - if (ignoreFailureVal) { - actionMap.ignoreFailure = ignoreFailureVal as String; - } - ignoreFailure.setAccessible(false); - - //persist - persist = actionClass.getDeclaredField("persist"); - persist.setAccessible(true); - persistVal = persist.get(curAction); - if (persistVal) { - actionMap.persist = persistVal as String; - } - persist.setAccessible(false); - - //resultMapName - resultMapName = actionClass.getDeclaredField("resultMapName"); - resultMapName.setAccessible(true); - resultMapNameVal = resultMapName.get(curAction); - if (resultMapNameVal) { - actionMap.resultMapName = resultMapNameVal as String; - } - resultMapName.setAccessible(false); - - //resultToContext - resultToContext = actionClass.getDeclaredField("resultToContext"); - resultToContext.setAccessible(true); - resultToContextVal = resultToContext.get(curAction); - if (resultToContextVal) { - actionMap.resultToContext = resultToContextVal as String; - } - resultToContext.setAccessible(false); - - //resultToResult - resultToResult = actionClass.getDeclaredField("resultToResult"); - resultToResult.setAccessible(true); - resultToResultVal = resultToResult.get(curAction); - if (resultToResultVal) { - actionMap.resultToResult = resultToResultVal as String; - } - resultToResult.setAccessible(false); - - //serviceMode - serviceMode = actionClass.getDeclaredField("serviceMode"); - serviceMode.setAccessible(true); - serviceModeVal = serviceMode.get(curAction); - if (serviceModeVal) { - actionMap.serviceMode = serviceModeVal as String; - } - serviceMode.setAccessible(false); - - //serviceName - serviceName = actionClass.getDeclaredField("serviceName"); - serviceName.setAccessible(true); - serviceNameVal = serviceName.get(curAction); - if (serviceNameVal) { - actionMap.serviceName = serviceNameVal as String; - } - serviceName.setAccessible(false); + //eventName + eventName = actionClass.getDeclaredField("eventName"); + eventName.setAccessible(true); + eventNameVal = eventName.get(curAction); + if (eventNameVal) { + actionMap.eventName = eventNameVal as String; + } + eventName.setAccessible(false); + + //ignoreError + ignoreError = actionClass.getDeclaredField("ignoreError"); + ignoreError.setAccessible(true); + ignoreErrorVal = ignoreError.get(curAction); + if (ignoreErrorVal) { + actionMap.ignoreError = ignoreErrorVal as String; + } + ignoreError.setAccessible(false); + + //ignoreFailure + ignoreFailure = actionClass.getDeclaredField("ignoreFailure"); + ignoreFailure.setAccessible(true); + ignoreFailureVal = ignoreFailure.get(curAction); + if (ignoreFailureVal) { + actionMap.ignoreFailure = ignoreFailureVal as String; + } + ignoreFailure.setAccessible(false); + + //persist + persist = actionClass.getDeclaredField("persist"); + persist.setAccessible(true); + persistVal = persist.get(curAction); + if (persistVal) { + actionMap.persist = persistVal as String; + } + persist.setAccessible(false); + + //resultMapName + resultMapName = actionClass.getDeclaredField("resultMapName"); + resultMapName.setAccessible(true); + resultMapNameVal = resultMapName.get(curAction); + if (resultMapNameVal) { + actionMap.resultMapName = resultMapNameVal as String; + } + resultMapName.setAccessible(false); + + //resultToContext + resultToContext = actionClass.getDeclaredField("resultToContext"); + resultToContext.setAccessible(true); + resultToContextVal = resultToContext.get(curAction); + if (resultToContextVal) { + actionMap.resultToContext = resultToContextVal as String; + } + resultToContext.setAccessible(false); + + //resultToResult + resultToResult = actionClass.getDeclaredField("resultToResult"); + resultToResult.setAccessible(true); + resultToResultVal = resultToResult.get(curAction); + if (resultToResultVal) { + actionMap.resultToResult = resultToResultVal as String; + } + resultToResult.setAccessible(false); + + //serviceMode + serviceMode = actionClass.getDeclaredField("serviceMode"); + serviceMode.setAccessible(true); + serviceModeVal = serviceMode.get(curAction); + if (serviceModeVal) { + actionMap.serviceMode = serviceModeVal as String; + } + serviceMode.setAccessible(false); + + //serviceName + serviceName = actionClass.getDeclaredField("serviceName"); + serviceName.setAccessible(true); + serviceNameVal = serviceName.get(curAction); + if (serviceNameVal) { + actionMap.serviceName = serviceNameVal as String; + } + serviceName.setAccessible(false); + + actionsList.add(actionMap); + + } else { // FIXME : we should also show field-names and values for set operation + setMap = [:]; + + // fieldName + fieldName = actionClass.getDeclaredField("fieldName"); + fieldName.setAccessible(true); + fieldNameVal = fieldName.get(curAction); + if (fieldNameVal) { + setMap.fieldName = fieldNameVal as String; + } + fieldName.setAccessible(false); + + // envName + envName = actionClass.getDeclaredField("envName"); + envName.setAccessible(true); + envNameVal = envName.get(curAction); + if (envNameVal) { + setMap.envName = envNameVal as String; + } + envName.setAccessible(false); + + // value + value = actionClass.getDeclaredField("value"); + value.setAccessible(true); + valueVal = value.get(curAction); + if (valueVal) { + setMap.value = valueVal as String; + } + value.setAccessible(false); + + // format + format = actionClass.getDeclaredField("format"); + format.setAccessible(true); + formatVal = format.get(curAction); + if (formatVal) { + setMap.format = formatVal as String; + } + format.setAccessible(false); - actionsList.add(actionMap); + setsList.add(setMap); + } } curRuleMap.actions = actionsList; + curRuleMap.sets= setsList; } actions.setAccessible(true); Modified: ofbiz/branches/executioncontext20090812/framework/webtools/webapp/webtools/service/ServiceForms.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/framework/webtools/webapp/webtools/service/ServiceForms.xml?rev=810248&r1=810247&r2=810248&view=diff ============================================================================== --- ofbiz/branches/executioncontext20090812/framework/webtools/webapp/webtools/service/ServiceForms.xml (original) +++ ofbiz/branches/executioncontext20090812/framework/webtools/webapp/webtools/service/ServiceForms.xml Tue Sep 1 21:33:41 2009 @@ -77,6 +77,8 @@ <field-map field-name="inputFields" from-field="jobCtx"/> <field-map field-name="entityName" value="JobSandbox"/> <field-map field-name="orderBy" from-field="parameters.sortField"/> + <field-map field-name="viewIndex" from-field="viewIndex"/> + <field-map field-name="viewSize" from-field="viewSize"/> </service> </actions> <field name="jobName" title="${uiLabelMap.WebtoolsJob}" sort-field="true"><display/></field> Modified: ofbiz/branches/executioncontext20090812/framework/webtools/webapp/webtools/service/availableservices.ftl URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/framework/webtools/webapp/webtools/service/availableservices.ftl?rev=810248&r1=810247&r2=810248&view=diff ============================================================================== --- ofbiz/branches/executioncontext20090812/framework/webtools/webapp/webtools/service/availableservices.ftl (original) +++ ofbiz/branches/executioncontext20090812/framework/webtools/webapp/webtools/service/availableservices.ftl Tue Sep 1 21:33:41 2009 @@ -151,18 +151,27 @@ <table class="basic-table" cellspacing='0'> <tr class="header-row"> <td>${uiLabelMap.WebtoolsEventName}</td> - <td>${uiLabelMap.WebtoolsRunOnError}</td> - <td>${uiLabelMap.WebtoolsRunOnFailure}</td> + <#if ecaMapList.runOnError?exists> + <td>${uiLabelMap.WebtoolsRunOnError}</td> + </#if> + <#if ecaMapList.runOnFailure?exists> + <td>${uiLabelMap.WebtoolsRunOnFailure}</td> + </#if> <td>${uiLabelMap.WebtoolsActions}</td> <td>${uiLabelMap.WebtoolsConditions}</td> + <td>${uiLabelMap.WebtoolsSet}</td> </tr> <#list ecaMapList as ecaMap> <tr> <td>${ecaMap.eventName?if_exists}</td> - <td>${ecaMap.runOnError?if_exists}</div></td> - <td>${ecaMap.runOnFailure?if_exists}</div></td> - <td> - <#if ecaMap.actions?exists && ecaMap.actions?has_content> + <#if ecaMap.runOnError?exists> + <td>${ecaMap.runOnError}</div></td> + </#if> + <#if ecaMap.runOnFailure?exists> + <td>${ecaMap.runOnFailure}</div></td> + </#if> + <#if ecaMap.actions?has_content> + <td> <#list ecaMap.actions as action> <table class="basic-table" cellspacing='0'> <tr> @@ -186,17 +195,17 @@ </tr> </table> </#list> - </#if> - </td> - <td> - <#if ecaMap.conditions?exists && ecaMap.conditions?has_content> + </td> + </#if> + <#if ecaMap.conditions?has_content> + <td> <#list ecaMap.conditions as condition> <table class='basic-table' cellspacing='0'> <tr> <td><b>${uiLabelMap.WebtoolsCompareType}</b> ${condition.compareType?default(uiLabelMap.CommonNA)}</td> <td> <b>${uiLabelMap.WebtoolsConditionService}</b> - <#if condition.conditionService?exists && condition.conditionService?has_content> + <#if condition.conditionService?has_content> <a href='<@ofbizUrl>${url}?sel_service_name=${condition.conditionService}</@ofbizUrl>'>${condition.conditionService?default(uiLabelMap.CommonNA)}</a> <#else> ${condition.conditionService?default(uiLabelMap.CommonNA)} @@ -221,8 +230,38 @@ </tr> </table><br/> </#list> - </#if> - </td> + </td> + </#if> + <#if ecaMap.sets?has_content> + <td> + <#list ecaMap.sets as set> + <table class='basic-table' cellspacing='0'> + <tr> + <td><b>${uiLabelMap.WebtoolsFieldName}</b> ${set.fieldName?default(uiLabelMap.CommonNA)}</td> + <td colspan="2"> </td> + </tr> + <tr> + <#if set.envName?has_content> + <td><b>${uiLabelMap.WebtoolsEnvName}</b> ${set.envName}</td> + <td colspan="2"> </td> + </#if> + </tr> + <tr> + <#if set.value?has_content> + <td><b>${uiLabelMap.CommonValue}</b> ${set.value}</td> + <td colspan="2"> </td> + </#if> + </tr> + <tr> + <#if set.format?has_content> + <td><b>${uiLabelMap.WebtoolsFormat}</b> ${set.format}</td> + <td colspan="2"> </td> + </#if> + </tr> + </table><br/> + </#list> + </td> + </#if> </tr> <tr><td colspan='5'><hr></td></tr> </#list> Modified: ofbiz/branches/executioncontext20090812/framework/webtools/webapp/webtools/tempexpr/tempExprForms.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/framework/webtools/webapp/webtools/tempexpr/tempExprForms.xml?rev=810248&r1=810247&r2=810248&view=diff ============================================================================== --- ofbiz/branches/executioncontext20090812/framework/webtools/webapp/webtools/tempexpr/tempExprForms.xml (original) +++ ofbiz/branches/executioncontext20090812/framework/webtools/webapp/webtools/tempexpr/tempExprForms.xml Tue Sep 1 21:33:41 2009 @@ -57,6 +57,8 @@ <service service-name="performFind" result-map="result" result-map-list="listIt"> <field-map field-name="inputFields" from-field="parameters"/> <field-map field-name="entityName" value="TemporalExpression"/> + <field-map field-name="viewIndex" from-field="viewIndex"/> + <field-map field-name="viewSize" from-field="viewSize"/> </service> </actions> </form> Modified: ofbiz/branches/executioncontext20090812/framework/widget/src/org/ofbiz/widget/form/ModelForm.java URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/framework/widget/src/org/ofbiz/widget/form/ModelForm.java?rev=810248&r1=810247&r2=810248&view=diff ============================================================================== --- ofbiz/branches/executioncontext20090812/framework/widget/src/org/ofbiz/widget/form/ModelForm.java (original) +++ ofbiz/branches/executioncontext20090812/framework/widget/src/org/ofbiz/widget/form/ModelForm.java Tue Sep 1 21:33:41 2009 @@ -789,6 +789,12 @@ executionContext.pushExecutionArtifact(this); AccessController accessController = executionContext.getAccessController(); accessController.checkPermission(View); + // increment the paginator + this.incrementPaginatorNumber(context); + // Populate the viewSize and viewIndex so they are available for use during form actions + context.put("viewIndex", this.getViewIndex(context)); + context.put("viewSize", this.getViewSize(context)); + runFormActions(context); setWidgetBoundaryComments(context); @@ -1293,8 +1299,6 @@ public void preparePager(Map<String, Object> context) { - // increment the paginator - this.incrementPaginatorNumber(context); this.rowCount = 0; String lookupName = this.getListName(); if (UtilValidate.isEmpty(lookupName)) { @@ -1352,7 +1356,7 @@ if (iter instanceof EntityListIterator) { try { - ((EntityListIterator) iter).first(); + ((EntityListIterator) iter).beforeFirst(); } catch (GenericEntityException e) { Debug.logError(e, "Error rewinding list form render EntityListIterator: " + e.toString(), module); } @@ -2439,9 +2443,7 @@ } else if (entryList instanceof EntityListIterator) { EntityListIterator iter = (EntityListIterator) entryList; try { - iter.last(); - listSize = iter.currentIndex(); - iter.beforeFirst(); + listSize = iter.getResultsSizeAfterPartialList(); } catch (GenericEntityException e) { Debug.logError(e, "Error getting list size", module); listSize = 0; Modified: ofbiz/branches/executioncontext20090812/framework/widget/src/org/ofbiz/widget/screen/ModelScreenWidget.java URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/framework/widget/src/org/ofbiz/widget/screen/ModelScreenWidget.java?rev=810248&r1=810247&r2=810248&view=diff ============================================================================== --- ofbiz/branches/executioncontext20090812/framework/widget/src/org/ofbiz/widget/screen/ModelScreenWidget.java (original) +++ ofbiz/branches/executioncontext20090812/framework/widget/src/org/ofbiz/widget/screen/ModelScreenWidget.java Tue Sep 1 21:33:41 2009 @@ -18,8 +18,10 @@ *******************************************************************************/ package org.ofbiz.widget.screen; +import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.Serializable; +import java.io.StringWriter; import java.util.Collection; import java.util.HashMap; import java.util.List; @@ -28,9 +30,21 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.xml.parsers.ParserConfigurationException; +import javax.xml.parsers.SAXParserFactory; +import javax.xml.transform.Transformer; +import javax.xml.transform.TransformerException; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.sax.SAXResult; +import javax.xml.transform.sax.SAXSource; +import javax.xml.transform.stream.StreamResult; +import javax.xml.transform.stream.StreamSource; import javolution.util.FastList; +import org.apache.fop.apps.FOUserAgent; +import org.apache.fop.apps.Fop; +import org.apache.fop.apps.FopFactory; +import org.apache.fop.apps.MimeConstants; import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.GeneralException; import org.ofbiz.base.util.StringUtil; @@ -60,8 +74,13 @@ import org.ofbiz.widget.tree.TreeFactory; import org.ofbiz.widget.tree.TreeStringRenderer; import org.ofbiz.widget.xml.XmlFormRenderer; +import org.ofbiz.webapp.control.RequestHandler; +import org.ofbiz.webapp.control.RequestHandlerException; +import org.ofbiz.webapp.view.ApacheFopWorker; import org.w3c.dom.Element; +import org.xml.sax.InputSource; import org.xml.sax.SAXException; +import org.xml.sax.XMLReader; /** * Widget Library - Screen model class @@ -1090,10 +1109,76 @@ if (dataResource != null) { mimeTypeId = dataResource.getString("mimeTypeId"); } + if (UtilValidate.isNotEmpty(content.get("mimeTypeId"))) { + mimeTypeId = content.getString("mimeTypeId"); + } if (UtilValidate.isNotEmpty(mimeTypeId) - && ((mimeTypeId.indexOf("application") >= 0) || (mimeTypeId.indexOf("image")) >= 0)) { - screenStringRenderer.renderContentFrame(writer, context, this); + && ((mimeTypeId.indexOf("application") >= 0) || (mimeTypeId.indexOf("image")) >= 0)) { + if (mimeTypeId.equals("application/pdf")) { + TransformerFactory tfactory = TransformerFactory.newInstance(); + try{ + + // + // this part is not working. If somebody can help to make it work? + // currently using only real temp files for debugging purposes. + // + // most of the code should be replaced by functions in xslTransform.java and other files. + // for debugging here mostly code using the code outside of ofbiz. + // + SAXParserFactory pfactory= SAXParserFactory.newInstance(); + pfactory.setNamespaceAware(true); + pfactory.setValidating(true); + pfactory.setXIncludeAware(true); + XMLReader reader = null; + try { + reader = pfactory.newSAXParser().getXMLReader(); + } catch (Exception e) { + throw new TransformerException("Error creating SAX parser/reader", e); + } + + // do the actual preprocessing fr includes + SAXSource source = new SAXSource(reader, new InputSource("/home/hans/ofbiz/svn/applications/commonext/documents/ApacheOfbiz.xml")); + // compile the xsl template + Transformer transformer1 = tfactory.newTransformer(new StreamSource("/home/hans/ofbiz/svn/applications/content/template/docbook/fo/docbook.xsl")); + // and apply the xsl template to the source document and save in a result string + StringWriter sw = new StringWriter(); + StreamResult sr = new StreamResult(sw); + transformer1.transform(source, sr); + // store into a file for debugging + java.io.FileWriter fw = new java.io.FileWriter(new java.io.File("/tmp/file1.fo")); + fw.write(sw.toString()); + fw.close(); + + + Debug.log("================start fo processor============================="); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + StreamSource src = new StreamSource("/tmp/file1.fo"); + FopFactory fopFactory = FopFactory.newInstance(); + FOUserAgent foUserAgent = fopFactory.newFOUserAgent(); + Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, baos); + TransformerFactory factory = TransformerFactory.newInstance(); + Transformer transformer = factory.newTransformer(); + transformer.transform(src, new SAXResult(fop.getDefaultHandler())); + baos.flush(); + baos.close(); + // write to browser + writer.append(baos.toString()); + // store into a file for debugging + java.io.FileWriter fend = new java.io.FileWriter(new java.io.File("/tmp/file1.pdf")); + fend.write(baos.toString()); + fend.close(); + + + } catch(Exception e) { + Debug.logError("================================Exception: " + e, module); + } + + + + } else { + screenStringRenderer.renderContentFrame(writer, context, this); + } } else { screenStringRenderer.renderContentBegin(writer, context, this); screenStringRenderer.renderContentBody(writer, context, this); Modified: ofbiz/branches/executioncontext20090812/framework/widget/templates/csvFormMacroLibrary.ftl URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/framework/widget/templates/csvFormMacroLibrary.ftl?rev=810248&r1=810247&r2=810248&view=diff ============================================================================== --- ofbiz/branches/executioncontext20090812/framework/widget/templates/csvFormMacroLibrary.ftl (original) +++ ofbiz/branches/executioncontext20090812/framework/widget/templates/csvFormMacroLibrary.ftl Tue Sep 1 21:33:41 2009 @@ -17,10 +17,10 @@ under the License. --> -<#macro renderField text><#if text?exists>${text?replace(",", "")}</#if></#macro> +<#macro renderField text><#if text?exists>"${text?replace("\"", "\"\"")}"</#if></#macro> <#macro renderDisplayField idName description class alert inPlaceEditorId="" inPlaceEditorUrl="" inPlaceEditorParams=""> -<@renderField description />, <#rt/> +<@renderField description />,<#rt/> </#macro> <#macro renderHyperlinkField></#macro> Modified: ofbiz/branches/executioncontext20090812/specialpurpose/assetmaint/widget/forms/FixedAssetForms.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/specialpurpose/assetmaint/widget/forms/FixedAssetForms.xml?rev=810248&r1=810247&r2=810248&view=diff ============================================================================== --- ofbiz/branches/executioncontext20090812/specialpurpose/assetmaint/widget/forms/FixedAssetForms.xml (original) +++ ofbiz/branches/executioncontext20090812/specialpurpose/assetmaint/widget/forms/FixedAssetForms.xml Tue Sep 1 21:33:41 2009 @@ -71,6 +71,8 @@ <field-map field-name="inputFields" from-field="parameters"/> <field-map field-name="entityName" value="FixedAssetMaintWorkEffort"/> <field-map field-name="orderBy" value="-actualStartDate"/> + <field-map field-name="viewIndex" from-field="viewIndex"/> + <field-map field-name="viewSize" from-field="viewSize"/> </service> </actions> <field name="maintHistSeqId" widget-style="linktext"> Modified: ofbiz/branches/executioncontext20090812/specialpurpose/assetmaint/widget/forms/ProductForms.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/specialpurpose/assetmaint/widget/forms/ProductForms.xml?rev=810248&r1=810247&r2=810248&view=diff ============================================================================== --- ofbiz/branches/executioncontext20090812/specialpurpose/assetmaint/widget/forms/ProductForms.xml (original) +++ ofbiz/branches/executioncontext20090812/specialpurpose/assetmaint/widget/forms/ProductForms.xml Tue Sep 1 21:33:41 2009 @@ -63,6 +63,8 @@ <service service-name="performFind" result-map="result" result-map-list="listIt"> <field-map field-name="inputFields" from-field="parameters"/> <field-map field-name="entityName" value="Product"/> + <field-map field-name="viewIndex" from-field="viewIndex"/> + <field-map field-name="viewSize" from-field="viewSize"/> </service> </actions> <field name="productId" title="${uiLabelMap.CommonId}" widget-style="buttontext"> @@ -95,6 +97,8 @@ <service service-name="performFind" result-map="result" result-map-list="listIt"> <field-map field-name="inputFields" from-field="parameters"/> <field-map field-name="entityName" value="Product"/> + <field-map field-name="viewIndex" from-field="viewIndex"/> + <field-map field-name="viewSize" from-field="viewSize"/> </service> </actions> <field name="productId" title="${uiLabelMap.CommonId}" widget-style="buttontext"> Modified: ofbiz/branches/executioncontext20090812/specialpurpose/assetmaint/widget/ismgr/FieldLookupForms.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/specialpurpose/assetmaint/widget/ismgr/FieldLookupForms.xml?rev=810248&r1=810247&r2=810248&view=diff ============================================================================== --- ofbiz/branches/executioncontext20090812/specialpurpose/assetmaint/widget/ismgr/FieldLookupForms.xml (original) +++ ofbiz/branches/executioncontext20090812/specialpurpose/assetmaint/widget/ismgr/FieldLookupForms.xml Tue Sep 1 21:33:41 2009 @@ -45,6 +45,8 @@ <service service-name="performFind" result-map="result" result-map-list="listIt"> <field-map field-name="inputFields" from-field="parameters"/> <field-map field-name="entityName" value="FixedAsset"/> + <field-map field-name="viewIndex" from-field="viewIndex"/> + <field-map field-name="viewSize" from-field="viewSize"/> </service> </actions> <field name="fixedAssetId" title="${uiLabelMap.AccountingFixedAssetId}" widget-style="buttontext"> @@ -78,6 +80,8 @@ <service service-name="performFind" result-map="result" result-map-list="listIt"> <field-map field-name="inputFields" from-field="parameters"/> <field-map field-name="entityName" value="FixedAsset"/> + <field-map field-name="viewIndex" from-field="viewIndex"/> + <field-map field-name="viewSize" from-field="viewSize"/> </service> </actions> <field name="fixedAssetId" title="${uiLabelMap.AccountingFixedAssetId}" widget-style="buttontext"> Modified: ofbiz/branches/executioncontext20090812/specialpurpose/assetmaint/widget/ismgr/FixedAssetForms.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/specialpurpose/assetmaint/widget/ismgr/FixedAssetForms.xml?rev=810248&r1=810247&r2=810248&view=diff ============================================================================== --- ofbiz/branches/executioncontext20090812/specialpurpose/assetmaint/widget/ismgr/FixedAssetForms.xml (original) +++ ofbiz/branches/executioncontext20090812/specialpurpose/assetmaint/widget/ismgr/FixedAssetForms.xml Tue Sep 1 21:33:41 2009 @@ -114,6 +114,8 @@ <service service-name="performFind" result-map="result" result-map-list="listIt"> <field-map field-name="inputFields" from-field="parameters"/> <field-map field-name="entityName" value="FixedAsset"/> + <field-map field-name="viewIndex" from-field="viewIndex"/> + <field-map field-name="viewSize" from-field="viewSize"/> </service> </actions> <field name="fixedAssetId" widget-style="linktext"> @@ -144,6 +146,8 @@ <service service-name="performFind" result-map="result" result-map-list="listIt"> <field-map field-name="inputFields" from-field="parameters"/> <field-map field-name="entityName" value="FixedAsset"/> + <field-map field-name="viewIndex" from-field="viewIndex"/> + <field-map field-name="viewSize" from-field="viewSize"/> </service> </actions> <field name="fixedAssetId" widget-style="linktext"> Modified: ofbiz/branches/executioncontext20090812/specialpurpose/cmssite/data/CmsSiteDemoData.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/specialpurpose/cmssite/data/CmsSiteDemoData.xml?rev=810248&r1=810247&r2=810248&view=diff ============================================================================== --- ofbiz/branches/executioncontext20090812/specialpurpose/cmssite/data/CmsSiteDemoData.xml (original) +++ ofbiz/branches/executioncontext20090812/specialpurpose/cmssite/data/CmsSiteDemoData.xml Tue Sep 1 21:33:41 2009 @@ -81,6 +81,7 @@ <li><a href="${thisContent.content.CMSS_DEMO_SCREEN.link}">Demo Page with screen widget and screen decorator</a></li> <li><a href="${thisContent.content.CMSS_DEMO_BLOG.link}">Demo Page with blog using screen decorator</a></li> <li><a href="${thisContent.content.CMSS_DEMO_TPL_DATA.link}">Demo Page with an xml resource formatted with a template ftl resource</a></li> + <li><a href="${thisContent.content.PUBLIC_DOCS.link}">The ofbiz public documents</a></li> </ul> </div> ]]></textData> @@ -171,6 +172,12 @@ <ContentAssoc contentId="OFBIZ_PPOINT" contentIdTo="OFBIZ_HOME" contentAssocTypeId="SUB_CONTENT" fromDate="2001-01-01 00:00:00" mapKey="demoHome"/> <WebSiteContent webSiteId="OfbizSite" contentId="OFBIZ_HOME" webSiteContentTypeId="DEFAULT_PAGE" fromDate="2001-01-01 00:00:00"/> + <!-- documents website --> + <DataResource dataResourceId="PUBLIC_DOCS" dataResourceTypeId="URL_RESOURCE" dataTemplateTypeId="SCREEN_COMBINED" objectInfo="component://cmssite/widget/CmssiteScreens.xml#publicDocs"/> + <Content contentId="PUBLIC_DOCS" contentTypeId="DOCUMENT" contentName="OFBIz public documents" dataResourceId="PUBLIC_DOCS"/> + <ContentAssoc contentId="CMSS_PPOINT" contentIdTo="PUBLIC_DOCS" contentAssocTypeId="SUB_CONTENT" fromDate="2001-01-01 00:00:00"/> + <ContentAssoc contentId="CMSS_PPOINT" contentIdTo="APACHE_OFBIZ_HTML" contentAssocTypeId="SUB_CONTENT" fromDate="2001-01-01 00:00:00" mapKey="documents"/> + <ArtifactPath artifactPath="ofbiz/cmssite" description="CMS Demo Site"/> <ArtifactPath artifactPath="ofbiz/ofbizsite" description="CMS OFBiz Demo Site"/> Modified: ofbiz/branches/executioncontext20090812/specialpurpose/cmssite/widget/CmssiteScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/specialpurpose/cmssite/widget/CmssiteScreens.xml?rev=810248&r1=810247&r2=810248&view=diff ============================================================================== --- ofbiz/branches/executioncontext20090812/specialpurpose/cmssite/widget/CmssiteScreens.xml (original) +++ ofbiz/branches/executioncontext20090812/specialpurpose/cmssite/widget/CmssiteScreens.xml Tue Sep 1 21:33:41 2009 @@ -77,11 +77,10 @@ <platform-specific><html> <html-template location="component://cmssite/template/cms/BlogList.ftl"/> </html></platform-specific> - </decorator-section> + </decorator-section> </decorator-screen> </widgets> </section> </screen> - </screens> Modified: ofbiz/branches/executioncontext20090812/specialpurpose/ebay/config/ebayExport.properties URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/specialpurpose/ebay/config/ebayExport.properties?rev=810248&r1=810247&r2=810248&view=diff ============================================================================== --- ofbiz/branches/executioncontext20090812/specialpurpose/ebay/config/ebayExport.properties (original) +++ ofbiz/branches/executioncontext20090812/specialpurpose/ebay/config/ebayExport.properties Tue Sep 1 21:33:41 2009 @@ -31,4 +31,6 @@ # sandbox eBayExport.xmlGatewayUri=https://api.sandbox.ebay.com/ws/api.dll # production -#eBayExport.xmlGatewayUri=https://api.ebay.com/ws/api.dll \ No newline at end of file +#eBayExport.xmlGatewayUri=https://api.ebay.com/ws/api.dll + +eBayExport.customXml=<custom-xml><UseTaxTable>false</UseTaxTable><DispatchTimeMax>3</DispatchTimeMax><ReturnPolicy><ReturnsAcceptedOption>ReturnsNotAccepted</ReturnsAcceptedOption></ReturnPolicy><ShippingDetails><ShippingType>Flat</ShippingType><ShippingServiceOptions><ShippingService>UPS2ndDay</ShippingService><ShippingServicePriority>1</ShippingServicePriority><ShippingServiceCost>5</ShippingServiceCost><ShippingServiceAdditionalCost>2</ShippingServiceAdditionalCost><ShippingSurcharge>1</ShippingSurcharge></ShippingServiceOptions></ShippingDetails></custom-xml> Modified: ofbiz/branches/executioncontext20090812/specialpurpose/ebay/ofbiz-component.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/specialpurpose/ebay/ofbiz-component.xml?rev=810248&r1=810247&r2=810248&view=diff ============================================================================== --- ofbiz/branches/executioncontext20090812/specialpurpose/ebay/ofbiz-component.xml (original) +++ ofbiz/branches/executioncontext20090812/specialpurpose/ebay/ofbiz-component.xml Tue Sep 1 21:33:41 2009 @@ -26,6 +26,7 @@ <classpath type="jar" location="build/lib/*"/> <entity-resource type="data" reader-name="seed" loader="main" location="data/EbaySecurityData.xml"/> + <entity-resource type="data" reader-name="seed" loader="main" location="data/EbayTypeData.xml"/> <service-resource type="model" loader="main" location="servicedef/services.xml"/> <service-resource type="eca" loader="main" location="servicedef/secas.xml"/> Modified: ofbiz/branches/executioncontext20090812/specialpurpose/ebay/servicedef/services.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/executioncontext20090812/specialpurpose/ebay/servicedef/services.xml?rev=810248&r1=810247&r2=810248&view=diff ============================================================================== --- ofbiz/branches/executioncontext20090812/specialpurpose/ebay/servicedef/services.xml (original) +++ ofbiz/branches/executioncontext20090812/specialpurpose/ebay/servicedef/services.xml Tue Sep 1 21:33:41 2009 @@ -31,7 +31,8 @@ <attribute type="List" mode="IN" name="selectResult" optional="false"/> <attribute type="String" mode="IN" name="country" optional="false"/> <attribute type="String" mode="IN" name="location" optional="false"/> - <attribute type="String" mode="IN" name="ebayCategory" optional="false"/> + <attribute type="String" mode="IN" name="webSiteUrl" optional="false"/> + <attribute type="String" mode="IN" name="ebayCategory" optional="true"/> <attribute type="String" mode="IN" name="paymentPayPal" optional="true"/> <attribute type="String" mode="IN" name="paymentVisaMC" optional="true"/> <attribute type="String" mode="IN" name="paymentAmEx" optional="true"/> @@ -46,8 +47,8 @@ <attribute type="String" mode="IN" name="paymentPersonalCheck" optional="true"/> <attribute type="String" mode="IN" name="payPalEmail" optional="true"/> <attribute type="String" mode="IN" name="listingDuration" optional="false"/> - <attribute type="String" mode="IN" name="startPrice" optional="false"/> - <attribute type="String" mode="IN" name="quantity" optional="false"/> + <attribute type="String" mode="IN" name="startPrice" optional="true"/> + <attribute type="String" mode="IN" name="quantity" optional="true"/> </service> <service name="getEbayCategories" engine="java" location="org.ofbiz.ebay.ProductsExportToEbay" invoke="getEbayCategories" auth="true"> |
Free forum by Nabble | Edit this page |