portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vku...@apache.org
Subject svn commit: r773916 - in /portals/jetspeed-2/applications/j2-admin/trunk/src: main/java/org/apache/jetspeed/portlets/site/ main/resources/org/apache/jetspeed/portlets/site/ main/resources/org/apache/jetspeed/portlets/site/resources/ webapp/WEB-INF/
Date Tue, 12 May 2009 14:49:40 GMT
Author: vkumar
Date: Tue May 12 14:49:38 2009
New Revision: 773916

URL: http://svn.apache.org/viewvc?rev=773916&view=rev
Log:
Adding Edit mode in Portal Site manager
adding portlet preference for portal site tree
Adding validation of user folders
Improving CSS for Auto Complete filed in portal site manager

Added:
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/site/PortalSiteManagerEdit.java
  (with props)
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/resources/org/apache/jetspeed/portlets/site/PortalSiteManagerEdit.html
  (with props)
Modified:
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/site/PortalSiteManager.java
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/site/PortalSiteManagerApplication.java
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/resources/org/apache/jetspeed/portlets/site/PortalSiteManager.html
    portals/jetspeed-2/applications/j2-admin/trunk/src/main/resources/org/apache/jetspeed/portlets/site/resources/SiteResources.properties
    portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/portlet.xml

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/site/PortalSiteManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/site/PortalSiteManager.java?rev=773916&r1=773915&r2=773916&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/site/PortalSiteManager.java
(original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/site/PortalSiteManager.java
Tue May 12 14:49:38 2009
@@ -35,11 +35,13 @@
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipFile;
 
+import javax.portlet.PortletRequest;
 import javax.portlet.RenderRequest;
 import javax.swing.tree.DefaultMutableTreeNode;
 import javax.swing.tree.DefaultTreeModel;
 import javax.swing.tree.TreeModel;
 
+import org.apache.commons.lang.StringUtils;
 import org.apache.jetspeed.PortalReservedParameters;
 import org.apache.jetspeed.components.portletregistry.PortletRegistry;
 import org.apache.jetspeed.decoration.DecorationFactory;
@@ -69,6 +71,7 @@
 import org.apache.jetspeed.portalsite.MenuElement;
 import org.apache.jetspeed.portlets.AdminPortletWebPage;
 import org.apache.jetspeed.portlets.site.SiteTreeNode.FileType;
+import org.apache.jetspeed.portlets.wicket.AbstractAdminWebApplication;
 import org.apache.jetspeed.portlets.wicket.component.DynamicResourceLink;
 import org.apache.jetspeed.portlets.wicket.component.JavascriptEventConfirmation;
 import org.apache.jetspeed.portlets.wicket.component.ResourceProvider;
@@ -136,20 +139,10 @@
 
     protected DecorationFactory decorationFactory;
 
-    // session
-    protected final static String SESSION_FOLDERS = "jetspeed.site.manager.folders";
-    
-    protected final static String SESSION_ROOT = "jetspeed.site.manager.root";
-
-    // context
-    public final static String FOLDERS = "folders";
-
-    public final static String JSROOT = "jsroot";
+    public final static String TREE_ROOT = "jsRoot";
 
     private final static String JETSPEED_PATH_SEPRATOR = "/";
 
-    public static final String ALL_SECURITY_REFS = "allSecurityRefs";
-
     private DefaultTreeModel treeModel;
 
     private AjaxTabbedPanel tabPanel;
@@ -244,7 +237,7 @@
                     return userNames.iterator();
                 }
             }
-        });
+        }.setRequired(true));
         treeForm.add(new Button("userFolderButton")
         {
 
@@ -266,6 +259,7 @@
                         .expandNode(populateTree());
             }
         });
+        add(new FeedbackPanel("feedback"));
         add(treeForm);
         add(tabPanel);
         controlTabs();
@@ -3053,26 +3047,17 @@
         this.userFolder = userFolder;
     }
 
