portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r333099 - in /portals/jetspeed-2/trunk/applications/pam/src: java/org/apache/jetspeed/portlets/site/ java/org/apache/jetspeed/portlets/site/resources/ webapp/WEB-INF/model/ webapp/WEB-INF/velocity/ webapp/WEB-INF/view/site/
Date Sun, 13 Nov 2005 18:46:23 GMT
Author: taylor
Date: Sun Nov 13 10:46:17 2005
New Revision: 333099

URL: http://svn.apache.org/viewcvs?rev=333099&view=rev
Log:
trying to implement Site Manager, can now add folders, pages
the more i work with this, the less i like the 2 portlet solution
without true portlet messaging in the api, it just makes things difficult

Added:
    portals/jetspeed-2/trunk/applications/pam/src/java/org/apache/jetspeed/portlets/site/PageProxyBean.java
    portals/jetspeed-2/trunk/applications/pam/src/webapp/WEB-INF/view/site/page-details.vm
Modified:
    portals/jetspeed-2/trunk/applications/pam/src/java/org/apache/jetspeed/portlets/site/FolderProxyBean.java
    portals/jetspeed-2/trunk/applications/pam/src/java/org/apache/jetspeed/portlets/site/PSMLTreeLoader.java
    portals/jetspeed-2/trunk/applications/pam/src/java/org/apache/jetspeed/portlets/site/SiteBrowserPortlet.java
    portals/jetspeed-2/trunk/applications/pam/src/java/org/apache/jetspeed/portlets/site/SiteDetailsPortlet.java
    portals/jetspeed-2/trunk/applications/pam/src/java/org/apache/jetspeed/portlets/site/resources/SiteResources.properties
    portals/jetspeed-2/trunk/applications/pam/src/java/org/apache/jetspeed/portlets/site/resources/SiteResources_en.properties
    portals/jetspeed-2/trunk/applications/pam/src/webapp/WEB-INF/model/spring-portlet-configuration.xml
    portals/jetspeed-2/trunk/applications/pam/src/webapp/WEB-INF/model/validator-configuration.xml
    portals/jetspeed-2/trunk/applications/pam/src/webapp/WEB-INF/velocity/velocity-macros.vm
    portals/jetspeed-2/trunk/applications/pam/src/webapp/WEB-INF/view/site/folder-details.vm

Modified: portals/jetspeed-2/trunk/applications/pam/src/java/org/apache/jetspeed/portlets/site/FolderProxyBean.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/applications/pam/src/java/org/apache/jetspeed/portlets/site/FolderProxyBean.java?rev=333099&r1=333098&r2=333099&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/applications/pam/src/java/org/apache/jetspeed/portlets/site/FolderProxyBean.java
(original)
+++ portals/jetspeed-2/trunk/applications/pam/src/java/org/apache/jetspeed/portlets/site/FolderProxyBean.java
Sun Nov 13 10:46:17 2005
@@ -41,13 +41,29 @@
     private boolean isNew = true;
 
     private String title;
+    private String name;
     private String shortTitle;
     private String defaultPage;
     private String theme;
     private String resourceType;
     private String key;
+    private String path;
     
     /**
+     * @return Returns the path.
+     */
+    public String getPath()
+    {
+        return path;
+    }
+    /**
+     * @param path The path to set.
+     */
+    public void setPath(String path)
+    {
+        this.path = path;
+    }
+    /**
      * @return Returns the defaultPage.
      */
     public String getDefaultPage()
@@ -120,7 +136,9 @@
                 setTitle(folder.getTitle());                
                 setShortTitle(folder.getShortTitle());
                 setDefaultPage(folder.getDefaultPage());
+                setName(folder.getName());
                 setKey(key);
+                setPath(folder.getPath());
                 isNew = false;
             }
         }
@@ -187,5 +205,19 @@
     public void setKey(String key)
     {
         this.key = key;
+    }
+    /**
+     * @return Returns the name.
+     */
+    public String getName()
+    {
+        return name;
+    }
+    /**
+     * @param name The name to set.
+     */
+    public void setName(String name)
+    {
+        this.name = name;
     }
 }

