portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vku...@apache.org
Subject svn commit: r737018 [2/3] - in /portals/jetspeed-2/applications/j2-admin/trunk: ./ src/main/java/org/apache/jetspeed/portlets/security/ src/main/java/org/apache/jetspeed/portlets/security/users/ src/main/java/org/apache/jetspeed/portlets/site/ src/main...
Date Fri, 23 Jan 2009 12:46:40 GMT
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=737018&r1=737017&r2=737018&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 Fri Jan 23 04:46:36 2009
@@ -22,122 +22,325 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.OutputStream;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
 import java.util.Enumeration;
 import java.util.Iterator;
+import java.util.List;
+import java.util.Locale;
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipFile;
 
 import javax.portlet.ActionRequest;
-import javax.portlet.ActionResponse;
-import javax.portlet.PortletConfig;
 import javax.portlet.PortletException;
 import javax.portlet.RenderRequest;
-import javax.portlet.RenderResponse;
+import javax.swing.tree.DefaultMutableTreeNode;
+import javax.swing.tree.DefaultTreeModel;
 
-import org.apache.commons.fileupload.FileItem;
-import org.apache.commons.fileupload.disk.DiskFileItemFactory;
-import org.apache.commons.fileupload.portlet.PortletFileUpload;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.jetspeed.CommonPortletServices;
-import org.apache.jetspeed.PortalReservedParameters;
+import org.apache.jetspeed.ajax.AJAXException;
 import org.apache.jetspeed.components.portletregistry.PortletRegistry;
 import org.apache.jetspeed.decoration.DecorationFactory;
 import org.apache.jetspeed.exception.JetspeedException;
-import org.apache.jetspeed.headerresource.HeaderResource;
+import org.apache.jetspeed.om.common.SecurityConstraints;
 import org.apache.jetspeed.om.folder.Folder;
+import org.apache.jetspeed.om.folder.FolderNotFoundException;
+import org.apache.jetspeed.om.folder.InvalidFolderException;
+import org.apache.jetspeed.om.page.Fragment;
 import org.apache.jetspeed.om.page.Link;
 import org.apache.jetspeed.om.page.Page;
+import org.apache.jetspeed.om.page.SecurityConstraintsDef;
+import org.apache.jetspeed.om.portlet.LocalizedField;
+import org.apache.jetspeed.page.FolderNotUpdatedException;
 import org.apache.jetspeed.page.PageManager;
-import org.apache.jetspeed.request.RequestContext;
-import org.apache.portals.gems.dojo.AbstractDojoVelocityPortlet;
+import org.apache.jetspeed.page.PageNotFoundException;
+import org.apache.jetspeed.page.PageNotUpdatedException;
+import org.apache.jetspeed.page.document.DocumentNotFoundException;
+import org.apache.jetspeed.page.document.Node;
+import org.apache.jetspeed.page.document.NodeException;
+import org.apache.jetspeed.page.document.UnsupportedDocumentTypeException;
+import org.apache.jetspeed.portlets.security.users.WicketUserAdmin;
+import org.apache.jetspeed.portlets.wicket.component.JavascriptEventConfirmation;
+import org.apache.jetspeed.security.SecurityException;
+import org.apache.wicket.Component;
+import org.apache.wicket.ResourceReference;
+import org.apache.wicket.ajax.AjaxRequestTarget;
+import org.apache.wicket.ajax.markup.html.AjaxLink;
+import org.apache.wicket.ajax.markup.html.form.AjaxButton;
+import org.apache.wicket.extensions.ajax.markup.html.autocomplete.AutoCompleteTextField;
+import org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow;
+import org.apache.wicket.extensions.ajax.markup.html.tabs.AjaxTabbedPanel;
+import org.apache.wicket.extensions.markup.html.tabs.AbstractTab;
+import org.apache.wicket.extensions.markup.html.tabs.ITab;
+import org.apache.wicket.extensions.markup.html.tabs.TabbedPanel;
+import org.apache.wicket.markup.html.basic.Label;
+import org.apache.wicket.markup.html.form.Button;
+import org.apache.wicket.markup.html.form.CheckBox;
+import org.apache.wicket.markup.html.form.DropDownChoice;
+import org.apache.wicket.markup.html.form.Form;
+import org.apache.wicket.markup.html.form.FormComponent;
+import org.apache.wicket.markup.html.form.RequiredTextField;
+import org.apache.wicket.markup.html.form.TextField;
+import org.apache.wicket.markup.html.image.Image;
+import org.apache.wicket.markup.html.link.ExternalLink;
+import org.apache.wicket.markup.html.list.ListItem;
+import org.apache.wicket.markup.html.list.ListView;
+import org.apache.wicket.markup.html.panel.FeedbackPanel;
+import org.apache.wicket.markup.html.panel.Panel;
+import org.apache.wicket.markup.html.tree.BaseTree;
+import org.apache.wicket.markup.html.tree.LinkIconPanel;
+import org.apache.wicket.markup.html.tree.LinkTree;
+import org.apache.wicket.model.IModel;
+import org.apache.wicket.model.Model;
+import org.apache.wicket.model.PropertyModel;
+import org.apache.wicket.util.string.Strings;
+import org.apache.wicket.validation.validator.StringValidator;
 
 /**
  * Manage the Portal Site
  * 
+ * @author <a href="mailto:vkumar@apache.org">Vivek Kumar</a>
  * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
  * @version $Id: $
  */