-    protected String determineRootFolder(RenderRequest request)
+    protected String determineRootFolder()
     {
-        String jsroot = request.getParameter(JSROOT);
-        if (jsroot == null || jsroot.equals(""))
+        PortletRequest request = ((AbstractAdminWebApplication) getApplication()).getPortletRequest();
+        String jsroot = request.getParameter(TREE_ROOT);
+        if (StringUtils.isEmpty(jsroot))
         {
-            jsroot = request.getPreferences().getValue("root",
-                    "/_user/" + request.getRemoteUser() + "/");
+            jsroot = request.getPreferences().getValue(TREE_ROOT,"/");
         }
-        // this.getContext(request).put(JSROOT, jsroot);
         return jsroot;
     }
 
-    protected String determineuserTree(RenderRequest request)
-    {
-        String userTree;
-        userTree = request.getPreferences()
-                .getValue("displayUserTree", "false");
-        return userTree;
-    }
-
     private void securityConstraintAction(String action, String constraint,
             String oldConstraintName)
     {
@@ -3174,7 +3159,7 @@
     private DefaultMutableTreeNode populateTree()
     {
         DefaultMutableTreeNode rootNode = null;
-        rootNode = retrieveFolders("/", rootNode);
+        rootNode = retrieveFolders(determineRootFolder(), rootNode);
         treeRoot = new DefaultTreeModel(rootNode);
         return rootNode;
     }

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/site/PortalSiteManagerApplication.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/site/PortalSiteManagerApplication.java?rev=773916&r1=773915&r2=773916&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/site/PortalSiteManagerApplication.java
(original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/site/PortalSiteManagerApplication.java
Tue May 12 14:49:38 2009
@@ -17,7 +17,6 @@
 package org.apache.jetspeed.portlets.site;
 
 import org.apache.jetspeed.portlets.wicket.AbstractAdminWebApplication;
-import org.apache.wicket.markup.html.AjaxServerAndClientTimeFilter;
 import org.apache.wicket.resource.loader.BundleStringResourceLoader;
 
 /**
@@ -30,10 +29,10 @@
     @Override
     protected void init()
     {
-
+        super.init();
         getResourceSettings().addStringResourceLoader(
                 new BundleStringResourceLoader("org.apache.jetspeed.portlets.site.resources.SiteResources"));
-        getRequestCycleSettings().addResponseFilter(new AjaxServerAndClientTimeFilter());
+        mountBookmarkablePage("/builder", PortalSiteManagerEdit.class);
     }
 
     @Override

Added: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/site/PortalSiteManagerEdit.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/site/PortalSiteManagerEdit.java?rev=773916&view=auto
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/site/PortalSiteManagerEdit.java
(added)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/site/PortalSiteManagerEdit.java
Tue May 12 14:49:38 2009
@@ -0,0 +1,117 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jetspeed.portlets.site;
+
+import java.io.IOException;
+
+import javax.portlet.PortletRequest;
+import javax.portlet.ReadOnlyException;
+import javax.portlet.ValidatorException;
+
+import org.apache.jetspeed.portlets.AdminPortletWebPage;
+import org.apache.jetspeed.portlets.wicket.AbstractAdminWebApplication;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.Button;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.TextField;
+import org.apache.wicket.markup.html.panel.FeedbackPanel;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.model.ResourceModel;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * @author <a href="mailto:vkumar@apache.org">Vivek Kumar</a>
+ * @version $Id$
+ */
+public class PortalSiteManagerEdit extends AdminPortletWebPage
+{
+    private Logger log = LoggerFactory.getLogger(PortalSiteManagerEdit.class);
+    private String treeRoot;
+
+    public PortalSiteManagerEdit()
+    {
+        PortletRequest request = ((AbstractAdminWebApplication) getApplication()).getPortletRequest();
+        treeRoot = request.getPreferences().getValue(PortalSiteManager.TREE_ROOT, "/");
+        add(new FeedbackPanel("feedback"));
+        Form userPrefernces = new Form("userPrefernces");
+        userPrefernces.add(new Label("treerootLabel", new ResourceModel("treeroot")));
+        userPrefernces.add(new TextField("treeroot", new PropertyModel(this, "treeRoot")).setRequired(true));
+        userPrefernces.add(new Button("addUserPrefernces", new ResourceModel("common.save"))
+        {
+            @Override
+            public void onSubmit()
+            {
+                PortletRequest request = ((AbstractAdminWebApplication) getApplication()).getPortletRequest();
+                try
+                {
+                    if (log.isDebugEnabled())
+                    {
+                        log.debug("Setting tree root " + getTreeRoot());
+                    }
+                    request.getPreferences().setValue(PortalSiteManager.TREE_ROOT, getTreeRoot());
+                    request.getPreferences().store();
+                    if (log.isDebugEnabled())
+                    {
+                        log.debug("Default settiing for portlet saved . ");
+                    }
+                }
+                catch (ValidatorException e)
+                {
+                    if (log.isErrorEnabled())
+                    {
+                        log.error(e.getMessage());
+                    }
+                    error(e.getMessage());
+                }
+                catch (IOException e)
+                {
+                    if (log.isErrorEnabled())
+                    {
+                        log.error(e.getMessage());
+                    }
+                    error(e.getMessage());
+                }
+                catch (ReadOnlyException e)
+                {
+                    if (log.isErrorEnabled())
+                    {
+                        log.error(e.getMessage());
+                    }
+                    error(e.getMessage());
+                }
+            }
+        });
+        add(userPrefernces);
+    }
+    /**
+     * @return the treeRoot
+     */
+    public String getTreeRoot()
+    {
+        return treeRoot;
+    }
+
+    /**
+     * @param treeRoot
+     *            the treeRoot to set
+     */
+    public void setTreeRoot(String treeRoot)
+    {
+        this.treeRoot = treeRoot;
+    }
+}

Propchange: portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/site/PortalSiteManagerEdit.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/resources/org/apache/jetspeed/portlets/site/PortalSiteManager.html
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/resources/org/apache/jetspeed/portlets/site/PortalSiteManager.html?rev=773916&r1=773915&r2=773916&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/resources/org/apache/jetspeed/portlets/site/PortalSiteManager.html
(original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/resources/org/apache/jetspeed/portlets/site/PortalSiteManager.html
Tue May 12 14:49:38 2009
@@ -24,45 +24,67 @@
 table.wicket-tree-content {
 	width: 100%;
 }
+
 #bysy_indicator {
-  display: none;
-  float: right;
-  background: rgb(255,241,168);
-  margin-top: 5px;
-  z-index: 1000;
-  width: 200;
-  font-weight: bold;
-  text-align: center;
-  font-size: 1em;
+	display: none;
+	float: right;
+	background: rgb(255, 241, 168);
+	margin-top: 5px;
+	z-index: 1000;
+	width: 200;
+	font-weight: bold;
+	text-align: center;
+	font-size: 1em;
+}
+
+div.wicket-aa {
+	background-color: white;
+	border-width: 2px;
+	border-color: #cccccc;
+	border-style: solid;
+	text-align: left;
+}
+
+div.wicket-aa ul {
+	list-style: none;
+	padding: 2px;
+	margin: 0;
+}
+
+div.wicket-aa ul li.selected {
+	background-color: #C0C0C0;
+	padding: 2px;
+	margin: 0;
 }
 </style>
 </wicket:head>
 <table>
 	<tr>
-		<td colspan="2" style="border:1px solid black; margin:4px; padding: 4px;width=200px">
-			<div wicket:id="siteTree" class="my-tree">[Tree goes here]</div>
+		<td>
+		<div wicket:id="feedback" />
 		</td>
-		<td width="700px" style="border:1px solid black; margin:4px; padding: 4px;">
-			<div wicket:id="tabs" class="tabpanel">[panel goes here]</div>
+	</tr>
+	<tr>
+		<td colspan="2"
+			style="border: 1px solid black; margin: 4px; padding: 4px;">
+		<div wicket:id="siteTree" class="my-tree">[Tree goes here]</div>
+		</td>
+		<td width="700px"
+			style="border: 1px solid black; margin: 4px; padding: 4px;">
+		<div wicket:id="tabs" class="tabpanel">[panel goes here]</div>
 		</td>
 	</tr>
 	<form wicket:id="treeForm">
 	<tr>
-		<td>
-			<input type="text" wicket:id="userFolder" />
-		</td>
-		<td>
-			<input type="submit" wicket:id="userFolderButton" value="Show User Folder" />
-		</td>
-		<td>
-
-		</td>
+		<td><input type="text" wicket:id="userFolder" /></td>
+		<td><input type="submit" wicket:id="userFolderButton"
+			value="Show User Folder" /></td>
+		<td></td>
 	</tr>
 	<tr>
 		<td>&nbsp;</td>
-		<td align="left">
-			<input type="submit" wicket:id="portalFolderButton" value="Show Portal Tree" />
-		</td>
+		<td align="left"><input type="submit"
+			wicket:id="portalFolderButton" value="Show Portal Tree" /></td>
 		<td>&nbsp;</td>
 	</tr>
 	</form>
@@ -96,4 +118,4 @@
    } 
  }
  </script>