Modified: portals/jetspeed-2/trunk/applications/pam/src/java/org/apache/jetspeed/portlets/site/PSMLTreeLoader.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/applications/pam/src/java/org/apache/jetspeed/portlets/site/PSMLTreeLoader.java?rev=333099&r1=333098&r2=333099&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/applications/pam/src/java/org/apache/jetspeed/portlets/site/PSMLTreeLoader.java
(original)
+++ portals/jetspeed-2/trunk/applications/pam/src/java/org/apache/jetspeed/portlets/site/PSMLTreeLoader.java
Sun Nov 13 10:46:17 2005
@@ -42,6 +42,7 @@
     public static final String ROOT_DOMAIN = "ROOT_DOMAIN";
     public static final String FOLDER_DOMAIN = "FOLDER_DOMAIN";
     public static final String PAGE_DOMAIN = "PAGE_DOMAIN";
+    public static final String LINK_DOMAIN = "LINK_DOMAIN";
 	
 	public final static String PORTLET_URL = "portlet_url";
 		
@@ -63,7 +64,7 @@
                                 PortletApplicationResources.PORTLET_URL, // action 
                                 null, // target 
                                 true, // expanded 
-                                "0"); // domain
+                                FOLDER_DOMAIN); // domain
                 
         return root;
     }    
@@ -78,7 +79,7 @@
                     PortletApplicationResources.PORTLET_URL, // action 
                     null, // target
                     false, // expanded
-                    domain, // domain
+                    FOLDER_DOMAIN, // domain
                     "Folder", // CSS
                     true); // lazy load
         
@@ -101,7 +102,7 @@
                     PortletApplicationResources.PORTLET_URL, // action 
                     null, // target
                     false, // expanded
-                    domain, // domain
+                    PAGE_DOMAIN, // domain
 					"Document", // css
 					true); // lazy load
     	
@@ -121,7 +122,7 @@
                     PortletApplicationResources.PORTLET_URL, // action
                     null, // target
                     false, // expanded
-                    domain, // domain
+                    LINK_DOMAIN, // domain
 					null, // css
                     true); // lazy load
         
