[jboss-svn-commits] JBL Code SVN: r25643 - in labs/jbosslabs/labs-3.0-build/integration/cs-hfurl/src/main: resources and 2 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Fri Mar 13 13:15:27 EDT 2009


Author: lkrzyzanek
Date: 2009-03-13 13:15:27 -0400 (Fri, 13 Mar 2009)
New Revision: 25643

Added:
   labs/jbosslabs/labs-3.0-build/integration/cs-hfurl/src/main/java/org/jboss/labs/clearspace/plugin/hfurl/struts/ReindexHfURLAction.java
   labs/jbosslabs/labs-3.0-build/integration/cs-hfurl/src/main/web/admin/
   labs/jbosslabs/labs-3.0-build/integration/cs-hfurl/src/main/web/admin/human-friendly-urls.ftl
Modified:
   labs/jbosslabs/labs-3.0-build/integration/cs-hfurl/src/main/resources/plugin.xml
   labs/jbosslabs/labs-3.0-build/integration/cs-hfurl/src/main/resources/plugin_i18n.properties
   labs/jbosslabs/labs-3.0-build/integration/cs-hfurl/src/main/resources/struts.xml
Log:
added admin actions

Added: labs/jbosslabs/labs-3.0-build/integration/cs-hfurl/src/main/java/org/jboss/labs/clearspace/plugin/hfurl/struts/ReindexHfURLAction.java
===================================================================
--- labs/jbosslabs/labs-3.0-build/integration/cs-hfurl/src/main/java/org/jboss/labs/clearspace/plugin/hfurl/struts/ReindexHfURLAction.java	                        (rev 0)
+++ labs/jbosslabs/labs-3.0-build/integration/cs-hfurl/src/main/java/org/jboss/labs/clearspace/plugin/hfurl/struts/ReindexHfURLAction.java	2009-03-13 17:15:27 UTC (rev 25643)
@@ -0,0 +1,62 @@
+/*
+ * JBoss.org http://jboss.org/
+ *
+ * Copyright (c) 2009  Red Hat Middleware, LLC. All rights reserved.
+ *
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT A WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License, v.2.1 along with this distribution; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ *
+ * Red Hat Author(s): Libor Krzyzanek
+ */
+package org.jboss.labs.clearspace.plugin.hfurl.struts;
+
+import org.jboss.labs.clearspace.plugin.hfurl.HFURLManager;
+
+import com.jivesoftware.community.action.JiveActionSupport;
+import com.opensymphony.xwork2.Preparable;
+
+/**
+ * @author <a href="mailto:lkrzyzan at redhat.com">Libor Krzyzanek</a>
+ * 
+ */
+public class ReindexHfURLAction extends JiveActionSupport implements Preparable {
+
+  private long indexedURLs = 0;
+
+  private HFURLManager hfURLManager;
+
+  public void prepare() throws Exception {
+    indexedURLs = hfURLManager.getIndexedURLsCount();
+  }
+
+  @Override
+  public String execute() {
+
+    addActionMessage(getText("plugin.hfurl.admin.hf-urls.reindex.text.sucess"));
+    return SUCCESS;
+  }
+
+  public void setHfURLManager(HFURLManager hfURLManager) {
+    this.hfURLManager = hfURLManager;
+  }
+
+  public void setIndexedURLs(long indexedURLs) {
+    this.indexedURLs = indexedURLs;
+  }
+
+  public long getIndexedURLs() {
+    return indexedURLs;
+  }
+
+}


Property changes on: labs/jbosslabs/labs-3.0-build/integration/cs-hfurl/src/main/java/org/jboss/labs/clearspace/plugin/hfurl/struts/ReindexHfURLAction.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain

Modified: labs/jbosslabs/labs-3.0-build/integration/cs-hfurl/src/main/resources/plugin.xml
===================================================================
--- labs/jbosslabs/labs-3.0-build/integration/cs-hfurl/src/main/resources/plugin.xml	2009-03-13 17:14:40 UTC (rev 25642)
+++ labs/jbosslabs/labs-3.0-build/integration/cs-hfurl/src/main/resources/plugin.xml	2009-03-13 17:15:27 UTC (rev 25643)
@@ -32,4 +32,17 @@
   <databaseKey>humanFriendlyURL</databaseKey>
   <databaseVersion>1</databaseVersion>
 
+  <components>
+    <component id="admin-console">
+      <tab id="system">
+        <section id="section-system">
+          <item id="system-hf-urls"
+                      name="plugin.hfurl.admin.hf-urls.name"
+                      url="human-friendly-urls-view.jspa"
+                      description="plugin.hfurl.admin.hf-urls.description"/>
+        </section>
+      </tab>
+    </component>
+  </components>
+
 </plugin>