-</html>
+</html>
\ No newline at end of file

Added: portals/jetspeed-2/applications/j2-admin/trunk/src/main/resources/org/apache/jetspeed/portlets/site/PortalSiteManagerEdit.html
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/resources/org/apache/jetspeed/portlets/site/PortalSiteManagerEdit.html?rev=773916&view=auto
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/resources/org/apache/jetspeed/portlets/site/PortalSiteManagerEdit.html
(added)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/resources/org/apache/jetspeed/portlets/site/PortalSiteManagerEdit.html
Tue May 12 14:49:38 2009
@@ -0,0 +1,34 @@
+<!-- 
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+  
+       http://www.apache.org/licenses/LICENSE-2.0
+  
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+  
+  Author <a href="mailto:vkumar@apache.org">Vivek Kumar</a>
+ -->
+<?xml version="1.0" encoding="UTF-8"?>
+
+<html xmlns="http://www.w3.org/1999/xhtml" >
+	<div wicket:id="feedback"></div>
+    <form wicket:id="userPrefernces">
+        <table  cellpadding="0" cellspacing="1" border="1" width="300px">
+            <tr>
+                <td><span wicket:id="treerootLabel"/></td>
+                <td><input type="text" wicket:id="treeroot" class="portlet-form-field-label"
/></td>				            
+            </tr>
+            <tr>
+                <td colspan="2"><input type="submit" wicket:id="addUserPrefernces"
/></td>			
+            </tr>
+        </table>    
+    </form>
+</html>
\ No newline at end of file

