incubator-graffito-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clomb...@apache.org
Subject svn commit: r125532 - in incubator/graffito/trunk/portlets/src: java/org/apache/portals/graffito/portlets java/org/apache/portals/graffito/portlets/resources java/org/apache/portals/graffito/util webapp/WEB-INF webapp/WEB-INF/tabs webapp/WEB-INF/velocity webapp/WEB-INF/view
Date Tue, 18 Jan 2005 18:59:29 GMT
Author: clombart
Date: Tue Jan 18 10:59:28 2005
New Revision: 125532

URL: http://svn.apache.org/viewcvs?view=rev&rev=125532
Log:
Continue to work on the Graffito BrowserPortlet
Added:
   incubator/graffito/trunk/portlets/src/java/org/apache/portals/graffito/portlets/GenericTabVelocityPortlet.java
   incubator/graffito/trunk/portlets/src/java/org/apache/portals/graffito/portlets/TabReader.java
   incubator/graffito/trunk/portlets/src/java/org/apache/portals/graffito/portlets/VelocityTab.java
   incubator/graffito/trunk/portlets/src/java/org/apache/portals/graffito/portlets/VelocityTabPage.java
   incubator/graffito/trunk/portlets/src/java/org/apache/portals/graffito/util/
   incubator/graffito/trunk/portlets/src/java/org/apache/portals/graffito/util/GraffitoTools.java
   incubator/graffito/trunk/portlets/src/webapp/WEB-INF/tabs/
   incubator/graffito/trunk/portlets/src/webapp/WEB-INF/tabs/tabs.xml
   incubator/graffito/trunk/portlets/src/webapp/WEB-INF/velocity/graffito-macros.vm
   incubator/graffito/trunk/portlets/src/webapp/WEB-INF/view/document.vm
      - copied unchanged from r125434, incubator/graffito/trunk/portlets/src/webapp/WEB-INF/view/adddocument.vm
   incubator/graffito/trunk/portlets/src/webapp/WEB-INF/view/edit-tab-sample.vm
      - copied, changed from r125434, incubator/graffito/trunk/portlets/src/webapp/WEB-INF/view/edit.vm
   incubator/graffito/trunk/portlets/src/webapp/WEB-INF/view/folder.vm
      - copied, changed from r125434, incubator/graffito/trunk/portlets/src/webapp/WEB-INF/view/addfolder.vm
   incubator/graffito/trunk/portlets/src/webapp/WEB-INF/view/security.vm
   incubator/graffito/trunk/portlets/src/webapp/WEB-INF/view/tab.vm
Removed:
   incubator/graffito/trunk/portlets/src/webapp/WEB-INF/view/adddocument.vm
   incubator/graffito/trunk/portlets/src/webapp/WEB-INF/view/addfolder.vm
   incubator/graffito/trunk/portlets/src/webapp/WEB-INF/view/edit.vm
Modified:
   incubator/graffito/trunk/portlets/src/java/org/apache/portals/graffito/portlets/BrowserInfo.java
   incubator/graffito/trunk/portlets/src/java/org/apache/portals/graffito/portlets/BrowserPortlet.java
   incubator/graffito/trunk/portlets/src/java/org/apache/portals/graffito/portlets/resources/messages.properties
   incubator/graffito/trunk/portlets/src/java/org/apache/portals/graffito/portlets/resources/messages_en.properties
   incubator/graffito/trunk/portlets/src/java/org/apache/portals/graffito/portlets/resources/messages_fr.properties
   incubator/graffito/trunk/portlets/src/webapp/WEB-INF/portlet.xml
   incubator/graffito/trunk/portlets/src/webapp/WEB-INF/velocity/velocity-macros.vm
   incubator/graffito/trunk/portlets/src/webapp/WEB-INF/velocity/velocity.properties
   incubator/graffito/trunk/portlets/src/webapp/WEB-INF/view/view.vm

Modified: incubator/graffito/trunk/portlets/src/java/org/apache/portals/graffito/portlets/BrowserInfo.java
Url: http://svn.apache.org/viewcvs/incubator/graffito/trunk/portlets/src/java/org/apache/portals/graffito/portlets/BrowserInfo.java?view=diff&rev=125532&p1=incubator/graffito/trunk/portlets/src/java/org/apache/portals/graffito/portlets/BrowserInfo.java&r1=125531&p2=incubator/graffito/trunk/portlets/src/java/org/apache/portals/graffito/portlets/BrowserInfo.java&r2=125532
==============================================================================
--- incubator/graffito/trunk/portlets/src/java/org/apache/portals/graffito/portlets/BrowserInfo.java	(original)
+++ incubator/graffito/trunk/portlets/src/java/org/apache/portals/graffito/portlets/BrowserInfo.java	Tue Jan 18 10:59:28 2005
@@ -14,6 +14,8 @@
 
 import java.util.Collection;
 
+import org.apache.portals.graffito.model.CmsObject;
+
 /**
  * Information on the current content folder displayed in the Graffito Browser Portlet
  * 
@@ -27,6 +29,8 @@
     private Collection documents;
 
     private Collection folders;
+    
+    private CmsObject currentCmsObject;
 
     /**
      * @return Returns the documents.
@@ -75,7 +79,18 @@
     {
         this.uri = uri;
     }
+            
+    public CmsObject getCurrentCmsObject()
+    {        
+        return currentCmsObject;
+        
+    }
     
+    
+    public void setCurrentCmsObject(CmsObject currentCmsObject)
+    {
+        this.currentCmsObject = currentCmsObject;
+    }
     /**
      * @return true if the Browser is empty, else false
      */

Modified: incubator/graffito/trunk/portlets/src/java/org/apache/portals/graffito/portlets/BrowserPortlet.java
Url: http://svn.apache.org/viewcvs/incubator/graffito/trunk/portlets/src/java/org/apache/portals/graffito/portlets/BrowserPortlet.java?view=diff&rev=125532&p1=incubator/graffito/trunk/portlets/src/java/org/apache/portals/graffito/portlets/BrowserPortlet.java&r1=125531&p2=incubator/graffito/trunk/portlets/src/java/org/apache/portals/graffito/portlets/BrowserPortlet.java&r2=125532
==============================================================================
--- incubator/graffito/trunk/portlets/src/java/org/apache/portals/graffito/portlets/BrowserPortlet.java	(original)
+++ incubator/graffito/trunk/portlets/src/java/org/apache/portals/graffito/portlets/BrowserPortlet.java	Tue Jan 18 10:59:28 2005
@@ -16,7 +16,7 @@
 package org.apache.portals.graffito.portlets;
 
 import java.io.IOException;
-
+import java.util.Date;
 
 import javax.portlet.ActionRequest;
 import javax.portlet.ActionResponse;