@@ -138,8 +139,9 @@
         NodeSet childLinks = null;
         try
         {
-            int ilevel = ((new Integer(parent.getDomain()).intValue()) + 1);        
-            String level = Integer.toString(ilevel);
+//            int ilevel = ((new Integer(parent.getDomain()).intValue()) + 1);        
+//            String level = Integer.toString(ilevel);
+            String level = "";
             
             childFolders = folder.getFolders();
             childPages = folder.getPages();

Added: portals/jetspeed-2/trunk/applications/pam/src/java/org/apache/jetspeed/portlets/site/PageProxyBean.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/applications/pam/src/java/org/apache/jetspeed/portlets/site/PageProxyBean.java?rev=333099&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/applications/pam/src/java/org/apache/jetspeed/portlets/site/PageProxyBean.java
(added)
+++ portals/jetspeed-2/trunk/applications/pam/src/java/org/apache/jetspeed/portlets/site/PageProxyBean.java
Sun Nov 13 10:46:17 2005
@@ -0,0 +1,207 @@
+/*
+ * Copyright 2000-2004 The Apache Software Foundation.
+ * 
+ * Licensed 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.Serializable;
+
+import org.apache.jetspeed.om.page.Page;
+import org.apache.jetspeed.page.PageManager;
+import org.apache.portals.bridges.frameworks.ExternalComponentSupport;
+import org.apache.portals.bridges.frameworks.Lookup;
+
+
+/**
+ * PageProxyBean
+ * 
+ * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
+ * @version $Id: FolderProxyBean.java 330359 2005-11-02 21:05:08Z rwatler $
+ */
+public class PageProxyBean 
+    implements 
+        ExternalComponentSupport, 
+        Lookup,
+        Serializable
+{
+    private static final long serialVersionUID = 1;
+    private transient PageManager pageManager = null;
+    private transient Page page;
+    private String lookupKey;
+    private boolean isNew = true;
+
+    private String key;
+    private String title;
+    private String shortTitle;
+    private String version;
+    private String resourceType;
+    private String name;
+    
+    public PageProxyBean()
+    {        
+    }
+    
+    /**
+     * @return Returns the resourceType.
+     */
+    public String getResourceType()
+    {
+        return resourceType;
+    }
+    /**
+     * @param resourceType The resourceType to set.
+     */
+    public void setResourceType(String resourceType)
+    {
+        this.resourceType = resourceType;
+    }
+    /**
+     * @return Returns the shortTitle.
+     */
+    public String getShortTitle()
+    {
+        return shortTitle;
+    }
+    /**
+     * @param shortTitle The shortTitle to set.
+     */
+    public void setShortTitle(String shortTitle)
+    {
+        this.shortTitle = shortTitle;
+    }
+        
+    public void setExternalSupport(Object externalSupport)
+    {
+        if (externalSupport instanceof PageManager)
+        {
+            pageManager = (PageManager)externalSupport;
+        }
+    }
+    
+    public void update(Page page)
+    {
+        page.setTitle(this.getTitle());
+        page.setShortTitle(this.getShortTitle());
+        page.setVersion(this.getVersion());
+    }
+    
+    public boolean lookup(String key)
+    {
+        boolean result = true;
+        try
+        {
+            if (pageManager != null)
+            {
+                this.page = pageManager.getPage(key);    
+                setTitle(page.getTitle());                
+                setShortTitle(page.getShortTitle());
+                setVersion(page.getVersion());
+                setName(page.getName());
+                setKey(key);
+                isNew = false;
+            }
+        }
+        catch (Exception ne)
+        {        
+            // create a new folder
+            result = false;
+        }
+        return result;
+    }
+    
+    /**
+     * @return Returns the title.
+     */
+    public String getTitle()
+    {
+        return title;
+    }
+    /**
+     * @param title The title to set.
+     */
+    public void setTitle(String title)
+    {
+        this.title = title;
+    }
+    /**
+     * @return Returns the lookupKey.
+     */
+    public String getLookupKey()
+    {
+        return lookupKey;
+    }
+    /**
+     * @param lookupKey The lookupKey to set.
+     */
+    public void setLookupKey(String lookupKey)
+    {
+        this.lookupKey = lookupKey;
+    }
+    /**
+     * @return Returns the isNew.
+     */
+    public boolean isNew()
+    {
+        return isNew;
+    }
+    /**
+     * @param isNew The isNew to set.
+     */
+    public void setNew(boolean isNew)
+    {
+        this.isNew = isNew;
+    }
+    /**
+     * @return Returns the key.
+     */
+    public String getKey()
+    {
+        return key;
+    }
+    /**
+     * @param key The key to set.
+     */
+    public void setKey(String key)
+    {
+        this.key = key;
+    }
+    /**
+     * @return Returns the version.
+     */
+    public String getVersion()
+    {
+        return version;
+    }
+    /**
+     * @param version The version to set.
+     */
+    public void setVersion(String version)
+    {
+        this.version = version;
+    }
+    /**
+     * @return Returns the name.
+     */
+    public String getName()
+    {
+        return name;
+    }
+    /**
+     * @param name The name to set.
+     */
+    public void setName(String name)
+    {
+        this.name = name;
+    }
+}

Modified: portals/jetspeed-2/trunk/applications/pam/src/java/org/apache/jetspeed/portlets/site/SiteBrowserPortlet.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/applications/pam/src/java/org/apache/jetspeed/portlets/site/SiteBrowserPortlet.java?rev=333099&r1=333098&r2=333099&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/applications/pam/src/java/org/apache/jetspeed/portlets/site/SiteBrowserPortlet.java
(original)
+++ portals/jetspeed-2/trunk/applications/pam/src/java/org/apache/jetspeed/portlets/site/SiteBrowserPortlet.java
Sun Nov 13 10:46:17 2005
@@ -68,8 +68,11 @@
 
     private TreeControl prepareSiteTree(RenderRequest request)
     {
+        String refresh = (String)PortletMessaging.consume(request, 
+                PortletApplicationResources.SITE_PORTLET, PortletApplicationResources.MESSAGE_REFRESH);
+        
         TreeControl control = (TreeControl) request.getPortletSession().getAttribute(SITE_TREE_ATTRIBUTE);
-        if (control == null)
+        if (refresh != null || control == null)
         {
             Folder root = null;
             try

Modified: portals/jetspeed-2/trunk/applications/pam/src/java/org/apache/jetspeed/portlets/site/SiteDetailsPortlet.java
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/applications/pam/src/java/org/apache/jetspeed/portlets/site/SiteDetailsPortlet.java?rev=333099&r1=333098&r2=333099&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/applications/pam/src/java/org/apache/jetspeed/portlets/site/SiteDetailsPortlet.java
(original)
+++ portals/jetspeed-2/trunk/applications/pam/src/java/org/apache/jetspeed/portlets/site/SiteDetailsPortlet.java
Sun Nov 13 10:46:17 2005
@@ -16,6 +16,7 @@
 package org.apache.jetspeed.portlets.site;
 
 import java.io.IOException;
+import java.io.NotSerializableException;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -24,16 +25,24 @@
 import javax.portlet.PortletConfig;
 import javax.portlet.PortletContext;
 import javax.portlet.PortletException;
+import javax.portlet.PortletMode;
+import javax.portlet.PortletRequest;
+import javax.portlet.PortletResponse;
 import javax.portlet.RenderRequest;
 import javax.portlet.RenderResponse;
 
 import org.apache.jetspeed.CommonPortletServices;
+import org.apache.jetspeed.PortalReservedParameters;
+import org.apache.jetspeed.container.state.MutableNavigationalState;
 import org.apache.jetspeed.exception.JetspeedException;
 import org.apache.jetspeed.om.folder.Folder;
 import org.apache.jetspeed.om.page.Page;
 import org.apache.jetspeed.page.PageManager;
 import org.apache.jetspeed.page.PageNotFoundException;
 import org.apache.jetspeed.portlets.pam.PortletApplicationResources;
+import org.apache.jetspeed.request.RequestContext;
+import org.apache.pluto.om.window.PortletWindow;
+import org.apache.portals.bridges.frameworks.FrameworkConstants;
 import org.apache.portals.bridges.frameworks.VelocityFrameworkPortlet;
 import org.apache.portals.messaging.PortletMessaging;
 
@@ -60,13 +69,14 @@
 
         Map externalSupportMap = new HashMap();
         externalSupportMap.put("folderBean", pageManager);
+        externalSupportMap.put("pageBean", pageManager);
         setExternalSupport(externalSupportMap);
     }
 
     public void doView(RenderRequest request, RenderResponse response) throws PortletException,
IOException
     {
         response.setContentType("text/html");
-
+        
         // Get the messages from the browser
         String currentFolder = (String) PortletMessaging.consume(request,
                 PortletApplicationResources.SITE_PORTLET, PortletApplicationResources.CURRENT_FOLDER);
@@ -76,11 +86,36 @@
         if (currentFolder != null)
         {
             request.setAttribute("site.folder.key", currentFolder);
+            changePortletView(request, response, "folder-view");
+        }
+        if (currentPage != null)
+        {
+            request.setAttribute("site.page.key", currentPage);
+            changePortletView(request, response, "page-view");
+        }
+        
+        String parent = request.getParameter("parent");
+        if (parent != null)
+        {
+            System.out.println("parent = " + parent);            
+            PortletMessaging.publish(request,
+                    PortletApplicationResources.SITE_PORTLET, "parent", parent);        
                       
         }
         super.doView(request, response);
 
     }
 
+    private void changePortletView(PortletRequest request, PortletResponse response, String
view)
+    {
+        //this.setDefaultViewPage("page-view");
+        PortletWindow window = (PortletWindow)request.getAttribute(PortalReservedParameters.PORTLET_WINDOW_ATTRIBUTE);
+        RequestContext context = (RequestContext)request.getAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE);
+        MutableNavigationalState state = (MutableNavigationalState)context.getPortalURL().getNavigationalState();
+        if (window != null)
+            state.clearParameters(window);            
+        this.setLogicalView(request, response, view, PortletMode.VIEW);        
+    }
+    
     public String processSaveFolderAction(ActionRequest request, ActionResponse response,
Object bean) 
     throws PortletException,
            IOException
@@ -94,8 +129,7 @@
             proxy.update(folder);
             pageManager.updateFolder(folder);
             
-            //PortletMessaging.publish(actionRequest, SecurityResources.TOPIC_USERS, SecurityResources.MESSAGE_REFRESH,
"true");
-            //PortletMessaging.publish(actionRequest, SecurityResources.TOPIC_USERS, SecurityResources.MESSAGE_SELECTED,
userName);
+            notifyUpdate(request, response, key);            
             
         }
         catch (JetspeedException e)