-public class PortalSiteManager extends AbstractDojoVelocityPortlet 
+public class PortalSiteManager extends WicketUserAdmin
 {
-    protected final Log log = LogFactory.getLog(this.getClass());
-    
+    // protected final Log log = LogFactory.getLog(this.getClass());
     // components
     protected PageManager pageManager;
     protected PortletRegistry registry;
     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 JSROOT = "jsroot";
     public static final String ALL_SECURITY_REFS = "allSecurityRefs";
-    
-	protected PageManager castorPageManager;
-    
-    public void init(PortletConfig config)
-    throws PortletException 
-    {
-        super.init(config);
-        pageManager = (PageManager) getPortletContext().getAttribute(CommonPortletServices.CPS_PAGE_MANAGER_COMPONENT);        
-        if (null == pageManager) 
-        { 
-            PortletException pe = new PortletException("Failed to find the Page Manager on SiteViewController initialization");
-            throw new RuntimeException(pe); 
-        }
-        registry = (PortletRegistry) getPortletContext().getAttribute(CommonPortletServices.CPS_REGISTRY_COMPONENT);
-        if (null == registry)
-        {
-            PortletException pe = new PortletException("Failed to find the Portlet Registry on SiteViewController initialization");
-            throw new RuntimeException(pe);             
-        }
-        decorationFactory = (DecorationFactory) getPortletContext().getAttribute(CommonPortletServices.CPS_DECORATION_FACTORY);
-        if (null == decorationFactory)
-        {
-            PortletException pe = new PortletException("Failed to find the Decoration Factory on SiteViewController initialization");
-            throw new RuntimeException(pe);             
-        }
-        castorPageManager = (PageManager) getPortletContext().getAttribute(CommonPortletServices.CPS_IMPORTER_MANAGER);
-        if (null == castorPageManager) {
-            PortletException pe = new PortletException(
-                    "Failed to find the castorPageManager on SiteViewController initialization");
-            throw new RuntimeException(pe);
-        }
-    }
-    
-    public void doView(RenderRequest request, RenderResponse response)
-            throws PortletException, IOException
+    protected PageManager castorPageManager;
+    private DefaultTreeModel treeModel;
+    private AjaxTabbedPanel tabPanel;
+    private DefaultTreeModel treeRoot;
+    private JetspeedDocument document;
+    private static List<String> pageDecoraters;
+    private static List<String> portletDecorators;
+    private static List<String> pageThemes;
+    private static List<String> constraintsDefs;
+    private static List<String> targetList;
+    private static String ADD_ACTION = "add";
+    private static String REMOVE_ACTION = "remove";
+    private static String SAVE_ACTION = "save";
+    String userFolder;
+    private AjaxLink addFolder;
+    private AjaxLink addPage;
+    private AjaxLink addLink;
+
+    public PortalSiteManager()
     {
-        try
+        super();
+        List<ITab> tabList = new ArrayList<ITab>();
+        DefaultMutableTreeNode rootNode = populateTree();
+        populateDocument(new SiteTreeNode("ROOT", "/", SiteTreeNode.FileType.Folder, true));
+        PortalTree siteTree = new PortalTree("siteTree", new PropertyModel(this, "treeRoot"));
+        siteTree.getTreeState().expandNode(rootNode);
+        tabPanel = new AjaxTabbedPanel("tabs", tabList);
+        tabPanel.setOutputMarkupId(true);
+        add(siteTree);
+        final ModalWindow metaDataModalWindow;
+        add(metaDataModalWindow = new ModalWindow("modalwindow"));
+        Form treeForm = new Form("treeForm");
+        treeForm.add(new AutoCompleteTextField<String>("userFolder", new PropertyModel(this, "userFolder"))
+        {
+            @Override
+            protected Iterator<String> getChoices(String input)
+            {
+                if (Strings.isEmpty(input) || input.length() < 1)
+                {
+                    List<String> emptyList = Collections.emptyList();
+                    return emptyList.iterator();
+                }
+                List<String> choices = new ArrayList<String>(10);
+                List<String> userNames = null;
+                try
+                {
+                    userNames = getUserManager().getUserNames(input);
+                }
+                catch (SecurityException e)
+                {
+                    // TODO Auto-generated catch block
+                    e.printStackTrace();
+                }
+                if (userNames == null)
+                {
+                    List<String> emptyList = Collections.emptyList();
+                    return emptyList.iterator();
+                }
+                if(userNames.size()>10)
+                {
+                    return userNames.subList(0, 10).iterator();    
+                }else{
+                    return userNames.iterator();
+                }               
+            }
+        });
+        treeForm.add(new Button("userFolderButton")
+        {
+            @Override
+            public void onSubmit()
+            {
+                ((LinkTree) getPage().get("siteTree")).getTreeState().expandNode(populateUserTree(userFolder));
+            }
+        });
+        treeForm.add(new Button("portalFolderButton")
+        {
+            @Override
+            public void onSubmit()
+            {
+                setUserFolder("");
+                ((LinkTree) getPage().get("siteTree")).getTreeState().expandNode(populateTree());
+            }
+        });
+        addFolder = new AjaxLink("addFolder")
+        {
+            @Override
+            public void onClick(AjaxRequestTarget target)
+            {
+                metaDataModalWindow.setContent(new AddFolderPanel(metaDataModalWindow.getContentId()));
+                metaDataModalWindow.show(target);
+            }
+        };
+        treeForm.add(addFolder);
+        addPage = new AjaxLink("addPage")
         {
-            String jsroot = determineRootFolder(request);
-            RequestContext requestContext = 
-                (RequestContext) request.getAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE);
-            this.getContext(request).put("page-decorations", decorationFactory.getPageDecorations(requestContext));
-            this.getContext(request).put("portlet-decorations", decorationFactory.getPortletDecorations(requestContext));
-            this.getContext(request).put("themes", decorationFactory.getDesktopPageDecorations(requestContext));
-            this.getContext(request).put("treeName", "portal");
-            this.getContext(request).put("userTree", determineuserTree(request));
-            this.getContext(request).put("defaultLayout", request.getPreferences().getValue("defaultLayout", "jetspeed-layouts::VelocityTwoColumns"));            
-            this.getContext(request).put(FOLDERS, retrieveFolders(request, jsroot));
-            this.getContext(request).put(ALL_SECURITY_REFS, pageManager.getPageSecurity().getSecurityConstraintsDefs());
-            if(request.getPortletSession().getAttribute("status") ==null){
-                request.getPortletSession().setAttribute("status","");
+            @Override
+            public void onClick(AjaxRequestTarget target)
+            {
+                metaDataModalWindow.setContent(new AddPagePanel(metaDataModalWindow.getContentId()));
+                metaDataModalWindow.show(target);
             }
+        };
+        treeForm.add(addPage);
+        addLink = new AjaxLink("addLink")
+        {
+            @Override
+            public void onClick(AjaxRequestTarget target)
+            {
+                metaDataModalWindow.setContent(new AddLinkPanel(metaDataModalWindow.getContentId()));
+                metaDataModalWindow.show(target);
+            }
+        };
+        treeForm.add(addLink);
+        addFolder.setVisibilityAllowed(true);
+        addPage.setVisibilityAllowed(true);
+        addLink.setVisibilityAllowed(true);
+        addFolder.setVisible(false);
+        addPage.setVisible(false);
+        addLink.setVisible(false);
+        add(treeForm);
+        add(tabPanel);
+        controlTabs();
+    }
+
+    private class PortalTree extends LinkTree
+    {
+        private static final long serialVersionUID = 3315834315652490831L;
+
+        public PortalTree(String id, IModel model)
+        {
+            super(id, model);
         }
-        catch (Exception e)
+
+        @Override
+        protected Component newNodeComponent(String id, IModel model)
         {
-            log.error("Failed to get root folder", e);
-            throw new PortletException("Failed to get root folder");
+            final IModel nodeModel = model;
+            return new LinkIconPanel(id, model, PortalTree.this)
+            {
+                private static final long serialVersionUID = 1L;
+                String path = "images";
+
+                @Override
+                protected Component newContentComponent(String componentId, BaseTree tree, IModel model)
+                {
+                    return new Label(componentId, getNodeTextModel(model));
+                }
+
+                /*
+                 * (non-Javadoc)
+                 * @see org.apache.wicket.markup.html.tree.LinkIconPanel#onNodeLinkClicked(java.lang.Object, org.apache.wicket.markup.html.tree.BaseTree,
+                 * org.apache.wicket.ajax.AjaxRequestTarget)
+                 */
+                @Override
+                protected void onNodeLinkClicked(Object node, BaseTree tree, AjaxRequestTarget target)
+                {
+                    super.onNodeLinkClicked(node, tree, target);
+                    DefaultMutableTreeNode treeNode = (DefaultMutableTreeNode) node;
+                    SiteTreeNode siteNode = (SiteTreeNode) treeNode.getUserObject();
+                    if (!tree.getTreeState().isNodeExpanded(treeNode))
+                    {
+                        populateDocument(siteNode);
+                        if (siteNode.getDocType() == SiteTreeNode.FileType.Folder && !siteNode.isLoaded())
+                        {
+                            retrieveFolders(siteNode.getNodePath(), treeNode);
+                            siteNode.setLoaded(true);
+                            tree.updateTree();
+                        }
+                        tree.getTreeState().expandNode(treeNode);
+                        controlTabs();
+                    }
+                    else
+                    {
+                        tree.getTreeState().collapseNode(treeNode);
+                    }
+                    if (siteNode.getDocType() == SiteTreeNode.FileType.Folder)
+                    {
+                        addFolder.setVisible(true);
+                        addPage.setVisible(true);
+                        addLink.setVisible(true);
+                    }
+                    else
+                    {
+                        addFolder.setVisible(false);
+                        addPage.setVisible(false);
+                        addLink.setVisible(false);
+                    }
+                    target.addComponent(tabPanel);
+                    target.addComponent(addFolder);
+                    target.addComponent(addLink);
+                    target.addComponent(addPage);
+                }
+
+                @Override
+                protected Component newImageComponent(String componentId, BaseTree tree, IModel<Object> model)
+                {
+                    return new Image(componentId)
+                    {
+                        private static final long serialVersionUID = 1L;
+
+                        @Override
+                        protected ResourceReference getImageResourceReference()
+                        {
+                            SiteTreeNode siteModel = (SiteTreeNode) ((DefaultMutableTreeNode) nodeModel.getObject()).getUserObject();
+                            if (siteModel.getDocType() == SiteTreeNode.FileType.Folder)
+                            {
+                                return new ResourceReference(PortalTree.class, path + "/folder.gif");
+                            }
+                            else if (siteModel.getDocType() == SiteTreeNode.FileType.Page)
+                            {
+                                return new ResourceReference(PortalTree.class, path + "/page.gif");
+                            }
+                            else if (siteModel.getDocType() == SiteTreeNode.FileType.Link)
+                            {
+                                return new ResourceReference(PortalTree.class, path + "/link.gif");
+                            }
+                            return new ResourceReference(PortalTree.class, path + "/folder_closed.gif");
+                        }
+                    };
+                }
+            };
         }
-        
-        super.doView(request, response);
-        request.getPortletSession().removeAttribute("status");
     }
-    
+
     protected String determineRootFolder(RenderRequest request)
     {
         String jsroot = request.getParameter(JSROOT);
@@ -145,17 +348,18 @@
         {
             jsroot = request.getPreferences().getValue("root", "/_user/" + request.getRemoteUser() + "/");
         }
-        this.getContext(request).put(JSROOT, jsroot);
+        // this.getContext(request).put(JSROOT, jsroot);
         return jsroot;
     }
+
     protected String determineuserTree(RenderRequest request)
     {
-    	String userTree;
-    	userTree = request.getPreferences().getValue("displayUserTree","false");
-    	return userTree;
+        String userTree;
+        userTree = request.getPreferences().getValue("displayUserTree", "false");
+        return userTree;
     }
-    public Folder retrieveFolders(RenderRequest request, String root)
-    throws PortletException
+
+    public Folder retrieveFolders(RenderRequest request, String root) throws PortletException
     {
         try
         {
@@ -164,284 +368,1378 @@
         }
         catch (Exception e)
         {
-            log.error("Failed to retrieve folders ", e);
+            // log.error("Failed to retrieve folders ", e);
+            e.printStackTrace();
             throw new PortletException("Failed to get root folder");
         }
     }
-    
-    protected void includeHeaderContent(HeaderResource headerResource)
-    {
-        headerResource.dojoAddCoreLibraryRequire("dojo.lang.*");
-        //headerResource.dojoAddCoreLibraryRequire("dojo.dnd.*");
-        headerResource.dojoAddCoreLibraryRequire("dojo.dnd.HtmlDragManager");
-        headerResource.dojoAddCoreLibraryRequire("dojo.dnd.DragAndDrop");
-        headerResource.dojoAddCoreLibraryRequire("dojo.dnd.HtmlDragAndDrop");
-        
-        headerResource.dojoAddCoreLibraryRequire("dojo.event.*");
-        headerResource.dojoAddCoreLibraryRequire("dojo.io");
-                
-        headerResource.dojoAddCoreLibraryRequire("dojo.widget.ContentPane");
-        headerResource.dojoAddCoreLibraryRequire("dojo.widget.LayoutContainer");
-        
-        headerResource.dojoAddCoreLibraryRequire("dojo.widget.Tree");
-        headerResource.dojoAddCoreLibraryRequire("dojo.widget.TreeRPCController");        
-        // headerResource.dojoAddCoreLibraryRequire("dojo.widget.TreeLoadingControllerV3");
-        headerResource.dojoAddCoreLibraryRequire("dojo.widget.TreeSelector");
-        headerResource.dojoAddCoreLibraryRequire("dojo.widget.TreeNode");
-        headerResource.dojoAddCoreLibraryRequire("dojo.widget.TreeContextMenu");
-        
-        headerResource.dojoAddCoreLibraryRequire("dojo.widget.ValidationTextbox");
-        headerResource.dojoAddCoreLibraryRequire("dojo.widget.ComboBox");
-        headerResource.dojoAddCoreLibraryRequire("dojo.widget.Checkbox");
-        headerResource.dojoAddCoreLibraryRequire("dojo.widget.Dialog");
-        headerResource.dojoAddCoreLibraryRequire("dojo.widget.Button");
-        
-        //headerResource.dojoAddModuleLibraryRequire( "jetspeed.desktop.core" );
-        headerResource.dojoAddModuleLibraryRequire( "jetspeed.site" );
-        headerResource.dojoAddModuleLibraryRequire( "jetspeed.widget.EditorTable" );        
-    }
-
-    public void doEdit(RenderRequest request, RenderResponse response)
-    throws PortletException, IOException
-    {
-        response.setContentType("text/html");
-        doPreferencesEdit(request, response);
-    }
-    
-    public void processAction(ActionRequest request, ActionResponse actionResponse) throws PortletException, java.io.IOException
-    {
-        String add = request.getParameter("Save");
-        String fileName ="";
-        String destPath="";
-        String fileType="";
-        String path="";
-        String usrFolder="";
-        boolean success = false;
-
-        if (add != null)
-        { 
-            processPreferencesAction(request, actionResponse);
-        } else {
-            cleanUserFolder(request.getUserPrincipal().toString());
-            try {
-                DiskFileItemFactory diskFileItemFactory = new DiskFileItemFactory();
-                PortletFileUpload portletFileUpload = new PortletFileUpload(diskFileItemFactory);
-                if (PortletFileUpload.isMultipartContent(request)) {
-                    Iterator fileIt = portletFileUpload.parseRequest(request).iterator();
-                    while (fileIt.hasNext()) {
-                        FileItem fileItem = (FileItem) fileIt.next();
-                        if (fileItem.getFieldName().equals("psmlFile")) {
-                            synchronized (this) {
-                                fileName = fileItem.getName();
-                                usrFolder = getTempFolder(request);
-                                path= System.getProperty("file.separator");
-                                String filePath = usrFolder + path + fileItem.getName();
-                                FileOutputStream out = new FileOutputStream(filePath);
-                                out.write(fileItem.get());
-                                out.close();
-                            }
-                        }else if(fileItem.isFormField() && fileItem.getFieldName().equalsIgnoreCase("importPath")){
-                            destPath= fileItem.getString();
-                        }  
-                    }
-                    fileType = fileExt(fileName);
-                    if (fileType != null && !fileType.equals("")&& fileName != null && !fileName.equals("") && destPath != null && !destPath.equals("")) {
-                        // if "/" is path, then file separator will work, as root.
-                        if(destPath.equals("/")) destPath =""; 
-                        Folder folder = castorPageManager.getFolder(request.getUserPrincipal().toString());
-                        if(fileType.equalsIgnoreCase("psml")){
-                            Page source = folder.getPage(fileName);
-                            Page page = null;
-                            if(pageManager.pageExists(destPath + "/" + fileName)){
-                                pageManager.removePage(pageManager.getPage(destPath + "/" + fileName));
-                                page = pageManager.copyPage(source, destPath + "/" + fileName);
-                            }
-                            page = pageManager.copyPage(source, destPath + "/" + fileName);                               
-                            pageManager.updatePage(page);
-                            success = true;
-                        }else if(fileType.equalsIgnoreCase("link")){
-                            Link source = folder.getLink(fileName);
-                            Link link;
-                            if(pageManager.linkExists(destPath + "/" + fileName)){
-                                pageManager.removeLink(pageManager.getLink(destPath + "/" + fileName));
-                                link = pageManager.copyLink(source, destPath + "/" + fileName);
-                            }
-                            link = pageManager.copyLink(source, destPath + "/" + fileName);
-                            pageManager.updateLink(link);
-                            success = true;
-                        }else if(fileType.equalsIgnoreCase("zip")){
-                            unzipfile(fileName,usrFolder + path,path);
-                            folder = castorPageManager.getFolder(request.getUserPrincipal().toString());
-                            importFolders(folder, request.getUserPrincipal().toString(), destPath);
-                            success = true;
-                        }
-                    }
-                }
-                if (success){
-                    request.getPortletSession().setAttribute("status",fileName);
-                 }else{
-                    request.getPortletSession().setAttribute("status","false"); 
-                 }
-            } catch (Exception e) {
-                request.getPortletSession().setAttribute("status","false");
-                //throw new PortletException("Error occured in file uplodad");
-            }
-        }
 
-    }    
-	private String fileExt(String fileName){
-	    int extIndex = fileName.lastIndexOf(".");
-        if(extIndex>0){
-            return fileName.substring(extIndex+1, fileName.length());
+    private String fileExt(String fileName)
+    {
+        int extIndex = fileName.lastIndexOf(".");
+        if (extIndex > 0)
+        {
+            return fileName.substring(extIndex + 1, fileName.length());
         }
         return "";
     }
-    private String getTempFolder(ActionRequest request) {
-		String dir = System.getProperty("java.io.tmpdir");
-		String path = System.getProperty("file.separator");
-		File file = new File(dir + path + request.getUserPrincipal());
-		file.mkdir();
-		return dir + path + request.getUserPrincipal();
-    }
 
-    private static final void copyInputStream(InputStream in, OutputStream out)
-    throws IOException
+    private String getTempFolder(ActionRequest request)
     {
-      byte[] buffer = new byte[1024];
-      int len;
-
-      while((len = in.read(buffer)) >= 0)
-        out.write(buffer, 0, len);
-
-      in.close();
-      out.close();
+        String dir = System.getProperty("java.io.tmpdir");
+        String path = System.getProperty("file.separator");
+        File file = new File(dir + path + request.getUserPrincipal());
+        file.mkdir();
+        return dir + path + request.getUserPrincipal();
     }
 
-    private boolean  unzipfile(String file,String destination,String sepreator) {
-      Enumeration entries;
-      String filePath="";
-      try {
-          ZipFile zipFile = new ZipFile(destination+sepreator+file);
-
-        entries = zipFile.entries();
+    private static final void copyInputStream(InputStream in, OutputStream out) throws IOException
+    {
+        byte[] buffer = new byte[1024];
+        int len;
+        while ((len = in.read(buffer)) >= 0)
+            out.write(buffer, 0, len);
+        in.close();
+        out.close();
+    }
 
-        while(entries.hasMoreElements()) {
-          ZipEntry entry = (ZipEntry)entries.nextElement();
-          filePath = destination+sepreator+entry.getName();
-          createPath(filePath);
-          copyInputStream(zipFile.getInputStream(entry),
-             new BufferedOutputStream(new FileOutputStream(filePath)));
+    private boolean unzipfile(String file, String destination, String sepreator)
+    {
+        Enumeration entries;
+        String filePath = "";
+        try
+        {
+            ZipFile zipFile = new ZipFile(destination + sepreator + file);
+            entries = zipFile.entries();
+            while (entries.hasMoreElements())
+            {
+                ZipEntry entry = (ZipEntry) entries.nextElement();
+                filePath = destination + sepreator + entry.getName();
+                createPath(filePath);
+                copyInputStream(zipFile.getInputStream(entry), new BufferedOutputStream(new FileOutputStream(filePath)));
+            }
+            zipFile.close();
+            return true;
+        }
+        catch (IOException ioe)
+        {
+            ioe.printStackTrace();
+            return false;
         }
-
-        zipFile.close();
-        return true;
-      } catch (IOException ioe) {
-        ioe.printStackTrace();
-        return false;
-      }
     }
-    
-    private void createPath(String filePath) {
-        String parentPath="";
+
+    private void createPath(String filePath)
+    {
+        String parentPath = "";
         File file = new File(filePath);
         File parent = new File(file.getParent());
-        if (!parent.exists()) {
+        if (!parent.exists())
+        {
             parentPath = parent.getPath();
             createPath(parentPath);
             parent.mkdir();
         }
     }
-    private Folder importFolders(Folder srcFolder,String userName,String destination) throws JetspeedException {
+
+    private Folder importFolders(Folder srcFolder, String userName, String destination) throws JetspeedException
+    {
         Folder dstFolder = lookupFolder(srcFolder.getPath());
-        dstFolder = pageManager.copyFolder(srcFolder,destination);
+        dstFolder = pageManager.copyFolder(srcFolder, destination);
         pageManager.updateFolder(dstFolder);
-        String newPath="";
+        String newPath = "";
         Iterator pages = srcFolder.getPages().iterator();
-        while (pages.hasNext()) {
+        while (pages.hasNext())
+        {
             Page srcPage = (Page) pages.next();
             Page dstPage = lookupPage(srcPage.getPath());
-            newPath = destination+getRealPath(srcPage.getPath());
-            dstPage = pageManager.copyPage(srcPage,newPath);
+            newPath = destination + getRealPath(srcPage.getPath());
+            dstPage = pageManager.copyPage(srcPage, newPath);
             pageManager.updatePage(dstPage);
         }
-
         Iterator links = srcFolder.getLinks().iterator();
-        while (links.hasNext()) {
+        while (links.hasNext())
+        {
             Link srcLink = (Link) links.next();
             Link dstLink = lookupLink(srcLink.getPath());
-            newPath = destination+getRealPath(srcLink.getPath());
+            newPath = destination + getRealPath(srcLink.getPath());
             dstLink = pageManager.copyLink(srcLink, newPath);
             pageManager.updateLink(dstLink);
         }
         Iterator folders = srcFolder.getFolders().iterator();
-        while (folders.hasNext()) {
+        while (folders.hasNext())
+        {
             Folder folder = (Folder) folders.next();
-            newPath = destination+getRealPath(folder.getPath());
-            importFolders(folder,userName, newPath );
+            newPath = destination + getRealPath(folder.getPath());
+            importFolders(folder, userName, newPath);
         }
-
         return dstFolder;
     }
-    private Page lookupPage(String path) {
-        try {
+
+    private Page lookupPage(String path)
+    {
+        try
+        {
             return castorPageManager.getPage(path);
-        } catch (Exception e) {
+        }
+        catch (Exception e)
+        {
             return null;
         }
     }
 
-    private Link lookupLink(String path) {
-        try {
+    private Link lookupLink(String path)
+    {
+        try
+        {
             return castorPageManager.getLink(path);
-        } catch (Exception e) {
+        }
+        catch (Exception e)
+        {
             return null;
         }
     }
 
-    private Folder lookupFolder(String path) {
-        try {
+    private Folder lookupFolder(String path)
+    {
+        try
+        {
             return castorPageManager.getFolder(path);
-        } catch (Exception e) {
+        }
+        catch (Exception e)
+        {
             return null;
         }
     }
-    private String getRealPath(String path){
+
+    private String getRealPath(String path)
+    {
         int index = path.lastIndexOf("/");
-        if (index>0)
+        if (index > 0)
         {
             return path.substring(index);
         }
         return path;
-         
     }
-    private boolean cleanUserFolder( String userName) {
+
+    private boolean cleanUserFolder(String userName)
+    {
         boolean success = false;
-        synchronized (this) {
+        synchronized (this)
+        {
             String tmpdir = System.getProperty("java.io.tmpdir");
             String path = System.getProperty("file.separator");
-            String folder = tmpdir + path + userName; 
-            File  dir = new File(folder);
-            if (dir.exists()) {
+            String folder = tmpdir + path + userName;
+            File dir = new File(folder);
+            if (dir.exists())
+            {
                 success = deleteDir(dir);
-            } 
+            }
             success = dir.mkdir();
         }
         return success;
     }
 
-    private boolean deleteDir(File dir) {
-        if( dir.exists() ) {
+    private boolean deleteDir(File dir)
+    {
+        if (dir.exists())
+        {
             File[] files = dir.listFiles();
-            for(int i=0; i<files.length; i++) {
-               if(files[i].isDirectory()) {
-                   deleteDir(files[i]);
-               }
-               else {
-                 files[i].delete();
-               }
+            for (int i = 0; i < files.length; i++)
+            {
+                if (files[i].isDirectory())
+                {
+                    deleteDir(files[i]);
+                }
+                else
+                {
+                    files[i].delete();
+                }
             }
-          }
-          return( dir.delete() );
+        }
+        return (dir.delete());
     }
 
+    protected class InformationTab extends BasePanel
+    {
+        private static final long serialVersionUID = 3039163446419682350L;
+
+        public InformationTab(String id, JetspeedDocument document)
+        {
+            super(id, document);
+            Form infoForm = new Form("infoForm");
+            Label nameLabel = new Label("name", "Name");
+            TextField nameField = new TextField("nameField", new PropertyModel(this, "document.name"));
+            infoForm.add(nameLabel);
+            infoForm.add(nameField);
+            Label titleLabel = new Label("title", "Title");
+            TextField titleField = new TextField("titleField", new PropertyModel(this, "document.title"));
+            infoForm.add(titleLabel);
+            infoForm.add(titleField);
+            Label shortTitleLabel = new Label("shortTitle", "ShortTitle");
+            TextField shortTitleField = new TextField("shortTitleField", new PropertyModel(this, "document.shortTitle"));
+            infoForm.add(shortTitleField);
+            infoForm.add(shortTitleLabel);
+            Label pageDecoratorLabel = new Label("pageDecorator", "Page Decorator");
+            DropDownChoice decoratorsList = new DropDownChoice("decoratorsList", new PropertyModel(this, "document.pageDecorator"), getPageDecorators());
+            infoForm.add(decoratorsList);
+            infoForm.add(pageDecoratorLabel);
+            Label portletDecoratorLabel = new Label("portletDecorator", "Portlet Decorator");
+            DropDownChoice portletDecoratorsList = new DropDownChoice("portletDecoratorsList", new PropertyModel(this, "document.portletDecorator"),
+                                                                      getPortletDecorators());
+            infoForm.add(portletDecoratorLabel);
+            infoForm.add(portletDecoratorsList);
+            Label themeLabel = new Label("theme", "Theme");
+            DropDownChoice themeField = new DropDownChoice("themeList", new PropertyModel(this, "document.desktopTheme"), getThemes());
+            themeField.setVisibilityAllowed(true);
+            themeLabel.setVisibilityAllowed(true);
+            infoForm.add(themeField);
+            infoForm.add(themeLabel);
+            Label visibleLabel = new Label("visible", "Hidden");
+            CheckBox visibleCheckbox = new CheckBox("visibleCheck", new PropertyModel(this, "document.hidden"));
+            infoForm.add(visibleLabel);
+            infoForm.add(visibleCheckbox);
+            Label urlLabel = new Label("urlLabel", "URL");
+            TextField urlField = new TextField("urlField", new PropertyModel(this, "document.url"));
+            infoForm.add(urlLabel);
+            infoForm.add(urlField);
+            urlLabel.setVisibilityAllowed(true);
+            urlField.setVisibilityAllowed(true);
+            Label targetLabel = new Label("targetLabel", "Target Window");
+            DropDownChoice targetField = new DropDownChoice("target", new PropertyModel(this, "document.target"), getTargetList());
+            infoForm.add(targetLabel);
+            infoForm.add(targetField);
+            targetLabel.setVisibilityAllowed(true);
+            targetField.setVisibilityAllowed(true);
+            Label defaultPageLabel = new Label("defaultPage", "Default Page");
+            TextField defaultPageField = new TextField("defaultPageField", new PropertyModel(this, "document.page"));
+            infoForm.add(defaultPageLabel);
+            infoForm.add(defaultPageField);
+            defaultPageLabel.setVisibilityAllowed(true);
+            defaultPageField.setVisibilityAllowed(true);
+            SiteTreeNode node = getUserSelectedNode();
+            if (node.getDocType() == SiteTreeNode.FileType.Folder)
+            {
+                urlLabel.setVisible(false);
+                urlField.setVisible(false);
+                targetLabel.setVisible(false);
+                targetField.setVisible(false);
+            }
+            else if (node.getDocType() == SiteTreeNode.FileType.Page)
+            {
+                defaultPageLabel.setVisible(false);
+                defaultPageField.setVisible(false);
+                urlLabel.setVisible(false);
+                urlField.setVisible(false);
+                targetLabel.setVisible(false);
+                targetField.setVisible(false);
+            }
+            else if (node.getDocType() == SiteTreeNode.FileType.Link)
+            {
+                defaultPageLabel.setVisible(false);
+                defaultPageField.setVisible(false);
+                targetLabel.setVisible(false);
+                defaultPageField.setVisible(false);
+                pageDecoratorLabel.setVisible(false);
+                decoratorsList.setVisible(false);
+                portletDecoratorLabel.setVisible(false);
+                portletDecoratorsList.setVisible(false);
+                themeField.setVisible(false);
+                themeLabel.setVisible(false);
+            }
+            infoForm.add(new AjaxButton("view", infoForm)
+            {
+                @Override
+                protected void onSubmit(AjaxRequestTarget target, Form form)
+                {
+                    excuteAction(getDocument(), "view");
+                }
+            });
+            infoForm.add(new AjaxButton("remove", infoForm)
+            {
+                @Override
+                protected void onSubmit(AjaxRequestTarget target, Form form)
+                {
+                    excuteAction(getDocument(), "remove");
+                }
+            }.add(new JavascriptEventConfirmation("onclick", "are you sure?")));
+            infoForm.add(new AjaxButton("save", infoForm)
+            {
+                @Override
+                protected void onSubmit(AjaxRequestTarget target, Form form)
+                {
+                    excuteAction(getDocument(), "save");
+                }
+            });
+            add(infoForm);
+        }
+    }
+
+    private DefaultMutableTreeNode getSelectedNode()
+    {
+        PortalTree tree = (PortalTree) getPage().get("siteTree");
+        Collection selectedNodes = tree.getTreeState().getSelectedNodes();
+        DefaultMutableTreeNode treeNode = null;
+        if (selectedNodes != null)
+        {
+            Iterator selectedNode = selectedNodes.iterator();
+            while (selectedNode.hasNext())
+            {
+                treeNode = (DefaultMutableTreeNode) selectedNode.next();
+                break;
+            }
+        }
+        return treeNode;
+    }
+
+    private SiteTreeNode getUserSelectedNode()
+    {
+        SiteTreeNode nodeTree = null;
+        PortalTree tree = (PortalTree) getPage().get("siteTree");
+        Collection selectedNodes = tree.getTreeState().getSelectedNodes();
+        DefaultMutableTreeNode treeNode = null;
+        if (selectedNodes != null)
+        {
+            Iterator selectedNode = selectedNodes.iterator();
+            while (selectedNode.hasNext())
+            {
+                treeNode = (DefaultMutableTreeNode) selectedNode.next();
+                break;
+            }
+            if (treeNode != null)
+            {
+                nodeTree = (SiteTreeNode) treeNode.getUserObject();
+            }
+            else
+            {
+                nodeTree = new SiteTreeNode("ROOT", "/", SiteTreeNode.FileType.Folder);
+            }
+        }
+        return nodeTree;
+    }
+
+    protected class SecurityTab extends BasePanel
+    {
+        private static final long serialVersionUID = 7948533482848224251L;
+
+        public SecurityTab(String id, JetspeedDocument document)
+        {
+            super(id, document);
+            final ModalWindow metaDataModalWindow;
+            add(metaDataModalWindow = new ModalWindow("modalwindow"));
+            add(new ListView("metaData", new PropertyModel(this, "document.securityConstraints"))
+            {
+                public void populateItem(final ListItem listItem)
+                {
+                    final String constraints = (String) listItem.getModelObject();
+                    listItem.add(new Label("name", constraints));
+                    listItem.add(new Label("type", "Security Reference"));
+                    listItem.add(new AjaxLink("edit")
+                    {
+                        @Override
+                        public void onClick(AjaxRequestTarget target)
+                        {
+                            metaDataModalWindow.setContent(new SecurityTabWindowPanel(metaDataModalWindow.getContentId(), constraints));
+                            metaDataModalWindow.show(target);
+                        }
+                    });
+                    listItem.add(new AjaxLink("delete")
+                    {
+                        @Override
+                        public void onClick(AjaxRequestTarget target)
+                        {
+                            securityConstraintAction(REMOVE_ACTION, constraints, "");
+                        }
+                    }.add(new JavascriptEventConfirmation("onclick", "are you sure?")));
+                }
+            });
+            add(new AjaxLink("new")
+            {
+                @Override
+                public void onClick(AjaxRequestTarget target)
+                {
+                    metaDataModalWindow.setContent(new SecurityTabWindowPanel(metaDataModalWindow.getContentId(), ""));
+                    metaDataModalWindow.show(target);
+                }
+            });
+        }
+    }
+
+    protected class MetaDataTab extends BasePanel
+    {
+        private static final long serialVersionUID = 6429774536790672910L;
+
+        public MetaDataTab(String id, JetspeedDocument doc)
+        {
+            super(id, doc);
+            final ModalWindow metaDataModalWindow;
+            add(metaDataModalWindow = new ModalWindow("modalwindow"));
+            ListView metaDataListView = new ListView("metaData", new PropertyModel(this, "document.metaData"))
+            {
+                private static final long serialVersionUID = 1L;
+
+                public void populateItem(final ListItem listItem)
+                {
+                    final JetspeedDocumentMetaData metaData = (JetspeedDocumentMetaData) listItem.getModelObject();
+                    listItem.add(new Label("name", metaData.getName()));
+                    listItem.add(new Label("language", metaData.getLanguage()));
+                    listItem.add(new Label("value", metaData.getValue()));
+                    listItem.add(new AjaxLink("edit", new Model("Edit"))
+                    {
+                        @Override
+                        public void onClick(AjaxRequestTarget target)
+                        {
+                            metaDataModalWindow.setContent(new MetaDataPanel(metaDataModalWindow.getContentId(), getDocument(), metaData));
+                            metaDataModalWindow.show(target);
+                        }
+                    });
+                    listItem.add(new AjaxLink("delete", new Model("Delete"))
+                    {
+                        private static final long serialVersionUID = 1L;
+
+                        @Override
+                        public void onClick(AjaxRequestTarget target)
+                        {
+                            metaDataAction(REMOVE_ACTION, metaData, null);
+                        }
+                    }.add(new JavascriptEventConfirmation("onclick", "are you sure?")));
+                }
+            };
+            add(metaDataListView);
+            add(new AjaxLink("new", new Model("New"))
+            {
+                @Override
+                public void onClick(AjaxRequestTarget target)
+                {
+                    metaDataModalWindow.setContent(new MetaDataPanel(metaDataModalWindow.getContentId(), getDocument(),
+                                                                     new JetspeedDocumentMetaData("", "", "")));
+                    metaDataModalWindow.show(target);
+                }
+            });
+        }
+    }
+
+    protected class SecurityTabWindowPanel extends Panel
+    {
+        private static final long serialVersionUID = -3223669376958653554L;
+        private String constraintName;
+
+        /**
+         * @return the constraintName
+         */
+        public String getConstraintName()
+        {
+            return constraintName;
+        }
+
+        /**
+         * @param constraintName
+         *            the constraintName to set
+         */
+        public void setConstraintName(String constraintName)
+        {
+            this.constraintName = constraintName;
+        }
+
+        public SecurityTabWindowPanel(String id, String constrainName)
+        {
+            super(id);
+            this.constraintName = constrainName;
+            Form securityTabForm = new Form("securityDataForm");
+            securityTabForm.add(new Label("securityConstraintLabel", "Security Constraint"));
+            DropDownChoice constraintsChoices = new DropDownChoice("constraints", new PropertyModel(this, "constraintName"), getConstraintsDef());
+            securityTabForm.add(constraintsChoices);
+            securityTabForm.add(new AjaxButton("save", securityTabForm)
+            {
+                @Override
+                protected void onSubmit(AjaxRequestTarget target, Form form)
+                {
+                    securityConstraintAction(SAVE_ACTION, getConstraintName(), null);
+                    ((ModalWindow) SecurityTabWindowPanel.this.getParent()).close(target);
+                }
+            });
+            add(securityTabForm);
+        }
+    }
+
+    protected class ImportDataTab extends BasePanel
+    {
+        private static final long serialVersionUID = 3676403374892366510L;
+        boolean recursively;
+
+        public ImportDataTab(String id, JetspeedDocument jetspeeeDoc)
+        {
+            super(id, jetspeeeDoc);
+            final SiteTreeNode node = getUserSelectedNode();
+            Form exportForm = new Form("exportForm");
+            Label exportLabel = new Label("exportName", "Export recursively");
+            CheckBox exportChkBox = new CheckBox("recursively", new PropertyModel(this, "recursively"));
+            Label exporNameLabel = new Label("expLabel", "Export Object");
+            TextField exportName = new TextField("expName", new PropertyModel(this, "document.name"));
+            exportLabel.setVisibilityAllowed(true);
+            exportChkBox.setVisibilityAllowed(true);
+            if (node.getDocType() != SiteTreeNode.FileType.Folder)
+            {
+                exportLabel.setVisible(false);
+                exportChkBox.setVisible(false);
+            }
+            exportForm.add(exporNameLabel);
+            exportForm.add(exportName);
+            exportForm.add(exportLabel);
+            exportForm.add(exportChkBox);
+            final ExternalLink ajaxDownlodLink = new ExternalLink("downLoad", "http://www.msn.com");
+            ajaxDownlodLink.setVisibilityAllowed(true);
+            ajaxDownlodLink.setVisible(false);
+            ajaxDownlodLink.setOutputMarkupId(true);
+            exportForm.add(ajaxDownlodLink);
+            AjaxButton exportButton = new AjaxButton("exprtButton", exportForm)
+            {
+                @Override
+                protected void onSubmit(AjaxRequestTarget target, Form<?> form)
+                {
+                    String link = ExportObject(node, recursively, getPortletRequest().getUserPrincipal().getName());
+                    ajaxDownlodLink.setDefaultModelObject("http://www.yahoo.com" + link);
+                    ajaxDownlodLink.setVisible(true);
+                    target.addComponent(ajaxDownlodLink);
+                }
+            };
+            exportForm.add(exportButton);
+            add(exportForm);
+        }
+    }
+
+    protected class MetaDataPanel extends BasePanel
+    {
+        private JetspeedDocumentMetaData metaData;
+        private JetspeedDocumentMetaData oldMetaData;
+
+        public MetaDataPanel(String id, JetspeedDocument document, JetspeedDocumentMetaData jmetaData)
+        {
+            super(id, document);
+            this.metaData = jmetaData;
+            this.oldMetaData = jmetaData;
+            Form metaDataForm = new Form("metaDataForm");
+            FormComponent fc;
+            fc = new RequiredTextField("name", new PropertyModel(this, "metaData.name"));
+            fc.add(StringValidator.minimumLength(2));
+            metaDataForm.add(fc);
+            metaDataForm.add(new Label("name-label", "Name"));
+            fc = new RequiredTextField("language", new PropertyModel(this, "metaData.language"));
+            fc.add(StringValidator.minimumLength(2));
+            metaDataForm.add(fc);
+            metaDataForm.add(new Label("language-label", "Language"));
+            fc = new RequiredTextField("metaValue", new PropertyModel(this, "metaData.value"));
+            fc.add(StringValidator.minimumLength(2));
+            metaDataForm.add(fc);
+            metaDataForm.add(new Label("value-label", "Value"));
+            metaDataForm.add(new AjaxButton("save", metaDataForm)
+            {
+                @Override
+                protected void onSubmit(AjaxRequestTarget target, Form form)
+                {
+                    metaDataAction(SAVE_ACTION, metaData, oldMetaData);
+                    ((ModalWindow) MetaDataPanel.this.getParent()).close(target);
+                }
+            });
+            add(metaDataForm);
+        }
+    }
+
+    private void securityConstraintAction(String action, String constraint, String oldConstraintName)
+    {
+        SiteTreeNode node = getUserSelectedNode();
+        Node jetspeedNode = null;
+        PageManager pageManager = getPageManager();
+        try
+        {
+            if (node.getDocType() == SiteTreeNode.FileType.Folder)
+            {
+                jetspeedNode = (Node) pageManager.getFolder(node.getNodePath());
+                if (action.equals(ADD_ACTION) || action.equals(SAVE_ACTION))
+                {
+                    updateSecurityReference(constraint, oldConstraintName, "", jetspeedNode);
+                }
+                else if (action.equals(REMOVE_ACTION))
+                {
+                    removeSecurityReference(constraint, jetspeedNode);
+                }
+                pageManager.updateFolder((Folder) jetspeedNode);
+            }
+            else if (node.getDocType() == SiteTreeNode.FileType.Page)
+            {
+                jetspeedNode = (Node) getPageManager().getPage(node.getNodePath());
+                if (action.equals(ADD_ACTION) || action.equals(SAVE_ACTION))
+                {
+                    updateSecurityReference(constraint, oldConstraintName, "", jetspeedNode);
+                }
+                else if (action.equals(REMOVE_ACTION))
+                {
+                    removeSecurityReference(constraint, jetspeedNode);
+                }
+                pageManager.updatePage((Page) jetspeedNode);
+            }
+            else if (node.getDocType() == SiteTreeNode.FileType.Link)
+            {
+                jetspeedNode = (Node) getPageManager().getLink(node.getNodePath());
+                if (action.equals(ADD_ACTION) || action.equals(SAVE_ACTION))
+                {
+                    updateSecurityReference(constraint, oldConstraintName, "", jetspeedNode);
+                }
+                else if (action.equals(REMOVE_ACTION))
+                {
+                    removeSecurityReference(constraint, jetspeedNode);
+                }
+                pageManager.updateLink((Link) jetspeedNode);
+            }
+        }
+        catch (Exception e)
+        {
+            // TODO: handle exception
+        }
+    }
+
+    private void metaDataAction(String action, JetspeedDocumentMetaData metaData, JetspeedDocumentMetaData oldMetaData)
+    {
+        SiteTreeNode node = getUserSelectedNode();
+        Node jetspeedNode = null;
+        PageManager pageManager = getPageManager();
+        try
+        {
+            if (node.getDocType() == SiteTreeNode.FileType.Folder)
+            {
+                jetspeedNode = (Node) pageManager.getFolder(node.getNodePath());
+                if (action.equals(ADD_ACTION) || action.equals(SAVE_ACTION))
+                {
+                    updateMetadata(metaData, oldMetaData, jetspeedNode);
+                }
+                else if (action.equals(REMOVE_ACTION))
+                {
+                    removeMetadata(metaData, jetspeedNode);
+                }
+                pageManager.updateFolder((Folder) jetspeedNode);
+            }
+            else if (node.getDocType() == SiteTreeNode.FileType.Page)
+            {
+                jetspeedNode = (Node) getPageManager().getPage(node.getNodePath());
+                if (action.equals(ADD_ACTION) || action.equals(SAVE_ACTION))
+                {
+                    updateMetadata(metaData, oldMetaData, jetspeedNode);
+                }
+                else if (action.equals(REMOVE_ACTION))
+                {
+                    removeMetadata(metaData, jetspeedNode);
+                }
+                pageManager.updatePage((Page) jetspeedNode);
+            }
+            else if (node.getDocType() == SiteTreeNode.FileType.Link)
+            {
+                jetspeedNode = (Node) getPageManager().getLink(node.getNodePath());
+                if (action.equals(ADD_ACTION) || action.equals(SAVE_ACTION))
+                {
+                    updateMetadata(metaData, oldMetaData, jetspeedNode);
+                }
+                else if (action.equals(REMOVE_ACTION))
+                {
+                    removeMetadata(metaData, jetspeedNode);
+                }
+                pageManager.updateLink((Link) jetspeedNode);
+            }
+        }
+        catch (Exception e)
+        {
+            // TODO: handle exception
+        }
+    }
+
+    protected void insertMetadata(JetspeedDocumentMetaData metaData, Node node)
+    {
+        Locale locale = new Locale(metaData.getLanguage());
+        node.getMetadata().addField(locale, metaData.getName(), metaData.getValue());
+    }
+
+    protected void updateMetadata(JetspeedDocumentMetaData metaData, JetspeedDocumentMetaData oldMetaData, Node node)
+    {
+        Collection cfields = node.getMetadata().getFields(oldMetaData.getName());
+        if (cfields == null || cfields.size() == 0)
+        {
+            insertMetadata(metaData, node);
+        }
+        boolean found = false;
+        Iterator fields = cfields.iterator();
+        while (fields.hasNext())
+        {
+            LocalizedField field = (LocalizedField) fields.next();
+            if (areFieldsSame(field.getName(), oldMetaData.getName()) && areFieldsSame(field.getLocale().toString(), oldMetaData.getLanguage()))
+            {
+                field.setName(metaData.getName());
+                field.setLocale(new Locale(metaData.getLanguage()));
+                field.setValue(metaData.getValue());
+                found = true;
+                break;
+            }
+        }
+        if (!found)
+            insertMetadata(metaData, node);
+    }
+
+    protected void removeMetadata(JetspeedDocumentMetaData metaData, Node node)
+    {
+        Collection cfields = node.getMetadata().getFields(metaData.getName());
+        Collection allFields = node.getMetadata().getFields();
+        if (cfields == null || cfields.size() == 0)
+        {
+            return;
+        }
+        boolean found = false;
+        Iterator fields = cfields.iterator();
+        while (fields.hasNext())
+        {
+            LocalizedField field = (LocalizedField) fields.next();
+            if (areFieldsSame(field.getName(), metaData.getName()) && areFieldsSame(field.getLocale().toString(), metaData.getLanguage()))
+            {
+                cfields.remove(field);
+                if (allFields.remove(field))
+                {
+                    node.getMetadata().setFields(allFields);
+                }
+                found = true;
+                break;
+            }
+        }
+    }
+
+    protected boolean isBlank(String field)
+    {
+        if (field == null || field.trim().length() == 0)
+            return true;
+        return false;
+    }
+
+    protected boolean isFieldModified(String paramValue, String prevValue)
+    {
+        if (paramValue == null)
+        {
+            if (prevValue == null)
+                return false;
+            else
+                return true;
+        }
+        else
+        {
+            if (prevValue == null)
+                return true;
+            if (prevValue.equals(paramValue))
+                return false;
+            else
+                return true;
+        }
+    }
+
+    protected boolean areFieldsSame(String f1, String f2)
+    {
+        return !isFieldModified(f1, f2);
+    }
+
+    protected boolean isBooleanModified(String paramValue, boolean prevValue)
+    {
+        if (paramValue == null)
+        {
+            if (prevValue == false)
+                return false;
+            else
+                return true;
+        }
+        else
+        {
+            if (prevValue == false)
+                return true;
+            else
+                return false;
+        }
+    }
+
+    private DefaultMutableTreeNode populateUserTree(String userName)
+    {
+        // DefaultMutableTreeNode rootNode = new DefaultMutableTreeNode(new SiteTreeNode("ROOT", "/"));
+        // List list = new ArrayList<SiteTreeNode>();
+        // list.add(new SiteTreeNode("pages", "/pages"));
+        // list.add(new SiteTreeNode("_users", "/_users"));
+        // // rootNode.add(new DefaultMutableTreeNode(list));
+        // add(rootNode, list);
+        DefaultMutableTreeNode rootNode = null;
+        rootNode = retrieveFolders("/_user/" + userName, rootNode);
+        treeRoot = new DefaultTreeModel(rootNode);
+        return rootNode;
+    }
+
+    private DefaultMutableTreeNode populateTree()
+    {
+        // DefaultMutableTreeNode rootNode = new DefaultMutableTreeNode(new SiteTreeNode("ROOT", "/"));
+        // List list = new ArrayList<SiteTreeNode>();
+        // list.add(new SiteTreeNode("pages", "/pages"));
+        // list.add(new SiteTreeNode("_users", "/_users"));
+        // // rootNode.add(new DefaultMutableTreeNode(list));
+        // add(rootNode, list);
+        DefaultMutableTreeNode rootNode = null;
+        rootNode = retrieveFolders("/", rootNode);
+        treeRoot = new DefaultTreeModel(rootNode);
+        return rootNode;
+    }
+
+    private DefaultMutableTreeNode retrieveFolders(String folderPath, DefaultMutableTreeNode rootNode)
+    {
+        try
+        {
+            Link link;
+            Folder folder;
+            DefaultMutableTreeNode tmpNode;
+            Page page;
+            Folder rootfolder = getPageManager().getFolder(folderPath);
+            if (rootNode == null)
+            {
+                rootNode = new DefaultMutableTreeNode(new SiteTreeNode(rootfolder));
+            }
+            Iterator folders = rootfolder.getFolders().iterator();
+            while (folders.hasNext())
+            {
+                folder = (Folder) folders.next();
+                rootNode.add(new DefaultMutableTreeNode(new SiteTreeNode(folder)));
+            }
+            Iterator pages = rootfolder.getPages().iterator();
+            while (pages.hasNext())
+            {
+                page = (Page) pages.next();
+                tmpNode = new DefaultMutableTreeNode(new SiteTreeNode(page));
+                tmpNode.setAllowsChildren(false);
+                rootNode.add(tmpNode);
+            }
+            Iterator links = rootfolder.getLinks().iterator();
+            while (links.hasNext())
+            {
+                link = (Link) links.next();
+                tmpNode = new DefaultMutableTreeNode(new SiteTreeNode(link));
+                tmpNode.setAllowsChildren(false);
+                rootNode.add(tmpNode);
+            }
+        }
+        catch (Exception e)
+        {
+            // log.error("Failed to retrieve folders ", e);
+            e.printStackTrace();
+        }
+        return rootNode;
+    }
+
+    private List<String> getPortletDecorators()
+    {
+        if (portletDecorators == null)
+        {
+            portletDecorators = new ArrayList<String>();
+            Iterator iterator = getDecorationFactory().getPortletDecorations(null).iterator();
+            while (iterator.hasNext())
+            {
+                portletDecorators.add((String) iterator.next());
+            }
+        }
+        return portletDecorators;
+    }
+
+    private List<String> getPageDecorators()
+    {
+        if (pageDecoraters == null)
+        {
+            pageDecoraters = new ArrayList<String>();
+            Iterator iterator = getDecorationFactory().getPageDecorations(null).iterator();
+            while (iterator.hasNext())
+            {
+                pageDecoraters.add((String) iterator.next());
+            }
+        }
+        return pageDecoraters;
+    }
+
+    private List<String> getThemes()
+    {
+        if (pageThemes == null)
+        {
+            pageThemes = new ArrayList<String>();
+            Iterator iterator = getDecorationFactory().getDesktopPageDecorations(null).iterator();
+            while (iterator.hasNext())
+            {
+                pageDecoraters.add((String) iterator.next());
+            }
+        }
+        return pageThemes;
+    }
+
+    private List<String> getTargetList()
+    {
+        if (targetList == null)
+        {
+            targetList = new ArrayList<String>();
+            targetList.add("new");
+            targetList.add("self");
+            targetList.add("top");
+            targetList.add("parent");
+        }
+        return targetList;
+    }
+
+    private List<String> getConstraintsDef()
+    {
+        if (constraintsDefs == null)
+        {
+            constraintsDefs = new ArrayList<String>();
+            try
+            {
+                Iterator constraintsDefIterator = getPageManager().getPageSecurity().getSecurityConstraintsDefs().iterator();
+                while (constraintsDefIterator.hasNext())
+                {
+                    constraintsDefs.add(((SecurityConstraintsDef) constraintsDefIterator.next()).getName());
+                }
+            }
+            catch (Exception e)
+            {
+                // TODO: handle exception
+            }
+        }
+        return constraintsDefs;
+    }
+
+    private void populateDocument(SiteTreeNode node)
+    {
+        try
+        {
+            if (node.getDocType() == SiteTreeNode.FileType.Folder)
+            {
+                document = new JetspeedDocument(getPageManager().getFolder(node.getNodePath()));
+            }
+            else if (node.getDocType() == SiteTreeNode.FileType.Page)
+            {
+                document = new JetspeedDocument(getPageManager().getPage(node.getNodePath()));
+            }
+            else if (node.getDocType() == SiteTreeNode.FileType.Link)
+            {
+                document = new JetspeedDocument(getPageManager().getLink(node.getNodePath()));
+            }
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+        }
+    }
+
+    private void controlTabs()
+    {
+        TabbedPanel tabs = (TabbedPanel) get("tabs");
+        tabs.getTabs().clear();
+        ITab tempTab;
+        tempTab = new AbstractTab(new Model("Information"))
+        {
+            public Panel getPanel(String panelId)
+            {
+                return new InformationTab(panelId, document);
+            }
+        };
+        tabs.getTabs().add(tempTab);
+        tempTab = new AbstractTab(new Model("Metadata"))
+        {
+            public Panel getPanel(String panelId)
+            {
+                return new MetaDataTab(panelId, document);
+            }
+        };
+        tabs.getTabs().add(tempTab);
+        tempTab = new AbstractTab(new Model("Security"))
+        {
+            public Panel getPanel(String panelId)
+            {
+                return new SecurityTab(panelId, document);
+            }
+        };
+        tabs.getTabs().add(tempTab);
+        tempTab = new AbstractTab(new Model("Import/Export"))
+        {
+            public Panel getPanel(String panelId)
+            {
+                return new ImportDataTab(panelId, document);
+            }
+        };
+        tabs.getTabs().add(tempTab);
+        tabs.setSelectedTab(0);
+    }
+
+    private void excuteAction(JetspeedDocument document, String action)
+    {
+        SiteTreeNode node = getUserSelectedNode();
+        PageManager pageManger = getPageManager();
+        if (node != null)
+        {
+            if (node.getDocType() == SiteTreeNode.FileType.Folder)
+            {
+                try
+                {
+                    Folder folder = pageManger.getFolder(node.getNodePath());
+                    if (action.equals("save"))
+                    {
+                        folder.setTitle(document.getTitle());
+                        folder.setShortTitle(document.getShortTitle());
+                        folder.setDefaultDecorator(document.getPageDecorator(), Fragment.LAYOUT);
+                        folder.setDefaultDecorator(document.getPortletDecorator(), Fragment.PORTLET);
+                        folder.setSkin(document.getDesktopTheme());
+                        folder.setHidden(document.isHidden());
+                        pageManger.updateFolder(folder);
+                    }
+                    else if (action.equals("remove"))
+                    {
+                        pageManger.removeFolder(folder);
+                    }
+                }
+                catch (FolderNotFoundException e)
+                {
+                    // TODO Auto-generated catch block
+                    e.printStackTrace();
+                }
+                catch (InvalidFolderException e)
+                {
+                    // TODO Auto-generated catch block
+                    e.printStackTrace();
+                }
+                catch (NodeException e)
+                {
+                    // TODO Auto-generated catch block
+                    e.printStackTrace();
+                }
+            }
+            else if (node.getDocType() == SiteTreeNode.FileType.Page)
+            {
+                try
+                {
+                    Page page = pageManger.getPage(node.getNodePath());
+                    if (action.equals("save"))
+                    {
+                        page = pageManger.getPage(node.getNodePath());
+                        page.setTitle(document.getTitle());
+                        page.setShortTitle(document.getShortTitle());
+                        page.setDefaultDecorator(document.getPageDecorator(), Fragment.LAYOUT);
+                        page.setDefaultDecorator(document.getPortletDecorator(), Fragment.PORTLET);
+                        page.setSkin(document.getDesktopTheme());
+                        page.setHidden(document.isHidden());
+                        pageManger.updatePage(page);
+                    }
+                    else if (action.equals("remove"))
+                    {
+                        pageManger.removePage(page);
+                    }
+                }
+                catch (PageNotFoundException e)
+                {
+                    // TODO Auto-generated catch block
+                    e.printStackTrace();
+                }
+                catch (PageNotUpdatedException e)
+                {
+                    // TODO Auto-generated catch block
+                    e.printStackTrace();
+                }
+                catch (NodeException e)
+                {
+                    // TODO Auto-generated catch block
+                    e.printStackTrace();
+                }
+            }
+            else if (node.getDocType() == SiteTreeNode.FileType.Link)
+            {
+                try
+                {
+                    Link link = pageManger.getLink(node.getNodePath());
+                    if (action.equals("save"))
+                    {
+                        link = pageManger.getLink(node.getNodePath());
+                        link.setTitle(document.getTitle());
+                        link.setShortTitle(document.getShortTitle());
+                        link.setUrl(document.getUrl());
+                        link.setTitle(document.getTitle());
+                        link.setHidden(document.isHidden());
+                        pageManger.updateLink(link);
+                    }
+                    else if (action.equals("remove"))
+                    {
+                        pageManger.removeLink(link);
+                    }
+                }
+                catch (UnsupportedDocumentTypeException e)
+                {
+                    // TODO Auto-generated catch block
+                    e.printStackTrace();
+                }
+                catch (DocumentNotFoundException e)
+                {
+                    // TODO Auto-generated catch block
+                    e.printStackTrace();
+                }
+                catch (NodeException e)
+                {
+                    // TODO Auto-generated catch block
+                    e.printStackTrace();
+                }
+            }
+        }
+    }
+
+    private class BasePanel extends Panel
+    {
+        private static final long serialVersionUID = -6442196391739061842L;
+        private JetspeedDocument document;
+
+        public BasePanel(String id, JetspeedDocument jDoc)
+        {
+            super(id);
+            this.document = jDoc;
+            final FeedbackPanel feedback = new FeedbackPanel("feedback");
+            feedback.setOutputMarkupId(true);
+            add(feedback);
+        }
+
+        public BasePanel(String id)
+        {
+            super(id);
+            final FeedbackPanel feedback = new FeedbackPanel("feedback");
+            feedback.setOutputMarkupId(true);
+            add(feedback);
+        }
+
+        /**
+         * @return the document
+         */
+        public JetspeedDocument getDocument()
+        {
+            return document;
+        }
+    }
+
+    protected void insertSecurityReference(String name, String kind, Node node) throws AJAXException
+    {
+        if (node.getSecurityConstraints() == null)
+        {
+            SecurityConstraints cons = node.newSecurityConstraints();
+            node.setSecurityConstraints(cons);
+        }
+        if (kind.equals("Owner"))
+        {
+            node.getSecurityConstraints().setOwner(name);
+        }
+        else
+        {
+            List refs = node.getSecurityConstraints().getSecurityConstraintsRefs();
+            if (refs.contains(name))
+                return;
+            refs.add(name);
+        }
+        return;
+    }
+
+    protected void updateSecurityReference(String name, String oldName, String kind, Node node) throws AJAXException
+    {
+        if (node.getSecurityConstraints() == null)
+        {
+            SecurityConstraints cons = node.newSecurityConstraints();
+            node.setSecurityConstraints(cons);
+        }
+        List refs = node.getSecurityConstraints().getSecurityConstraintsRefs();
+        if (refs == null || refs.size() == 0)
+        {
+            insertSecurityReference(name, kind, node);
+        }
+        boolean found = false;
+        if (kind.equals("Owner"))
+        {
+            node.getSecurityConstraints().setOwner(name);
+            found = true;
+        }
+        else
+        {
+            for (int ix = 0; ix < refs.size(); ix++)
+            {
+                String ref = (String) refs.get(ix);
+                if (areFieldsSame(ref, oldName))
+                {
+                    refs.set(ix, name);
+                    found = true;
+                    break;
+                }
+            }
+        }
+        if (!found)
+            insertSecurityReference(name, kind, node);
+        return;
+    }
+
+    protected void removeSecurityReference(String name, Node node)
+    {
+        if (node.getSecurityConstraints() != null)
+        {
+            String kind = "";
+            if (kind.equals("Owner"))
+            {
+                node.getSecurityConstraints().setOwner(null);
+            }
+            else
+            {
+                List refs = node.getSecurityConstraints().getSecurityConstraintsRefs();
+                if (!refs.contains(name))
+                    return; // nothing to do
+                refs.remove(name);
+            }
+        }
+    }
+
+    private String ExportObject(SiteTreeNode siteNode, boolean recursive, String userName)
+    {
+        String downloadPath = "";
+        boolean success = true;
+        String objectPath = siteNode.getNodePath();
+        if (!cleanUserFolder(userName))
+            success = false;
+        if (success)
+        {
+            PageManager pageManager = getPageManager();
+            PageManager castorPageManager = getCastorPageManager();
+            try
+            {
+                if (siteNode.getDocType() == SiteTreeNode.FileType.Folder)
+                {
+                    Folder folder = pageManager.getFolder(siteNode.getNodePath());
+                    if (recursive)
+                    {
+                        PortalSiteManagerUtil.importFolder(castorPageManager, folder, userName, getRealPath(folder.getPath()));
+                    }
+                    else
+                    {
+                        Folder destFolder = castorPageManager.copyFolder(folder, PortalSiteManagerUtil.getUserFolder(userName, true) + siteNode.getNodeName());
+                        castorPageManager.updateFolder(destFolder);
+                    }
+                }
+                else if (siteNode.getDocType() == SiteTreeNode.FileType.Page)
+                {
+                    objectPath = PortalSiteManagerUtil.getParentPath(objectPath);
+                    Folder folder = pageManager.getFolder(objectPath);
+                    Page page = folder.getPage(siteNode.getNodeName());
+                    Page destPage = castorPageManager.copyPage(page, PortalSiteManagerUtil.getUserFolder(userName, true) + siteNode.getNodeName());
+                    castorPageManager.updatePage(destPage);
+                }
+                else if (siteNode.getDocType() == SiteTreeNode.FileType.Link)
+                {
+                    objectPath = PortalSiteManagerUtil.getParentPath(objectPath);
+                    Folder folder = pageManager.getFolder(objectPath);
+                    Link link = folder.getLink(siteNode.getNodeName());
+                    Link destLink = castorPageManager.copyLink(link, PortalSiteManagerUtil.getUserFolder(userName, true) + siteNode.getNodeName());
+                    castorPageManager.updateLink(destLink);
+                }
+                String link = userName + "_" + siteNode.getNodeName();
+                if (siteNode.getDocType() == SiteTreeNode.FileType.Folder)
+                    link = userName + ".zip";
+                getServletRequest().getSession().setAttribute("file", link);
+                downloadPath = PortalSiteManagerUtil.getDownloadLink(getServletRequest(), siteNode.getNodeName(), userName, siteNode.getDocType().toString());
+            }
+            catch (Exception e)
+            {
+                e.printStackTrace();
+            }
+        }
+        return downloadPath;
+    }
+
+    /**
+     * @return the userFolder
+     */
+    public String getUserFolder()
+    {
+        return userFolder;
+    }
+
+    /**
+     * @param userFolder
+     *            the userFolder to set
+     */
+    public void setUserFolder(String userFolder)
+    {
+        this.userFolder = userFolder;
+    }
+
+    private class AddFolderPanel extends Panel
+    {
+        private JetspeedDocument document;
+
+        public AddFolderPanel(String id)
+        {
+            super(id);
+            document = new JetspeedDocument();
+            Form infoForm = new Form("newForm");
+            Label nameLabel = new Label("name", "Name");
+            TextField nameField = new TextField("nameField", new PropertyModel(this, "document.name"));
+            infoForm.add(nameLabel);
+            infoForm.add(nameField);
+            Label titleLabel = new Label("title", "Title");
+            TextField titleField = new TextField("titleField", new PropertyModel(this, "document.title"));
+            infoForm.add(titleLabel);
+            infoForm.add(titleField);
+            Label shortTitleLabel = new Label("shortTitle", "ShortTitle");
+            TextField shortTitleField = new TextField("shortTitleField", new PropertyModel(this, "document.shortTitle"));
+            infoForm.add(shortTitleField);
+            infoForm.add(shortTitleLabel);
+            infoForm.add(new AjaxLink("close")
+            {
+                @Override
+                public void onClick(AjaxRequestTarget target)
+                {
+                    ((ModalWindow) AddFolderPanel.this.getParent()).close(target);
+                }
+            });
+            infoForm.add(new AjaxButton("new")
+            {
+                @Override
+                protected void onSubmit(AjaxRequestTarget target, Form<?> form)
+                {
+                    SiteTreeNode treeNode = getUserSelectedNode();
+                    DefaultMutableTreeNode node = getSelectedNode();
+                    Folder folder = getPageManager().newFolder(treeNode.getNodePath() + "/" + document.getName());
+                    folder.setTitle(document.getTitle());
+                    folder.setShortTitle(document.getShortTitle());
+                    try
+                    {
+                        getPageManager().updateFolder(folder);
+                        node.insert(new DefaultMutableTreeNode(new SiteTreeNode(folder)), 0);
+                    }
+                    catch (FolderNotUpdatedException e)
+                    {
+                        // TODO Auto-generated catch block
+                        e.printStackTrace();
+                    }
+                    catch (NodeException e)
+                    {
+                        // TODO Auto-generated catch block
+                        e.printStackTrace();
+                    }
+                    ((ModalWindow) AddFolderPanel.this.getParent()).close(target);
+                }
+            });
+            add(infoForm);
+        }
+    }
+
+    private class AddPagePanel extends Panel
+    {
+        public AddPagePanel(String id)
+        {
+            super(id);
+        }
+    }
+
+    private class AddLinkPanel extends Panel
+    {
+        public AddLinkPanel(String id)
+        {
+            super(id);
+        }
+    }
 }

Added: 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=737018&view=auto
==============================================================================
--- portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/site/PortalSiteManagerApplication.java (added)
+++ portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/portlets/site/PortalSiteManagerApplication.java Fri Jan 23 04:46:36 2009
@@ -0,0 +1,33 @@
+/*
+ * 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 org.apache.jetspeed.portlets.wicket.AbstractAdminWebApplication;
+
+/**
+ * @author <a href="mailto:vkumar@apache.org">Vivek Kumar</a>
+ * @version $Id:
+ */
+public class PortalSiteManagerApplication extends AbstractAdminWebApplication
+{
+
+    @Override
+    public Class getHomePage()
+    {
+        return PortalSiteManager.class;
+    }
+}

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



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