@@ -25,16 +25,13 @@
 import javax.portlet.PortletException;
 import javax.portlet.PortletMode;
 import javax.portlet.PortletRequest;
-import javax.portlet.PortletRequestDispatcher;
 import javax.portlet.PortletSession;
 import javax.portlet.RenderRequest;
 import javax.portlet.RenderResponse;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.portals.bridges.velocity.GenericVelocityPortlet;
 import org.apache.portals.graffito.ContentModelService;
 import org.apache.portals.graffito.exception.ContentManagementException;
+import org.apache.portals.graffito.model.Folder;
 import org.apache.velocity.context.Context;
 
 /**
@@ -43,9 +40,9 @@
  * @author <a href="mailto:christophe.lombart@sword-technologies.com">Christophe Lombart</a>
  * @version $Id: BrowserPortlet.java,v 1.1 2004/12/28 14:29:11 christophe Exp $
  */
-public class BrowserPortlet extends GenericVelocityPortlet
+public class BrowserPortlet extends GenericTabVelocityPortlet
 {
-
+    
     /** Velocity variable to set the browser info object in the Velocity context */
     private static final String VELOCITY_BROWSER_INFO = "browserInfo";
     
@@ -58,12 +55,7 @@
     /** Portlet preference attritube containing the root uri used to display the content browser */
     private static final String CONTENT_SCOPE = "gaffito.content.scope";
 
-    
-    protected Log log = LogFactory.getLog(BrowserPortlet.class);
-
-   
     private ContentModelService modelService;
-    
 
     /**
      * @see javax.portlet.Portlet#init(javax.portlet.PortletConfig)
@@ -71,8 +63,9 @@
     public void init(PortletConfig config) throws PortletException
     {
         super.init(config);
-        PortletContext context = getPortletContext();
-
+                        
+        PortletContext context = getPortletContext();        
+        
         modelService = (ContentModelService) context.getAttribute("cps:ContentModel");
         if (null == modelService)
         {
@@ -88,18 +81,24 @@
     {
         
         response.setContentType("text/html");
-        Context velocityContext = this.getContext(request);
+        Context velocityContext = this.getContext(request);        
         
         try
         {
-            BrowserInfo browserInfo = this.getSessionBrowserInfo(request);
-            if (null == browserInfo)
+            BrowserInfo browserInfo = null;
+            String uri = request.getParameter("uri");
+            if (uri == null)
             {
-                String parentUri = this.getDefaultContentScope(request);
+                uri = this.getDefaultContentScope(request);
+                browserInfo = this.getSessionBrowserInfo(request);
+            }
+            
+            if (null == browserInfo)
+            {                
                 browserInfo = new BrowserInfo();
-                browserInfo.setDocuments(modelService.getDocuments(parentUri));
-                browserInfo.setFolders(modelService.getFolders(parentUri));
-                browserInfo.setUri(parentUri);
+                browserInfo.setDocuments(modelService.getDocuments(uri));
+                browserInfo.setFolders(modelService.getFolders(uri));
+                browserInfo.setUri(uri);
                 
                 this.setSessionContentBrowser(request, browserInfo);
             }            
@@ -109,8 +108,7 @@
         {
             throw new PortletException("Failed to view the portlet - impossible to access to Graffito content store : " + e.getMessage());
         }
-        
-        
+                         
         super.doView(request, response);
 
         
@@ -121,27 +119,14 @@
      */
     public void doEdit(RenderRequest request, RenderResponse response) throws PortletException, IOException
     {
-        response.setContentType("text/html");
-        Context velocityContext = this.getContext(request);
-        BrowserInfo browserInfo = this.getSessionBrowserInfo(request);
-        velocityContext.put(VELOCITY_BROWSER_INFO, browserInfo); 
-        String page = this.getEditPage(request);
+
+        response.setContentType("text/html");                        
         
-        if (page != null)
-        {
-            this.clearEditPage(request);
-            PortletContext context = getPortletContext();
-            PortletRequestDispatcher rd = context.getRequestDispatcher(page);            
-            rd.include(request, response); 
-            
-            
-        }
-        else
-        {
-            super.doEdit(request, response);
-        }
+        BrowserInfo browserInfo = this.getSessionBrowserInfo(request);                               
+        Context velocityContext = this.getContext(request);
+        velocityContext.put(VELOCITY_BROWSER_INFO, browserInfo);
         
-                   
+        super.doEdit(request, response);
     }
 
     /**
@@ -149,40 +134,43 @@
      */
     public void processAction(ActionRequest request, ActionResponse response) throws PortletException, IOException
     {
-                
+
+        
         if (request.getPortletMode() == PortletMode.EDIT)
-        {            
-            String action = request.getParameter("addfolder");
+        {           
+            
+            
+            String action = request.getParameter("folder.add");
+            if (action!=null)
+            {
+                this.createFolder(request, response);
+                return;
+            }
+            
+            action = request.getParameter("document.add");
             if (action!=null)
             {
-                this.setEditPage(request, "/WEB-INF/view/addfolder.vm");
+                response.setRenderParameter(PARAM_EDIT_PAGE, "/WEB-INF/view/document.vm");
+                return;
+            }
+
+            action = request.getParameter("folder.save");
+            if (action!=null)
+            {
+                this.saveFolder(request, response);                                
                 return;
             }
             
-            action = request.getParameter("adddocument");
+            action = request.getParameter("cancel");
             if (action!=null)
             {
-                this.setEditPage(request, "/WEB-INF/view/adddocument.vm");
+                response.setRenderParameter(PARAM_EDIT_PAGE, "/WEB-INF/view/edit.vm" );                
                 return;
-            }              
+            }            
+            
+            super.processAction(request, response);            
                 
         }
-        else
-        {
-//            String browserAction = request.getParameter("db.browser.action");
-//            if (browserAction != null)
-//            {
-//                if (browserAction.equals("refresh"))
-//                {
-//                   // clearDatabaseBrowserIterator(request);
-//                }
-//                String start = request.getParameter("start");
-//                if (start != null)
-//                {
-//                    response.setRenderParameter("start", start);
-//                }
-//            }
-        }
 
     }
 
@@ -191,34 +179,64 @@
         return (BrowserInfo) request.getPortletSession().getAttribute(SESSION_BROWSER_INFO, PortletSession.PORTLET_SCOPE);
     }
 
-    protected void setSessionContentBrowser(RenderRequest request, BrowserInfo browserInfo)
+    protected void setSessionContentBrowser(PortletRequest request, BrowserInfo browserInfo)
     {
         request.getPortletSession().setAttribute(SESSION_BROWSER_INFO, browserInfo);
     }