Propchange: portals/jetspeed-2/applications/j2-admin/trunk/src/main/resources/org/apache/jetspeed/portlets/site/PortalSiteManagerEdit.html
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/main/resources/org/apache/jetspeed/portlets/site/resources/SiteResources.properties
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/resources/org/apache/jetspeed/portlets/site/resources/SiteResources.properties?rev=773916&r1=773915&r2=773916&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/resources/org/apache/jetspeed/portlets/site/resources/SiteResources.properties
(original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/resources/org/apache/jetspeed/portlets/site/resources/SiteResources.properties
Tue May 12 14:49:38 2009
@@ -82,4 +82,5 @@
 menu.option=Options
 menu.text=Text
 
-action.delete.confirm = Are sure you want to delete the selected item(s)?
\ No newline at end of file
+action.delete.confirm = Are sure you want to delete the selected item(s)?
+treeroot=Tree root
\ No newline at end of file

Modified: portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/portlet.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/portlet.xml?rev=773916&r1=773915&r2=773916&view=diff
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/portlet.xml (original)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/webapp/WEB-INF/portlet.xml Tue May
12 14:49:38 2009
@@ -746,7 +746,11 @@
     <init-param>
       <name>wicketFilterPath</name>
       <value>/portalSiteManager</value>
-    </init-param>        
+    </init-param>
+    <init-param>
+      <name>editPage</name>
+      <value>/portalSiteManager/builder</value>
+    </init-param>    
     <expiration-cache>0</expiration-cache>
     <supports>
         <mime-type>text/html</mime-type>
@@ -761,25 +765,9 @@
     </portlet-info>
     <portlet-preferences>
         <preference>
-            <name>defaultLayout</name>
-            <value>jetspeed-layouts::VelocityTwoColumns</value>
-        </preference>
-        <preference>
-            <name>displayUserTree</name>
-            <value>false</value>
-        </preference>        
-        <preference>
-            <name>root</name>
+            <name>jsRoot</name>
             <value>/</value>
         </preference>
-        <preference>
-            <name>viewInNewWindow</name>
-            <value>true</value>
-        </preference>          
-        <preference>
-            <name>showSearchTab</name>
-            <value>true</value>
-        </preference>                        
     </portlet-preferences>
 </portlet>    
 



---------------------------------------------------------------------
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