svnno****@sourc*****
svnno****@sourc*****
2008年 10月 31日 (金) 18:14:06 JST
Revision: 1274 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=pal&view=rev&rev=1274 Author: shinsuke Date: 2008-10-31 18:14:06 +0900 (Fri, 31 Oct 2008) Log Message: ----------- i18ned, and fixed a rule criteria problem. Modified Paths: -------------- pal-admin/trunk/src/main/java/jp/sf/pal/admin/logic/ProfilingRuleLogic.java pal-admin/trunk/src/main/java/jp/sf/pal/admin/service/ProfilingRuleService.java pal-admin/trunk/src/main/java/jp/sf/pal/admin/web/profiler/RuleConfirmPage.java pal-admin/trunk/src/main/java/jp/sf/pal/admin/web/profiler/RuleCriterionConfirmPage.java pal-admin/trunk/src/main/resources/jp/sf/pal/admin/web/profiler/label.properties pal-admin/trunk/src/main/resources/jp/sf/pal/admin/web/profiler/label_ja.properties pal-admin/trunk/src/main/webapp/view/profiler/ruleConfirm.html pal-admin/trunk/src/main/webapp/view/profiler/ruleCriterionConfirm.html pal-admin/trunk/src/main/webapp/view/profiler/ruleCriterionEdit.html pal-admin/trunk/src/main/webapp/view/profiler/ruleCriterionList.html pal-admin/trunk/src/main/webapp/view/profiler/ruleEdit.html pal-admin/trunk/src/main/webapp/view/profiler/ruleList.html -------------- next part -------------- Modified: pal-admin/trunk/src/main/java/jp/sf/pal/admin/logic/ProfilingRuleLogic.java =================================================================== --- pal-admin/trunk/src/main/java/jp/sf/pal/admin/logic/ProfilingRuleLogic.java 2008-10-31 07:01:26 UTC (rev 1273) +++ pal-admin/trunk/src/main/java/jp/sf/pal/admin/logic/ProfilingRuleLogic.java 2008-10-31 09:14:06 UTC (rev 1274) @@ -147,8 +147,8 @@ } - public RuleCriterion getRuleCriterion(String id, String name) { - if (id == null || name == null) { + public RuleCriterion getRuleCriterion(String id, String name, String type) { + if (id == null || name == null || type == null) { return null; } org.apache.jetspeed.profiler.rules.ProfilingRule rule = getProfiler() @@ -158,7 +158,8 @@ } for (Object obj : rule.getRuleCriteria()) { org.apache.jetspeed.profiler.rules.RuleCriterion ruleCriterion = (org.apache.jetspeed.profiler.rules.RuleCriterion) obj; - if (name.equals(ruleCriterion.getName())) { + if (name.equals(ruleCriterion.getName()) + && type.equals(ruleCriterion.getType())) { RuleCriterion entity = new RuleCriterion(); entity.setRuleName(id); entity.setName(ruleCriterion.getName()); @@ -201,17 +202,18 @@ if (rule == null) { throw new CommonException("profiling.rule.does.not.exist"); } - if (entity.getName() == null) { + if (entity.getName() == null || entity.getType() == null) { throw new CommonException("rule.criterion.does.not.exist"); } for (Object obj : rule.getRuleCriteria()) { org.apache.jetspeed.profiler.rules.RuleCriterion ruleCriterion = (org.apache.jetspeed.profiler.rules.RuleCriterion) obj; - if (entity.getName().equals(ruleCriterion.getName())) { + if (entity.getName().equals(ruleCriterion.getName()) + && entity.getType().equals(ruleCriterion.getType())) { try { - // ruleCriterion.setRuleId(entity.getRuleName()); - // ruleCriterion.setName(entity.getName()); + // ruleCriterion.setRuleId(entity.getRuleName()); + // ruleCriterion.setName(entity.getName()); ruleCriterion.setValue(entity.getValue()); - ruleCriterion.setType(entity.getType()); + // ruleCriterion.setType(entity.getType()); ruleCriterion.setFallbackType(entity.getFallbackType()); ruleCriterion.setFallbackOrder(entity.getFallbackOrder()); getProfiler().storeProfilingRule(rule); @@ -231,12 +233,13 @@ if (rule == null) { throw new CommonException("profiling.rule.does.not.exist"); } - if (entity.getName() == null) { + if (entity.getName() == null || entity.getType() == null) { throw new CommonException("rule.criterion.does.not.exist"); } for (Object obj : rule.getRuleCriteria()) { org.apache.jetspeed.profiler.rules.RuleCriterion ruleCriterion = (org.apache.jetspeed.profiler.rules.RuleCriterion) obj; - if (entity.getName().equals(ruleCriterion.getName())) { + if (entity.getName().equals(ruleCriterion.getName()) + && entity.getType().equals(ruleCriterion.getType())) { try { rule.getRuleCriteria().remove(ruleCriterion); getProfiler().storeProfilingRule(rule); Modified: pal-admin/trunk/src/main/java/jp/sf/pal/admin/service/ProfilingRuleService.java =================================================================== --- pal-admin/trunk/src/main/java/jp/sf/pal/admin/service/ProfilingRuleService.java 2008-10-31 07:01:26 UTC (rev 1273) +++ pal-admin/trunk/src/main/java/jp/sf/pal/admin/service/ProfilingRuleService.java 2008-10-31 09:14:06 UTC (rev 1274) @@ -135,7 +135,8 @@ public void loadPage(RuleCriterionEditPage page) throws CommonException { if (page.isUpdate()) { RuleCriterion ruleCriterion = getProfilingRuleLogic() - .getRuleCriterion(page.getRuleName(), page.getName()); + .getRuleCriterion(page.getRuleName(), page.getName(), + page.getType()); if (ruleCriterion == null) { throw new CommonException("could.not.find.rule.criterion"); } @@ -155,7 +156,7 @@ public void loadPage(RuleCriterionConfirmPage page) throws CommonException { RuleCriterion ruleCriterion = getProfilingRuleLogic().getRuleCriterion( - page.getRuleName(), page.getName()); + page.getRuleName(), page.getName(), page.getType()); if (ruleCriterion == null) { throw new CommonException("could.not.find.rule.criterion"); } @@ -166,7 +167,7 @@ public void addRuleCriterion(AbstractRuleCriterionPage page) throws CommonException { RuleCriterion ruleCriterion = getProfilingRuleLogic().getRuleCriterion( - page.getRuleName(), page.getName()); + page.getRuleName(), page.getName(), page.getType()); if (ruleCriterion != null) { throw new CommonException("profiling.rule.already.exists"); } @@ -178,7 +179,7 @@ public void updateRuleCriterion(AbstractRuleCriterionPage page) throws CommonException { RuleCriterion ruleCriterion = getProfilingRuleLogic().getRuleCriterion( - page.getRuleName(), page.getName()); + page.getRuleName(), page.getName(), page.getType()); if (ruleCriterion == null) { throw new CommonException("profiling.rule.does.not.exist"); } @@ -189,7 +190,7 @@ public void deleteRuleCriterion(AbstractRuleCriterionPage page) throws CommonException { RuleCriterion ruleCriterion = getProfilingRuleLogic().getRuleCriterion( - page.getRuleName(), page.getName()); + page.getRuleName(), page.getName(), page.getType()); if (ruleCriterion == null) { throw new CommonException("profiling.rule.does.not.exist"); } Modified: pal-admin/trunk/src/main/java/jp/sf/pal/admin/web/profiler/RuleConfirmPage.java =================================================================== --- pal-admin/trunk/src/main/java/jp/sf/pal/admin/web/profiler/RuleConfirmPage.java 2008-10-31 07:01:26 UTC (rev 1273) +++ pal-admin/trunk/src/main/java/jp/sf/pal/admin/web/profiler/RuleConfirmPage.java 2008-10-31 09:14:06 UTC (rev 1274) @@ -126,12 +126,19 @@ super.setTitle(title); } - public String getDoBackValue(){ + public String getDoBackValue() { return getLabelHelper().getLabelValue("back"); } - - public String getDoFinishValue(){ - return getLabelHelper().getLabelValue("create"); + + public String getDoFinishValue() { + if (isCreate()) { + return getLabelHelper().getLabelValue("create"); + } else if (isUpdate()) { + return getLabelHelper().getLabelValue("update"); + } else if (isDelete()) { + return getLabelHelper().getLabelValue("delete"); + } + return ""; } - + } Modified: pal-admin/trunk/src/main/java/jp/sf/pal/admin/web/profiler/RuleCriterionConfirmPage.java =================================================================== --- pal-admin/trunk/src/main/java/jp/sf/pal/admin/web/profiler/RuleCriterionConfirmPage.java 2008-10-31 07:01:26 UTC (rev 1273) +++ pal-admin/trunk/src/main/java/jp/sf/pal/admin/web/profiler/RuleCriterionConfirmPage.java 2008-10-31 09:14:06 UTC (rev 1274) @@ -146,12 +146,19 @@ public void setFallbackType(Integer fallbackType) { super.setFallbackType(fallbackType); } - - public String getDoBackValue(){ + + public String getDoBackValue() { return getLabelHelper().getLabelValue("back"); } - - public String getDoOnceValue(){ - return getLabelHelper().getLabelValue("create"); + + public String getDoOnceValue() { + if (isCreate()) { + return getLabelHelper().getLabelValue("create"); + } else if (isUpdate()) { + return getLabelHelper().getLabelValue("update"); + } else if (isDelete()) { + return getLabelHelper().getLabelValue("delete"); + } + return ""; } } Modified: pal-admin/trunk/src/main/resources/jp/sf/pal/admin/web/profiler/label.properties =================================================================== --- pal-admin/trunk/src/main/resources/jp/sf/pal/admin/web/profiler/label.properties 2008-10-31 07:01:26 UTC (rev 1273) +++ pal-admin/trunk/src/main/resources/jp/sf/pal/admin/web/profiler/label.properties 2008-10-31 09:14:06 UTC (rev 1274) @@ -1,9 +1,12 @@ listTab=List newTab=New -backTab=Back +profilingRuleTab=Profiling Rule List +editTab=Edit +editTab=Delete ruleList=Profiling Rule List ruleInformationLabel=Profiling Rule Information +ruleInformation=Profiling Rule Information ruleCriterionList=Rule Criterion List ruleCriterionInformation=Rule Criterion Information Modified: pal-admin/trunk/src/main/resources/jp/sf/pal/admin/web/profiler/label_ja.properties =================================================================== --- pal-admin/trunk/src/main/resources/jp/sf/pal/admin/web/profiler/label_ja.properties 2008-10-31 07:01:26 UTC (rev 1273) +++ pal-admin/trunk/src/main/resources/jp/sf/pal/admin/web/profiler/label_ja.properties 2008-10-31 09:14:06 UTC (rev 1274) @@ -1,7 +1,8 @@ -listTab=\u4e00\u89a7 +listTab=\u30eb\u30fc\u30eb\u57fa\u6e96\u4e00\u89a7 newTab=\u65b0\u898f -backTab=\u623b\u308b +profilingRuleTab=\u30d7\u30ed\u30d5\u30a1\u30a4\u30ea\u30f3\u30b0\u30eb\u30fc\u30eb\u4e00\u89a7 editTab=\u7de8\u96c6 +deleteTab=\u524a\u9664 ruleList=\u30d7\u30ed\u30d5\u30a1\u30a4\u30ea\u30f3\u30b0\u30eb\u30fc\u30eb\u4e00\u89a7 ruleInformationLabel=\u30d7\u30ed\u30d5\u30a1\u30a4\u30ea\u30f3\u30b0\u30eb\u30fc\u30eb @@ -21,7 +22,7 @@ create=\u767b\u9332 update=\u66f4\u65b0 back=\u623b\u308b -editCriterion=\u5224\u65ad\u57fa\u6e96 +editCriterion=\u30eb\u30fc\u30eb\u57fa\u6e96\u8a2d\u5b9a ruleCriterionList.newTab=\u65b0\u898f ruleCriterionList.name=\u30eb\u30fc\u30eb\u540d Modified: pal-admin/trunk/src/main/webapp/view/profiler/ruleConfirm.html =================================================================== --- pal-admin/trunk/src/main/webapp/view/profiler/ruleConfirm.html 2008-10-31 07:01:26 UTC (rev 1273) +++ pal-admin/trunk/src/main/webapp/view/profiler/ruleConfirm.html 2008-10-31 09:14:06 UTC (rev 1274) @@ -9,7 +9,7 @@ <form id="ruleConfirmForm"><input type="hidden" id="crudType" /> <div style="padding: 3px;"> <div style="padding: 3px;"> - <a id="goRuleList-tab" href="ruleList.html?fixed_crudType=0" style="text-decoration: none;font-weight: bold;"><span id="listTabLabel">List</span></a> | + <a id="goRuleList-tab" href="ruleList.html?fixed_crudType=0" style="text-decoration: none;font-weight: bold;"><span id="profilingRuleTabLabel">List</span></a> | <span id="isCreate-tab"><label id="newTabLabel">New</label></span> <span id="isUpdate-tab"><label id="editTabLabel">Edit</label></span> <span id="isDelete-tab"><label id="deleteTabLabel">Delete</label></span> Modified: pal-admin/trunk/src/main/webapp/view/profiler/ruleCriterionConfirm.html =================================================================== --- pal-admin/trunk/src/main/webapp/view/profiler/ruleCriterionConfirm.html 2008-10-31 07:01:26 UTC (rev 1273) +++ pal-admin/trunk/src/main/webapp/view/profiler/ruleCriterionConfirm.html 2008-10-31 09:14:06 UTC (rev 1274) @@ -9,11 +9,11 @@ <form id="ruleCriterionConfirmForm"><input type="hidden" id="crudType" /><input type="hidden" id="ruleName" /> <div style="padding: 3px;"> <div style="padding: 3px;"> + <a id="jumpRuleList-tab" href="ruleList.html" style="text-decoration: none;font-weight: bold;"><span id="profilingRuleTabLabel">Back to Rule List</span></a> | <a id="goRuleCriterionList-tab" href="ruleCriterionList.html?fixed_crudType=0&ruleName=1" style="text-decoration: none;font-weight: bold;"><span id="listTabLabel">List</span></a> | <span id="isCreate-tab"><label id="newTabLabel">New</label></span> <span id="isUpdate-tab"><label id="editTabLabel">Edit</label></span> - <span id="isDelete-tab"><label id="deleteTabLabel">Delete</label></span> | - <a id="jumpRuleList-tab" href="ruleList.html" style="text-decoration: none;font-weight: bold;"><span id="backTabLabel">Back to Rule List</span></a> + <span id="isDelete-tab"><label id="deleteTabLabel">Delete</label></span> </div> <!-- message: BEGIN --> <div class="portlet-msg"> Modified: pal-admin/trunk/src/main/webapp/view/profiler/ruleCriterionEdit.html =================================================================== --- pal-admin/trunk/src/main/webapp/view/profiler/ruleCriterionEdit.html 2008-10-31 07:01:26 UTC (rev 1273) +++ pal-admin/trunk/src/main/webapp/view/profiler/ruleCriterionEdit.html 2008-10-31 09:14:06 UTC (rev 1274) @@ -10,10 +10,9 @@ <div style="padding: 3px;"> <!-- tab: END --> <div style="padding: 3px;"> + <a id="jumpRuleList-tab" href="ruleList.html" style="text-decoration: none;font-weight: bold;"><span id="profilingRuleTabLabel">Back to Rule List</span></a> | <a id="goRuleCriterionList-tab" href="ruleCriterionList.html?fixed_crudType=0&ruleName=1" style="text-decoration: none;font-weight: bold;"><span id="listTabLabel">List</span></a> | <span id="isCreate-tab"><label id="newTabLabel">New</label></span> - <span id="isUpdate-tab"><label id="editTabLabel">Edit</label></span> | - <a id="jumpRuleList-tab" href="ruleList.html" style="text-decoration: none;font-weight: bold;"><span id="backTabLabel">Back to Rule List</span></a> </div> <!-- message: BEGIN --> <div class="portlet-msg"> @@ -30,10 +29,10 @@ <label id="nameLabel">Name</label> </td> <td class="portlet-section-body"> - <div id="isCreate"> + <div id="isCreate-name"> <input type="text" id="name-input" size="20"/> </div> - <div id="isNotCreate"> + <div id="isNotCreate-name"> <span id="name-display">NAME</span> <input type="hidden" id="name-hidden" /> </div> @@ -58,10 +57,16 @@ <label id="typeLabel">type</label> </td> <td class="portlet-section-body"> - <input type="hidden" id="typeItemsSave"/> - <select id="type" size="1"> - <option>aaa</option> - </select> + <div id="isCreate-type"> + <input type="hidden" id="typeItemsSave"/> + <select id="type" size="1"> + <option>aaa</option> + </select> + </div> + <div id="isNotCreate-type"> + <span id="type-display">NAME</span> + <input type="hidden" id="type-hidden" /> + </div> </td> <td> <span id="typeMessage"></span> Modified: pal-admin/trunk/src/main/webapp/view/profiler/ruleCriterionList.html =================================================================== --- pal-admin/trunk/src/main/webapp/view/profiler/ruleCriterionList.html 2008-10-31 07:01:26 UTC (rev 1273) +++ pal-admin/trunk/src/main/webapp/view/profiler/ruleCriterionList.html 2008-10-31 09:14:06 UTC (rev 1274) @@ -9,9 +9,9 @@ <form id="ruleCriterionListForm"><input id="ruleName" type="hidden"/> <div style="padding: 3px;"> <div style="padding: 3px;"> + <a id="jumpRuleList-tab" href="ruleList.html" style="text-decoration: none;font-weight: bold;"><span id="profilingRuleTabLabel">Back to Rule List</span></a> | <label id="listTabLabel">List</label> | - <a id="goRuleCriterionEdit-tab" href="ruleCriterionEdit.html?fixed_crudType=0&fixed_name=1&ruleName=1" style="text-decoration: none;font-weight: bold;"><span id="newTabLabel">New</span></a> | - <a id="jumpRuleList-tab" href="ruleList.html" style="text-decoration: none;font-weight: bold;"><span id="backTabLabel">Back to Rule List</span></a> + <a id="goRuleCriterionEdit-tab" href="ruleCriterionEdit.html?fixed_crudType=0&fixed_name=1&ruleName=1" style="text-decoration: none;font-weight: bold;"><span id="newTabLabel">New</span></a> </div> <!-- message: BEGIN --> <div class="portlet-msg"> @@ -61,17 +61,17 @@ <span id="name">user</span> </td> <td class="portlet-section-body"> - <span id="value">user</span> + <span id="value">value</span> </td> <td class="portlet-section-body"> - <span id="type">user</span> + <span id="type">type</span> </td> <td class="portlet-section-body"> - <span id="fallbackOrder">roles</span> + <span id="fallbackOrder">fallbackOrder</span> </td> <td class="portlet-section-alternate"> - <a id="goRuleCriterionEdit" href="ruleCriterionEdit.html?fixed_crudType=2&ruleName=name&name=name"><span id="editLabel">Edit</span></a> - <a id="goRuleCriterionConfirm-delete" href="ruleCriterionConfirm.html?fixed_crudType=3&ruleName=name&name=name"><span id="deleteLabel">Delete</span></a> + <a id="goRuleCriterionEdit" href="ruleCriterionEdit.html?fixed_crudType=2&ruleName=name&name=name&type=type"><span id="editLabel">Edit</span></a> + <a id="goRuleCriterionConfirm-delete" href="ruleCriterionConfirm.html?fixed_crudType=3&ruleName=name&name=name&type=type"><span id="deleteLabel">Delete</span></a> </td> </tr> </tbody> Modified: pal-admin/trunk/src/main/webapp/view/profiler/ruleEdit.html =================================================================== --- pal-admin/trunk/src/main/webapp/view/profiler/ruleEdit.html 2008-10-31 07:01:26 UTC (rev 1273) +++ pal-admin/trunk/src/main/webapp/view/profiler/ruleEdit.html 2008-10-31 09:14:06 UTC (rev 1274) @@ -9,7 +9,7 @@ <form id="ruleEditForm"><input type="hidden" id="crudType" /> <div style="padding: 3px;"> <div style="padding: 3px;"> - <a id="goRuleList-tab" href="ruleList.html?fixed_crudType=0" style="text-decoration: none;font-weight: bold;"><span id="listTabLabel">List</span></a> | + <a id="goRuleList-tab" href="ruleList.html?fixed_crudType=0" style="text-decoration: none;font-weight: bold;"><span id="profilingRuleTabLabel">List</span></a> | <span id="isCreate-tab"><label id="newTabLabel">New</label></span> <span id="isUpdate-tab"><label id="editTabLabel">Edit</label></span> </div> Modified: pal-admin/trunk/src/main/webapp/view/profiler/ruleList.html =================================================================== --- pal-admin/trunk/src/main/webapp/view/profiler/ruleList.html 2008-10-31 07:01:26 UTC (rev 1273) +++ pal-admin/trunk/src/main/webapp/view/profiler/ruleList.html 2008-10-31 09:14:06 UTC (rev 1274) @@ -9,7 +9,7 @@ <form id="ruleListForm"> <div style="padding: 3px;"> <div style="padding: 3px;"> - <label id="listTabLabel">List</label> | + <label id="profilingRuleTab">List</label> | <a id="goRuleEdit-tab" href="ruleEdit.html?fixed_crudType=0&fixed_name=" style="text-decoration: none;font-weight: bold;"><span id="newTabLabel">New</span></a> </div> <!-- message: BEGIN -->