-
-    protected void clearSessionContentBrowser(PortletRequest request)
+    
+    protected void removeSessionContentBrowser(PortletRequest request)
     {
         request.getPortletSession().removeAttribute(SESSION_BROWSER_INFO);
-    }
+    }    
 
     protected String getDefaultContentScope(PortletRequest request)
     {
         return request.getPreferences().getValue(CONTENT_SCOPE, DEFAULT_CONTENT_SCOPE);
-    }
+    }     
     
-    protected void setEditPage(PortletRequest request, String page)
+    protected void createFolder(ActionRequest request, ActionResponse response) throws PortletException
     {
-        request.getPortletSession().setAttribute("test", page);
+        
+        try
+        {
+            BrowserInfo browserInfo = this.getSessionBrowserInfo(request);        
+            Folder folder = modelService.createFolder();            
+            browserInfo.setCurrentCmsObject(folder);
+            this.setSessionContentBrowser(request, browserInfo);
+            response.setRenderParameter(PARAM_EDIT_PAGE, "/WEB-INF/view/folder.vm");
+        }
+        catch (ContentManagementException e)
+        {
+            throw new PortletException("Impossible to create a folder ", e);
+        }               
     }
     
-    protected String getEditPage(PortletRequest request)
-    {
-        return (String) request.getPortletSession().getAttribute("test",  PortletSession.PORTLET_SCOPE);
-    }  
-    
-    protected void clearEditPage(PortletRequest request)
-    {
-        request.getPortletSession().removeAttribute("test");
-    }    
-      
+    protected void saveFolder(ActionRequest request, ActionResponse response) throws PortletException
+    {        
+        try
+        {
+            BrowserInfo browserInfo = this.getSessionBrowserInfo(request);                      
+            Folder folder = (Folder) browserInfo.getCurrentCmsObject();
+            String name = request.getParameter("name");
+            String title = request.getParameter("title");
+            String description = request.getParameter("description");
+            
+            folder.setCreationDate(new Date());
+            folder.setDescription(description);
+            folder.setLastModified(new Date());
+            folder.setName(name);
+            folder.setTitle(title);
+            folder.setUri(browserInfo.getUri() + "/" + name);
+            
+            modelService.addFolder(folder);
+            
+            response.setRenderParameter(PARAM_EDIT_PAGE, "/WEB-INF/view/edit.vm");
+            response.setPortletMode(PortletMode.VIEW);
+            this.removeSessionContentBrowser(request);
+        }
+        catch (ContentManagementException e)
+        {
+            throw new PortletException("Impossible to create a folder ", e);
+        }                
+    }
 }

Added: incubator/graffito/trunk/portlets/src/java/org/apache/portals/graffito/portlets/GenericTabVelocityPortlet.java
Url: http://svn.apache.org/viewcvs/incubator/graffito/trunk/portlets/src/java/org/apache/portals/graffito/portlets/GenericTabVelocityPortlet.java?view=auto&rev=125532
==============================================================================
--- (empty file)
+++ incubator/graffito/trunk/portlets/src/java/org/apache/portals/graffito/portlets/GenericTabVelocityPortlet.java	Tue Jan 18 10:59:28 2005
@@ -0,0 +1,121 @@
+/*
+ * 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.portals.graffito.portlets;
+
+import java.io.IOException;
+import java.util.HashMap;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletConfig;
+import javax.portlet.PortletContext;
+import javax.portlet.PortletException;
+import javax.portlet.PortletMode;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.portals.bridges.velocity.GenericVelocityPortlet;
+import org.apache.velocity.context.Context;
+
+/**
+ * Velocity portlet which can manage tab pages in the view & edit mode.
+ * 
+ * @author <a href="mailto:christophe.lombart@sword-technologies.com">Christophe Lombart</a>
+ * @version $Id:  Exp $
+ */
+public class GenericTabVelocityPortlet extends GenericVelocityPortlet
+{
+
+    private static final String TAB_CONFIG = "TabConfig";        
+    protected HashMap tabs = new HashMap();
+    
+    protected Log log = LogFactory.getLog(GenericTabVelocityPortlet.class);
+
+    /**
+     * @see javax.portlet.Portlet#init(javax.portlet.PortletConfig)
+     */
+    public void init(PortletConfig config) throws PortletException
+    {
+        super.init(config);
+                        
+        PortletContext context = getPortletContext();
+        String tabConfig = config.getInitParameter(TAB_CONFIG);
+        if (null == tabConfig)
+        {
+            throw new PortletException("Portlet init parameter TabConfig not found");
+        }
+        
+        String xmlFile = context.getRealPath(tabConfig);
+        try
+        {
+            tabs = TabReader.getTabs(xmlFile);            
+        }
+        catch (Exception e)
+        {
+            throw new PortletException("Impossible to read the tab xml file : " + xmlFile );            
+        }
+                
+    }
+
+    /**
+     * @see javax.portlet.GenericPortlet#doView(javax.portlet.RenderRequest, javax.portlet.RenderResponse)
+     */
+    public void doView(RenderRequest request, RenderResponse response) throws PortletException, IOException
+    {
+        
+        Context velocityContext = this.getContext(request);
+        velocityContext.put("tabs", tabs);                
+        
+        super.doView(request, response);
+    }
+
+    /**
+     * @see javax.portlet.GenericPortlet#doEdit(javax.portlet.RenderRequest, javax.portlet.RenderResponse)
+     */
+    public void doEdit(RenderRequest request, RenderResponse response) throws PortletException, IOException
+    {
+        Context velocityContext = this.getContext(request);
+        velocityContext.put("tabs", tabs);  
+        super.doEdit(request, response);
+    }
+
+    /**
+     * @see javax.portlet.Portlet#processAction(javax.portlet.ActionRequest, javax.portlet.ActionResponse)
+     */
+    public void processAction(ActionRequest request, ActionResponse response) throws PortletException, IOException
+    {
+                
+        if (request.getPortletMode() == PortletMode.EDIT)
+        {           
+            String tabId = request.getParameter("selectTab");
+            if (tabId != null)
+            {                
+                
+                VelocityTab tab = (VelocityTab) tabs.get(tabId);
+                String pageId = request.getParameter("selectPage");
+                    
+                if (pageId == null)
+                {
+                    throw new PortletException("Impossible to find the selected page");
+                }
+                
+                tab.setSelectedPage(pageId);
+            }            
+        }            
+    }
+}
\ No newline at end of file

