You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by sa...@apache.org on 2011/03/24 08:23:50 UTC
svn commit: r1084863 [2/11] - in /ofbiz/branches/jackrabbit20100709: ./
applications/accounting/data/
applications/accounting/src/org/ofbiz/accounting/invoice/
applications/accounting/src/org/ofbiz/accounting/payment/
applications/accounting/src/org/of...
Modified: ofbiz/branches/jackrabbit20100709/applications/content/servicedef/services_data.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/content/servicedef/services_data.xml?rev=1084863&r1=1084862&r2=1084863&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/content/servicedef/services_data.xml (original)
+++ ofbiz/branches/jackrabbit20100709/applications/content/servicedef/services_data.xml Thu Mar 24 07:23:42 2011
@@ -36,6 +36,7 @@
<attribute name="partyId" type="String" mode="IN" optional="true"/>
<attribute name="dataResourceId" type="String" mode="OUT" optional="false"/>
<attribute name="dataResource" type="org.ofbiz.entity.GenericValue" mode="OUT" optional="true"/>
+ <attribute name="uploadedFile" type="java.nio.ByteBuffer" mode="IN" optional="true"/>
<override name="objectInfo" allow-html="safe"/>
</service>
<service name="createDataResourceAndAssocToContent" default-entity-name="DataResource" engine="simple"
Modified: ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/ContentManagementEvents.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/ContentManagementEvents.java?rev=1084863&r1=1084862&r2=1084863&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/ContentManagementEvents.java (original)
+++ ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/ContentManagementEvents.java Thu Mar 24 07:23:42 2011
@@ -237,7 +237,7 @@ public class ContentManagementEvents {
boolean statusIdUpdated = false;
Map<String, Object> results = null;
while (it.hasNext()) {
- Object [] arr = (Object [])it.next();
+ Object [] arr = it.next();
//if (Debug.infoOn()) Debug.logInfo("in updatePublishLinks, arr:" + Arrays.asList(arr) , module);
String contentId = (String)arr[0]; // main (2nd level) site id
String origSubContentId = null;
@@ -258,7 +258,7 @@ public class ContentManagementEvents {
}
}
- String currentSubContentId = (String)siteIdLookup.get(contentId);
+ String currentSubContentId = siteIdLookup.get(contentId);
//if (Debug.infoOn()) Debug.logInfo("in updatePublishLinks, currentSubContentId:" + currentSubContentId , module);
//if (Debug.infoOn()) Debug.logInfo("in updatePublishLinks, origSubContentId:" + origSubContentId , module);
try {
@@ -332,7 +332,7 @@ public class ContentManagementEvents {
oldActiveValues = delegator.findByAnd("ContentAssoc", UtilMisc.toMap("contentId", targContentId, "contentIdTo", contentId, "contentAssocTypeId", "PUBLISH_LINK", "thruDate", null));
iterOldActive = oldActiveValues.iterator();
while (iterOldActive.hasNext()) {
- GenericValue cAssoc = (GenericValue)iterOldActive.next();
+ GenericValue cAssoc = iterOldActive.next();
cAssoc.set("thruDate", nowTimestamp);
cAssoc.store();
}
Modified: ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/ContentManagementServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/ContentManagementServices.java?rev=1084863&r1=1084862&r2=1084863&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/ContentManagementServices.java (original)
+++ ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/ContentManagementServices.java Thu Mar 24 07:23:42 2011
@@ -970,7 +970,7 @@ public class ContentManagementServices {
if (i > 0) {
// Swap with previous entry
try {
- GenericValue prevValue = (GenericValue)listFiltered.get(i-1);
+ GenericValue prevValue = listFiltered.get(i-1);
Long prevSeqNum = (Long)prevValue.get("sequenceNum");
prevValue.put("sequenceNum", Long.valueOf(seqNum));
prevValue.store();
@@ -983,7 +983,7 @@ public class ContentManagementServices {
} else {
if (i < listFiltered.size()) {
// Swap with next entry
- GenericValue nextValue = (GenericValue)listFiltered.get(i+1);
+ GenericValue nextValue = listFiltered.get(i+1);
nextValue.put("sequenceNum", Long.valueOf(seqNum));
nextValue.store();
seqNum += seqIncrement;
@@ -1510,7 +1510,7 @@ public class ContentManagementServices {
List<GenericValue> listFiltered = EntityUtil.filterByDate(contentRoleList, true);
List<GenericValue> listOrdered = EntityUtil.orderBy(listFiltered, UtilMisc.toList("fromDate DESC"));
if (listOrdered.size() > 0) {
- contentRole = (GenericValue) listOrdered.get(0);
+ contentRole = listOrdered.get(0);
hasExistingContentRole = true;
}
} catch (GenericEntityException e) {
@@ -1592,9 +1592,9 @@ public class ContentManagementServices {
List<GenericValue> listOrdered = EntityUtil.orderBy(listFiltered, UtilMisc.toList("purchaseFromDate", "purchaseThruDate"));
List<GenericValue> listThrusOnly = EntityUtil.filterOutByCondition(listOrdered, EntityCondition.makeCondition("purchaseThruDate", EntityOperator.EQUALS, null));
if (listThrusOnly.size() > 0) {
- productContent = (GenericValue) listThrusOnly.get(0);
+ productContent = listThrusOnly.get(0);
} else if (listOrdered.size() > 0) {
- productContent = (GenericValue) listOrdered.get(0);
+ productContent = listOrdered.get(0);
}
} catch (GenericEntityException e) {
Debug.logError(e.toString(), module);
@@ -1784,7 +1784,7 @@ public class ContentManagementServices {
contentRevisionMap.put("oldDataResourceId", oldDataResourceId);
// need committedByPartyId
for (int i=0; i < parentList.size(); i++) {
- String thisContentId = (String)parentList.get(i);
+ String thisContentId = parentList.get(i);
contentRevisionMap.put("contentId", thisContentId);
result = dispatcher.runSync("persistContentRevisionAndItem", contentRevisionMap);
errorMsg = ServiceUtil.getErrorMessage(result);
Modified: ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/ContentManagementWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/ContentManagementWorker.java?rev=1084863&r1=1084862&r2=1084863&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/ContentManagementWorker.java (original)
+++ ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/ContentManagementWorker.java Thu Mar 24 07:23:42 2011
@@ -216,7 +216,7 @@ public class ContentManagementWorker {
}
GenericPK cachedPK = null;
if (UtilValidate.isNotEmpty(entityName)) {
- cachedPK = (GenericPK)currentEntityMap.get(entityName);
+ cachedPK = currentEntityMap.get(entityName);
}
getCurrentValueWithCachedPK(request, delegator, cachedPK, entityName);
GenericPK currentPK = (GenericPK)request.getAttribute("currentPK");
@@ -255,7 +255,7 @@ public class ContentManagementWorker {
String sPassed = null;
Object oPassed = null;
Object oCached = null;
- String ky = (String)keyIt.next();
+ String ky = keyIt.next();
oPassed = passedPK.get(ky);
if (oPassed != null) {
sPassed = oPassed.toString();
@@ -355,7 +355,7 @@ public class ContentManagementWorker {
GenericValue contentAssoc = null;
Iterator<GenericValue> it = relatedPubPts.iterator();
while (it.hasNext()) {
- contentAssoc = (GenericValue)it.next();
+ contentAssoc = it.next();
String pub = (String)contentAssoc.get("contentId");
//webSitePublishPoint = delegator.findByPrimaryKeyCache("WebSitePublishPoint", UtilMisc.toMap("contentId", pub));
webSitePublishPoint = getWebSitePublishPoint(delegator, pub, false);
@@ -449,7 +449,7 @@ public class ContentManagementWorker {
public static GenericValue getWebSitePublishPoint(Delegator delegator, String contentId, boolean ignoreCache) throws GenericEntityException {
GenericValue webSitePublishPoint = null;
if (!ignoreCache)
- webSitePublishPoint = (GenericValue)cachedWebSitePublishPoints.get(contentId);
+ webSitePublishPoint = cachedWebSitePublishPoints.get(contentId);
if (webSitePublishPoint == null) {
webSitePublishPoint = delegator.findByPrimaryKey("WebSitePublishPoint", UtilMisc.toMap("contentId", contentId));
@@ -717,7 +717,7 @@ public class ContentManagementWorker {
List<GenericValue> listFiltered = EntityUtil.filterByDate(listAll);
Iterator<GenericValue> iter = listFiltered.iterator();
while (iter.hasNext()) {
- GenericValue contentAssoc = (GenericValue)iter.next();
+ GenericValue contentAssoc = iter.next();
String subContentId = contentAssoc.getString("contentId");
subLeafCount += updateStatsTopDown(delegator, subContentId, typeList);
}
@@ -743,7 +743,7 @@ public class ContentManagementWorker {
List<GenericValue> listFiltered = EntityUtil.filterByDate(listAll);
Iterator<GenericValue> iter = listFiltered.iterator();
while (iter.hasNext()) {
- GenericValue contentAssoc = (GenericValue)iter.next();
+ GenericValue contentAssoc = iter.next();
String contentIdTo = contentAssoc.getString("contentIdTo");
GenericValue contentTo = delegator.findByPrimaryKey("Content", UtilMisc.toMap("contentId", contentIdTo));
int intLeafCount = 0;
Modified: ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/blog/BlogRssServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/blog/BlogRssServices.java?rev=1084863&r1=1084862&r2=1084863&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/blog/BlogRssServices.java (original)
+++ ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/blog/BlogRssServices.java Thu Mar 24 07:23:42 2011
@@ -117,7 +117,7 @@ public class BlogRssServices {
if (contentRecs != null) {
Iterator<GenericValue> i = contentRecs.iterator();
while (i.hasNext()) {
- GenericValue v = (GenericValue) i.next();
+ GenericValue v = i.next();
String sub = null;
try {
Map<String, Object> dummy = FastMap.newInstance();
Modified: ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/compdoc/CompDocServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/compdoc/CompDocServices.java?rev=1084863&r1=1084862&r2=1084863&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/compdoc/CompDocServices.java (original)
+++ ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/compdoc/CompDocServices.java Thu Mar 24 07:23:42 2011
@@ -181,7 +181,7 @@ public class CompDocServices {
Iterator<GenericValue> iter = compDocParts.iterator();
int pgCnt =0;
while (iter.hasNext()) {
- GenericValue contentAssocRevisionItemView = (GenericValue)iter.next();
+ GenericValue contentAssocRevisionItemView = iter.next();
//String thisContentId = contentAssocRevisionItemView.getString("contentId");
//String thisContentRevisionSeqId = contentAssocRevisionItemView.getString("maxRevisionSeqId");
String thisDataResourceId = contentAssocRevisionItemView.getString("dataResourceId");
Modified: ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/content/ContentServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/content/ContentServices.java?rev=1084863&r1=1084862&r2=1084863&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/content/ContentServices.java (original)
+++ ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/content/ContentServices.java Thu Mar 24 07:23:42 2011
@@ -105,7 +105,7 @@ public class ContentServices {
Iterator<GenericValue> it = contentList.iterator();
Map<String, Object> permResults = null;
while (it.hasNext()) {
- GenericValue content = (GenericValue) it.next();
+ GenericValue content = it.next();
serviceInMap.put("currentContent", content);
try {
permResults = dispatcher.runSync("checkContentPermission", serviceInMap);
@@ -284,7 +284,7 @@ public class ContentServices {
try {
List<GenericValue> statusItems = delegator.findByAnd("StatusItem",UtilMisc.toMap("statusTypeId", "CONTENT_STATUS"), UtilMisc.toList("sequenceId"));
if (!UtilValidate.isEmpty(statusItems)) {
- content.put("statusId", ((GenericValue) statusItems.get(0)).getString("statusId"));
+ content.put("statusId", (statusItems.get(0)).getString("statusId"));
}
} catch (GenericEntityException e) {
return ServiceUtil.returnError(e.getMessage());
@@ -845,7 +845,7 @@ public class ContentServices {
Iterator<GenericValue> it = filteredAssocs.iterator();
while (it.hasNext()) {
- GenericValue val = (GenericValue) it.next();
+ GenericValue val = it.next();
val.set("thruDate", nowTimestamp);
val.store();
//if (Debug.infoOn()) Debug.logInfo("in deactivateAssocs, val:" + val, module);
@@ -1070,7 +1070,7 @@ public class ContentServices {
if (mapIn != null) {
Set<Map.Entry<String, Object>> entrySet = mapIn.entrySet();
for (Map.Entry<String, Object> entry : entrySet) {
- String key = (String)entry.getKey();
+ String key = entry.getKey();
if (key.startsWith(prefix)) {
// String keyBase = key.substring(prefix.length());
Object value = entry.getValue();
@@ -1112,7 +1112,7 @@ public class ContentServices {
if (mapIn != null) {
Set<Map.Entry<String, Object>> entrySet = mapIn.entrySet();
for (Map.Entry<String, Object> entry : entrySet) {
- String key = (String)entry.getKey();
+ String key = entry.getKey();
Object value = entry.getValue();
if (value instanceof String) {
if (UtilValidate.isNotEmpty(value)) {
Modified: ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/content/ContentServicesComplex.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/content/ContentServicesComplex.java?rev=1084863&r1=1084862&r2=1084863&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/content/ContentServicesComplex.java (original)
+++ ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/content/ContentServicesComplex.java Thu Mar 24 07:23:42 2011
@@ -142,7 +142,7 @@ public class ContentServicesComplex {
return ServiceUtil.returnError(e.getMessage());
}
for (int i=0; i < relatedAssocs.size(); i++) {
- GenericValue a = (GenericValue)relatedAssocs.get(i);
+ GenericValue a = relatedAssocs.get(i);
Debug.logVerbose(" contentId:" + a.get("contentId") + " To:" + a.get("caContentIdTo") + " fromDate:" + a.get("caFromDate") + " thruDate:" + a.get("caThruDate") + " AssocTypeId:" + a.get("caContentAssocTypeId"), null);
}
Map<String, Object> results = FastMap.newInstance();
@@ -259,7 +259,7 @@ public class ContentServicesComplex {
if (assocTypes != null && assocTypes.size() > 1) {
Iterator<GenericValue> it = contentAssocsDateFiltered.iterator();
while (it.hasNext()) {
- contentAssoc = (GenericValue)it.next();
+ contentAssoc = it.next();
contentAssocTypeId = (String)contentAssoc.get("contentAssocTypeId");
if (assocTypes.contains(contentAssocTypeId)) {
contentAssocsTypeFiltered.add(contentAssoc);
@@ -283,7 +283,7 @@ public class ContentServicesComplex {
Locale locale = Locale.getDefault(); // TODO: this needs to be passed in
Iterator<GenericValue> it = contentAssocsTypeFiltered.iterator();
while (it.hasNext()) {
- contentAssoc = (GenericValue)it.next();
+ contentAssoc = it.next();
content = contentAssoc.getRelatedOneCache(assocRelationName);
if (UtilValidate.isNotEmpty(contentTypes)) {
String contentTypeId = (String)content.get("contentTypeId");
Modified: ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/content/ContentWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/content/ContentWorker.java?rev=1084863&r1=1084862&r2=1084863&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/content/ContentWorker.java (original)
+++ ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/content/ContentWorker.java Thu Mar 24 07:23:42 2011
@@ -613,7 +613,7 @@ public class ContentWorker implements or
try {
List<GenericValue> purposeValueList = content.getRelatedCache("ContentPurpose");
for (int i = 0; i < purposeValueList.size(); i++) {
- GenericValue purposeValue = (GenericValue) purposeValueList.get(i);
+ GenericValue purposeValue = purposeValueList.get(i);
purposes.add(purposeValue.get("contentPurposeTypeId"));
}
} catch (GenericEntityException e) {
@@ -627,7 +627,7 @@ public class ContentWorker implements or
try {
List<GenericValue> sectionValueList = content.getRelatedCache("FromContentAssoc");
for (int i = 0; i < sectionValueList.size(); i++) {
- GenericValue sectionValue = (GenericValue) sectionValueList.get(i);
+ GenericValue sectionValue = sectionValueList.get(i);
String contentAssocPredicateId = (String)sectionValue.get("contentAssocPredicateId");
if (contentAssocPredicateId != null && contentAssocPredicateId.equals("categorizes")) {
sections.add(sectionValue.get("contentIdTo"));
@@ -644,7 +644,7 @@ public class ContentWorker implements or
try {
List<GenericValue> topicValueList = content.getRelatedCache("FromContentAssoc");
for (int i = 0; i < topicValueList.size(); i++) {
- GenericValue topicValue = (GenericValue) topicValueList.get(i);
+ GenericValue topicValue = topicValueList.get(i);
String contentAssocPredicateId = (String)topicValue.get("contentAssocPredicateId");
if (contentAssocPredicateId != null && contentAssocPredicateId.equals("topifies"))
topics.add(topicValue.get("contentIdTo"));
@@ -689,7 +689,7 @@ public class ContentWorker implements or
//if (Debug.infoOn()) Debug.logInfo("traverse, relatedViews:" + relatedViews,null);
Iterator<GenericValue> it = relatedViews.iterator();
while (it.hasNext()) {
- GenericValue assocValue = (GenericValue) it.next();
+ GenericValue assocValue = it.next();
Map<String, Object> thisNode = ContentWorker.makeNode(assocValue);
checkConditions(delegator, thisNode, null, whenMap);
// boolean isReturnBeforePick = booleanDataType(thisNode.get("isReturnBeforePick"));
@@ -852,7 +852,7 @@ public class ContentWorker implements or
List<EntityExpr> exprListOr = FastList.newInstance();
Iterator<String> it = assocTypes.iterator();
while (it.hasNext()) {
- String assocType = (String) it.next();
+ String assocType = it.next();
expr = EntityCondition.makeCondition("contentAssocTypeId", EntityOperator.EQUALS, assocType);
exprListOr.add(expr);
}
@@ -934,7 +934,7 @@ public class ContentWorker implements or
List<GenericValue> lst2 = EntityUtil.filterByDate(lst);
//if (Debug.infoOn()) Debug.logInfo("getContentAncestry, lst2:" + lst2, "");
if (lst2.size() > 0) {
- GenericValue contentAssoc = (GenericValue)lst2.get(0);
+ GenericValue contentAssoc = lst2.get(0);
getContentAncestry(delegator, contentAssoc.getString(contentIdOtherField), contentAssocTypeId, direction, contentAncestorList);
contentAncestorList.add(contentAssoc);
}
@@ -964,7 +964,7 @@ public class ContentWorker implements or
//if (Debug.infoOn()) Debug.logInfo("getContentAncestry, lst2:" + lst2, "");
Iterator<GenericValue> iter = lst2.iterator();
while (iter.hasNext()) {
- GenericValue contentAssoc = (GenericValue)iter.next();
+ GenericValue contentAssoc = iter.next();
String contentIdOther = contentAssoc.getString(contentIdOtherField);
if (!contentAncestorList.contains(contentIdOther)) {
getContentAncestryAll(delegator, contentIdOther, passedContentTypeId, direction, contentAncestorList);
@@ -1020,7 +1020,7 @@ public class ContentWorker implements or
List<GenericValue> lst2 = EntityUtil.filterByDate(lst);
//if (Debug.infoOn()) Debug.logInfo("getContentAncestry, lst2:" + lst2, "");
if (lst2.size() > 0) {
- GenericValue contentAssoc = (GenericValue)lst2.get(0);
+ GenericValue contentAssoc = lst2.get(0);
getContentAncestryValues(delegator, contentAssoc.getString(contentIdOtherField), contentAssocTypeId, direction, contentAncestorList);
GenericValue content = delegator.findByPrimaryKeyCache("Content", UtilMisc.toMap("contentId", contentAssoc.getString(contentIdOtherField)));
@@ -1415,7 +1415,7 @@ public class ContentWorker implements or
GenericValue val = null;
if (filteredList.size() > 0) {
- val = (GenericValue)filteredList.get(0);
+ val = filteredList.get(0);
}
return val;
}
Modified: ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/content/UploadContentAndImage.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/content/UploadContentAndImage.java?rev=1084863&r1=1084862&r2=1084863&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/content/UploadContentAndImage.java (original)
+++ ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/content/UploadContentAndImage.java Thu Mar 24 07:23:42 2011
@@ -101,7 +101,7 @@ public class UploadContentAndImage {
FileItem imageFi = null;
byte[] imageBytes = {};
for (int i = 0; i < lst.size(); i++) {
- fi = (FileItem) lst.get(i);
+ fi = lst.get(i);
//String fn = fi.getName();
String fieldName = fi.getFieldName();
if (fi.isFormField()) {
@@ -368,7 +368,7 @@ public class UploadContentAndImage {
byte[] imageBytes = {};
passedParams.put("userLogin", userLogin);
for (int i = 0; i < lst.size(); i++) {
- fi = (FileItem) lst.get(i);
+ fi = lst.get(i);
//String fn = fi.getName();
String fieldName = fi.getFieldName();
if (fi.isFormField()) {
@@ -467,7 +467,7 @@ public class UploadContentAndImage {
Map<String, Object> ftlContext2 = FastMap.newInstance();
Map<String, Object> ftlContext3 = FastMap.newInstance();
while (iter.hasNext()) {
- String keyName = (String)iter.next();
+ String keyName = iter.next();
Object obj = passedParams.get(keyName + suffix);
ftlContext2.put(keyName, obj);
}
Modified: ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/data/DataResourceWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/data/DataResourceWorker.java?rev=1084863&r1=1084862&r2=1084863&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/data/DataResourceWorker.java (original)
+++ ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/data/DataResourceWorker.java Thu Mar 24 07:23:42 2011
@@ -50,6 +50,13 @@ import org.apache.commons.fileupload.Fil
import org.apache.commons.fileupload.FileUploadException;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.fileupload.servlet.ServletFileUpload;
+import org.apache.tika.Tika;
+import org.apache.tika.exception.TikaException;
+import org.apache.tika.io.TikaInputStream;
+import org.apache.tika.metadata.Metadata;
+import org.apache.tika.parser.AutoDetectParser;
+import org.apache.tika.parser.ParseContext;
+import org.apache.tika.parser.Parser;
import org.ofbiz.base.location.FlexibleLocation;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.FileUtil;
@@ -77,7 +84,9 @@ import org.ofbiz.widget.screen.ScreenFac
import org.ofbiz.widget.screen.ScreenRenderer;
import org.ofbiz.widget.screen.ScreenStringRenderer;
import org.w3c.dom.Document;
+import org.xml.sax.ContentHandler;
import org.xml.sax.SAXException;
+import org.xml.sax.helpers.DefaultHandler;
import freemarker.template.Template;
import freemarker.template.TemplateException;
@@ -381,6 +390,13 @@ public class DataResourceWorker impleme
return mimeTypeId;
}
+ public static String getMimeTypeWithByteBuffer(java.nio.ByteBuffer buffer) throws IOException {
+ byte[] b = buffer.array();
+
+ Tika tika = new Tika();
+ return tika.detect(b);
+ }
+
public static String buildRequestPrefix(Delegator delegator, Locale locale, String webSiteId, String https) {
Map<String, Object> prefixValues = FastMap.newInstance();
String prefix;
Modified: ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/layout/LayoutEvents.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/layout/LayoutEvents.java?rev=1084863&r1=1084862&r2=1084863&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/layout/LayoutEvents.java (original)
+++ ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/layout/LayoutEvents.java Thu Mar 24 07:23:42 2011
@@ -595,7 +595,7 @@ public class LayoutEvents {
Collection<String> keyColl = passedPK.getAllKeys();
Iterator<String> keyIt = keyColl.iterator();
while (keyIt.hasNext()) {
- String attrName = (String)keyIt.next();
+ String attrName = keyIt.next();
String attrVal = (String)request.getAttribute(attrName);
if (attrVal == null) {
attrVal = (String)paramMap.get(attrName);
Modified: ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/layout/LayoutWorker.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/layout/LayoutWorker.java?rev=1084863&r1=1084862&r2=1084863&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/layout/LayoutWorker.java (original)
+++ ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/layout/LayoutWorker.java Thu Mar 24 07:23:42 2011
@@ -81,7 +81,7 @@ public class LayoutWorker {
FileItem fi = null;
FileItem imageFi = null;
for (int i=0; i < lst.size(); i++) {
- fi = (FileItem)lst.get(i);
+ fi = lst.get(i);
String fieldName = fi.getFieldName();
String fieldStr = fi.getString();
if (fi.isFormField()) {
@@ -114,7 +114,7 @@ public class LayoutWorker {
}
public static ByteBuffer returnByteBuffer(Map<String, ByteBuffer> map) {
- ByteBuffer byteBuff = (ByteBuffer)map.get("imageData");
+ ByteBuffer byteBuff = map.get("imageData");
return byteBuff;
}
}
Modified: ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/survey/PdfSurveyServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/survey/PdfSurveyServices.java?rev=1084863&r1=1084862&r2=1084863&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/survey/PdfSurveyServices.java (original)
+++ ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/survey/PdfSurveyServices.java Thu Mar 24 07:23:42 2011
@@ -283,7 +283,7 @@ public class PdfSurveyServices {
continue;
}
- GenericValue surveyQuestionAndAppl = (GenericValue)questions.get(0);
+ GenericValue surveyQuestionAndAppl = questions.get(0);
String surveyQuestionId = (String)surveyQuestionAndAppl.get("surveyQuestionId");
String surveyQuestionTypeId = (String)surveyQuestionAndAppl.get("surveyQuestionTypeId");
GenericValue surveyResponseAnswer = delegator.makeValue("SurveyResponseAnswer", UtilMisc.toMap("surveyResponseId", surveyResponseId, "surveyQuestionId", surveyQuestionId));
Modified: ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/survey/SurveyWrapper.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/survey/SurveyWrapper.java?rev=1084863&r1=1084862&r2=1084863&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/survey/SurveyWrapper.java (original)
+++ ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/survey/SurveyWrapper.java Thu Mar 24 07:23:42 2011
@@ -379,7 +379,7 @@ public class SurveyWrapper {
if (UtilValidate.isNotEmpty(passThru)) {
Iterator<String> i = passThru.keySet().iterator();
while (i.hasNext()) {
- String key = (String) i.next();
+ String key = i.next();
if (key.toUpperCase().startsWith("ANSWERS_")) {
int splitIndex = key.indexOf('_');
String questionId = key.substring(splitIndex+1);
@@ -486,7 +486,7 @@ public class SurveyWrapper {
Iterator<String> i = thisResult.keySet().iterator();
while (i.hasNext()) {
Map<String, Object> optMap = FastMap.newInstance();
- String optId = (String) i.next();
+ String optId = i.next();
Long optTotal = (Long) thisResult.get(optId);
if (optTotal == null) {
optTotal = Long.valueOf(0);
@@ -553,7 +553,7 @@ public class SurveyWrapper {
if (eli != null) {
GenericValue value;
- while (((value = (GenericValue) eli.next()) != null)) {
+ while (((value = eli.next()) != null)) {
if ("Y".equalsIgnoreCase(value.getString("booleanResponse"))) {
result[1]++;
} else {
@@ -600,7 +600,7 @@ public class SurveyWrapper {
if (eli != null) {
GenericValue value;
- while (((value = (GenericValue) eli.next()) != null)) {
+ while (((value = eli.next()) != null)) {
switch (type) {
case 1:
Long n = value.getLong("numericResponse");
@@ -688,7 +688,7 @@ public class SurveyWrapper {
EntityListIterator eli = this.getEli(question, -1);
if (eli != null) {
GenericValue value;
- while (((value = (GenericValue) eli.next()) != null)) {
+ while (((value = eli.next()) != null)) {
String optionId = value.getString("surveyOptionSeqId");
if (UtilValidate.isNotEmpty(optionId)) {
Long optCount = (Long) result.remove(optionId);
Modified: ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/webapp/ftl/LoopSubContentTransform.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/webapp/ftl/LoopSubContentTransform.java?rev=1084863&r1=1084862&r2=1084863&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/webapp/ftl/LoopSubContentTransform.java (original)
+++ ofbiz/branches/jackrabbit20100709/applications/content/src/org/ofbiz/content/webapp/ftl/LoopSubContentTransform.java Thu Mar 24 07:23:42 2011
@@ -90,7 +90,7 @@ public class LoopSubContentTransform imp
} else if (i >= lst.size()) {
return false;
}
- GenericValue subContentDataResourceView = (GenericValue) lst.get(i);
+ GenericValue subContentDataResourceView = lst.get(i);
ctx.put("subContentDataResourceView", subContentDataResourceView);
GenericValue electronicText = null;
try {
Modified: ofbiz/branches/jackrabbit20100709/applications/content/webapp/content/content/DisplayContentNav.ftl
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/content/webapp/content/content/DisplayContentNav.ftl?rev=1084863&r1=1084862&r2=1084863&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/content/webapp/content/content/DisplayContentNav.ftl (original)
+++ ofbiz/branches/jackrabbit20100709/applications/content/webapp/content/content/DisplayContentNav.ftl Thu Mar 24 07:23:42 2011
@@ -58,52 +58,17 @@ var rawdata = [
<#-------------------------------------------------------------------------------------define Requests-->
var treeSelected = false;
- var editDocumentTreeUrl = '<@o...@ofbizUrl>';
var listDocument = '<@o...@ofbizUrl>';
- var editDocumentUrl = '<@o...@ofbizUrl>';
- var deleteDocumentUrl = '<@o...@ofbizUrl>';
<#-------------------------------------------------------------------------------------create Tree-->
function createTree() {
jQuery(function () {
jQuery("#tree").jstree({
- "plugins" : [ "themes", "json_data", "ui", "contextmenu", "crrm"],
+ "plugins" : [ "themes", "json_data", "ui", "crrm"],
"json_data" : {
"data" : rawdata,
"progressive_render" : false
},
- 'contextmenu': {
- 'items': {
- 'ccp' : false,
- 'create' : false,
- 'rename' : false,
- 'remove' : false,
- 'create1' : {
- 'label' : "New Folder",
- 'action' : function(obj) {
- callCreateDocumentTree(obj.attr('id'));
- }
- },
- 'create2' : {
- 'label' : "New Content in Folder",
- 'action' : function(obj) {
- callCreateDocument(obj.attr('id'));
- }
- },
- 'rename1' : {
- 'label' : "Rename Folder",
- 'action' : function(obj) {
- callRenameDocumentTree(obj.attr('id'));
- }
- },
- 'delete1' : {
- 'label' : "Delete Folder",
- 'action' : function(obj) {
- callDeleteDocument(obj.attr('id'), obj.attr('contentId'), obj.attr('AssocType'), obj.attr('fromDate'));
- }
- },
- }
- }
});
});
}
@@ -131,81 +96,6 @@ var rawdata = [
}
});
}
-<#-------------------------------------------------------------------------------------callCreateDocumentTree function-->
- function callCreateDocumentTree(contentId) {
- jQuery.ajax({
- url: editDocumentTreeUrl,
- type: 'POST',
- data: { contentId: contentId,
- contentAssocTypeId: 'TREE_CHILD'},
- error: function(msg) {
- showErrorAlert("${uiLabelMap.CommonErrorMessage2}","${uiLabelMap.ErrorLoadingContent} : " + msg);
- },
- success: function(msg) {
- jQuery('#Document').html(msg);
- }
- });
- }
-<#-------------------------------------------------------------------------------------callCreateSection function-->
- function callCreateDocument(contentId) {
- jQuery.ajax({
- url: editDocumentUrl,
- type: 'POST',
- data: {contentId: contentId},
- error: function(msg) {
- showErrorAlert("${uiLabelMap.CommonErrorMessage2}","${uiLabelMap.ErrorLoadingContent} : " + msg);
- },
- success: function(msg) {
- jQuery('#Document').html(msg);
- }
- });
- }
-<#-------------------------------------------------------------------------------------callEditSection function-->
- function callEditDocument(contentIdTo) {
- jQuery.ajax({
- url: editDocumentUrl,
- type: 'POST',
- data: {contentIdTo: contentIdTo},
- error: function(msg) {
- showErrorAlert("${uiLabelMap.CommonErrorMessage2}","${uiLabelMap.ErrorLoadingContent} : " + msg);
- },
- success: function(msg) {
- jQuery('#Document').html(msg);
- }
- });
-
- }
-<#-------------------------------------------------------------------------------------callDeleteItem function-->
- function callDeleteDocument(contentId, contentIdTo, contentAssocTypeId, fromDate) {
- jQuery.ajax({
- url: deleteDocumentUrl,
- type: 'POST',
- data: {contentId : contentId, contentIdTo : contentIdTo, contentAssocTypeId : contentAssocTypeId, fromDate : fromDate},
- error: function(msg) {
- showErrorAlert("${uiLabelMap.CommonErrorMessage2}","${uiLabelMap.ErrorLoadingContent} : " + msg);
- },
- success: function(msg) {
- location.reload();
- }
- });
- }
- <#-------------------------------------------------------------------------------------callRename function-->
- function callRenameDocumentTree(contentId) {
- jQuery.ajax({
- url: editDocumentTreeUrl,
- type: 'POST',
- data: { contentId: contentId,
- contentAssocTypeId:'TREE_CHILD',
- rename: 'Y'
- },
- error: function(msg) {
- showErrorAlert("${uiLabelMap.CommonErrorMessage2}","${uiLabelMap.ErrorLoadingContent} : " + msg);
- },
- success: function(msg) {
- jQuery('#Document').html(msg);
- }
- });
- }
<#------------------------------------------------------pagination function -->
function nextPrevDocumentList(url){
url= '<@o...@ofbizUrl>';
Modified: ofbiz/branches/jackrabbit20100709/applications/content/widget/content/ContentScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/content/widget/content/ContentScreens.xml?rev=1084863&r1=1084862&r2=1084863&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/content/widget/content/ContentScreens.xml (original)
+++ ofbiz/branches/jackrabbit20100709/applications/content/widget/content/ContentScreens.xml Thu Mar 24 07:23:42 2011
@@ -82,7 +82,7 @@ under the License.
<screen name="navigateContent">
<section>
<actions>
- <set field="layoutSettings.javaScripts[+0]" value="/images/jquery/jquery-1.4.2.min.js" global="true"/>
+ <set field="layoutSettings.javaScripts[+0]" value="/images/jquery/jquery-1.5.1.min.js" global="true"/>
<set field="titleProperty" value="PageTitleNavigateContent"/>
<set field="tabButtonItem" value="navigateContent"/>
<set field="labelTitleProperty" value="PageTitleNavigateContent"/>
Modified: ofbiz/branches/jackrabbit20100709/applications/manufacturing/src/org/ofbiz/manufacturing/bom/BOMHelper.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/manufacturing/src/org/ofbiz/manufacturing/bom/BOMHelper.java?rev=1084863&r1=1084862&r2=1084863&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/manufacturing/src/org/ofbiz/manufacturing/bom/BOMHelper.java (original)
+++ ofbiz/branches/jackrabbit20100709/applications/manufacturing/src/org/ofbiz/manufacturing/bom/BOMHelper.java Thu Mar 24 07:23:42 2011
@@ -72,7 +72,7 @@ public class BOMHelper {
Iterator<GenericValue> nodesIterator = productNodesList.iterator();
int depth = 0;
while (nodesIterator.hasNext()) {
- oneNode = (GenericValue)nodesIterator.next();
+ oneNode = nodesIterator.next();
depth = 0;
depth = getMaxDepth(oneNode.getString("productId"), bomType, inDate, delegator);
depth++;
@@ -118,9 +118,9 @@ public class BOMHelper {
GenericValue duplicatedNode = null;
Iterator<GenericValue> nodesIterator = productNodesList.iterator();
while (nodesIterator.hasNext()) {
- oneNode = (GenericValue)nodesIterator.next();
+ oneNode = nodesIterator.next();
for (int i = 0; i < productIdKeys.size(); i++) {
- if (oneNode.getString("productId").equals((String)productIdKeys.get(i))) {
+ if (oneNode.getString("productId").equals(productIdKeys.get(i))) {
return oneNode;
}
}
@@ -143,7 +143,7 @@ public class BOMHelper {
List<GenericValue> shipmentPlans = delegator.findByAnd("OrderShipment", UtilMisc.toMap("shipmentId", shipmentId));
Iterator<GenericValue> shipmentPlansIt = shipmentPlans.iterator();
while (shipmentPlansIt.hasNext()) {
- GenericValue shipmentPlan = (GenericValue)shipmentPlansIt.next();
+ GenericValue shipmentPlan = shipmentPlansIt.next();
GenericValue orderItem = shipmentPlan.getRelatedOne("OrderItem");
List<GenericValue> productionRuns = delegator.findByAndCache("WorkOrderItemFulfillment", UtilMisc.toMap("orderId", shipmentPlan.getString("orderId"), "orderItemSeqId", shipmentPlan.getString("orderItemSeqId"), "shipGroupSeqId", shipmentPlan.getString("shipGroupSeqId")));
Modified: ofbiz/branches/jackrabbit20100709/applications/manufacturing/src/org/ofbiz/manufacturing/bom/BOMNode.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/manufacturing/src/org/ofbiz/manufacturing/bom/BOMNode.java?rev=1084863&r1=1084862&r2=1084863&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/manufacturing/src/org/ofbiz/manufacturing/bom/BOMNode.java (original)
+++ ofbiz/branches/jackrabbit20100709/applications/manufacturing/src/org/ofbiz/manufacturing/bom/BOMNode.java Thu Mar 24 07:23:42 2011
@@ -118,7 +118,7 @@ public class BOMNode {
GenericValue oneChild = null;
BOMNode oneChildNode = null;
while (childrenIterator.hasNext()) {
- oneChild = (GenericValue)childrenIterator.next();
+ oneChild = childrenIterator.next();
// Configurator
oneChildNode = configurator(oneChild, productFeatures, getRootNode().getProductForRules(), inDate);
// If the node is null this means that the node has been discarded by the rules.
@@ -145,7 +145,7 @@ public class BOMNode {
if (productPartRules != null) {
GenericValue rule = null;
for (int i = 0; i < productPartRules.size(); i++) {
- rule = (GenericValue)productPartRules.get(i);
+ rule = productPartRules.get(i);
String ruleCondition = (String)rule.get("productFeature");
String ruleOperator = (String)rule.get("ruleOperator");
String newPart = (String)rule.get("productIdInSubst");
@@ -163,7 +163,7 @@ public class BOMNode {
} else {
if (productFeatures != null) {
for (int j = 0; j < productFeatures.size(); j++) {
- feature = (GenericValue)productFeatures.get(j);
+ feature = productFeatures.get(j);
if (ruleCondition.equals((String)feature.get("productFeatureId"))) {
ruleSatisfied = true;
break;
@@ -277,7 +277,7 @@ public class BOMNode {
if (productFeatures != null) {
GenericValue feature = null;
for (int j = 0; j < productFeatures.size(); j++) {
- feature = (GenericValue)productFeatures.get(j);
+ feature = productFeatures.get(j);
selectedFeatures.put(feature.getString("productFeatureTypeId"), feature.getString("productFeatureId")); // FIXME
}
}
@@ -292,7 +292,7 @@ public class BOMNode {
storeResult = dispatcher.runSync("getProductVariant", context);
List<GenericValue> variantProducts = UtilGenerics.checkList(storeResult.get("products"));
if (variantProducts.size() == 1) {
- variantProduct = (GenericValue)variantProducts.get(0);
+ variantProduct = variantProducts.get(0);
}
} catch (GenericServiceException e) {
if (Debug.infoOn()) Debug.logInfo("Error calling getProductVariant service " + e.getMessage(), module);
@@ -346,7 +346,7 @@ public class BOMNode {
GenericValue oneChild = null;
BOMNode oneChildNode = null;
while (childrenIterator.hasNext()) {
- oneChild = (GenericValue)childrenIterator.next();
+ oneChild = childrenIterator.next();
oneChildNode = new BOMNode(oneChild.getString("productId"), delegator, dispatcher, userLogin);
// Configurator
//oneChildNode = configurator(oneChild, productFeatures, getRootNode().getProductForRules(), delegator);
@@ -392,14 +392,14 @@ public class BOMNode {
BOMNode oneChildNode = null;
depth++;
for (int i = 0; i < children.size(); i++) {
- oneChild = (GenericValue)children.get(i);
+ oneChild = children.get(i);
BigDecimal bomQuantity = BigDecimal.ZERO;
try {
bomQuantity = oneChild.getBigDecimal("quantity");
} catch (Exception exc) {
bomQuantity = BigDecimal.ONE;
}
- oneChildNode = (BOMNode)childrenNodes.get(i);
+ oneChildNode = childrenNodes.get(i);
sb.append("<br/>");
if (oneChildNode != null) {
oneChildNode.print(sb, quantity.multiply(bomQuantity), depth);
@@ -451,7 +451,7 @@ public class BOMNode {
BOMNode oneChildNode = null;
depth++;
for (int i = 0; i < children.size(); i++) {
- oneChildNode = (BOMNode)childrenNodes.get(i);
+ oneChildNode = childrenNodes.get(i);
if (excludeWIPs && "WIP".equals(oneChildNode.getProduct().getString("productTypeId"))) {
continue;
}
@@ -473,7 +473,7 @@ public class BOMNode {
BOMNode oneChildNode = null;
depth++;
for (int i = 0; i < children.size(); i++) {
- oneChildNode = (BOMNode)childrenNodes.get(i);
+ oneChildNode = childrenNodes.get(i);
if (excludeWIPs && "WIP".equals(oneChildNode.getProduct().getString("productTypeId"))) {
continue;
}
@@ -486,7 +486,7 @@ public class BOMNode {
public void sumQuantity(Map<String, BOMNode> nodes) {
// First of all, we try to fetch a node with the same partId
- BOMNode sameNode = (BOMNode)nodes.get(product.getString("productId"));
+ BOMNode sameNode = nodes.get(product.getString("productId"));
// If the node is not found we create a new node for the current product
if (sameNode == null) {
sameNode = new BOMNode(product, dispatcher, userLogin);
@@ -497,7 +497,7 @@ public class BOMNode {
// Now (recursively) we visit the children.
BOMNode oneChildNode = null;
for (int i = 0; i < childrenNodes.size(); i++) {
- oneChildNode = (BOMNode)childrenNodes.get(i);
+ oneChildNode = childrenNodes.get(i);
if (oneChildNode != null) {
oneChildNode.sumQuantity(nodes);
}
@@ -512,7 +512,7 @@ public class BOMNode {
List<String> childProductionRuns = FastList.newInstance();
Timestamp maxEndDate = null;
for (int i = 0; i < childrenNodes.size(); i++) {
- oneChildNode = (BOMNode)childrenNodes.get(i);
+ oneChildNode = childrenNodes.get(i);
if (oneChildNode != null) {
Map<String, Object> tmpResult = oneChildNode.createManufacturingOrder(facilityId, date, null, null, null, null, null, shipGroupSeqId, shipmentId, false, false);
String childProductionRunId = (String)tmpResult.get("productionRunId");
@@ -576,7 +576,7 @@ public class BOMNode {
delegator.create("WorkOrderItemFulfillment", UtilMisc.toMap("workEffortId", productionRunId, "orderId", orderId, "orderItemSeqId", orderItemSeqId, "shipGroupSeqId", shipGroupSeqId));
}
for (int i = 0; i < childProductionRuns.size(); i++) {
- delegator.create("WorkEffortAssoc", UtilMisc.toMap("workEffortIdFrom", (String)childProductionRuns.get(i), "workEffortIdTo", productionRunId, "workEffortAssocTypeId", "WORK_EFF_PRECEDENCY", "fromDate", startDate));
+ delegator.create("WorkEffortAssoc", UtilMisc.toMap("workEffortIdFrom", childProductionRuns.get(i), "workEffortIdTo", productionRunId, "workEffortAssocTypeId", "WORK_EFF_PRECEDENCY", "fromDate", startDate));
}
}
} catch (GenericEntityException e) {
@@ -594,7 +594,7 @@ public class BOMNode {
Timestamp startDate = proposedOrder.getRequirementStartDate();
minStartDate = startDate;
for (int i = 0; i < childrenNodes.size(); i++) {
- BOMNode oneChildNode = (BOMNode)childrenNodes.get(i);
+ BOMNode oneChildNode = childrenNodes.get(i);
if (oneChildNode != null) {
Timestamp childStartDate = oneChildNode.getStartDate(facilityId, startDate, false);
if (childStartDate.compareTo(minStartDate) < 0) {
@@ -633,7 +633,7 @@ public class BOMNode {
}
if (UtilValidate.isNotEmpty(pfs)) {
for (int i = 0; i < pfs.size(); i++) {
- GenericValue pf = (GenericValue)pfs.get(i);
+ GenericValue pf = pfs.get(i);
if (UtilValidate.isNotEmpty(pf.get("minimumStock")) && UtilValidate.isNotEmpty(pf.get("reorderQuantity"))) {
isWarehouseManaged = true;
break;
@@ -682,7 +682,7 @@ public class BOMNode {
// Now (recursively) we visit the children.
BOMNode oneChildNode = null;
for (int i = 0; i < children.size(); i++) {
- oneChildNode = (BOMNode)childrenNodes.get(i);
+ oneChildNode = childrenNodes.get(i);
if (oneChildNode != null) {
oneChildNode.isConfigured(arr);
}
Modified: ofbiz/branches/jackrabbit20100709/applications/manufacturing/src/org/ofbiz/manufacturing/bom/BOMServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/manufacturing/src/org/ofbiz/manufacturing/bom/BOMServices.java?rev=1084863&r1=1084862&r2=1084863&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/manufacturing/src/org/ofbiz/manufacturing/bom/BOMServices.java (original)
+++ ofbiz/branches/jackrabbit20100709/applications/manufacturing/src/org/ofbiz/manufacturing/bom/BOMServices.java Thu Mar 24 07:23:42 2011
@@ -86,7 +86,7 @@ public class BOMServices {
List<GenericValue> bomTypesValues = delegator.findByAnd("ProductAssocType", UtilMisc.toMap("parentTypeId", "PRODUCT_COMPONENT"));
Iterator<GenericValue> bomTypesValuesIt = bomTypesValues.iterator();
while (bomTypesValuesIt.hasNext()) {
- bomTypes.add(((GenericValue)bomTypesValuesIt.next()).getString("productAssocTypeId"));
+ bomTypes.add((bomTypesValuesIt.next()).getString("productAssocTypeId"));
}
} catch (GenericEntityException gee) {
return ServiceUtil.returnError(UtilProperties.getMessage(resource, "ManufacturingBomErrorRunningMaxDethAlgorithm", UtilMisc.toMap("errorString", gee.getMessage()), locale));
@@ -100,7 +100,7 @@ public class BOMServices {
Iterator<String> bomTypesIt = bomTypes.iterator();
try {
while (bomTypesIt.hasNext()) {
- String oneBomType = (String)bomTypesIt.next();
+ String oneBomType = bomTypesIt.next();
depth = BOMHelper.getMaxDepth(productId, oneBomType, fromDate, delegator);
if (depth > maxDepth) {
maxDepth = depth;
@@ -152,7 +152,7 @@ public class BOMServices {
Iterator<GenericValue> virtualProductsIt = virtualProducts.iterator();
while (virtualProductsIt.hasNext()) {
int virtualDepth = 0;
- GenericValue oneVirtualProductAssoc = (GenericValue)virtualProductsIt.next();
+ GenericValue oneVirtualProductAssoc = virtualProductsIt.next();
GenericValue virtualProduct = delegator.findByPrimaryKey("Product", UtilMisc.toMap("productId", oneVirtualProductAssoc.getString("productId")));
if (virtualProduct.get("billOfMaterialLevel") != null) {
virtualDepth = virtualProduct.getLong("billOfMaterialLevel").intValue();
@@ -174,7 +174,7 @@ public class BOMServices {
List<BOMNode> products = FastList.newInstance();
tree.print(products, llc.intValue());
for (int i = 0; i < products.size(); i++) {
- BOMNode oneNode = (BOMNode)products.get(i);
+ BOMNode oneNode = products.get(i);
GenericValue oneProduct = oneNode.getProduct();
int lev = 0;
if (oneProduct.get("billOfMaterialLevel") != null) {
@@ -192,7 +192,7 @@ public class BOMServices {
variantProducts = EntityUtil.filterByDate(variantProducts, true);
Iterator<GenericValue> variantProductsIt = variantProducts.iterator();
while (variantProductsIt.hasNext()) {
- GenericValue oneVariantProductAssoc = (GenericValue)variantProductsIt.next();
+ GenericValue oneVariantProductAssoc = variantProductsIt.next();
GenericValue variantProduct = delegator.findByPrimaryKey("Product", UtilMisc.toMap("productId", oneVariantProductAssoc.getString("productId")));
variantProduct.set("billOfMaterialLevel", llc);
variantProduct.store();
@@ -224,7 +224,7 @@ public class BOMServices {
Long zero = Long.valueOf(0);
List<GenericValue> allProducts = FastList.newInstance();
while (productsIt.hasNext()) {
- GenericValue product = (GenericValue)productsIt.next();
+ GenericValue product = productsIt.next();
product.set("billOfMaterialLevel", zero);
allProducts.add(product);
}
@@ -233,7 +233,7 @@ public class BOMServices {
productsIt = products.iterator();
while (productsIt.hasNext()) {
- GenericValue product = (GenericValue)productsIt.next();
+ GenericValue product = productsIt.next();
try {
Map<String, Object> depthResult = dispatcher.runSync("updateLowLevelCode", UtilMisc.<String, Object>toMap("productIdTo", product.getString("productId"), "alsoComponents", Boolean.valueOf(false), "alsoVariants", Boolean.valueOf(false)));
Debug.logInfo("Product [" + product.getString("productId") + "] Low Level Code [" + depthResult.get("lowLevelCode") + "]", module);
@@ -417,7 +417,7 @@ public class BOMServices {
Iterator<BOMNode> componentsIt = components.iterator();
while (componentsIt.hasNext()) {
Map<String, Object> componentMap = FastMap.newInstance();
- BOMNode node = (BOMNode)componentsIt.next();
+ BOMNode node = componentsIt.next();
componentMap.put("product", node.getProduct());
componentMap.put("quantity", node.getQuantity());
componentsMap.add(componentMap);
@@ -468,7 +468,7 @@ public class BOMServices {
}
Iterator<BOMNode> componentsIt = components.iterator();
while (componentsIt.hasNext()) {
- BOMNode oneComponent = (BOMNode)componentsIt.next();
+ BOMNode oneComponent = componentsIt.next();
if (!oneComponent.isManufactured()) {
notAssembledComponents.add(oneComponent);
}
@@ -507,7 +507,7 @@ public class BOMServices {
Map<String, Object> orderReadHelpers = FastMap.newInstance();
Map<String, Object> partyOrderShipments = FastMap.newInstance();
while (shipmentItemsIt.hasNext()) {
- GenericValue shipmentItem = (GenericValue)shipmentItemsIt.next();
+ GenericValue shipmentItem = shipmentItemsIt.next();
// Get the OrderShipments
List<GenericValue> orderShipments = null;
try {
@@ -554,7 +554,7 @@ public class BOMServices {
}
List<BOMNode> productsInPackages = UtilGenerics.checkList(resultService.get("productsInPackages"));
if (productsInPackages.size() == 1) {
- BOMNode root = (BOMNode)productsInPackages.get(0);
+ BOMNode root = productsInPackages.get(0);
String rootProductId = (root.getSubstitutedNode() != null? root.getSubstitutedNode().getProduct().getString("productId"): root.getProduct().getString("productId"));
if (orderItem.getString("productId").equals(rootProductId)) {
productsInPackages = null;
@@ -583,7 +583,7 @@ public class BOMServices {
// there are subcomponents:
// this is a multi package shipment item
for (int j = 0; j < productsInPackages.size(); j++) {
- BOMNode component = (BOMNode)productsInPackages.get(j);
+ BOMNode component = productsInPackages.get(j);
Map<String, Object> boxTypeContentMap = FastMap.newInstance();
boxTypeContentMap.put("content", orderShipmentReadMap);
boxTypeContentMap.put("componentIndex", Integer.valueOf(j));
@@ -638,9 +638,9 @@ public class BOMServices {
}
// The packages and package contents are created.
for (Map.Entry<String, List<Map<String, Object>>> boxTypeContentEntry : boxTypeContent.entrySet()) {
- String boxTypeId = (String)boxTypeContentEntry.getKey();
+ String boxTypeId = boxTypeContentEntry.getKey();
List<Map<String, Object>> contentList = UtilGenerics.checkList(boxTypeContentEntry.getValue());
- GenericValue boxType = (GenericValue)boxTypes.get(boxTypeId);
+ GenericValue boxType = boxTypes.get(boxTypeId);
BigDecimal boxWidth = boxType.getBigDecimal("boxLength");
BigDecimal totalWidth = BigDecimal.ZERO;
if (boxWidth == null) {
@@ -660,7 +660,7 @@ public class BOMServices {
if (subProduct) {
// multi package
Integer index = (Integer)contentMap.get("componentIndex");
- BOMNode component = (BOMNode)productsInPackages.get(index.intValue());
+ BOMNode component = productsInPackages.get(index.intValue());
product = component.getProduct();
quantity = component.getQuantity();
} else {
Modified: ofbiz/branches/jackrabbit20100709/applications/manufacturing/src/org/ofbiz/manufacturing/bom/BOMTree.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/manufacturing/src/org/ofbiz/manufacturing/bom/BOMTree.java?rev=1084863&r1=1084862&r2=1084863&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/manufacturing/src/org/ofbiz/manufacturing/bom/BOMTree.java (original)
+++ ofbiz/branches/jackrabbit20100709/applications/manufacturing/src/org/ofbiz/manufacturing/bom/BOMTree.java Thu Mar 24 07:23:42 2011
@@ -106,7 +106,7 @@ public class BOMTree {
List<GenericValue> productFeatures = FastList.newInstance();
GenericValue oneProductFeatureAppl = null;
for (int i = 0; i < productFeaturesAppl.size(); i++) {
- oneProductFeatureAppl = (GenericValue)productFeaturesAppl.get(i);
+ oneProductFeatureAppl = productFeaturesAppl.get(i);
productFeatures.add(delegator.findByPrimaryKey("ProductFeature",
UtilMisc.toMap("productFeatureId", oneProductFeatureAppl.getString("productFeatureId"))));
Modified: ofbiz/branches/jackrabbit20100709/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRun.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRun.java?rev=1084863&r1=1084862&r2=1084863&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRun.java (original)
+++ ofbiz/branches/jackrabbit20100709/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRun.java Thu Mar 24 07:23:42 2011
@@ -137,13 +137,13 @@ public class ProductionRun {
}
if (productionRunRoutingTasks != null) {
for (Iterator<GenericValue> iter = productionRunRoutingTasks.iterator(); iter.hasNext();) {
- GenericValue routingTask = (GenericValue) iter.next();
+ GenericValue routingTask = iter.next();
routingTask.store();
}
}
if (productionRunComponents != null) {
for (Iterator<GenericValue> iter = productionRunComponents.iterator(); iter.hasNext();) {
- GenericValue component = (GenericValue) iter.next();
+ GenericValue component = iter.next();
component.store();
}
}
@@ -202,7 +202,7 @@ public class ProductionRun {
this.updateCompletionDate = true;
if (productionRunComponents == null) getProductionRunComponents();
for (Iterator<GenericValue> iter = productionRunComponents.iterator(); iter.hasNext();) {
- GenericValue component = (GenericValue) iter.next();
+ GenericValue component = iter.next();
componentQuantity = component.getBigDecimal("estimatedQuantity");
component.set("estimatedQuantity", componentQuantity.divide(previousQuantity, 10, BigDecimal.ROUND_HALF_UP).multiply(newQuantity));
}
@@ -257,7 +257,7 @@ public class ProductionRun {
if (quantity == null) getQuantity();
Timestamp endDate=null;
for (Iterator<GenericValue> iter = productionRunRoutingTasks.iterator(); iter.hasNext();) {
- GenericValue routingTask = (GenericValue) iter.next();
+ GenericValue routingTask = iter.next();
if (priority.compareTo(routingTask.getLong("priority")) <= 0) {
// Calculate the estimatedCompletionDate
long totalTime = ProductionRun.getEstimatedTaskTime(routingTask, quantity, dispatcher);
@@ -332,7 +332,7 @@ public class ProductionRun {
productionRunComponents = FastList.newInstance();
GenericValue routingTask;
for (Iterator<GenericValue> iter = productionRunRoutingTasks.iterator(); iter.hasNext();) {
- routingTask = (GenericValue)iter.next();
+ routingTask = iter.next();
productionRunComponents.addAll(routingTask.getRelated("WorkEffortGoodStandard", UtilMisc.toMap("workEffortGoodStdTypeId", "PRUNT_PROD_NEEDED"),null));
}
} catch (GenericEntityException e) {
@@ -375,7 +375,7 @@ public class ProductionRun {
Debug.logWarning(e.getMessage(), module);
}
}
- return (GenericValue) (UtilValidate.isNotEmpty(productionRunRoutingTasks) ? productionRunRoutingTasks.get(productionRunRoutingTasks.size() - 1): null);
+ return (UtilValidate.isNotEmpty(productionRunRoutingTasks) ? productionRunRoutingTasks.get(productionRunRoutingTasks.size() - 1): null);
}
return null;
}
Modified: ofbiz/branches/jackrabbit20100709/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunHelper.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/jackrabbit20100709/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunHelper.java?rev=1084863&r1=1084862&r2=1084863&view=diff
==============================================================================
--- ofbiz/branches/jackrabbit20100709/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunHelper.java (original)
+++ ofbiz/branches/jackrabbit20100709/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunHelper.java Thu Mar 24 07:23:42 2011
@@ -89,7 +89,7 @@ public class ProductionRunHelper {
List<GenericValue> linkedWorkEfforts = EntityUtil.filterByDate(delegator.findByAnd("WorkEffortAssoc",
UtilMisc.toMap("workEffortIdTo", productionRunId, "workEffortAssocTypeId", "WORK_EFF_PRECEDENCY")));
for (int i = 0; i < linkedWorkEfforts.size(); i++) {
- GenericValue link = (GenericValue)linkedWorkEfforts.get(i);
+ GenericValue link = linkedWorkEfforts.get(i);
getLinkedProductionRuns(delegator, dispatcher, link.getString("workEffortIdFrom"), productionRuns);
}
}