@@ -109,21 +143,41 @@
     throws PortletException,
            IOException
     {
-        System.out.println("Processing SAVE action.");
         FolderProxyBean proxy = (FolderProxyBean)bean;
         String key = proxy.getKey();
         try
         {
-            Folder folder = pageManager.newFolder(key);
+            String fullKey = getFullKey(request, key);
+            System.out.println("Saving . " + fullKey);
+            Folder folder = pageManager.newFolder(fullKey);
             
             
-            //Folder folder = pageManager.getFolder(key);
             proxy.update(folder);
             pageManager.updateFolder(folder);
             
-            //PortletMessaging.publish(actionRequest, SecurityResources.TOPIC_USERS, SecurityResources.MESSAGE_REFRESH,
"true");
-            //PortletMessaging.publish(actionRequest, SecurityResources.TOPIC_USERS, SecurityResources.MESSAGE_SELECTED,
userName);
+            notifyUpdate(request, response, fullKey);            
+        }
+        catch (JetspeedException e)
+        {
+            e.printStackTrace();
+        }
+        return "folder-view:success";
+    }
+
+    public String processDeleteFolderAction(ActionRequest request, ActionResponse response,
Object bean) 
+    throws PortletException,
+           IOException
+    {
+        FolderProxyBean proxy = (FolderProxyBean)bean;
+        String key = proxy.getKey();
+        try
+        {
+            String fullKey = getFullKey(request, key);
+            
+            Folder folder = pageManager.getFolder(fullKey);
+            pageManager.removeFolder(folder);
             
+            notifyUpdate(request, response, fullKey);            
         }
         catch (JetspeedException e)
         {
@@ -132,4 +186,53 @@
         return "folder-view:success";
     }
     
+    private String getFullKey(ActionRequest request, String key)
+    {
+        String parent = (String)PortletMessaging.consume(request, PortletApplicationResources.SITE_PORTLET,
"parent");
+        if (parent == null)
+        {
+            return "/" + key;
+        }
+        if (!parent.endsWith("/"))
+            parent += "/";
+
+        return parent + key;        
+    }
+    
+    public String processSavePageAction(ActionRequest request, ActionResponse response, Object
bean) 
+    throws PortletException,
+           IOException
+    {
+        System.out.println("Processing SAVE Page action.");
+        PageProxyBean proxy = (PageProxyBean)bean;
+        String key = proxy.getKey();
+        try
+        {            
+            Page page = pageManager.getPage(key);
+            proxy.update(page);
+            pageManager.updatePage(page);
+
+            notifyUpdate(request, response, proxy.getKey());
+            
+        }
+        catch (JetspeedException e)
+        {
+            e.printStackTrace();            
+        }
+        return "page-view:success";
+    }
+
+    private void notifyUpdate(ActionRequest request, ActionResponse response, String selected)
+    throws NotSerializableException
+    {
+        PortletMessaging.publish(request,
+                PortletApplicationResources.SITE_PORTLET,
+                PortletApplicationResources.MESSAGE_REFRESH, "true");
+//        PortletMessaging.publish(request,
+//                PortletApplicationResources.SITE_PORTLET,
+//                PortletApplicationResources.MESSAGE_SELECTED, proxy
+//                        .getLookupKey());
+        changePortletView(request, response, "folder-view");
+        
+    }
 }