Added: incubator/graffito/trunk/portlets/src/java/org/apache/portals/graffito/portlets/TabReader.java
Url: http://svn.apache.org/viewcvs/incubator/graffito/trunk/portlets/src/java/org/apache/portals/graffito/portlets/TabReader.java?view=auto&rev=125532
==============================================================================
--- (empty file)
+++ incubator/graffito/trunk/portlets/src/java/org/apache/portals/graffito/portlets/TabReader.java	Tue Jan 18 10:59:28 2005
@@ -0,0 +1,95 @@
+/*
+ * 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.portals.graffito.portlets;
+
+import java.io.IOException;
+import java.util.HashMap;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+
+/**
+ * 
+ * @author <a href="mailto:christophe.lombart@sword-technologies.com">Lombart Christophe </a>
+ * @version $Id: Exp $
+ */
+public class TabReader
+{
+
+    /**
+     * Build a collection of {@link VelocityTab} from an xml file.
+     * 
+     * @param xmlFile
+     * @return
+     * @throws IOException
+     * @throws SAXException
+     * @throws ParserConfigurationException
+     */
+    public static HashMap getTabs(String xmlFile) throws IOException, SAXException, ParserConfigurationException
+    {
+
+        HashMap tabs = new HashMap();
+
+        DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+        //        try
+        //        {
+        DocumentBuilder builder = factory.newDocumentBuilder();
+        Document document = builder.parse(xmlFile);
+        Node root = document.getFirstChild();
+        NodeList tabList = root.getChildNodes();
+        for (int tabIndex = 0; tabIndex < tabList.getLength(); tabIndex++)
+        {
+            Node tabNode = tabList.item(tabIndex);
+            if (tabNode.getNodeType() == Node.ELEMENT_NODE)
+            {
+
+                //String tabId = no
+                String tabId = tabNode.getAttributes().getNamedItem("id").getNodeValue();
+                //System.out.println("Tab : " + tabId);
+                VelocityTab tab = new VelocityTab(tabId);
+                NodeList pageList = tabNode.getChildNodes();
+                
+                for (int pageIndex = 0; pageIndex < pageList.getLength(); pageIndex++)
+                {
+                    Node pageNode = pageList.item(pageIndex);
+                    if (pageNode.getNodeType() == Node.ELEMENT_NODE)
+                    {
+                        String id = pageNode.getAttributes().getNamedItem("id").getNodeValue();
+                        String label = pageNode.getAttributes().getNamedItem("label").getNodeValue();
+                        String view = pageNode.getAttributes().getNamedItem("view").getNodeValue();
+                        VelocityTabPage page = new VelocityTabPage(id, label, view);
+                        tab.addPage(page);
+                    }
+                }
+
+                tabs.put(tabId, tab);
+            }
+        }
+
+        return tabs;
+        //        }
+        //        catch (Exception e)
+        //        {
+        //            throw new PortletException("Failed to the tab xml file : " + xmlFile);
+        //        }
+    }
+
+}
\ No newline at end of file

Added: incubator/graffito/trunk/portlets/src/java/org/apache/portals/graffito/portlets/VelocityTab.java
Url: http://svn.apache.org/viewcvs/incubator/graffito/trunk/portlets/src/java/org/apache/portals/graffito/portlets/VelocityTab.java?view=auto&rev=125532
==============================================================================
--- (empty file)
+++ incubator/graffito/trunk/portlets/src/java/org/apache/portals/graffito/portlets/VelocityTab.java	Tue Jan 18 10:59:28 2005
@@ -0,0 +1,76 @@
+/*
+ * 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.portals.graffito.portlets;
+
+import java.util.ArrayList;
+
+/**
+ * Velocity Tab containse a series of {@link org.apache.portals.graffito.portlets.VelocityTabPage}
+ * 
+ * @author <a href="mailto:christophe.lombart@sword-technologies.com">Lombart Christophe </a>
+ * @version $Id: Exp $
+ */
+public class VelocityTab
+{
+     private ArrayList tabPages = new ArrayList();
+     private int selectedPage = 0;
+     private String id;
+     
+     public VelocityTab(String id)
+     {
+         this.id = id;
+     }
+     
+     public String getId()
+     {
+         return id;
+     }
+     
+     
+     public void addPage(VelocityTabPage page)
+     {         
+         tabPages.add(page);
+     }
+     
+     public VelocityTabPage[] getPages()
+     {
+         return (VelocityTabPage[]) tabPages.toArray(new VelocityTabPage[tabPages.size()]);
+     }
+     
+     public VelocityTabPage getSelectedPage()
+     {
+         return (VelocityTabPage) tabPages.get(selectedPage);
+     }
+     
+     public void setSelectedPage(String pageId)
+     {
+         VelocityTabPage[] pages = this.getPages();
+         for (int i = 0; i<pages.length; i++)
+         {
+             if (pages[i].getId().equals(pageId))
+             {
+                 this.selectedPage= i;
+                 break;
+             }
+         }
+         
+     }
+     
+     public boolean isSelected(VelocityTabPage page)
+     {
+         return ((VelocityTabPage) tabPages.get(selectedPage)).getId().equals(page.getId());   
+     }
+}

Added: incubator/graffito/trunk/portlets/src/java/org/apache/portals/graffito/portlets/VelocityTabPage.java
Url: http://svn.apache.org/viewcvs/incubator/graffito/trunk/portlets/src/java/org/apache/portals/graffito/portlets/VelocityTabPage.java?view=auto&rev=125532
==============================================================================
--- (empty file)
+++ incubator/graffito/trunk/portlets/src/java/org/apache/portals/graffito/portlets/VelocityTabPage.java	Tue Jan 18 10:59:28 2005
@@ -0,0 +1,67 @@
+/*
+ * 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.portals.graffito.portlets;
+
+/**
+ * Information on one view in a VelocityTab. See {@link org.apache.portals.graffito.portlets.VelocityTab}
+ * 
+ * @author <a href="mailto:christophe.lombart@sword-technologies.com">Lombart Christophe </a>
+ * @version $Id: Exp $
+ */
+public class VelocityTabPage
+{
+    private String id;
+    private String label;
+    private String view;    
+
+    /**
+     * @param label
+     * @param view
+     */
+    public VelocityTabPage(String id, String label, String view)
+    {
+        this.id = id;
+        this.label = label;
+        this.view = view;       
+    }
+    
+    
+    public String getId()
+    {
+        return id;
+    }
+    public void setId(String id)
+    {
+        this.id = id;
+    }
+    
+    public String getLabel()
+    {
+        return label;
+    }
+    public void setLabel(String label)
+    {
+        this.label = label;
+    }
+    public String getView()
+    {
+        return view;
+    }
+    public void setView(String view)
+    {
+        this.view = view;
+    }
+}

