portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vku...@apache.org
Subject svn commit: r769766 - in /portals/jetspeed-2/applications/j2-admin/trunk: ./ src/main/java/org/apache/jetspeed/portlets/profiler/ src/main/java/org/apache/jetspeed/portlets/profiler/resources/
Date Wed, 29 Apr 2009 12:06:15 GMT
Author: vkumar
Date: Wed Apr 29 12:06:13 2009
New Revision: 769766

URL: http://svn.apache.org/viewvc?rev=769766&view=rev
Log:
Fixing issue http://issues.apache.org/jira/browse/JS2-486
Adding multilingual support portlet
Removing old JSF code
Removing JSF bridge dependency from j2-admin

Removed:
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/profiler/ProfileCriterionForm.java
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/profiler/ProfileRuleForm.java
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/profiler/ProfileRulesExtent.java
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/profiler/ProfilerAdminPortlet.java
Modified:
    portals/jetspeed-2/applications/j2-admin/trunk/pom.xml
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/profiler/WicketProfilerAdmin$RuleEditPanel$CriterionEditPanel.html
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/profiler/WicketProfilerAdmin$RuleEditPanel.html
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/profiler/WicketProfilerAdmin.java
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/profiler/WicketProfilerAdminApplication.java
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/profiler/resources/ProfilerResources.properties
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/profiler/resources/ProfilerResources_en.properties