Modified: portals/jetspeed-2/trunk/applications/pam/src/java/org/apache/jetspeed/portlets/site/resources/SiteResources.properties
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/applications/pam/src/java/org/apache/jetspeed/portlets/site/resources/SiteResources.properties?rev=333099&r1=333098&r2=333099&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/applications/pam/src/java/org/apache/jetspeed/portlets/site/resources/SiteResources.properties
(original)
+++ portals/jetspeed-2/trunk/applications/pam/src/java/org/apache/jetspeed/portlets/site/resources/SiteResources.properties
Sun Nov 13 10:46:17 2005
@@ -28,6 +28,11 @@
 DefaultPage = Default Page
 Theme = Theme
 ResourceType = Resource Type
+Name = Name
+
+# Page titles
+page.details = Page Details
+Version = Version
 
 # buttons and navigations
 save = Save

Modified: portals/jetspeed-2/trunk/applications/pam/src/java/org/apache/jetspeed/portlets/site/resources/SiteResources_en.properties
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/applications/pam/src/java/org/apache/jetspeed/portlets/site/resources/SiteResources_en.properties?rev=333099&r1=333098&r2=333099&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/applications/pam/src/java/org/apache/jetspeed/portlets/site/resources/SiteResources_en.properties
(original)
+++ portals/jetspeed-2/trunk/applications/pam/src/java/org/apache/jetspeed/portlets/site/resources/SiteResources_en.properties
Sun Nov 13 10:46:17 2005
@@ -30,6 +30,11 @@
 DefaultPage = Default Page
 Theme = Theme
 ResourceType = Resource Type