Modified: incubator/graffito/trunk/portlets/src/java/org/apache/portals/graffito/portlets/resources/messages.properties
Url: http://svn.apache.org/viewcvs/incubator/graffito/trunk/portlets/src/java/org/apache/portals/graffito/portlets/resources/messages.properties?view=diff&rev=125532&p1=incubator/graffito/trunk/portlets/src/java/org/apache/portals/graffito/portlets/resources/messages.properties&r1=125531&p2=incubator/graffito/trunk/portlets/src/java/org/apache/portals/graffito/portlets/resources/messages.properties&r2=125532
==============================================================================
--- incubator/graffito/trunk/portlets/src/java/org/apache/portals/graffito/portlets/resources/messages.properties	(original)
+++ incubator/graffito/trunk/portlets/src/java/org/apache/portals/graffito/portlets/resources/messages.properties	Tue Jan 18 10:59:28 2005
@@ -7,6 +7,7 @@
 help.text.edit = Use the edit mode to modify, add or delete folders & documents.
 
 div.path= You are in :  
+div.newfolder= Add new folder in : 
 div.folders = Folders
 div.documents = Documents 
 
@@ -15,13 +16,19 @@
 edit.tab.title=Title
 edit.tab.description=Description
 
+field.name = Name
+field.title= Title
+field.description=Description
+
 link.addfolder= Add Folder
 link.adddocument = Add Document
 link.delete = Delete
 
-info.nocontent= No content found in this folder
-
+tab.document=Document
+tab.folder=Folder
+tab.security=Security
 
+info.nocontent= No content found in this folder. Use the edit mode to add new content.
 error.servers=No content server found
 
 

Modified: incubator/graffito/trunk/portlets/src/java/org/apache/portals/graffito/portlets/resources/messages_en.properties
Url: http://svn.apache.org/viewcvs/incubator/graffito/trunk/portlets/src/java/org/apache/portals/graffito/portlets/resources/messages_en.properties?view=diff&rev=125532&p1=incubator/graffito/trunk/portlets/src/java/org/apache/portals/graffito/portlets/resources/messages_en.properties&r1=125531&p2=incubator/graffito/trunk/portlets/src/java/org/apache/portals/graffito/portlets/resources/messages_en.properties&r2=125532
==============================================================================
--- incubator/graffito/trunk/portlets/src/java/org/apache/portals/graffito/portlets/resources/messages_en.properties	(original)
+++ incubator/graffito/trunk/portlets/src/java/org/apache/portals/graffito/portlets/resources/messages_en.properties	Tue Jan 18 10:59:28 2005
@@ -7,7 +7,8 @@
 help.text.edit = Use the edit mode to modity, add or delete folders & documents.
 
 
-div.path= You are in : 
+div.path= You are in :
+div.newfolder= Add new folder in :  
 div.folders = Folders
 div.documents = Documents 
 
@@ -20,6 +21,9 @@
 link.adddocument = Add Document
 link.delete = Delete
 
-info.nocontent= No content found in this folder
+tab.general=General
+tab.security=Security
 
+
+info.nocontent= No content found in this folder. Use the edit mode to add new content.
 error.servers=No content server found

Modified: incubator/graffito/trunk/portlets/src/java/org/apache/portals/graffito/portlets/resources/messages_fr.properties
Url: http://svn.apache.org/viewcvs/incubator/graffito/trunk/portlets/src/java/org/apache/portals/graffito/portlets/resources/messages_fr.properties?view=diff&rev=125532&p1=incubator/graffito/trunk/portlets/src/java/org/apache/portals/graffito/portlets/resources/messages_fr.properties&r1=125531&p2=incubator/graffito/trunk/portlets/src/java/org/apache/portals/graffito/portlets/resources/messages_fr.properties&r2=125532
==============================================================================
--- incubator/graffito/trunk/portlets/src/java/org/apache/portals/graffito/portlets/resources/messages_fr.properties	(original)
+++ incubator/graffito/trunk/portlets/src/java/org/apache/portals/graffito/portlets/resources/messages_fr.properties	Tue Jan 18 10:59:28 2005
@@ -6,6 +6,7 @@
 help.text.edit = Utilisez le mode edit pour ajouter, modifier ou effacer des documents et répertoires.
 
 div.path = Vous êtes dans   
+div.newfolder= Ajout d'un nouveau répertoire dans  
 div.folders = Répertoires  
 div.documents = Documents 
 
@@ -17,8 +18,9 @@
 link.addfolder= Ajouter un répertoire
 link.adddocument = Ajouter un document
 link.delete = Supprimer
-  
-info.nocontent= Ce répertoire n'a pas de contenu  
-
 
+tab.general=Information Générale
+tab.security=Securité
+  
+info.nocontent= Ce répertoire n'a pas de contenu. Utilisez le mode d'édition pour gérer votre contenu. 
 error.servers=Impossible de trouver un serveur de contenu 

Added: incubator/graffito/trunk/portlets/src/java/org/apache/portals/graffito/util/GraffitoTools.java
Url: http://svn.apache.org/viewcvs/incubator/graffito/trunk/portlets/src/java/org/apache/portals/graffito/util/GraffitoTools.java?view=auto&rev=125532
==============================================================================
--- (empty file)
+++ incubator/graffito/trunk/portlets/src/java/org/apache/portals/graffito/util/GraffitoTools.java	Tue Jan 18 10:59:28 2005
@@ -0,0 +1,50 @@
+/*
+ * 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.portals.graffito.util;
+
+import java.util.ArrayList;
+
+import org.apache.portals.graffito.model.CmsObject;
+import org.apache.portals.graffito.model.Folder;
+
+/**
+ *
+ * Velocity tools used for Graffito 
+ * 
+ * @author <a href="mailto:christophe.lombart@sword-technologies.com">Lombart Christophe </a>
+ * @version $Id: Exp $
+ */
+public class GraffitoTools
+{
+      public static Folder[] getParents(CmsObject cmsObject)
+      {
+          ArrayList parents = new ArrayList();
+          Folder parent = cmsObject.getParentFolder();
+          while (parent != null)
+          {
+              parents.add(0,parent);
+              parent = parent.getParentFolder();
+          }
+          
+          if (parents.size() == 0)
+          {
+              return null; 
+          }
+          
+          return (Folder[]) parents.toArray(new Folder[parents.size()]);
+          
+      }
+}

Modified: incubator/graffito/trunk/portlets/src/webapp/WEB-INF/portlet.xml
Url: http://svn.apache.org/viewcvs/incubator/graffito/trunk/portlets/src/webapp/WEB-INF/portlet.xml?view=diff&rev=125532&p1=incubator/graffito/trunk/portlets/src/webapp/WEB-INF/portlet.xml&r1=125531&p2=incubator/graffito/trunk/portlets/src/webapp/WEB-INF/portlet.xml&r2=125532
==============================================================================
--- incubator/graffito/trunk/portlets/src/webapp/WEB-INF/portlet.xml	(original)
+++ incubator/graffito/trunk/portlets/src/webapp/WEB-INF/portlet.xml	Tue Jan 18 10:59:28 2005
@@ -37,7 +37,11 @@
 		<init-param>
 			<name>HelpPage</name>
 			<value>/WEB-INF/view/help.vm</value>
