portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject svn commit: r345860 - /portals/jetspeed-2/trunk/applications/pam/src/java/org/apache/jetspeed/portlets/site/SiteDetailsPortlet.java
Date Mon, 21 Nov 2005 07:37:17 GMT
Author: taylor
Date: Sun Nov 20 23:37:16 2005
New Revision: 345860

URL: http://svn.apache.org/viewcvs?rev=345860&view=rev
Log:
very minimalistic add Page

Modified:
    portals/jetspeed-2/trunk/applications/pam/src/java/org/apache/jetspeed/portlets/site/SiteDetailsPortlet.java

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=345860&r1=345859&r2=345860&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 20 23:37:16 2005
@@ -36,13 +36,12 @@
 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.Fragment;
 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;
 
@@ -164,6 +163,40 @@
         return "folder-view:success";
     }
 
+    public String processAddPageAction(ActionRequest request, ActionResponse response, Object
bean) 
+    throws PortletException,
+           IOException
+    {
+        PageProxyBean proxy = (PageProxyBean)bean;
+        String key = proxy.getKey();
+        try
+        {
+            String fullKey = getFullKey(request, key);
+            System.out.println("Saving . " + fullKey);
+            Page page = pageManager.newPage(fullKey);
+            // TODO: Get System Wide defaults for decorators
+            page.getRootFragment().setName("jetspeed-layouts::VelocityTwoColumns");
+            page.setDefaultDecorator("tigris", Fragment.LAYOUT);
+            page.setDefaultDecorator("tigris", Fragment.PORTLET);
+            // or:
+            //String templateFolder = actionRequest.getPreferences().getValue("newUserTemplateDirectory",
"/_user/template/");
+            // TODO: copy the entire dir tree, not just the default-page.psml           
     
+            //Page template = pageManager.getPage(templateFolder + "default-page.psml");
               
+            //Page copy = pageManager.copyPage(template, Folder.USER_FOLDER + userName +
"/default-page.psml");
+            
+            
+            proxy.update(page);
+            pageManager.updatePage(page);
+            
+            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



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