+Name = Name
+
+# Page titles
+page.details = Page Details
+Version = Version
 
 # buttons and navigations
 save = Save

Modified: portals/jetspeed-2/trunk/applications/pam/src/webapp/WEB-INF/model/spring-portlet-configuration.xml
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/applications/pam/src/webapp/WEB-INF/model/spring-portlet-configuration.xml?rev=333099&r1=333098&r2=333099&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/applications/pam/src/webapp/WEB-INF/model/spring-portlet-configuration.xml
(original)
+++ portals/jetspeed-2/trunk/applications/pam/src/webapp/WEB-INF/model/spring-portlet-configuration.xml
Sun Nov 13 10:46:17 2005
@@ -12,6 +12,12 @@
 			<value>site.folder.key</value>
 		</property>
     </bean>    
+    <bean id="pageBean" singleton='false' class="org.apache.jetspeed.portlets.site.PageProxyBean">
+        <description>Page bean</description>
+		<property name="lookupKey">
+			<value>site.page.key</value>
+		</property>
+    </bean>    
     
 <!-- Views -->
     <bean id="portlet-views" class="java.util.HashMap">
@@ -21,6 +27,9 @@
   	   	  <entry key="folder-view">
   	   	  	<value>/WEB-INF/view/site/folder-details.vm</value>
   	   	  </entry>
+  	   	  <entry key="page-view">
+  	   	  	<value>/WEB-INF/view/site/page-details.vm</value>
+  	   	  </entry>          
   	   	  <entry key="add-page">
   	   	  	<value>/WEB-INF/view/site/add-page.vm</value>
   	   	  </entry>
@@ -59,6 +68,9 @@
   	   	  <entry key="folder-view">
   	   	  	<value>folderBean</value>
   	   	  </entry>
+  	   	  <entry key="page-view">
+  	   	  	<value>pageBean</value>
+  	   	  </entry>          
   	   	</map>
   	   </constructor-arg>    	
     </bean>
@@ -71,6 +83,9 @@
   	   	  <entry key="folder-view">
   	   	  	<value>folderBean</value>
   	   	  </entry>
+  	   	  <entry key="page-view">
+  	   	  	<value>pageBean</value>
+  	   	  </entry>          
   	   	</map>
   	   </constructor-arg>    	
     </bean>
@@ -88,6 +103,9 @@
   	   	  <entry key="folder-view:success">
   	   	  	<value>folder-view,mode:view</value>
   	   	  </entry>            
+  	   	  <entry key="page-view:success">
+  	   	  	<value>page-view,mode:view</value>
+  	   	  </entry>                      
   	   	</map>  	   	
   	   </constructor-arg>    	
     </bean>    

Modified: portals/jetspeed-2/trunk/applications/pam/src/webapp/WEB-INF/model/validator-configuration.xml
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/applications/pam/src/webapp/WEB-INF/model/validator-configuration.xml?rev=333099&r1=333098&r2=333099&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/applications/pam/src/webapp/WEB-INF/model/validator-configuration.xml
(original)
+++ portals/jetspeed-2/trunk/applications/pam/src/webapp/WEB-INF/model/validator-configuration.xml
Sun Nov 13 10:46:17 2005
@@ -37,5 +37,10 @@
          	   <arg key="Title"/>
          </field>    
       </form>
+      <form name="pageBean">
+         <field property="title"  depends="required">
+         	   <arg key="Title"/>
+         </field>    
+      </form>      
    </formset>   
 </form-validation>

Modified: portals/jetspeed-2/trunk/applications/pam/src/webapp/WEB-INF/velocity/velocity-macros.vm
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/applications/pam/src/webapp/WEB-INF/velocity/velocity-macros.vm?rev=333099&r1=333098&r2=333099&view=diff
==============================================================================
Binary files - no diff available.