-		</init-param>
+		</init-param>
+		<init-param>
+			<name>TabConfig</name>
+			<value>/WEB-INF/tabs/tabs.xml</value>
+		</init-param>		
 		<expiration-cache>0</expiration-cache>
 		<supports>
 			<mime-type>text/html</mime-type>
@@ -53,12 +57,6 @@
 				<name>graffito.content.scope</name>
 				<value>/graffito</value>
 			</preference>
-			<preference>
-				<name>edit.tabs</name>
-				<value>Tab1:Action1:/WEB-INF/view/tab1.vm</value>
-			</preference>
-			
-			
 		</portlet-preferences>
 	</portlet>
 </portlet-app>

Added: incubator/graffito/trunk/portlets/src/webapp/WEB-INF/tabs/tabs.xml
Url: http://svn.apache.org/viewcvs/incubator/graffito/trunk/portlets/src/webapp/WEB-INF/tabs/tabs.xml?view=auto&rev=125532
==============================================================================
--- (empty file)
+++ incubator/graffito/trunk/portlets/src/webapp/WEB-INF/tabs/tabs.xml	Tue Jan 18 10:59:28 2005
@@ -0,0 +1,7 @@
+<tabs>
+	<tab id="document">
+	    <page id="doc" label="tab.document" view= "/WEB-INF/view/adddocument.vm" />
+  	    <page id="folder" label="tab.folder" view= "/WEB-INF/view/addfolder.vm" />
+ 	    <page id="security" label="tab.security" view= "/WEB-INF/view/security.vm" />
+	</tab>	
+</tabs>
\ No newline at end of file

Added: incubator/graffito/trunk/portlets/src/webapp/WEB-INF/velocity/graffito-macros.vm
Url: http://svn.apache.org/viewcvs/incubator/graffito/trunk/portlets/src/webapp/WEB-INF/velocity/graffito-macros.vm?view=auto&rev=125532
==============================================================================
--- (empty file)
+++ incubator/graffito/trunk/portlets/src/webapp/WEB-INF/velocity/graffito-macros.vm	Tue Jan 18 10:59:28 2005
@@ -0,0 +1,56 @@
+#macro (formField2 $label $value $size $id $MESSAGES $ERRORS)
+	#if ($ERRORS)
+		#set ($eflag = "$!ERRORS.get($id)")
+	#else
+		#set ($eflag = "")
+	#end
+	<tr>
+	    <th class="portlet-section-alternate"><font class="portlet-form-field-label">$!MESSAGES.getString($label)</font></th>		
+		<td>
+			<input id="$!id" type="text" name="$!id" size="$!size" value="$!value" class="portlet-form-label-field">
+		</td>
+		#if ($!eflag == "")
+			<td width="5%" align="left">&nbsp;</td>
+		#else
+			<td width="5%" class="portlet-msg-error" align="left">&nbsp;</td>  
+		#end	
+	</tr>
+#end
+
+#macro (tab $tab $MESSAGES $urlAction)
+
+	#set ($tabPages = $tab.getPages())
+
+    
+	<div>
+		<table border="0" cellpadding="0" cellspacing="0" width="50%">
+			<tbody>
+				<tr>  
+					<td  style="font-size: 1pt;" nowrap="true">&nbsp;</td>
+					<td  style="font-size: 1pt;" nowrap="true">&nbsp;</td>
+					<td  style="font-size: 1pt;" nowrap="true">&nbsp;</td>
+					#foreach($tabPage in $tabPages)
+						#if($tab.isSelected($tabPage))	
+							<td class="LTabLeft" style="font-size: 1pt;" nowrap="true">&nbsp;</td>
+							<td class="LTab" align="center" valign="middle">$MESSAGES.getString($tabPage.getLabel())</td>
+							<td class="LTabRight" style="font-size: 1pt;" nowrap="true">&nbsp;</td>
+						#else							
+							<td class="LTabLeftLow" style="font-size: 1pt;" nowrap="true">&nbsp;</td>
+							<td class="LTabLow" align="center" valign="middle"><a href="$urlAction?selectTab=$tab.getId()&selectPage=$tabPage.getId()">$MESSAGES.getString($tabPage.getLabel())</a></td>
+							<td class="LTabRightLow" style="font-size: 1pt;" nowrap="true">&nbsp;</td>			
+						#end	                     
+					#end
+				</tr>        
+			</tbody>			
+		</table>	
+	</div>
+	<div class="portlet-section-alternate" /></div>
+	#parse($tab.getSelectedPage().getView())
+#end
+
+
+#macro (cmspath $cmsObjects $renderResponse)	
+	#foreach($cmsObject in $cmsObjects)
+	   >> <a href="$renderResponse.createRenderURL()?uri=$cmsObject.getUri()">$cmsObject.getName()</a>
+	#end
+#end
\ No newline at end of file

Modified: incubator/graffito/trunk/portlets/src/webapp/WEB-INF/velocity/velocity-macros.vm
Url: http://svn.apache.org/viewcvs/incubator/graffito/trunk/portlets/src/webapp/WEB-INF/velocity/velocity-macros.vm?view=diff&rev=125532&p1=incubator/graffito/trunk/portlets/src/webapp/WEB-INF/velocity/velocity-macros.vm&r1=125531&p2=incubator/graffito/trunk/portlets/src/webapp/WEB-INF/velocity/velocity-macros.vm&r2=125532
==============================================================================
--- incubator/graffito/trunk/portlets/src/webapp/WEB-INF/velocity/velocity-macros.vm	(original)
+++ incubator/graffito/trunk/portlets/src/webapp/WEB-INF/velocity/velocity-macros.vm	Tue Jan 18 10:59:28 2005
@@ -112,3 +112,6 @@
     <td width="5%" class="portlet-form-label" align="left">&nbsp;</td>
   </tr>
 #end
+
+
+

Modified: incubator/graffito/trunk/portlets/src/webapp/WEB-INF/velocity/velocity.properties
Url: http://svn.apache.org/viewcvs/incubator/graffito/trunk/portlets/src/webapp/WEB-INF/velocity/velocity.properties?view=diff&rev=125532&p1=incubator/graffito/trunk/portlets/src/webapp/WEB-INF/velocity/velocity.properties&r1=125531&p2=incubator/graffito/trunk/portlets/src/webapp/WEB-INF/velocity/velocity.properties&r2=125532
==============================================================================
--- incubator/graffito/trunk/portlets/src/webapp/WEB-INF/velocity/velocity.properties	(original)
+++ incubator/graffito/trunk/portlets/src/webapp/WEB-INF/velocity/velocity.properties	Tue Jan 18 10:59:28 2005
@@ -87,7 +87,7 @@
 
 velocimacro.library.autoreload = true
 velocimacro.permissions.allow.inline.to.replace.global = true