Modified: portals/jetspeed-2/applications/j2-admin/trunk/pom.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/pom.xml?rev=769766&r1=769765&r2=769766&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/pom.xml (original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/pom.xml Wed Apr 29 12:06:13 2009
@@ -71,7 +71,6 @@
         <jetspeed-2.version>2.2-SNAPSHOT</jetspeed-2.version>
         <org.apache.portals.bridges.common.version>1.0.4</org.apache.portals.bridges.common.version>
         <org.apache.portals.bridges.velocity.version>1.0.4</org.apache.portals.bridges.velocity.version>
-        <org.apache.portals.bridges.jsf.version>1.0.4</org.apache.portals.bridges.jsf.version>
         <org.apache.portals.bridges.frameworks.version>1.0.4</org.apache.portals.bridges.frameworks.version>
         <org.apache.portals.bridges.portletfilter.version>1.0.4</org.apache.portals.bridges.portletfilter.version>
         <org.apache.portals.applications.apa-gems.version>1.0-SNAPSHOT</org.apache.portals.applications.apa-gems.version>
@@ -180,17 +179,6 @@
         </dependency>
         <dependency>
             <groupId>org.apache.portals.bridges</groupId>
-            <artifactId>portals-bridges-jsf</artifactId>
-            <version>${org.apache.portals.bridges.jsf.version}</version>
-        <exclusions>
-          <exclusion>
-            <groupId>commons-logging</groupId>
-            <artifactId>commons-logging</artifactId>
-          </exclusion>
-        </exclusions>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.portals.bridges</groupId>
             <artifactId>portals-bridges-portletfilter</artifactId>
             <version>${org.apache.portals.bridges.portletfilter.version}</version>
         <exclusions>

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/profiler/WicketProfilerAdmin$RuleEditPanel$CriterionEditPanel.html
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/profiler/WicketProfilerAdmin%24RuleEditPanel%24CriterionEditPanel.html?rev=769766&r1=769765&r2=769766&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/profiler/WicketProfilerAdmin$RuleEditPanel$CriterionEditPanel.html
(original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/profiler/WicketProfilerAdmin$RuleEditPanel$CriterionEditPanel.html
Wed Apr 29 12:06:13 2009
@@ -71,8 +71,8 @@
 	            </tr>
 	        </table>
 	        
-	        <input type="submit" value="Save Criterion" wicket:id="saveCriterionButton"/>
-	        <input type="submit" value="Remove Criterion" wicket:id="removeCriterionButton"/>
+	        <input type="submit" wicket:id="saveCriterionButton"/>
+	        <input type="submit" wicket:id="removeCriterionButton"/>
 	    
 	    </form>
 

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/profiler/WicketProfilerAdmin$RuleEditPanel.html
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/profiler/WicketProfilerAdmin%24RuleEditPanel.html?rev=769766&r1=769765&r2=769766&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/profiler/WicketProfilerAdmin$RuleEditPanel.html
(original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/profiler/WicketProfilerAdmin$RuleEditPanel.html
Wed Apr 29 12:06:13 2009
@@ -52,12 +52,12 @@
 	        <span wicket:id="ruleCriteriaLabel">rule criteria</span>
 	        <table wicket:id="ruleCriteriaTable" cellpadding="2"></table>
 	
-	        <input type="submit" value="New Criterion" wicket:id="newCriterionButton"/>
+	        <input type="submit" wicket:id="newCriterionButton"/>
 	        
             <div wicket:id="criterionEditPanel">criterionEditPanel</div>
 	        
-	        <input type="submit" value="Save Rule" wicket:id="ruleSaveButton"/>
-	        <input type="submit" value="Remove Rule" wicket:id="ruleRemoveButton"/>
+	        <input type="submit" wicket:id="ruleSaveButton"/>
+	        <input type="submit" wicket:id="ruleRemoveButton"/>
 	        
 	    </form>
     </div>

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/profiler/WicketProfilerAdmin.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/profiler/WicketProfilerAdmin.java?rev=769766&r1=769765&r2=769766&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/profiler/WicketProfilerAdmin.java
(original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/profiler/WicketProfilerAdmin.java
Wed Apr 29 12:06:13 2009
@@ -49,6 +49,9 @@
 import org.apache.wicket.model.IModel;
 import org.apache.wicket.model.Model;
 import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.model.ResourceModel;
+import org.apache.wicket.validation.IValidatable;
+import org.apache.wicket.validation.validator.AbstractValidator;
 
 public class WicketProfilerAdmin extends AdminPortletWebPage {
 
@@ -88,11 +91,10 @@
         add(rulesForm);
 
         // button the create a new rule
-        Button newRuleButton = new Button("newRuleButton") {
+        Button newRuleButton = new Button("newRuleButton", new ResourceModel("profiler.rule.new"))
{
 
             @Override
             public void onSubmit() {
-                System.out.println("newRuleButton.onSubmit");
                 Profiler profiler = getServiceLocator().getProfiler();
                 try
                 {
@@ -104,7 +106,7 @@
                 }
                 catch (Exception e)
                 {
-                    System.out.println("Failed to CREATE NEW: rule = " + profilingRule.getId());
+                    e.printStackTrace();
                     // TODO add error message to feedback panel            
                 }
             }
@@ -162,18 +164,20 @@
             FeedbackPanel feedbackPanel = new FeedbackPanel("feedbackPanel");
             ruleEditForm.add(feedbackPanel);
             
-            ruleEditForm.add(new Label("ruleIdLabel", "Rule ID"));
-            ruleEditForm.add(new Label("ruleTitleLabel", "Rule Title"));
-            ruleEditForm.add(new Label("ruleClassLabel", "Rule Class"));
+            ruleEditForm.add(new Label("ruleIdLabel", new ResourceModel("profiler.rule.id")));
+            ruleEditForm.add(new Label("ruleTitleLabel", new ResourceModel("profiler.rule.title")));
+            ruleEditForm.add(new Label("ruleClassLabel", new ResourceModel("profiler.rule.class")));
             
             ruleIdField = new TextField("ruleIdField", new PropertyModel(WicketProfilerAdmin.this,
"profilingRule.id"));
             ruleIdField.setRequired(true);
+            ruleIdField.add(new ProfileRuleValidator());
+            
             TextField ruleTitleField = new TextField("ruleTitleField", new PropertyModel(WicketProfilerAdmin.this,
"profilingRule.title"));
             
             DropDownChoice ruleClassField = new DropDownChoice("ruleClassField", classNames);
             ruleClassField.setModel(new PropertyModel(WicketProfilerAdmin.this, "profilingRule.classname"));
             
-            Button ruleSaveButton = new Button("ruleSaveButton") {
+            Button ruleSaveButton = new Button("ruleSaveButton", new ResourceModel("profiler.rule.save"))
{
 
                 @Override
                 public void onSubmit() {
@@ -192,7 +196,7 @@
                 
             };
 
-            Button ruleRemoveButton = new Button("ruleRemoveButton") {
+            Button ruleRemoveButton = new Button("ruleRemoveButton", new ResourceModel("profiler.rule.remove"))
{
 
                 @Override
                 public void onSubmit() {
@@ -222,7 +226,7 @@
             
             // the list of criteria for the selected rule
             
-            ruleEditForm.add(new Label("ruleCriteriaLabel", "Rule Criteria"));
+            ruleEditForm.add(new Label("ruleCriteriaLabel",new ResourceModel("criteria.title")));
             
             SortableDataProvider dataProvider = new SortableDataProvider()
             {
@@ -267,7 +271,7 @@
             ruleCriteriaTable.addBottomToolbar(new NavigationToolbar(ruleCriteriaTable));
             ruleEditForm.add(ruleCriteriaTable);
 
-            Button newCriterionButton = new Button("newCriterionButton") {
+            Button newCriterionButton = new Button("newCriterionButton",new ResourceModel("criteria.new"))
{
 
                 @Override
                 public void onSubmit() {
@@ -357,11 +361,11 @@
                 FeedbackPanel feedbackPanel = new FeedbackPanel("feedbackPanel");
                 criterionEditForm.add(feedbackPanel);
                 
-                criterionEditForm.add(new Label("criterionNameLabel", "Name"));
-                criterionEditForm.add(new Label("criterionValueLabel", "Value"));
-                criterionEditForm.add(new Label("criterionResolverTypeLabel", "Resolver Type"));
-                criterionEditForm.add(new Label("criterionFallbackLabel", "Fallback"));
-                criterionEditForm.add(new Label("criterionOrderLabel", "Order"));
+                criterionEditForm.add(new Label("criterionNameLabel", new ResourceModel("criterion.name")));
+                criterionEditForm.add(new Label("criterionValueLabel", new ResourceModel("criterion.value")));
+                criterionEditForm.add(new Label("criterionResolverTypeLabel", new ResourceModel("criterion.resolver")));
+                criterionEditForm.add(new Label("criterionFallbackLabel", new ResourceModel("criterion.fallback.type")));
+                criterionEditForm.add(new Label("criterionOrderLabel", new ResourceModel("criterion.fallback.order")));
                 
                 TextField criterionNameField = new TextField("criterionNameField", new PropertyModel(RuleEditPanel.this,
"criterion.name"));
                 criterionNameField.setRequired(true);
@@ -385,7 +389,7 @@
                 criterionEditForm.add(criterionFallbackField);
                 criterionEditForm.add(criterionOrderField);
 
-                Button saveCriterionButton = new Button("saveCriterionButton") {
+                Button saveCriterionButton = new Button("saveCriterionButton",new ResourceModel("profiler.rule.save"))
{
 
                     @Override
                     public void onSubmit() {
@@ -414,7 +418,7 @@
                     
                 };
                 
-                Button removeCriterionButton = new Button("removeCriterionButton") {
+                Button removeCriterionButton = new Button("removeCriterionButton",new ResourceModel("criteria.remove"))
{
 
                     @Override
                     public void onSubmit() {
@@ -481,5 +485,18 @@
         return new ArrayList<ProfilingRule>(getServiceLocator().getProfiler().getRules());
     }
     
-    
+    private class ProfileRuleValidator extends AbstractValidator<String>{
+        //private static final String ERROR_KEY = "rule.exits"; 
+        @Override
+        protected void onValidate(IValidatable validatable)
+        {
+            String ruleName = (String)validatable.getValue();
+            if(getServiceLocator().getProfiler().getRule(ruleName)!=null)
+            {
+              error(validatable);   
+            }
+        }    
+        
+        
+    }    
 }

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/profiler/WicketProfilerAdminApplication.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/profiler/WicketProfilerAdminApplication.java?rev=769766&r1=769765&r2=769766&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/profiler/WicketProfilerAdminApplication.java
(original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/profiler/WicketProfilerAdminApplication.java
Wed Apr 29 12:06:13 2009
@@ -1,12 +1,19 @@
 package org.apache.jetspeed.portlets.profiler;
 
 import org.apache.jetspeed.portlets.wicket.AbstractAdminWebApplication;
+import org.apache.wicket.resource.loader.BundleStringResourceLoader;
 
-public class WicketProfilerAdminApplication extends AbstractAdminWebApplication {
-
+public class WicketProfilerAdminApplication extends AbstractAdminWebApplication
+{
     @Override
-    public Class getHomePage() {
+    public Class getHomePage()
+    {
         return WicketProfilerAdmin.class;
     }
 
+    @Override
+    protected void init()
+    {
+        getResourceSettings().addStringResourceLoader(new BundleStringResourceLoader("org.apache.jetspeed.portlets.profiler.resources.ProfilerResources"));
+    }
 }

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/profiler/resources/ProfilerResources.properties
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/profiler/resources/ProfilerResources.properties?rev=769766&r1=769765&r2=769766&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/profiler/resources/ProfilerResources.properties
(original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/profiler/resources/ProfilerResources.properties
Wed Apr 29 12:06:13 2009
@@ -30,4 +30,5 @@
 criterion.value=Value
 criterion.fallback.order=Order
 criterion.resolver=Resolver Type
-criterion.fallback.type=Fallback
\ No newline at end of file
+criterion.fallback.type=Fallback
+WicketProfilerAdmin$ProfileRuleValidator= Rule already exits
\ No newline at end of file

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/profiler/resources/ProfilerResources_en.properties
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/profiler/resources/ProfilerResources_en.properties?rev=769766&r1=769765&r2=769766&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/profiler/resources/ProfilerResources_en.properties
(original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/profiler/resources/ProfilerResources_en.properties
Wed Apr 29 12:06:13 2009
@@ -30,4 +30,5 @@
 criterion.value=Value
 criterion.fallback.order=Order
 criterion.resolver=Resolver Type
-criterion.fallback.type=Fallback
\ No newline at end of file
+criterion.fallback.type=Fallback
+WicketProfilerAdmin$ProfileRuleValidator= Rule already exits
\ No newline at end of file



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message