Author: jleroux
Date: Sun Jan 25 08:41:44 2009 New Revision: 737491 URL: http://svn.apache.org/viewvc?rev=737491&view=rev Log: LabelsInfo13.patch by Marco from "New tool to get labels information" (https://issues.apache.org/jira/browse/OFBIZ-2070) - OFBIZ-2070 Modified: ofbiz/trunk/framework/webtools/config/WebtoolsUiLabels.xml ofbiz/trunk/framework/webtools/servicedef/services.xml ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/labelmanager/LabelManagerFactory.java ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/labelmanager/UpdateManager.groovy ofbiz/trunk/framework/webtools/webapp/webtools/labelmanager/UpdateLabel.ftl ofbiz/trunk/framework/webtools/widget/LabelManagerScreens.xml Modified: ofbiz/trunk/framework/webtools/config/WebtoolsUiLabels.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/config/WebtoolsUiLabels.xml?rev=737491&r1=737490&r2=737491&view=diff ============================================================================== --- ofbiz/trunk/framework/webtools/config/WebtoolsUiLabels.xml (original) +++ ofbiz/trunk/framework/webtools/config/WebtoolsUiLabels.xml Sun Jan 25 08:41:44 2009 @@ -1469,6 +1469,10 @@ <value xml:lang="fr">La traduction ${key} existe déjà dans le fichier ${fileName}</value> <value xml:lang="it">La label ${key} esiste giâà öâÃâ nel file ${fileName}</value> </property> + <property key="WebtoolsLabelManagerRemove"> + <value xml:lang="en">Remove Label</value> + <value xml:lang="it">Rimuovi label</value> + </property> <property key="WebtoolsLabelManagerSearchBy"> <value xml:lang="en">Filter Labels Info By</value> <value xml:lang="fr">Filtrer les traductions</value> Modified: ofbiz/trunk/framework/webtools/servicedef/services.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/servicedef/services.xml?rev=737491&r1=737490&r2=737491&view=diff ============================================================================== --- ofbiz/trunk/framework/webtools/servicedef/services.xml (original) +++ ofbiz/trunk/framework/webtools/servicedef/services.xml Sun Jan 25 08:41:44 2009 @@ -135,6 +135,7 @@ <attribute name="update_label" type="String" mode="IN" optional="false"/> <attribute name="fileName" type="String" mode="IN" optional="false"/> <attribute name="confirm" type="String" mode="IN" optional="true"/> + <attribute name="removeLabel" type="String" mode="IN" optional="true"/> <attribute name="localeNames" type="List" mode="IN" optional="true"/> <attribute name="localeValues" type="List" mode="IN" optional="true"/> </service> Modified: ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/labelmanager/LabelManagerFactory.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/labelmanager/LabelManagerFactory.java?rev=737491&r1=737490&r2=737491&view=diff ============================================================================== --- ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/labelmanager/LabelManagerFactory.java (original) +++ ofbiz/trunk/framework/webtools/src/org/ofbiz/webtools/labelmanager/LabelManagerFactory.java Sun Jan 25 08:41:44 2009 @@ -49,7 +49,7 @@ public static final String module = LabelManagerFactory.class.getName(); public static final String resource = "WebtoolsUiLabels"; - private static final String keySeparator = ";"; + public static final String keySeparator = ";"; protected static UtilCache<String, LabelManagerFactory> labelManagerFactoryCache = new UtilCache<String, LabelManagerFactory>("LabelManagerFactory"); @@ -171,11 +171,15 @@ String update_label = (String)context.get("update_label"); String fileName = (String)context.get("fileName"); String confirm = (String)context.get("confirm"); + String removeLabel = (String)context.get("removeLabel"); List<String> localeNames = UtilGenerics.cast(context.get("localeNames")); List<String> localeValues = UtilGenerics.cast(context.get("localeValues")); Locale locale = (Locale) context.get("locale"); - if (UtilValidate.isNotEmpty(confirm)) { + // Remove a Label + if (UtilValidate.isNotEmpty(removeLabel)) { + labels.remove(key + keySeparator + fileName); + } else if (UtilValidate.isNotEmpty(confirm)) { LabelInfo label = labels.get(key + keySeparator + fileName); // Update a Label @@ -226,10 +230,6 @@ i++; } - if (UtilValidate.isNotEmpty(label) && label.getLabelValueSize() == 0) { - labels.remove(key + keySeparator + fileName); - } - return notEmptyLabels; } } Modified: ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/labelmanager/UpdateManager.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/labelmanager/UpdateManager.groovy?rev=737491&r1=737490&r2=737491&view=diff ============================================================================== --- ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/labelmanager/UpdateManager.groovy (original) +++ ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/actions/labelmanager/UpdateManager.groovy Sun Jan 25 08:41:44 2009 @@ -26,6 +26,7 @@ context.fileNamesFound = LabelManagerFactory.getFileNamesFound(); context.componentNamesFound = LabelManagerFactory.getComponentNamesFound(); -if (parameters.sourceKey != null && parameters.sourceFileName != null) { - context.label = context.labels.get(parameters.sourceKey + "_" + parameters.sourceFileName); +if (parameters.sourceKey && parameters.sourceFileName) { + context.label = context.labels.get(parameters.sourceKey + LabelManagerFactory.keySeparator + parameters.sourceFileName); + context.titleProperty = "WebtoolsLabelManagerUpdate"; } Modified: ofbiz/trunk/framework/webtools/webapp/webtools/labelmanager/UpdateLabel.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/webapp/webtools/labelmanager/UpdateLabel.ftl?rev=737491&r1=737490&r2=737491&view=diff ============================================================================== --- ofbiz/trunk/framework/webtools/webapp/webtools/labelmanager/UpdateLabel.ftl (original) +++ ofbiz/trunk/framework/webtools/webapp/webtools/labelmanager/UpdateLabel.ftl Sun Jan 25 08:41:44 2009 @@ -52,7 +52,15 @@ </td> </tr> <tr> - <td colspan="2"> </td> + <td colspan="2" align="center"> + <input type="submit" value="${uiLabelMap.CommonBack}"/> + <#if parameters.sourceKey?exists> + <input type="submit" value="${uiLabelMap.CommonUpdate}" name="confirm"/> + <input type="submit" value="${uiLabelMap.WebtoolsLabelManagerRemove}" name="removeLabel"/> + <#else> + <input type="submit" value="${uiLabelMap.CommonAdd}" name="confirm"/> + </#if> + </td> </tr> <#list localesFound as localeFound> <#if parameters.sourceKey?exists> @@ -88,8 +96,13 @@ </#list> <tr> <td colspan="2" align="center"> - <input type="submit" value="${uiLabelMap.CommonConfirm}" name="confirm"/> - <input type="submit" value="${uiLabelMap.CommonCancel}"/> + <input type="submit" value="${uiLabelMap.CommonBack}"/> + <#if parameters.sourceKey?exists> + <input type="submit" value="${uiLabelMap.CommonUpdate}" name="confirm"/> + <input type="submit" value="${uiLabelMap.WebtoolsLabelManagerRemove}" name="removeLabel"/> + <#else> + <input type="submit" value="${uiLabelMap.CommonAdd}" name="confirm"/> + </#if> </td> </tr> </table> Modified: ofbiz/trunk/framework/webtools/widget/LabelManagerScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/widget/LabelManagerScreens.xml?rev=737491&r1=737490&r2=737491&view=diff ============================================================================== --- ofbiz/trunk/framework/webtools/widget/LabelManagerScreens.xml (original) +++ ofbiz/trunk/framework/webtools/widget/LabelManagerScreens.xml Sun Jan 25 08:41:44 2009 @@ -52,7 +52,7 @@ <if-has-permission permission="LABEL_MANAGER_VIEW"/> </condition> <actions> - <set field="titleProperty" value="WebtoolsLabelManagerUpdate"/> + <set field="titleProperty" value="WebtoolsLabelManagerAddNew"/> <script location="component://webtools/webapp/webtools/WEB-INF/actions/labelmanager/UpdateManager.groovy"/> </actions> <widgets> |
Free forum by Nabble | Edit this page |