Author: deepak
Date: Sat Sep 3 10:14:44 2016
New Revision: 1759066
URL: http://svn.apache.org/viewvc?rev=1759066&view=rev
Log:
(OFBIZ-8011) Applied patch from jira issue
=====================================
Add UI labels for success / error messages in product component
=====================================
Thanks Tanmay for your contribution.
Modified:
ofbiz/trunk/applications/product/config/ProductErrorUiLabels.xml
ofbiz/trunk/applications/product/config/ProductUiLabels.xml
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/imagemanagement/CropImage.java
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/imagemanagement/FrameImage.java
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/imagemanagement/ImageManagementServices.java
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/imagemanagement/ReplaceImage.java
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/imagemanagement/RotateImage.java
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductServices.java
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/subscription/SubscriptionServices.java
Modified: ofbiz/trunk/applications/product/config/ProductErrorUiLabels.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/config/ProductErrorUiLabels.xml?rev=1759066&r1=1759065&r2=1759066&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/config/ProductErrorUiLabels.xml (original)
+++ ofbiz/trunk/applications/product/config/ProductErrorUiLabels.xml Sat Sep 3
10:14:44 2016
@@ -83,6 +83,15 @@
<value xml:lang="ja">å
¥åããæ°é (${parameters.quantity})
ãæå¾
ããæ°é (${picklistItem.quantity}) ãã大ããã</value>
<value xml:lang="zh">è¾å
¥çæ°éï¼${parameters.quantity}ï¼å¤§äºææçæ°éï¼${picklistItem.quantity}ï¼ã</value>
</property>
+ <property key="ProductCannotCreateTheTargetDirectory">
+ <value xml:lang="en">Cannot create the target directory.</value>
+ </property>
+ <property key="ProductCannotReplaceBecauseBothImagesAreTheSameImage">
+ <value xml:lang="en">Cannot replace because both images are the same
image.</value>
+ </property>
+ <property key="ProductCannotReplaceImage">
+ <value xml:lang="en">Cannot replace image.</value>
+ </property>
<property key="ProductCreateCommunicationEventProductPermissionError">
<value xml:lang="de">Berechtigungsfehler beim Erstellen des Produkt
Communication Events</value>
<value xml:lang="en">Create Communication Event Product Permission
Error</value>
@@ -107,6 +116,12 @@
<value xml:lang="zh">éè¯¯ï¼ææè®¢åæç»é½æ²¡æéªè¯</value>
<value xml:lang="zh-TW">é¯èª¤:ææè¨å®ç´°é
齿²æé©è</value>
</property>
+ <property key="ProductErrorCreatingNewVirtualProductFromVariantProducts">
+ <value xml:lang="en">Error creating new virtual product from variant
products: ${errorString}</value>
+ </property>
+ <property key="ProductErrorsOccurInParsingImageProperties.xml">
+ <value xml:lang="en">Errors occur in parsing ImageProperties.xml:
${errorString}</value>
+ </property>
<property key="ProductErrorEnteredBothDimensionAndPackageInputBoxField">
<value xml:lang="de">FEHLER: MaÃangaben und Verpackung wurden
angegeben, beide Felder zusammen können nicht verarbeitet werden (bitte nur
eins von beiden angeben)</value>
<value xml:lang="en">ERROR: Entered Dimension and Package input box,
both the fields cannot be processed together (should enter one of them)</value>
@@ -704,6 +719,15 @@
<value xml:lang="zh">è®¢åæ°éå¿
须䏿¯ç©ºãè¯·éæ°è¾å
¥æå°åæ£è¡¨åã</value>
<value xml:lang="zh-TW">è¨å®æ¸éå¿
é 䏿¯ç©º.è«éæ°è¼¸å
¥åå°æè²¨è¡¨å®.</value>
</property>
+ <property key="ProductPleaseChooseImageToReplace">
+ <value xml:lang="en">Please choose image to replace.</value>
+ </property>
+ <property key="ProductPleaseChooseReplacementImage">
+ <value xml:lang="en">Please choose replacement image.</value>
+ </property>
+ <property key="ProductPleaseSelectImage">
+ <value xml:lang="en">Please select Image.</value>
+ </property>
<property key="ProductRemoveCommunicationEventProductPermissionError">
<value xml:lang="de">Produkt Berechtigungsfehler beim Löschen des
Kommunikationsevents</value>
<value xml:lang="en">Remove Communication Event Product Permission
Error</value>
@@ -743,6 +767,9 @@
<value xml:lang="zh">ç¶æååæ æï¼ä»
${productReview.statusId} å为 ${parameters.statusId}</value>
<value xml:lang="zh-TW">çæ
è®åç¡æ:å¾
${productReview.statusId} è®çº ${parameters.statusId}</value>
</property>
+ <property key="ProductScaleAdditionalImageInAllDifferentSizesIsImpossible">
+ <value xml:lang="en">Scale additional image in all different sizes is
impossible: ${errorString}</value>
+ </property>
<property key="productSearchEvents.added_param_features">
<value xml:lang="de">${numAdded} Merkmale hinzugefügt mit ID
${productFeatureId}</value>
<value xml:lang="en">Added ${numAdded} features with ID
${productFeatureId}</value>
@@ -1096,6 +1123,9 @@
<value xml:lang="zh">æ²¡ææ¾å°äº§åï¼æ è¯æ¯</value>
<value xml:lang="zh-TW">æ²ææ¾å°ç¢åè奿¯</value>
</property>
+ <property key="ProductSubscriptionCouldntBeExpired">
+ <value xml:lang="en">Subscription couldn't be expired for
subscriptionId: ${subscriptionId}</value>
+ </property>
<property
key="productutilservices.did_not_find_any_valid_variants_for_virtual_ID">
<value xml:lang="de">Keine gültigen Varianten gefunden für
virtuelles Produkt mit der ID [${productId}], kein Merge
durchgeführt...</value>
<value xml:lang="en">Did not find any valid variants for virtual ID
[${productId}], not doing merge...</value>
Modified: ofbiz/trunk/applications/product/config/ProductUiLabels.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/config/ProductUiLabels.xml?rev=1759066&r1=1759065&r2=1759066&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/config/ProductUiLabels.xml (original)
+++ ofbiz/trunk/applications/product/config/ProductUiLabels.xml Sat Sep 3
10:14:44 2016
@@ -16001,6 +16001,12 @@
<value xml:lang="zh">å建è
/修订è
</value>
<value xml:lang="zh-TW">æ°å»ºè
/ä¿®è¨è
</value>
</property>
+ <property key="ProductCreateNewThumbnailSizeSuccessful">
+ <value xml:lang="en">Create new thumbnail size successful.</value>
+ </property>
+ <property key="ProductCropImageSuccessfully">
+ <value xml:lang="en">Crop image successfully.</value>
+ </property>
<property key="ProductCrossSell">
<value xml:lang="de">Ihnen könnte auch gefallen:</value>
<value xml:lang="en">You might be interested in these as well:</value>
@@ -18425,6 +18431,9 @@
<value xml:lang="zh">åºå®è´¹ç¨</value>
<value xml:lang="zh-TW">åºå®è²»ç¨</value>
</property>
+ <property key="ProductFrameImageSuccessfully">
+ <value xml:lang="en">Frame image successfully.</value>
+ </property>
<property key="ProductFromAnOrder">
<value xml:lang="de">von Auftrag</value>
<value xml:lang="en">from Order</value>
@@ -27320,6 +27329,9 @@
<value xml:lang="zh">å é¤ç»æèª</value>
<value xml:lang="zh-TW">åªé¤çµæèª</value>
</property>
+ <property key="ProductRenameImageSuccessfully.">
+ <value xml:lang="en">Rename image successfully.</value>
+ </property>
<property key="ProductReorderQuantity">
<value xml:lang="de">Neubestellung Menge</value>
<value xml:lang="en">Reorder Quantity</value>
@@ -27334,6 +27346,9 @@
<value xml:lang="zh">åè®¢è´æ°é</value>
<value xml:lang="zh-TW">åè¨è³¼æ¸é</value>
</property>
+ <property key="ProductReplaceImageSuccessfully">
+ <value xml:lang="en">Replace image successfully.</value>
+ </property>
<property key="ProductReplaceOriginal">
<value xml:lang="de">Erstetzt Original</value>
<value xml:lang="en">Replace Original</value>
@@ -27613,6 +27628,9 @@
<value xml:lang="zh">éç½®æ¥æ</value>
<value xml:lang="zh-TW">éç½®æ¥æ</value>
</property>
+ <property key="ProductResizeImagesSuccessful">
+ <value xml:lang="en">Resize images successful.</value>
+ </property>
<property key="ProductResultOfImageUpload">
<value xml:lang="de">Resultat des Bild hochladens</value>
<value xml:lang="en">Result of image Upload</value>
@@ -27828,6 +27846,9 @@
<value xml:lang="zh">æ±æ»</value>
<value xml:lang="zh-TW">å¯ç¸½</value>
</property>
+ <property key="ProductRotatedImageSuccessfully">
+ <value xml:lang="en">Rotated image successfully.</value>
+ </property>
<property key="ProductRouteSegment">
<value xml:lang="de">Weg Abschnitt</value>
<value xml:lang="en">Route Segment</value>
@@ -27934,6 +27955,9 @@
<value xml:lang="zh">è§å</value>
<value xml:lang="zh-TW">è¦å</value>
</property>
+ <property key="ProductRunSubscriptionExpiredServiceCalledSuccessfully">
+ <value xml:lang="en">runSubscriptionExpired service called
successfully with subscriptionId ${subscriptionId}</value>
+ </property>
<property key="ProductSRCH">
<value xml:lang="de">Suche</value>
<value xml:lang="en">SRCH</value>
Modified:
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/imagemanagement/CropImage.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/imagemanagement/CropImage.java?rev=1759066&r1=1759065&r2=1759066&view=diff
==============================================================================
---
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/imagemanagement/CropImage.java
(original)
+++
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/imagemanagement/CropImage.java
Sat Sep 3 10:14:44 2016
@@ -23,13 +23,14 @@ import java.awt.image.RenderedImage;
import java.io.File;
import java.io.IOException;
import java.util.HashMap;
+import java.util.Locale;
import java.util.Map;
import javax.imageio.ImageIO;
-import org.jdom.JDOMException;
import org.apache.ofbiz.base.util.Debug;
import org.apache.ofbiz.base.util.UtilDateTime;
+import org.apache.ofbiz.base.util.UtilProperties;
import org.apache.ofbiz.base.util.UtilValidate;
import org.apache.ofbiz.base.util.string.FlexibleStringExpander;
import org.apache.ofbiz.entity.Delegator;
@@ -39,17 +40,20 @@ import org.apache.ofbiz.service.Dispatch
import org.apache.ofbiz.service.GenericServiceException;
import org.apache.ofbiz.service.LocalDispatcher;
import org.apache.ofbiz.service.ServiceUtil;
+import org.jdom.JDOMException;
public class CropImage {
public static final String module = CropImage.class.getName();
- public static final String resource = "ProductErrorUiLabels";
+ public static final String resourceError = "ProductErrorUiLabels";
+ public static final String resource = "ProductUiLabels";
public static Map<String, Object> imageCrop(DispatchContext dctx,
Map<String, ? extends Object> context)
throws IOException, JDOMException {
LocalDispatcher dispatcher = dctx.getDispatcher();
Delegator delegator = dispatcher.getDelegator();
+ Locale locale = (Locale)context.get("locale");
GenericValue userLogin = (GenericValue) context.get("userLogin");
String nameOfThumb =
FlexibleStringExpander.expandString(EntityUtilProperties.getPropertyValue("catalog",
"image.management.nameofthumbnail", delegator), context);
@@ -150,11 +154,11 @@ public class CropImage {
return ServiceUtil.returnError(e.getMessage());
}
} else {
- String errMsg = "Please select Image.";
+ String errMsg = UtilProperties.getMessage(resourceError,
"ProductPleaseSelectImage", locale);
Debug.logFatal(errMsg, module);
return ServiceUtil.returnError(errMsg);
}
- String successMsg = "Crop image successfully.";
+ String successMsg = UtilProperties.getMessage(resource,
"ProductCropImageSuccessfully", locale);
Map<String, Object> result = ServiceUtil.returnSuccess(successMsg);
return result;
}
Modified:
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/imagemanagement/FrameImage.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/imagemanagement/FrameImage.java?rev=1759066&r1=1759065&r2=1759066&view=diff
==============================================================================
---
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/imagemanagement/FrameImage.java
(original)
+++
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/imagemanagement/FrameImage.java
Sat Sep 3 10:14:44 2016
@@ -61,7 +61,8 @@ import org.apache.ofbiz.service.ServiceU
public class FrameImage {
public static final String module = FrameImage.class.getName();
- public static final String resource = "ProductErrorUiLabels";
+ public static final String resourceError = "ProductErrorUiLabels";
+ public static final String resource = "ProductUiLabels";
public static Map<String, Object> addImageFrame(DispatchContext dctx,
Map<String, ? extends Object> context)
throws IOException, JDOMException {
@@ -80,12 +81,12 @@ public class FrameImage {
Locale locale = (Locale) context.get("locale");
if (UtilValidate.isEmpty(context.get("frameContentId")) ||
UtilValidate.isEmpty(context.get("frameDataResourceId"))) {
- result =
ServiceUtil.returnError(UtilProperties.getMessage(resource,
+ result =
ServiceUtil.returnError(UtilProperties.getMessage(resourceError,
"ProductImageFrameContentIdRequired", locale));
result.putAll(context);
}
if (UtilValidate.isEmpty(context.get("imageWidth")) ||
UtilValidate.isEmpty(context.get("imageHeight"))) {
- result =
ServiceUtil.returnError(UtilProperties.getMessage(resource,
+ result =
ServiceUtil.returnError(UtilProperties.getMessage(resourceError,
"ProductImageWidthAndHeightRequired", locale));
result.putAll(context);
}
@@ -207,12 +208,12 @@ public class FrameImage {
}
}
else{
- String errMsg = "Please select Image.";
+ String errMsg = UtilProperties.getMessage(resourceError,
"ProductPleaseSelectImage", locale);
Debug.logFatal(errMsg, module);
result = ServiceUtil.returnError(errMsg);
result.putAll(context);
}
- String successMsg = "Frame image successfully.";
+ String successMsg = UtilProperties.getMessage(resource,
"ProductFrameImageSuccessfully", locale);
result = ServiceUtil.returnSuccess(successMsg);
return result;
}
Modified:
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/imagemanagement/ImageManagementServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/imagemanagement/ImageManagementServices.java?rev=1759066&r1=1759065&r2=1759066&view=diff
==============================================================================
---
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/imagemanagement/ImageManagementServices.java
(original)
+++
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/imagemanagement/ImageManagementServices.java
Sat Sep 3 10:14:44 2016
@@ -61,7 +61,8 @@ import org.apache.ofbiz.service.ServiceU
public class ImageManagementServices {
public static final String module =
ImageManagementServices.class.getName();
- public static final String resource = "ProductErrorUiLabels";
+ public static final String resourceError = "ProductErrorUiLabels";
+ public static final String resource = "ProductUiLabels";
private static int imageCount = 0;
private static String imagePath;
@@ -89,7 +90,7 @@ public class ImageManagementServices {
if (!rootTargetDir.exists()) {
boolean created = rootTargetDir.mkdirs();
if (!created) {
- String errMsg = "Cannot create the target directory";
+ String errMsg = UtilProperties.getMessage(resourceError,
"ProductCannotCreateTheTargetDirectory", locale);
Debug.logFatal(errMsg, module);
return ServiceUtil.returnError(errMsg);
}
@@ -172,11 +173,11 @@ public class ImageManagementServices {
out.close();
} catch (FileNotFoundException e) {
Debug.logError(e, module);
- return
ServiceUtil.returnError(UtilProperties.getMessage(resource,
+ return
ServiceUtil.returnError(UtilProperties.getMessage(resourceError,
"ProductImageViewUnableWriteFile",
UtilMisc.toMap("fileName", file.getAbsolutePath()), locale));
} catch (IOException e) {
Debug.logError(e, module);
- return
ServiceUtil.returnError(UtilProperties.getMessage(resource,
+ return
ServiceUtil.returnError(UtilProperties.getMessage(resourceError,
"ProductImageViewUnableWriteBinaryData",
UtilMisc.toMap("fileName", file.getAbsolutePath()), locale));
}
}
@@ -192,11 +193,11 @@ public class ImageManagementServices {
outFile.close();
} catch (FileNotFoundException e) {
Debug.logError(e, module);
- return
ServiceUtil.returnError(UtilProperties.getMessage(resource,
+ return
ServiceUtil.returnError(UtilProperties.getMessage(resourceError,
"ProductImageViewUnableWriteFile",
UtilMisc.toMap("fileName", fileOriginal.getAbsolutePath()), locale));
} catch (IOException e) {
Debug.logError(e, module);
- return
ServiceUtil.returnError(UtilProperties.getMessage(resource,
+ return
ServiceUtil.returnError(UtilProperties.getMessage(resourceError,
"ProductImageViewUnableWriteBinaryData",
UtilMisc.toMap("fileName", fileOriginal.getAbsolutePath()), locale));
}
@@ -204,11 +205,11 @@ public class ImageManagementServices {
try {
resultResize.putAll(scaleImageMangementInAllSize(dctx,
context, imageName, sizeType, productId));
} catch (IOException e) {
- String errMsg = "Scale additional image in all different
sizes is impossible : " + e.toString();
+ String errMsg = UtilProperties.getMessage(resourceError,
"ProductScaleAdditionalImageInAllDifferentSizesIsImpossible",
UtilMisc.toMap("errorString", e.toString()), locale);
Debug.logError(e, errMsg, module);
return ServiceUtil.returnError(errMsg);
} catch (JDOMException e) {
- String errMsg = "Errors occur in parsing
ImageProperties.xml : " + e.toString();
+ String errMsg = UtilProperties.getMessage(resourceError,
"ProductErrorsOccurInParsingImageProperties.xml", UtilMisc.toMap("errorString",
e.toString()), locale);
Debug.logError(e, errMsg, module);
return ServiceUtil.returnError(errMsg);
}
@@ -324,7 +325,7 @@ public class ImageManagementServices {
if (resultXMLMap.containsKey("responseMessage") &&
resultXMLMap.get("responseMessage").equals("success")) {
imgPropertyMap.putAll(UtilGenerics.<Map<String, Map<String,
String>>>cast(resultXMLMap.get("xml")));
} else {
- String errMsg = UtilProperties.getMessage(resource,
"ScaleImage.unable_to_parse", locale) + " : ImageProperties.xml";
+ String errMsg = UtilProperties.getMessage(resourceError,
"ScaleImage.unable_to_parse", locale) + " : ImageProperties.xml";
Debug.logError(errMsg, module);
result.put("errorMessage", errMsg);
return result;
@@ -349,7 +350,7 @@ public class ImageManagementServices {
imgHeight = bufImg.getHeight();
imgWidth = bufImg.getWidth();
if (imgHeight == 0.0 || imgWidth == 0.0) {
- String errMsg = UtilProperties.getMessage(resource,
"ScaleImage.one_current_image_dimension_is_null", locale) + " : imgHeight = " +
imgHeight + " ; imgWidth = " + imgWidth;
+ String errMsg = UtilProperties.getMessage(resourceError,
"ScaleImage.one_current_image_dimension_is_null", locale) + " : imgHeight = " +
imgHeight + " ; imgWidth = " + imgWidth;
Debug.logError(errMsg, module);
result.put("errorMessage", errMsg);
return result;
@@ -369,7 +370,7 @@ public class ImageManagementServices {
if (!targetDir.exists()) {
boolean created = targetDir.mkdirs();
if (!created) {
- String errMsg =
UtilProperties.getMessage(resource,
"ScaleImage.unable_to_create_target_directory", locale) + " - " +
targetDirectory;
+ String errMsg =
UtilProperties.getMessage(resourceError,
"ScaleImage.unable_to_create_target_directory", locale) + " - " +
targetDirectory;
Debug.logFatal(errMsg, module);
return ServiceUtil.returnError(errMsg);
}
@@ -383,12 +384,12 @@ public class ImageManagementServices {
//FIXME can be removed ?
// boolean check = deleteFile.delete();
} catch (IllegalArgumentException e) {
- String errMsg = UtilProperties.getMessage(resource,
"ScaleImage.one_parameter_is_null", locale) + e.toString();
+ String errMsg =
UtilProperties.getMessage(resourceError, "ScaleImage.one_parameter_is_null",
locale) + e.toString();
Debug.logError(errMsg, module);
result.put("errorMessage", errMsg);
return result;
} catch (IOException e) {
- String errMsg = UtilProperties.getMessage(resource,
"ScaleImage.error_occurs_during_writing", locale) + e.toString();
+ String errMsg =
UtilProperties.getMessage(resourceError,
"ScaleImage.error_occurs_during_writing", locale) + e.toString();
Debug.logError(errMsg, module);
result.put("errorMessage", errMsg);
return result;
@@ -407,7 +408,7 @@ public class ImageManagementServices {
return result;
} else {
- String errMsg = UtilProperties.getMessage(resource,
"ScaleImage.unable_to_scale_original_image", locale) + " : " + filenameToUse;
+ String errMsg = UtilProperties.getMessage(resourceError,
"ScaleImage.unable_to_scale_original_image", locale) + " : " + filenameToUse;
Debug.logError(errMsg, module);
result.put("errorMessage", errMsg);
return ServiceUtil.returnError(errMsg);
@@ -565,12 +566,12 @@ public class ImageManagementServices {
outFileThumb.close();
} catch (FileNotFoundException e) {
Debug.logError(e, module);
- return ServiceUtil.returnError(UtilProperties.getMessage(resource,
+ return
ServiceUtil.returnError(UtilProperties.getMessage(resourceError,
"ProductImageViewUnableWriteFile",
UtilMisc.toMap("fileName",
fileOriginalThumb.getAbsolutePath()), locale));
} catch (IOException e) {
Debug.logError(e, module);
- return ServiceUtil.returnError(UtilProperties.getMessage(resource,
+ return
ServiceUtil.returnError(UtilProperties.getMessage(resourceError,
"ProductImageViewUnableWriteBinaryData",
UtilMisc.toMap("fileName",
fileOriginalThumb.getAbsolutePath()), locale));
}
@@ -579,11 +580,11 @@ public class ImageManagementServices {
try {
resultResizeThumb.putAll(scaleImageMangementInAllSize(dctx,
context, filenameToUseThumb, "thumbnail", productId));
} catch (IOException e) {
- String errMsg = "Scale additional image in all different sizes is
impossible : " + e.toString();
+ String errMsg = UtilProperties.getMessage(resourceError,
"ProductScaleAdditionalImageInAllDifferentSizesIsImpossible",
UtilMisc.toMap("errorString", e.toString()), locale);
Debug.logError(e, errMsg, module);
return ServiceUtil.returnError(errMsg);
} catch (JDOMException e) {
- String errMsg = "Errors occur in parsing ImageProperties.xml : " +
e.toString();
+ String errMsg = UtilProperties.getMessage(resourceError,
"ProductErrorsOccurInParsingImageProperties.xml", UtilMisc.toMap("errorString",
e.toString()), locale);
Debug.logError(e, errMsg, module);
return ServiceUtil.returnError(errMsg);
}
@@ -698,6 +699,7 @@ public class ImageManagementServices {
public static Map<String, Object> createNewImageThumbnail(DispatchContext
dctx, Map<String, ? extends Object> context) {
LocalDispatcher dispatcher = dctx.getDispatcher();
Delegator delegator = dispatcher.getDelegator();
+ Locale locale = (Locale)context.get("locale");
GenericValue userLogin = (GenericValue) context.get("userLogin");
String imageServerPath =
FlexibleStringExpander.expandString(EntityUtilProperties.getPropertyValue("catalog",
"image.management.path", delegator), context);
String imageServerUrl =
FlexibleStringExpander.expandString(EntityUtilProperties.getPropertyValue("catalog",
"image.management.url", delegator), context);
@@ -756,12 +758,13 @@ public class ImageManagementServices {
Debug.logError(e, module);
return ServiceUtil.returnError(e.getMessage());
}
- String successMsg = "Create new thumbnail size successful";
+ String successMsg = UtilProperties.getMessage(resource,
"ProductCreateNewThumbnailSizeSuccessful", locale);
return ServiceUtil.returnSuccess(successMsg);
}
public static Map<String, Object> resizeImageOfProduct(DispatchContext
dctx, Map<String, ? extends Object> context) {
Delegator delegator = dctx.getDelegator();
+ Locale locale = (Locale)context.get("locale");
String imageServerPath =
FlexibleStringExpander.expandString(EntityUtilProperties.getPropertyValue("catalog",
"image.management.path", delegator), context);
String productId = (String) context.get("productId");
String dataResourceName = (String) context.get("dataResourceName");
@@ -781,13 +784,14 @@ public class ImageManagementServices {
Debug.logError(e, module);
return ServiceUtil.returnError(e.getMessage());
}
- String successMsg = "Resize images successful";
+ String successMsg = UtilProperties.getMessage(resource,
"ProductResizeImagesSuccessful", locale);
return ServiceUtil.returnSuccess(successMsg);
}
public static Map<String, Object> renameImage(DispatchContext dctx,
Map<String, ? extends Object> context) {
LocalDispatcher dispatcher = dctx.getDispatcher();
Delegator delegator = dctx.getDelegator();
+ Locale locale = (Locale)context.get("locale");
GenericValue userLogin = (GenericValue) context.get("userLogin");
String imageServerPath =
FlexibleStringExpander.expandString(EntityUtilProperties.getPropertyValue("catalog",
"image.management.path", delegator), context);
String imageServerUrl =
FlexibleStringExpander.expandString(EntityUtilProperties.getPropertyValue("catalog",
"image.management.url", delegator), context);
@@ -916,7 +920,7 @@ public class ImageManagementServices {
Debug.logError(e, module);
return ServiceUtil.returnError(e.getMessage());
}
- String successMsg = "Rename image successfully.";
+ String successMsg = UtilProperties.getMessage(resource,
"ProductRenameImageSuccessfully.", locale);
return ServiceUtil.returnSuccess(successMsg);
}
}
Modified:
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/imagemanagement/ReplaceImage.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/imagemanagement/ReplaceImage.java?rev=1759066&r1=1759065&r2=1759066&view=diff
==============================================================================
---
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/imagemanagement/ReplaceImage.java
(original)
+++
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/imagemanagement/ReplaceImage.java
Sat Sep 3 10:14:44 2016
@@ -22,11 +22,13 @@ import java.awt.image.BufferedImage;
import java.io.File;
import java.util.HashMap;
import java.util.List;
+import java.util.Locale;
import java.util.Map;
import javax.imageio.ImageIO;
import org.apache.ofbiz.base.util.Debug;
+import org.apache.ofbiz.base.util.UtilProperties;
import org.apache.ofbiz.base.util.UtilValidate;
import org.apache.ofbiz.base.util.string.FlexibleStringExpander;
import org.apache.ofbiz.entity.Delegator;
@@ -40,11 +42,13 @@ import org.apache.ofbiz.service.ServiceU
public class ReplaceImage{
public static final String module = ReplaceImage.class.getName();
- public static final String resource = "ProductErrorUiLabels";
+ public static final String resourceError = "ProductErrorUiLabels";
+ public static final String resource = "ProductUiLabels";
public static Map<String, Object> replaceImageToExistImage(DispatchContext
dctx, Map<String, ? extends Object> context) {
LocalDispatcher dispatcher = dctx.getDispatcher();
Delegator delegator = dctx.getDelegator();
+ Locale locale = (Locale)context.get("locale");
GenericValue userLogin = (GenericValue) context.get("userLogin");
String imageServerPath =
FlexibleStringExpander.expandString(EntityUtilProperties.getPropertyValue("catalog",
"image.management.path", delegator), context);
String productId = (String) context.get("productId");
@@ -56,19 +60,19 @@ public class ReplaceImage{
if (UtilValidate.isNotEmpty(dataResourceNameExist)) {
if (UtilValidate.isNotEmpty(contentIdReplace)) {
if (contentIdExist.equals(contentIdReplace)) {
- String errMsg = "Cannot replace because both images are
the same image.";
+ String errMsg = UtilProperties.getMessage(resourceError,
"ProductCannotReplaceBecauseBothImagesAreTheSameImage", locale);
Debug.logError(errMsg, module);
return ServiceUtil.returnError(errMsg);
}
}
else{
- String errMsg = "Please choose image to replace.";
+ String errMsg = UtilProperties.getMessage(resourceError,
"ProductPleaseChooseImageToReplace", locale);
Debug.logError(errMsg, module);
return ServiceUtil.returnError(errMsg);
}
}
else{
- String errMsg = "Please choose replacement image.";
+ String errMsg = UtilProperties.getMessage(resourceError,
"ProductPleaseChooseReplacementImage", locale);
Debug.logError(errMsg, module);
return ServiceUtil.returnError(errMsg);
}
@@ -111,11 +115,11 @@ public class ReplaceImage{
dispatcher.runSync("removeProductContentAndImageFile",
productContentCtx);
}
} catch (Exception e) {
- String errMsg = "Cannot replace image.";
+ String errMsg = UtilProperties.getMessage(resourceError,
"ProductCannotReplaceImage", locale);
Debug.logError(errMsg, module);
return ServiceUtil.returnError(errMsg);
}
- String successMsg = "Replace image successfully.";
+ String successMsg = UtilProperties.getMessage(resource,
"ProductReplaceImageSuccessfully", locale);
return ServiceUtil.returnSuccess(successMsg);
}
Modified:
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/imagemanagement/RotateImage.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/imagemanagement/RotateImage.java?rev=1759066&r1=1759065&r2=1759066&view=diff
==============================================================================
---
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/imagemanagement/RotateImage.java
(original)
+++
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/imagemanagement/RotateImage.java
Sat Sep 3 10:14:44 2016
@@ -24,13 +24,14 @@ import java.awt.image.RenderedImage;
import java.io.File;
import java.io.IOException;
import java.util.HashMap;
+import java.util.Locale;
import java.util.Map;
import javax.imageio.ImageIO;
-import org.jdom.JDOMException;
import org.apache.ofbiz.base.util.Debug;
import org.apache.ofbiz.base.util.UtilDateTime;
+import org.apache.ofbiz.base.util.UtilProperties;
import org.apache.ofbiz.base.util.UtilValidate;
import org.apache.ofbiz.base.util.string.FlexibleStringExpander;
import org.apache.ofbiz.entity.Delegator;
@@ -40,15 +41,18 @@ import org.apache.ofbiz.service.Dispatch
import org.apache.ofbiz.service.GenericServiceException;
import org.apache.ofbiz.service.LocalDispatcher;
import org.apache.ofbiz.service.ServiceUtil;
+import org.jdom.JDOMException;
public class RotateImage {
public static final String module = RotateImage.class.getName();
- public static final String resource = "ProductErrorUiLabels";
+ public static final String resourceError = "ProductErrorUiLabels";
+ public static final String resource = "ProductFUiLabels";
public static Map<String, Object> imageRotate(DispatchContext dctx,
Map<String, ? extends Object> context)
throws IOException, JDOMException {
+ Locale locale = (Locale)context.get("locale");
LocalDispatcher dispatcher = dctx.getDispatcher();
Delegator delegator = dctx.getDelegator();
GenericValue userLogin = (GenericValue) context.get("userLogin");
@@ -157,11 +161,11 @@ public class RotateImage {
return ServiceUtil.returnError(e.getMessage());
}
} else {
- String errMsg = "Please select Image.";
+ String errMsg = UtilProperties.getMessage(resourceError,
"ProductPleaseSelectImage", locale);
Debug.logFatal(errMsg, module);
return ServiceUtil.returnError(errMsg);
}
- String successMsg = "Rotated image successfully.";
+ String successMsg = UtilProperties.getMessage(resource,
"ProductRotatedImageSuccessfully", locale);
Map<String, Object> result = ServiceUtil.returnSuccess(successMsg);
return result;
}
Modified:
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductServices.java?rev=1759066&r1=1759065&r2=1759066&view=diff
==============================================================================
---
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductServices.java
(original)
+++
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/product/ProductServices.java
Sat Sep 3 10:14:44 2016
@@ -891,7 +891,7 @@ public class ProductServices {
productAssoc.create();
}
} catch (GenericEntityException e) {
- String errMsg = "Error creating new virtual product from variant
products: " + e.toString();
+ String errMsg = UtilProperties.getMessage(resourceError,
"ProductErrorCreatingNewVirtualProductFromVariantProducts",
UtilMisc.toMap("errorString", e.toString()), locale);
Debug.logError(e, errMsg, module);
return ServiceUtil.returnError(errMsg);
}
Modified:
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/subscription/SubscriptionServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/subscription/SubscriptionServices.java?rev=1759066&r1=1759065&r2=1759066&view=diff
==============================================================================
---
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/subscription/SubscriptionServices.java
(original)
+++
ofbiz/trunk/applications/product/src/main/java/org/apache/ofbiz/product/subscription/SubscriptionServices.java
Sat Sep 3 10:14:44 2016
@@ -53,6 +53,7 @@ public class SubscriptionServices {
public static final String module = SubscriptionServices.class.getName();
public static final String resource = "ProductUiLabels";
+ public static final String resourceError = "ProductErrorUiLabels";
public static final String resourceOrderError = "OrderErrorUiLabels";
public static Map<String, Object>
processExtendSubscription(DispatchContext dctx, Map<String, ? extends Object>
context) {
@@ -307,7 +308,7 @@ public class SubscriptionServices {
public static Map<String, Object> runServiceOnSubscriptionExpiry(
DispatchContext dctx, Map<String, ? extends Object> context) {
LocalDispatcher dispatcher = dctx.getDispatcher();
Delegator delegator = dctx.getDelegator();
-
+ Locale locale =(Locale)context.get("locale");
GenericValue userLogin = (GenericValue) context.get("userLogin");
Map<String, Object> result = new HashMap<String, Object>();
Map<String, Object> expiryMap = new HashMap<String, Object>();
@@ -376,7 +377,7 @@ public class SubscriptionServices {
Debug.logInfo("Service mentioned in
serviceNameOnExpiry called with result: " + result.get("successMessage"),
module);
} else if (result == null && subscriptionId !=
null) {
Debug.logError("Subscription couldn't be
expired for subscriptionId: " + subscriptionId, module);
- return ServiceUtil.returnError("Subscription
couldn't be expired for subscriptionId: " + subscriptionId);
+ return
ServiceUtil.returnError(UtilProperties.getMessage(resourceError,
"ProductSubscriptionCouldntBeExpired", UtilMisc.toMap("subscriptionId",
subscriptionId), locale));
}
}
}
@@ -394,10 +395,11 @@ public class SubscriptionServices {
public static Map<String, Object> runSubscriptionExpired(
DispatchContext dctx, Map<String, ? extends Object> context) {
+ Locale locale = (Locale)context.get("locale");
String subscriptionId = (String) context.get("subscriptionId");
Map<String, Object> result = new HashMap<String, Object>();
if (subscriptionId != null) {
- return ServiceUtil.returnSuccess("runSubscriptionExpired service
called successfully with subscriptionId " + subscriptionId);
+ return
ServiceUtil.returnSuccess(UtilProperties.getMessage(resource,
"ProductRunSubscriptionExpiredServiceCalledSuccessfully", locale));
}
return result;
}