-velocimacro.library = /WEB-INF/VM_global_library.vm, /WEB-INF/velocity/velocity-macros.vm
+velocimacro.library = /WEB-INF/VM_global_library.vm, /WEB-INF/velocity/velocity-macros.vm, /WEB-INF/velocity/graffito-macros.vm
 
 #template.loader.2.public.name = URL
 #template.loader.2.description = Velocity URL Template Loader

Deleted: /incubator/graffito/trunk/portlets/src/webapp/WEB-INF/view/adddocument.vm
Url: http://svn.apache.org/viewcvs/incubator/graffito/trunk/portlets/src/webapp/WEB-INF/view/adddocument.vm?view=auto&rev=125531
==============================================================================

Deleted: /incubator/graffito/trunk/portlets/src/webapp/WEB-INF/view/addfolder.vm
Url: http://svn.apache.org/viewcvs/incubator/graffito/trunk/portlets/src/webapp/WEB-INF/view/addfolder.vm?view=auto&rev=125531
==============================================================================

Copied: incubator/graffito/trunk/portlets/src/webapp/WEB-INF/view/document.vm (from r125434, incubator/graffito/trunk/portlets/src/webapp/WEB-INF/view/adddocument.vm)
Url: http://svn.apache.org/viewcvs/incubator/graffito/trunk/portlets/src/webapp/WEB-INF/view/document.vm?view=diff&rev=125532&p1=incubator/graffito/trunk/portlets/src/webapp/WEB-INF/view/adddocument.vm&r1=125434&p2=incubator/graffito/trunk/portlets/src/webapp/WEB-INF/view/document.vm&r2=125532
==============================================================================

Copied: incubator/graffito/trunk/portlets/src/webapp/WEB-INF/view/edit-tab-sample.vm (from r125434, incubator/graffito/trunk/portlets/src/webapp/WEB-INF/view/edit.vm)
Url: http://svn.apache.org/viewcvs/incubator/graffito/trunk/portlets/src/webapp/WEB-INF/view/edit-tab-sample.vm?view=diff&rev=125532&p1=incubator/graffito/trunk/portlets/src/webapp/WEB-INF/view/edit.vm&r1=125434&p2=incubator/graffito/trunk/portlets/src/webapp/WEB-INF/view/edit-tab-sample.vm&r2=125532
==============================================================================
--- incubator/graffito/trunk/portlets/src/webapp/WEB-INF/view/edit.vm	(original)
+++ incubator/graffito/trunk/portlets/src/webapp/WEB-INF/view/edit-tab-sample.vm	Tue Jan 18 10:59:28 2005
@@ -1,50 +1,28 @@
+#*
+Copyright 2004 The Apache Software Foundation
 
-#set ($MESSAGES = $portletConfig.getResourceBundle($renderRequest.Locale))
+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
 
-<div class="portlet-menu">$MESSAGES.getString('div.path') $browserInfo.getUri()</div>
+    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.
+*#
+
+#**
 
-<form action="$renderResponse.createActionURL()" method="post">
-	#set ($folders = $browserInfo.getFolders())
-	#set ($documents = $browserInfo.getDocuments())
-	
-	#if($browserInfo.isEmpty())
-		<div class="portlet-msg-info">$MESSAGES.getString('info.nocontent')</div>
-	#else
-	<table>
-			
-		<tr>
-			<th class="portlet-section-header">$MESSAGES.getString('edit.tab.select')</th>
-			<th class="portlet-section-header">$MESSAGES.getString('edit.tab.name')</th>
-			<th class="portlet-section-header">$MESSAGES.getString('edit.tab.title')</th>
-			<th class="portlet-section-header">$MESSAGES.getString('edit.tab.description')</th>
-		</tr>
-		<tr><div class="portlet-menu">$MESSAGES.getString('div.folders')</div></tr>	
-		#foreach ($folder in $folders)
-		<tr>
-			<td class="portlet-section-body"><input type="checkbox"/></th>
-			<td class="portlet-section-body">folder.getName()</th>
-			<td class="portlet-section-body">folder.getTitle()</th>
-			<td class="portlet-section-body">folder.getDescription()</th>
-		</tr>
-		#end
-		<tr><div class="portlet-menu">$MESSAGES.getString('div.documents')</div></tr>
-		#foreach ($document in $documents)
-		<tr>
-			<td class="portlet-section-body"><input type="checkbox"/></th>
-			<td class="portlet-section-body">document.getName()</th>
-			<td class="portlet-section-body">document.getTitle()</th>
-			<td class="portlet-section-body">document.getDescription()</th>
-		</tr>
-		#end
-	</table>	
-	#end
-	
-	<div class="portlet-menu">
-		<input type="submit" name="addfolder" value="$MESSAGES.getString('link.addfolder')" />	
-		<input type="submit" name="adddocument" value="$MESSAGES.getString('link.adddocument')" />	
-	</div>
-	
-</form>
+@author <a href="mailto:christophe.lombart@sword-technologies.com">Christophe Lombart</a>
+@version $Id:  Exp $
 
+*#
+#set ($MESSAGES = $portletConfig.getResourceBundle($renderRequest.Locale))
+
+<div class="portlet-menu">$MESSAGES.getString('div.path') $browserInfo.getUri()</div>
 
+#tab($tabs.get("document") $MESSAGES  $renderResponse.createActionURL())
 

Deleted: /incubator/graffito/trunk/portlets/src/webapp/WEB-INF/view/edit.vm
Url: http://svn.apache.org/viewcvs/incubator/graffito/trunk/portlets/src/webapp/WEB-INF/view/edit.vm?view=auto&rev=125531
==============================================================================

Copied: incubator/graffito/trunk/portlets/src/webapp/WEB-INF/view/folder.vm (from r125434, incubator/graffito/trunk/portlets/src/webapp/WEB-INF/view/addfolder.vm)
Url: http://svn.apache.org/viewcvs/incubator/graffito/trunk/portlets/src/webapp/WEB-INF/view/folder.vm?view=diff&rev=125532&p1=incubator/graffito/trunk/portlets/src/webapp/WEB-INF/view/addfolder.vm&r1=125434&p2=incubator/graffito/trunk/portlets/src/webapp/WEB-INF/view/folder.vm&r2=125532
==============================================================================
--- incubator/graffito/trunk/portlets/src/webapp/WEB-INF/view/addfolder.vm	(original)
+++ incubator/graffito/trunk/portlets/src/webapp/WEB-INF/view/folder.vm	Tue Jan 18 10:59:28 2005
@@ -20,5 +20,22 @@
 @version $Id:  Exp $
 
 *#