Modified: labs/jbosslabs/labs-3.0-build/integration/cs-hfurl/src/main/resources/plugin_i18n.properties
===================================================================
--- labs/jbosslabs/labs-3.0-build/integration/cs-hfurl/src/main/resources/plugin_i18n.properties	2009-03-13 17:14:40 UTC (rev 25642)
+++ labs/jbosslabs/labs-3.0-build/integration/cs-hfurl/src/main/resources/plugin_i18n.properties	2009-03-13 17:15:27 UTC (rev 25643)
@@ -1,6 +1,10 @@
 # Administration
 plugin.hfurl.admin.hf-urls.name=Human friendly URLs
-plugin.hfurl.admin.hf-urls.description=Management of human frineldy URLs
+plugin.hfurl.admin.hf-urls.description=Click to manage human frineldy URLs
+plugin.hfurl.admin.hf-urls.indexedURLs=Count of indexed articles
+plugin.hfurl.admin.hf-urls.reindex.description=Update human friendly URLs index of existing articles
+plugin.hfurl.admin.hf-urls.reindex.submit=Update index
+plugin.hfurl.admin.hf-urls.reindex.text.sucess=Index was sucessfuly updated
 
 # Navigation
 plugin.hfurl.navigation.name=Article navigation

Modified: labs/jbosslabs/labs-3.0-build/integration/cs-hfurl/src/main/resources/struts.xml
===================================================================
--- labs/jbosslabs/labs-3.0-build/integration/cs-hfurl/src/main/resources/struts.xml	2009-03-13 17:14:40 UTC (rev 25642)
+++ labs/jbosslabs/labs-3.0-build/integration/cs-hfurl/src/main/resources/struts.xml	2009-03-13 17:15:27 UTC (rev 25643)
@@ -9,16 +9,39 @@
     -->
     <action name="wikiNavigation"
       class="org.jboss.labs.clearspace.plugin.hfurl.struts.NavigationAction">
-      <result name="success">/plugins/human-friendly-urls/navigation.ftl
+      <result name="success" type="freemarker">
+        /plugins/human-friendly-urls/navigation.ftl
       </result>
     </action>
-    
+
     <action name="wikiNotFound"
       class="com.jivesoftware.community.action.JiveActionSupport">
-      <result name="success">/plugins/human-friendly-urls/notfound.ftl
+      <result name="success" type="freemarker">
+        /plugins/human-friendly-urls/notfound.ftl
       </result>
     </action>
 
   </package>
 
+  <package name="hfurl-actions-admin" namespace="/admin"
+    extends="community-admin-default">
+
+    <action name="human-friendly-urls-view"
+      class="org.jboss.labs.clearspace.plugin.hfurl.struts.ReindexHfURLAction" method="input">
+      <result name="input" type="freemarker">
+        /plugins/human-friendly-urls/admin/human-friendly-urls.ftl
+      </result>
+    </action>
+
+    <action name="human-friendly-urls-reindex"
+      class="org.jboss.labs.clearspace.plugin.hfurl.struts.ReindexHfURLAction">
+      <result name="input" type="freemarker">
+        /plugins/human-friendly-urls/admin/human-friendly-urls.ftl
+      </result>
+      <result name="success" type="freemarker">
+        /plugins/human-friendly-urls/admin/human-friendly-urls.ftl
+      </result>
+    </action>
+  </package>
+
 </struts>

Added: labs/jbosslabs/labs-3.0-build/integration/cs-hfurl/src/main/web/admin/human-friendly-urls.ftl
===================================================================
--- labs/jbosslabs/labs-3.0-build/integration/cs-hfurl/src/main/web/admin/human-friendly-urls.ftl	                        (rev 0)
+++ labs/jbosslabs/labs-3.0-build/integration/cs-hfurl/src/main/web/admin/human-friendly-urls.ftl	2009-03-13 17:15:27 UTC (rev 25643)
@@ -0,0 +1,23 @@
+<html>
+    <head>
+        <#assign pageTitle=action.getText('plugin.hfurl.admin.hf-urls.name') />
+        <title>${pageTitle}</title>
+        <content tag="pagetitle">${pageTitle}</content>
+        <content tag="pageID">system-hf-urls</content>
+    </head>
+    <body>
+        <@s.actionmessage />
+        <@s.fielderror />
+        <p>
+         Count of indexed URLs:&nbsp;<@s.property value="indexedURLs"/>
+        </p>
+        <@s.form theme="simple" action="human-friendly-urls-reindex">
+          <table>
+            <tr>
+              <td><@s.text name="plugin.hfurl.admin.hf-urls.reindex.description"/>:</td>
+              <td><@s.submit value="${action.getText('plugin.hfurl.admin.hf-urls.reindex.submit')}"/></td>
+            </tr>
+          </table
+        </@s.form>
+    </body>
+</html>
\ No newline at end of file




More information about the jboss-svn-commits mailing list