Modified: portals/jetspeed-2/trunk/applications/pam/src/webapp/WEB-INF/view/site/folder-details.vm
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/applications/pam/src/webapp/WEB-INF/view/site/folder-details.vm?rev=333099&r1=333098&r2=333099&view=diff
==============================================================================
--- portals/jetspeed-2/trunk/applications/pam/src/webapp/WEB-INF/view/site/folder-details.vm
(original)
+++ portals/jetspeed-2/trunk/applications/pam/src/webapp/WEB-INF/view/site/folder-details.vm
Sun Nov 13 10:46:17 2005
@@ -10,6 +10,7 @@
 <form action="$renderResponse.createActionURL()" method="post">
 <input type='hidden' name='portlet.action' value='processSaveFolderAction'/>
 <table>
+	#readField('Name' "$!folderBean.Path" "40" 'path' $MESSAGES $ERRORS)
     #formField('Title' "$!folderBean.Title" "40" 'title' $MESSAGES $ERRORS)
     #formField('ShortTitle' "$!folderBean.ShortTitle" "40" 'shortTitle' $MESSAGES $ERRORS)
     #formField('DefaultPage' "$!folderBean.DefaultPage" "40" 'defaultPage' $MESSAGES $ERRORS)
@@ -17,8 +18,12 @@
 <br/>
 <input type="submit" name="Save" value="$MESSAGES.getString('save')" />
 <!-- <a href="#" onClick='return checkSubmit("Remove","${pa.name}")'>$MESSAGES.getString('remove')</a>
-->
-<a href="$forward.getView('add-subfolder')">[$MESSAGES.getString('add.subfolder')]</a>
-<a href="$forward.getView('add-page')">[$MESSAGES.getString('add.page')]</a>
+#set ($sub = $forward.getView('add-subfolder'))
+$sub.setParameter('parent', $!folderBean.Key)
+#set ($page = $forward.getView('add-page'))
+$page.setParameter('parent', $!folderBean.Key)
+<a href="$sub">[$MESSAGES.getString('add.subfolder')]</a>
+<a href="$page">[$MESSAGES.getString('add.page')]</a>
 <a href="$forward.getView('add-link')">[$MESSAGES.getString('add.link')]</a>
 <a href="$forward.getView('doc-order')">[$MESSAGES.getString('doc.order')]</a>
 <a href="$forward.getView('menus')">[$MESSAGES.getString('menus')]</a>

Added: portals/jetspeed-2/trunk/applications/pam/src/webapp/WEB-INF/view/site/page-details.vm
URL: http://svn.apache.org/viewcvs/portals/jetspeed-2/trunk/applications/pam/src/webapp/WEB-INF/view/site/page-details.vm?rev=333099&view=auto
==============================================================================
--- portals/jetspeed-2/trunk/applications/pam/src/webapp/WEB-INF/view/site/page-details.vm
(added)
+++ portals/jetspeed-2/trunk/applications/pam/src/webapp/WEB-INF/view/site/page-details.vm
Sun Nov 13 10:46:17 2005
@@ -0,0 +1,24 @@
+<script language="javascript" src="${request.contextPath}/javascript/pam.js"></script>
+
+#set ($MESSAGES = $portletConfig.getResourceBundle($renderRequest.Locale))
+
+#if ($!pageBean.isNew())
+
+#else
+<h2 class="portlet-section-header">$MESSAGES.getString('page.details')</h2>
+
+<form action="$renderResponse.createActionURL()" method="post">
+<input type='hidden' name='portlet.action' value='processSavePageAction'/>
+<table>
+    #formField('Title' "$!pageBean.Title" "40" 'title' $MESSAGES $ERRORS)
+    #formField('ShortTitle' "$!pageBean.ShortTitle" "40" 'shortTitle' $MESSAGES $ERRORS)
+    #formField('Version' "$!pageBean.Version" "40" 'version' $MESSAGES $ERRORS)
+</table>
+<br/>
+<input type="submit" name="Save" value="$MESSAGES.getString('save')" />
+<!-- <a href="#" onClick='return checkSubmit("Remove","${pa.name}")'>$MESSAGES.getString('remove')</a>
-->
+<a href="$forward.getView('security')">[$MESSAGES.getString('security')]</a>
+</form>
+
+#ErrorMessages($ERRORS)
+#end
\ 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