+#set ($MESSAGES = $portletConfig.getResourceBundle($renderRequest.Locale))
+#set ($folder = $browserInfo.getCurrentCmsObject())
 
-ADD FOLDER
\ No newline at end of file
+<div class="portlet-menu">$MESSAGES.getString('div.newfolder') $browserInfo.getUri()</div>
+
+<div class="portlet-section-header">Folder Info </div>
+<form action="$renderResponse.createActionURL()" method="post">
+    <input type="hidden" name="uri" value="$folde.getUri()" size="100" maxlength="100"/>
+	<table border="0" cellspacing="2" cellpadding="3">
+		#formField2('field.name' "$!folder.getName()" "25" 'name' $MESSAGES $ERRORS)
+        #formField2('field.title' "$!folder.getTitle()" "25" 'title' $MESSAGES $ERRORS)
+        #formField2('field.description' "$!folder.getDescription()" "50" 'description' $MESSAGES $ERRORS)		
+	</table>
+	<div class="portlet-section-footer">
+		<input type="submit" name="folder.save" value="Save" class="portlet-dlg-icon-label"/>
+		<input type="submit" name="cancel" value="Cancel" class="portlet-dlg-icon-label"/>
+	</div>
+</form>
+#ErrorMessages($ERRORS)

Added: incubator/graffito/trunk/portlets/src/webapp/WEB-INF/view/security.vm
Url: http://svn.apache.org/viewcvs/incubator/graffito/trunk/portlets/src/webapp/WEB-INF/view/security.vm?view=auto&rev=125532
==============================================================================
--- (empty file)
+++ incubator/graffito/trunk/portlets/src/webapp/WEB-INF/view/security.vm	Tue Jan 18 10:59:28 2005
@@ -0,0 +1,24 @@
+#*
+Copyright 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.
+*#
+
+#**
+
+@author <a href="mailto:christophe.lombart@sword-technologies.com">Christophe Lombart</a>
+@version $Id:  Exp $
+
+*#
+
+Security
\ No newline at end of file

Added: incubator/graffito/trunk/portlets/src/webapp/WEB-INF/view/tab.vm
Url: http://svn.apache.org/viewcvs/incubator/graffito/trunk/portlets/src/webapp/WEB-INF/view/tab.vm?view=auto&rev=125532
==============================================================================
--- (empty file)
+++ incubator/graffito/trunk/portlets/src/webapp/WEB-INF/view/tab.vm	Tue Jan 18 10:59:28 2005
@@ -0,0 +1,52 @@
+#*
+Copyright 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.
+*#
+
+#**
+
+@author <a href="mailto:christophe.lombart@sword-technologies.com">Christophe Lombart</a>
+@version $Id:  Exp $
+
+*#
+#set ($MESSAGES = $portletConfig.getResourceBundle($renderRequest.Locale))
+#set ($tabPages = $tab.getPages())
+
+
+<div id="tabs">
+<table border="0" cellpadding="0" cellspacing="0" width="65%">
+  <tbody>
+	<tr>  
+		<td  style="font-size: 1pt;" nowrap="true">&nbsp;</td>
+		<td  style="font-size: 1pt;" nowrap="true">&nbsp;</td>
+		<td  style="font-size: 1pt;" nowrap="true">&nbsp;</td>
+		#foreach($tabPage in $tabPages)
+			#if($tabPage.isSelected())	
+				<td class="LTabLeft" style="font-size: 1pt;" nowrap="true">&nbsp;</td>
+				<td class="LTab" align="center" valign="middle">$tabPage.getLabel()</td>
+				<td class="LTabRight" style="font-size: 1pt;" nowrap="true">&nbsp;</td>
+			#else
+				<td class="LTabLeftLow" style="font-size: 1pt;" nowrap="true">&nbsp;</td>
+				<td class="LTabLow" align="center" valign="middle"><a href="">$tabPage.getLabel()</a></td>
+				<td class="LTabRightLow" style="font-size: 1pt;" nowrap="true">&nbsp;</td>			
+			#end	                     
+		#end
+	</tr>        
+  </tbody>			
+</table>	
+</div>
+<div class="portlet-section-alternate" /></div>
+#parse($tab.getSelectedPage().getPage())
+
+

Modified: incubator/graffito/trunk/portlets/src/webapp/WEB-INF/view/view.vm
Url: http://svn.apache.org/viewcvs/incubator/graffito/trunk/portlets/src/webapp/WEB-INF/view/view.vm?view=diff&rev=125532&p1=incubator/graffito/trunk/portlets/src/webapp/WEB-INF/view/view.vm&r1=125531&p2=incubator/graffito/trunk/portlets/src/webapp/WEB-INF/view/view.vm&r2=125532
==============================================================================
--- incubator/graffito/trunk/portlets/src/webapp/WEB-INF/view/view.vm	(original)
+++ incubator/graffito/trunk/portlets/src/webapp/WEB-INF/view/view.vm	Tue Jan 18 10:59:28 2005
@@ -27,19 +27,35 @@
 #if( $browserInfo.isEmpty())	
   	    <div class="portlet-msg-info">$MESSAGES.getString('info.nocontent')</div>		
 #else         
-	
-	<div class="portlet-menu">$MESSAGES.getString('div.folders')</div>
 	#set ($folders = $browserInfo.getFolders())
-	#foreach ($folder in $folders)
-		$folder.getName()
-	#end	
-	
-	
-	<div class="portlet-menu">$MESSAGES.getString('div.documents')</div>
-	#set ($documents = $browserInfo.getDocuments())
-	#foreach ($document in $documents)
-		$document.getName()
-	#end	
-	
+	#if($folders.size() > 0)
+		<div class="portlet-menu">$MESSAGES.getString('div.folders')</div>		
+		<div class="arrowfolder">
+			<table border="0">
+				<tr>
+					<td>
+						<table border="0" cellpadding="0" cellspacing="40">
+							<tr>
+								#foreach ($folder in $folders)
+									<td>					
+										<font class="portlet-folder-item"><a href="$renderResponse.createRenderURL()?uri=$folder.getUri()">$folder.getName()</a></font>	
+									</td>
+								#end
+							</tr>
+						</table>
+					</td>
+				</tr>
+			</table>
+		</div>
+	#end
+
+	#set ($documents = $browserInfo.getDocuments())	
+	#if($documents.size() > 0)	
+		<div class="portlet-menu">$MESSAGES.getString('div.documents')</div>
+
+		#foreach ($document in $documents)
+			<font class="portlet-menu-item"><a href="$renderResponse.createRenderURL()?uri=$folder.getUri()">$document.getTitle()</a></font>
+		#end	
+	#end
 #end
 

Mime
View raw message