Improved: Change resources with proper naming convention in all plugin components.

(OFBIZ-11739)
Also, made MODULE as private data member of class instead of public. Thanks Jacques for review.
This commit is contained in:
Suraj Khurana
2020-05-29 13:14:02 +05:30
parent 2c65f7d17b
commit ae31c01fa7
64 changed files with 398 additions and 398 deletions
@@ -61,8 +61,8 @@ import org.xml.sax.SAXException;
import freemarker.template.TemplateException;
public class ExamplePrintServices {
public static final String MODULE = ExamplePrintServices.class.getName();
public static final String resource = "ExampleUiLabels";
private static final String MODULE = ExamplePrintServices.class.getName();
private static final String RESOURCE = "ExampleUiLabels";
public static Map<String, Object> printReportPdf(DispatchContext dctx, Map<String, ? extends Object> context) {
Locale locale = (Locale)context.get("locale");
@@ -82,11 +82,11 @@ public class ExamplePrintServices {
try {
screenStringRenderer = new MacroScreenRenderer("screen", visualTheme.getModelTheme().getScreenRendererLocation("screen"));
} catch (TemplateException e) {
String errMsg = UtilProperties.getMessage(resource, "ExampleGeneralErrorRenderingScreen", UtilMisc.toMap("errorString", e.toString()), locale);
String errMsg = UtilProperties.getMessage(RESOURCE, "ExampleGeneralErrorRenderingScreen", UtilMisc.toMap("errorString", e.toString()), locale);
Debug.logError(e, errMsg, MODULE);
return ServiceUtil.returnError(errMsg);
} catch (IOException e) {
String errMsg = UtilProperties.getMessage(resource, "ExampleIOErrorRenderingScreen", UtilMisc.toMap("errorString", e.toString()), locale);
String errMsg = UtilProperties.getMessage(RESOURCE, "ExampleIOErrorRenderingScreen", UtilMisc.toMap("errorString", e.toString()), locale);
Debug.logError(e, errMsg, MODULE);
return ServiceUtil.returnError(errMsg);
}
@@ -100,19 +100,19 @@ public class ExamplePrintServices {
try {
reportScreenRenderer.render(screenLocation, reportScreenName);
} catch (GeneralException e) {
String errMsg = UtilProperties.getMessage(resource, "ExampleGeneralErrorRenderingScreen", UtilMisc.toMap("errorString", e.toString()), locale);
String errMsg = UtilProperties.getMessage(RESOURCE, "ExampleGeneralErrorRenderingScreen", UtilMisc.toMap("errorString", e.toString()), locale);
Debug.logError(e, errMsg, MODULE);
return ServiceUtil.returnError(errMsg);
} catch (IOException e) {
String errMsg = UtilProperties.getMessage(resource, "ExampleIOErrorRenderingScreen", UtilMisc.toMap("errorString", e.toString()), locale);
String errMsg = UtilProperties.getMessage(RESOURCE, "ExampleIOErrorRenderingScreen", UtilMisc.toMap("errorString", e.toString()), locale);
Debug.logError(e, errMsg, MODULE);
return ServiceUtil.returnError(errMsg);
} catch (SAXException e) {
String errMsg = UtilProperties.getMessage(resource, "ExampleSAXErrorRenderingScreen", UtilMisc.toMap("errorString", e.toString()), locale);
String errMsg = UtilProperties.getMessage(RESOURCE, "ExampleSAXErrorRenderingScreen", UtilMisc.toMap("errorString", e.toString()), locale);
Debug.logError(e, errMsg, MODULE);
return ServiceUtil.returnError(errMsg);
} catch (ParserConfigurationException e) {
String errMsg = UtilProperties.getMessage(resource, "ExampleParserConfigurationErrorRenderingScreen", UtilMisc.toMap("errorString", e.toString()), locale);
String errMsg = UtilProperties.getMessage(RESOURCE, "ExampleParserConfigurationErrorRenderingScreen", UtilMisc.toMap("errorString", e.toString()), locale);
Debug.logError(e, errMsg, MODULE);
return ServiceUtil.returnError(errMsg);
}
@@ -159,7 +159,7 @@ public class ExamplePrintServices {
try {
job.print(myDoc, aset);
} catch (PrintException pe) {
String errMsg = UtilProperties.getMessage(resource, "ExampleUnableToPrintPDFFromXSL-FO", UtilMisc.toMap("errorString", pe.toString()), locale);
String errMsg = UtilProperties.getMessage(RESOURCE, "ExampleUnableToPrintPDFFromXSL-FO", UtilMisc.toMap("errorString", pe.toString()), locale);
Debug.logError(pe, errMsg, MODULE);
return ServiceUtil.returnError(errMsg);
}
@@ -29,7 +29,7 @@ import org.apache.ofbiz.service.DispatchContext;
import org.apache.ofbiz.service.ServiceUtil;
public class ExampleServices {
public static final String MODULE = ExampleServices.class.getName();
private static final String MODULE = ExampleServices.class.getName();
public static Map<String, Object> sendExamplePushNotifications(DispatchContext dctx, Map<String, ? extends Object> context) {
String exampleId = (String) context.get("exampleId");
@@ -35,7 +35,7 @@ import org.apache.ofbiz.base.util.Debug;
@ServerEndpoint("/ws/pushNotifications")
public class ExampleWebSockets {
public static final String MODULE = ExampleWebSockets.class.getName();
private static final String MODULE = ExampleWebSockets.class.getName();
private static Set<Session> clients = Collections.synchronizedSet(new HashSet<Session>());