incubator-graffito-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clomb...@apache.org
Subject svn commit: r155832 - in incubator/graffito/trunk/applications/browser/src: java/org/apache/portals/graffito/portlets/ java/org/apache/portals/graffito/portlets/resources/ java/org/apache/portals/graffito/portlets/util/ webapp/WEB-INF/ webapp/WEB-INF/view/document/ webapp/WEB-INF/view/folder/ webapp/kupu/
Date Tue, 01 Mar 2005 22:36:31 GMT
Author: clombart
Date: Tue Mar  1 14:36:28 2005
New Revision: 155832

URL: http://svn.apache.org/viewcvs?view=rev&rev=155832
Log:
Refactor the Browser portlet : 
* Add the PortletAction feature - I have to check with the J2 implementation to see if we
can group both solution.
* Create the dto pck

Makes small bug fix. 

The portlet is not yet stable. Continue to work on it.

Modified:
    incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/BrowserPortlet.java
    incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/GenericTabVelocityPortlet.java
    incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/resources/messages.properties
    incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/util/GraffitoTools.java
    incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/util/PortletFileUploadBase.java
    incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/portlet.xml
    incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/document/document-text-edit.vm
    incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/document/document-type.vm
    incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/document/document-upload-edit.vm
    incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/document/document.vm
    incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/folder/folder-detail.vm
    incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/folder/folder-edit.vm
    incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuinit_form.js

Modified: incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/BrowserPortlet.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/BrowserPortlet.java?view=diff&r1=155831&r2=155832
==============================================================================
--- incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/BrowserPortlet.java
(original)
+++ incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/BrowserPortlet.java
Tue Mar  1 14:36:28 2005
@@ -13,52 +13,44 @@
 package org.apache.portals.graffito.portlets;
 
 import java.io.IOException;
-import java.io.UnsupportedEncodingException;
 import java.util.ArrayList;
-import java.util.Date;
 
 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.PortletRequest;
 
-import javax.portlet.PortletSession;
 import javax.portlet.RenderRequest;
 import javax.portlet.RenderResponse;
 
-import org.apache.commons.fileupload.FileItem;
 import org.apache.portals.graffito.ContentModelService;
 import org.apache.portals.graffito.ContentServerService;
 import org.apache.portals.graffito.exception.ContentManagementException;
 import org.apache.portals.graffito.model.CmsObject;
 import org.apache.portals.graffito.model.Document;
 import org.apache.portals.graffito.model.Folder;
-import org.apache.portals.graffito.portlets.util.PortletDiskFileUpload;
-import org.apache.portals.graffito.portlets.util.PortletFileUploadBase;
+import org.apache.portals.graffito.portlets.dto.BrowserInfo;
+import org.apache.portals.graffito.portlets.util.BrowserInfoUtil;
 import org.apache.portals.graffito.util.CmsUtil;
 import org.apache.velocity.context.Context;
 
 /**
  * Graffito Content Browser.
  * 
- * In the view mode, this browser gives a way to navigate across the complete content tree.
In the edit mode, this browser can
- * manager folders & documents (edit, add, delete, manage security, versionning, ...).
+ * In the view mode, this browser gives the possibility to navigate across the complete content
tree. In the edit mode, this browser can
+ * manage folders & documents (edit, add, delete, manage security, versionning, ...).
  * 
  * @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 GenericTabVelocityPortlet
+public class BrowserPortlet extends AbstractGraffitoPortlet
 {
 
     /** Velocity variable to set the browser info object in the Velocity context */
     private static final String VELOCITY_BROWSER_INFO = "browserInfo";
 
-    /** Portlet session attribute name used to set the Browser info */
-    private static final String SESSION_BROWSER_INFO = "graffito.browser.info";
-
     /** Default uri used to display the content browser */
     private static final String DEFAULT_CONTENT_SCOPE = "/graffito";
 
@@ -127,20 +119,19 @@
         if (uri == null)
         {
             uri = this.getDefaultContentScope(request);
-            browserInfo = this.getSessionBrowserInfo(request);
+            browserInfo = BrowserInfoUtil.getSessionBrowserInfo(request);
         }
 
         if (null == browserInfo)
         {
             browserInfo = this.initBrowserInfo(uri, request, response);
-            this.setSessionContentBrowser(request, browserInfo);
+            BrowserInfoUtil.setSessionContentBrowser(request, browserInfo);
         }
 
         this.selectViewTemplate(browserInfo, request, response);
 
         velocityContext.put(VELOCITY_BROWSER_INFO, browserInfo);
         super.doView(request, response);
-        
 
     }
 
@@ -149,15 +140,16 @@
      */
     public void doEdit(RenderRequest request, RenderResponse response) throws PortletException,
IOException
     {
-    
+
         response.setContentType("text/html");
         Context velocityContext = this.getContext(request);
 
-        BrowserInfo browserInfo = this.getSessionBrowserInfo(request);        
+        BrowserInfo browserInfo = BrowserInfoUtil.getSessionBrowserInfo(request);
+        
         this.selectEditTemplate(browserInfo, request, response);
         velocityContext.put(VELOCITY_BROWSER_INFO, browserInfo);
 
-        super.doEdit(request, response);     
+        super.doEdit(request, response);
     }
 
     /**
@@ -165,96 +157,11 @@
      */
     public void processAction(ActionRequest request, ActionResponse response) throws PortletException,
IOException
     {
-
-        if (request.getPortletMode() == PortletMode.EDIT)
-        {
-            PortletDiskFileUpload diskFileUpload = new PortletDiskFileUpload();
-
-            if (this.hasFieldForm(request, diskFileUpload, "folder.add"))
-            {
-                this.createFolder(request, response);
-                return;
-            }
-            
-            if (this.hasFieldForm(request, diskFileUpload, "folder.update"))
-            {
-                this.updateFolder(request, response);
-                return;
-            }            
-
-            if (this.hasFieldForm(request, diskFileUpload, "document.add"))
-            {
-                this.createDocument(request, response);
-                return;
-            }
-
-            if (this.hasFieldForm(request, diskFileUpload, "document.new.step2"))
-            {
-                this.createDocumentStep2(request, response);
-                return;
-            }
-
-            if (this.hasFieldForm(request, diskFileUpload, "folder.save"))
-            {
-                this.saveFolder(request, response);
-                return;
-            }
-
-            if (this.hasFieldForm(request, diskFileUpload, "document.save"))
-            {
-                this.saveDocument(request, response);
-                return;
-            }
-            
-            if (this.hasFieldForm(request, diskFileUpload, "document.upload"))
-            {
-                this.uploadDocument(request, response, diskFileUpload);
-                return;
-            }
-            
-            if (this.hasFieldForm(request, diskFileUpload, "cmsobject.delete"))
-            {
-                this.deleteCmsObject(request, response);
-                return;
-            }
-
-            if (this.hasFieldForm(request, diskFileUpload, "cancel"))
-            {
-                request.setAttribute(PARAM_EDIT_PAGE, "/WEB-INF/view/folder/folder-edit.vm");
-                return;
-            }
-            
-            super.processAction(request, response);
-
-        }
+        actionHandler.processAction(request, response);
+        super.processAction(request, response);
 
     }
 
-    protected BrowserInfo getSessionBrowserInfo(PortletRequest request)
-    {
-        Object sessionBrowserInfo = request.getPortletSession().getAttribute(SESSION_BROWSER_INFO,
PortletSession.PORTLET_SCOPE);
-        
-        // After deploying a new graffito war file into jetspeed, there is a classpath exception
whith the
-        // current object in the session
-        if (sessionBrowserInfo instanceof BrowserInfo)
-        {
-            return (BrowserInfo) sessionBrowserInfo;
-        }
-        else
-        {
-            return null;
-        }
-    }
-
-    protected void setSessionContentBrowser(PortletRequest request, BrowserInfo browserInfo)
-    {
-        request.getPortletSession().setAttribute(SESSION_BROWSER_INFO, browserInfo);
-    }
-
-    protected void removeSessionContentBrowser(PortletRequest request)
-    {
-        request.getPortletSession().removeAttribute(SESSION_BROWSER_INFO);
-    }
 
     protected String getDefaultContentScope(PortletRequest request)
     {
@@ -262,284 +169,10 @@
         return request.getPreferences().getValue(CONTENT_SCOPE, DEFAULT_CONTENT_SCOPE);
     }
 
-    protected void createFolder(ActionRequest request, ActionResponse response) throws PortletException
-    {
-
-        try
-        {
-            BrowserInfo browserInfo = this.getSessionBrowserInfo(request);
-            Folder folder = modelService.createFolder();
-            browserInfo.setCurrentCmsObject(folder);
-            browserInfo.setOperation(BrowserInfo.INSERT);
-            this.setSessionContentBrowser(request, browserInfo);            
-            response.setRenderParameter(PARAM_EDIT_PAGE, "/WEB-INF/view/folder/folder-detail.vm");
-
-        }
-        catch (ContentManagementException e)
-        {
-            throw new PortletException("Impossible to create a folder ", e);
-        }
-    }
-    
-    protected void updateFolder(ActionRequest request, ActionResponse response) throws PortletException
-    {
-
-        try
-        {
-            BrowserInfo browserInfo = this.getSessionBrowserInfo(request);
-            String uri = request.getParameter("uri");
-            Folder folder = modelService.getFolder(uri);
-            browserInfo.setCurrentCmsObject(folder);
-            browserInfo.setOperation(BrowserInfo.UPDATE);
-            this.setSessionContentBrowser(request, browserInfo);            
-            response.setRenderParameter(PARAM_EDIT_PAGE, "/WEB-INF/view/folder/folder-detail.vm");
-
-        }
-        catch (ContentManagementException e)
-        {
-            throw new PortletException("Impossible to create a folder ", e);
-        }
-    }    
-
-    protected void createDocument(ActionRequest request, ActionResponse response) throws
PortletException
-    {
-
-        try
-        {
-            BrowserInfo browserInfo = this.getSessionBrowserInfo(request);
-            Document document = modelService.createDocument();
-            browserInfo.setCurrentCmsObject(document);
-            browserInfo.setOperation(BrowserInfo.INSERT);
-            this.setSessionContentBrowser(request, browserInfo);
-            
-            response.setRenderParameter(PARAM_EDIT_PAGE, "/WEB-INF/view/document/document-type.vm");
-        }
-        catch (ContentManagementException e)
-        {
-            throw new PortletException("Impossible to create a document ", e);
-        }
-    }
-
-    protected void createDocumentStep2(ActionRequest request, ActionResponse response) throws
PortletException
-    {
-
-        //        try
-        //        {
-        BrowserInfo browserInfo = this.getSessionBrowserInfo(request);
-        Document document = (Document) browserInfo.getCurrentCmsObject();
-        String name = request.getParameter("name");
-        String title = request.getParameter("title");
-        String description = request.getParameter("description");
-        String owner = request.getParameter("owner");
-        String language = request.getParameter("language");
-
-        document.setCreationDate(new Date());
-        document.setDescription(description);
-        document.setLastModified(new Date());
-        document.setName(name);
-        document.setTitle(title);
-        document.setOwner(owner);
-        document.setLanguage(language);
-
-        String parentFolderUri = null;
-        if (browserInfo.getCurrentFolder() == null)
-        {
-            parentFolderUri = browserInfo.getCurrentServer().getScope();
-        }
-        else
-        {
-            parentFolderUri = browserInfo.getCurrentFolder().getUri();
-        }
-
-        document.setUri(parentFolderUri + "/" + name);
-        document.setVersionNumber("1.0");
-
-        String type = request.getParameter("documentType");
-        if (type.equals("document.type.text"))
-        {
-            document.setContentType("text/plain");
-            response.setRenderParameter(PARAM_EDIT_PAGE, "/WEB-INF/view/document/document-text-edit.vm");
-        }
-
-        if (type.equals("document.type.html"))
-        {
-            document.getContent().setContent("[Add your text here]".getBytes());
-            document.setContentType("text/html");
-            //response.setRenderParameter(PARAM_EDIT_PAGE, "/fckeditor/htmleditor.vm");
-            response.setRenderParameter(PARAM_EDIT_PAGE, "/kupu/kupu.vm");
-
-        }
-
-        if (type.equals("document.type.upload"))
-        {
-           response.setRenderParameter(PARAM_EDIT_PAGE, "/WEB-INF/view/document/document-upload-edit.vm");
-        }
-
-        browserInfo.setCurrentCmsObject(document);
-        this.setSessionContentBrowser(request, browserInfo);
-
-        //        }
-        //        catch (ContentManagementException e)
-        //        {
-        //            throw new PortletException("Impossible to create a document ", e);
-        //        }
-    }
-
-    protected void saveFolder(ActionRequest request, ActionResponse response) throws PortletException
-    {
-        try
-        {
-            BrowserInfo browserInfo = this.getSessionBrowserInfo(request);
-            Folder folder = (Folder) browserInfo.getCurrentCmsObject();
-            if (browserInfo.isInsert())
-            {
-                String name = request.getParameter("name");
-                folder.setCreationDate(new Date());
-                folder.setLastModified(new Date());  
-                folder.setName(name);
-                String parentFolderUri = null;
-                if (browserInfo.getCurrentFolder() == null)
-                {
-                    parentFolderUri = browserInfo.getCurrentServer().getScope();
-                }
-                else
-                {
-                    parentFolderUri = browserInfo.getCurrentFolder().getUri();
-                }
-
-                folder.setUri(parentFolderUri + "/" + name);
-                
-            }
-            else
-            {
-                folder.setLastModified(new Date());    
-            }
-            
-            String title = request.getParameter("title");
-            String description = request.getParameter("description");            
-            folder.setDescription(description);
-            folder.setTitle(title);
-
-            if (browserInfo.isInsert())
-            {
-                modelService.addFolder(folder);
-            }
-            else
-            {
-                modelService.updateFolder(folder);
-            }
-
-            response.setRenderParameter(PARAM_EDIT_PAGE, "/WEB-INF/view/folder/folder-edit.vm");
-
-            response.setPortletMode(PortletMode.VIEW);
-            this.removeSessionContentBrowser(request);
-        }
-        catch (ContentManagementException e)
-        {
-            throw new PortletException("Impossible to save a folder ", e);
-        }
-    }
-
-    protected void saveDocument(ActionRequest request, ActionResponse response) throws PortletException
-    {
-        try
-        {
-            BrowserInfo browserInfo = this.getSessionBrowserInfo(request);
-            Document document = (Document) browserInfo.getCurrentCmsObject();
-
-            //Other attributes has been initialised in the method createDocumentStep2
-            String content = request.getParameter("content");            
-            try
-            {
-                document.getContent().setContent(content.getBytes(request.getCharacterEncoding()));
-                document.getContent().setEncoding(request.getCharacterEncoding());
-            }
-            catch (UnsupportedEncodingException e)
-            {
-                document.getContent().setContent(content.getBytes());
-            }
-            document.setSize(content.length());
-            if (browserInfo.getOperation().equals(BrowserInfo.INSERT))
-            {
-                modelService.addDocument(document);
-            }
-            else
-            {
-                modelService.updateDocument(document);
-            }
-            response.setRenderParameter(PARAM_EDIT_PAGE, "/WEB-INF/view/folder/folder-edit.vm");
-            response.setPortletMode(PortletMode.VIEW);
-            this.removeSessionContentBrowser(request);
-        }
-        catch (ContentManagementException e)
-        {
-            throw new PortletException("Impossible to create a document ", e);
-        }
-    }
-
-    protected void uploadDocument(ActionRequest request, ActionResponse response, PortletDiskFileUpload
diskFileUpload) throws PortletException
-    {
-        try
-        {
-            BrowserInfo browserInfo = this.getSessionBrowserInfo(request);
-            Document document = (Document) browserInfo.getCurrentCmsObject();
-
-            diskFileUpload.setRepositoryPath("c:/tmp/upload");
-            FileItem fileItem = diskFileUpload.getFileItem(request, "file");
-            document.setContentType(fileItem.getContentType());
-            document.getContent().setContent(fileItem.get());
-            document.getContent().setEncoding(request.getCharacterEncoding());
-
-            document.setSize(fileItem.getSize());
-            if (browserInfo.getOperation().equals(BrowserInfo.INSERT))
-            {
-                modelService.addDocument(document);
-            }
-            else
-            {
-                modelService.updateDocument(document);
-            }
-            response.setRenderParameter(PARAM_EDIT_PAGE, "/WEB-INF/view/folder/folder-edit.vm");
-            response.setPortletMode(PortletMode.VIEW);
-            this.removeSessionContentBrowser(request);
-        }
-        catch (Exception e)
-        {
-            throw new PortletException("Impossible to upload a document ", e);
-        }
-    }
-    
-    protected void deleteCmsObject(ActionRequest request, ActionResponse response) throws
PortletException
-    {
-        try
-        {
-            String[] uriToDelete = request.getParameterValues("uri");
-            if (uriToDelete == null)
-            {
-                // No cms object has been selected
-                return;
-            }
-
-            for (int i = 0; i < uriToDelete.length; i++)
-            {
-                modelService.removeAll(uriToDelete);
-            }
-            response.setRenderParameter(PARAM_EDIT_PAGE, "/WEB-INF/view/folder/folder-edit.vm");
-            response.setPortletMode(PortletMode.VIEW);
-            this.removeSessionContentBrowser(request);
-
-        }
-        catch (ContentManagementException e)
-        {
-            throw new PortletException("Impossible to delete all cms objects ", e);
-        }
-    }
-
     /**
      * Initialise the list of the available document types
      * 
-     * @param documentTypes
-     *            comma separated document types
+     * @param documentTypes  comma separated document types
      */
     private void initDocumentTypes(String documentTypes)
     {
@@ -554,8 +187,7 @@
     /**
      * Initialise the list of the available document types
      * 
-     * @param documentLanguages
-     *            comma separated document types
+     * @param documentLanguages comma separated language types
      */
     private void initDocumentLanguages(String documentLanguages)
     {
@@ -617,14 +249,14 @@
         CmsObject cmsObject = browserInfo.getCurrentCmsObject();
         if ((cmsObject instanceof Folder) || (cmsObject == null))
         {
-           request.setAttribute(PARAM_VIEW_PAGE, "/WEB-INF/view/folder/folder-browser.vm"
);
+            request.setAttribute(PARAM_VIEW_PAGE, "/WEB-INF/view/folder/folder-browser.vm");
         }
         else
         {
             Document document = (Document) cmsObject;
             if (document.getContentType().equals("text/plain"))
             {
-                request.setAttribute(PARAM_VIEW_PAGE, "/WEB-INF/view/document/document-text-html-view.vm"
);
+                request.setAttribute(PARAM_VIEW_PAGE, "/WEB-INF/view/document/document-text-html-view.vm");
                 return;
             }
 
@@ -641,17 +273,16 @@
             throws PortletException
     {
 
-        
         // Check if the edit template has been already defined (from the processAction method)
         String editPageParam = request.getParameter(PARAM_EDIT_PAGE);
-        if (editPageParam != null &&  (! editPageParam.equals(this.getDefaultEditPage())))
+        if (editPageParam != null && (! editPageParam.equals(this.getDefaultEditPage())))
         {
             request.setAttribute(PARAM_EDIT_PAGE, editPageParam);
         }
         else
         {
             CmsObject cmsObject = browserInfo.getCurrentCmsObject();
-            
+
             if ((cmsObject == null) || (cmsObject instanceof Folder))
             {
                 request.setAttribute(PARAM_EDIT_PAGE, "/WEB-INF/view/folder/folder-edit.vm");
@@ -670,19 +301,11 @@
                 }
 
             }
-        }                
-    }
-    
-    
-    private boolean hasFieldForm(ActionRequest request, PortletDiskFileUpload diskFileUpload,
 String fieldName)
-    {
-        if (! PortletFileUploadBase.isMultipartContent(request))
-        {
-            return (request.getParameter(fieldName) != null);
         }
-        else
+        
+        if (browserInfo.getOperation() == null)
         {
-            return diskFileUpload.hasFieldName(request, fieldName);
+            browserInfo.setOperation(BrowserInfo.UPDATE);
         }
     }
 

Modified: incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/GenericTabVelocityPortlet.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/GenericTabVelocityPortlet.java?view=diff&r1=155831&r2=155832
==============================================================================
--- incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/GenericTabVelocityPortlet.java
(original)
+++ incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/GenericTabVelocityPortlet.java
Tue Mar  1 14:36:28 2005
@@ -36,7 +36,7 @@
 import org.apache.velocity.context.Context;
 
 /**
- * Velocity portlet which can manage tab pages in the view & edit mode.
+ * Velocity portlet used for all Graffito Portlets
  * 
  * @author <a href="mailto:christophe.lombart@sword-technologies.com">Christophe Lombart</a>
  * @version $Id:  Exp $
@@ -52,7 +52,7 @@
     protected String viewerServlet;
     protected String putServlet;
     
-    protected Log log = LogFactory.getLog(GenericTabVelocityPortlet.class);
+    protected Log log = LogFactory.getLog(AbstractGraffitoPortlet.class);
 
     /**
      * @see javax.portlet.Portlet#init(javax.portlet.PortletConfig)
@@ -101,8 +101,7 @@
         
         Context velocityContext = this.getContext(request);
         velocityContext.put("tabs", tabs);   
-        velocityContext.put("graffitoTools", new GraffitoTools(request.getContextPath() +
"/" + viewerServlet, 
-                                                               request.getContextPath() +
"/" + putServlet));
+        velocityContext.put("graffitoTools", new GraffitoTools(request.getContextPath() +
"/" + viewerServlet));
         
         super.doView(request, response);
     }
@@ -114,8 +113,7 @@
     {
         Context velocityContext = this.getContext(request);
         velocityContext.put("tabs", tabs); 
-        velocityContext.put("graffitoTools", new GraffitoTools(request.getContextPath() +
"/" + viewerServlet, 
-                                                               request.getContextPath() +
"/" + putServlet));
+        velocityContext.put("graffitoTools", new GraffitoTools(request.getContextPath() +
"/" + viewerServlet));
         super.doEdit(request, response);
     }
 

Modified: incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/resources/messages.properties
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/resources/messages.properties?view=diff&r1=155831&r2=155832
==============================================================================
--- incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/resources/messages.properties
(original)
+++ incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/resources/messages.properties
Tue Mar  1 14:36:28 2005
@@ -12,6 +12,7 @@
 div.newdocument= Add new document in : 
 div.updatedocument = Update Document : 
 div.folders = Folders
+div.folder = Folder
 div.documents = Documents 
 div.server = Server
 

Modified: incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/util/GraffitoTools.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/util/GraffitoTools.java?view=diff&r1=155831&r2=155832
==============================================================================
--- incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/util/GraffitoTools.java
(original)
+++ incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/util/GraffitoTools.java
Tue Mar  1 14:36:28 2005
@@ -31,7 +31,6 @@
 public class GraffitoTools
 {
       private String graffitoViewerServlet;
-      private String graffitoPutServlet;
       
       /**
        * Constructor 
@@ -39,13 +38,10 @@
        * @param graffitoViewerName The Graffito Viewer Servlet. 
        *        This servlet reference can be used in the href to display binary documents
like PDF, ...
        * 
-       * @param graffitoPutServlet The Graffito Put Servlet.
-       * 		This servlet reference can be used in a web editor to send back a document stream
via an HTTP PUT
        */
-      public GraffitoTools(String graffitoViewerServlet, String graffitoPutServlet)
+      public GraffitoTools(String graffitoViewerServlet)
       {
            this.graffitoViewerServlet = graffitoViewerServlet;
-           this.graffitoPutServlet = graffitoPutServlet;
       }
       
       public Folder[] getParents(CmsObject cmsObject)
@@ -94,14 +90,5 @@
       {
           return graffitoViewerServlet;
       }
-      
-      /**
-       * 
-       * @return The Graffito Put Servlet (used for binary documents)
-       */
-      public String getPutServlet()
-      {
-          return graffitoPutServlet;
-      }
-      
+            
 }

Modified: incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/util/PortletFileUploadBase.java
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/util/PortletFileUploadBase.java?view=diff&r1=155831&r2=155832
==============================================================================
--- incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/util/PortletFileUploadBase.java
(original)
+++ incubator/graffito/trunk/applications/browser/src/java/org/apache/portals/graffito/portlets/util/PortletFileUploadBase.java
Tue Mar  1 14:36:28 2005
@@ -449,6 +449,15 @@
         return null;
     }
     
+    public List getFileItems(ActionRequest request) throws FileUploadException
+    {
+        if (fileItems == null)
+        {    
+            fileItems = this.parseRequest(request);
+        }
+        return fileItems;
+    }
+    
     // ------------------------------------------------------ Protected methods
 
 

Modified: incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/portlet.xml
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/portlet.xml?view=diff&r1=155831&r2=155832
==============================================================================
--- incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/portlet.xml (original)
+++ incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/portlet.xml Tue Mar 
1 14:36:28 2005
@@ -41,13 +41,13 @@
 			<value>/WEB-INF/tabs/tabs.xml</value>
 		</init-param>		
 		<init-param>
-			<name>ViewerServlet</name>
-			<value>viewer</value>
+			<name>ActionConfig</name>
+			<value>/WEB-INF/actions/actions.xml</value>
 		</init-param>		
 		<init-param>
-			<name>PutServlet</name>
-			<value>contentupdate</value>
-		</init-param>				
+			<name>ViewerServlet</name>
+			<value>viewer</value>
+		</init-param>					
 		<init-param>
 			<name>DocumentTypes</name>
 			<value>document.type.upload,document.type.text,document.type.html,document.type.news</value>

Modified: incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/document/document-text-edit.vm
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/document/document-text-edit.vm?view=diff&r1=155831&r2=155832
==============================================================================
--- incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/document/document-text-edit.vm
(original)
+++ incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/document/document-text-edit.vm
Tue Mar  1 14:36:28 2005
@@ -32,8 +32,8 @@
     <input type="hidden" name="uri" value="$document.getUri()" size="100" maxlength="100"/>
 	#formFieldTextArea($document.getContent().getContentAsString() "content" $MESSAGES $ERRORS)
   
 	<div class="portlet-section-footer">
-		<input type="submit" name="document.save" value="Save" class="portlet-dlg-icon-label"/>
-		<input type="submit" name="cancel" value="Cancel" class="portlet-dlg-icon-label"/>
+		<input type="submit" name="portletAction_document.save" value="Save" class="portlet-dlg-icon-label"/>
	
+		<input type="submit" name="portletAction_general.cancel" value="Cancel" class="portlet-dlg-icon-label"/>
	
 	</div>
 </form>
 

Modified: incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/document/document-type.vm
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/document/document-type.vm?view=diff&r1=155831&r2=155832
==============================================================================
--- incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/document/document-type.vm
(original)
+++ incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/document/document-type.vm
Tue Mar  1 14:36:28 2005
@@ -40,8 +40,8 @@
            
 	</table>
 	<div class="portlet-section-footer">
-		<input type="submit" name="document.new.step2" value="Next" class="portlet-dlg-icon-label"/>
-		<input type="submit" name="cancel" value="Cancel" class="portlet-dlg-icon-label"/>
+		<input type="submit" name="portletAction_document.createStep2" value="Next" class="portlet-dlg-icon-label"/>
+		<input type="submit" name="portletAction_general.cancel" value="Cancel" class="portlet-dlg-icon-label"/>
 	</div>
 </form>
 

Modified: incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/document/document-upload-edit.vm
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/document/document-upload-edit.vm?view=diff&r1=155831&r2=155832
==============================================================================
--- incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/document/document-upload-edit.vm
(original)
+++ incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/document/document-upload-edit.vm
Tue Mar  1 14:36:28 2005
@@ -32,8 +32,8 @@
 		#formFieldFile('file.upload' "" "50" 'file' $MESSAGES $ERRORS)
 	</table>
 	<div class="portlet-section-footer">
-		<input type="submit" name="document.upload" value="Upload" class="portlet-dlg-icon-label"/>
-		<input type="submit" name="cancel" value="Cancel" class="portlet-dlg-icon-label"/>
+		<input type="submit" name="portletAction_document.upload" value="Upload" class="portlet-dlg-icon-label"/>
+		<input type="submit" name="portletAction_general.cancel" value="Cancel" class="portlet-dlg-icon-label"/>
 	</div>
 </form>
 #ErrorMessages($ERRORS)

Modified: incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/document/document.vm
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/document/document.vm?view=diff&r1=155831&r2=155832
==============================================================================
--- incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/document/document.vm
(original)
+++ incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/document/document.vm
Tue Mar  1 14:36:28 2005
@@ -36,8 +36,8 @@
         #formFieldInput('field.description' "$!document.getDescription()" "50" 'description'
$MESSAGES $ERRORS)		
 	</table>
 	<div class="portlet-section-footer">
-		<input type="submit" name="document.save" value="Save" class="portlet-dlg-icon-label"/>
-		<input type="submit" name="cancel" value="Cancel" class="portlet-dlg-icon-label"/>
+		<input type="submit" name="portletAction_document.save" value="Save" class="portlet-dlg-icon-label"/>
+		<input type="submit" name="portletAction_general.cancel" value="Cancel" class="portlet-dlg-icon-label"/>
 	</div>
 </form>
 

Modified: incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/folder/folder-detail.vm
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/folder/folder-detail.vm?view=diff&r1=155831&r2=155832
==============================================================================
--- incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/folder/folder-detail.vm
(original)
+++ incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/folder/folder-detail.vm
Tue Mar  1 14:36:28 2005
@@ -49,8 +49,8 @@
         #formFieldInput('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"/>
+		<input type="submit" name="portletAction_folder.save" value="Save" class="portlet-dlg-icon-label"/>
+		<input type="submit" name="portletAction_general.cancel" value="Cancel" class="portlet-dlg-icon-label"/>
 	</div>
 </form>
 

Modified: incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/folder/folder-edit.vm
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/folder/folder-edit.vm?view=diff&r1=155831&r2=155832
==============================================================================
--- incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/folder/folder-edit.vm
(original)
+++ incubator/graffito/trunk/applications/browser/src/webapp/WEB-INF/view/folder/folder-edit.vm
Tue Mar  1 14:36:28 2005
@@ -51,8 +51,8 @@
 			#end			
 			<tr>
 				<td class="$cssClass"><input type="checkbox" name="uri" value="$folder.getUri()"
/></td>
-				<td class="$cssClass"><img src="content/tigris/images/folder.gif" border="0"/></td>
-				<td class="$cssClass"><a href="$renderResponse.createActionURL()?uri=$folder.getUri()&folder.update=selected">$folder.getName()</a></td>
+				<td class="$cssClass">$MESSAGES.getString('div.folder')</td>
+				<td class="$cssClass"><a href="$renderResponse.createActionURL()?uri=$folder.getUri()&portletAction_folder.edit=selected">$folder.getName()</a></td>
 				<td class="$cssClass">$folder.getTitle()</td>
 				<td class="$cssClass">$folder.getDescription()</td>
 				<td class="$cssClass">$!folder.getCreationDate()</td>
@@ -71,7 +71,7 @@
 			<tr>
 				<td class="$cssClass"><input type="checkbox" name="uri" value="$document.getUri()"
 /></td>
 				<td class="$cssClass">$document.getContentType() </td>		
-				<td class="$cssClass"><a href="$renderResponse.createActionURL()?uri=$document.getUri()&document.update=selected">$document.getName()</a></td>
+				<td class="$cssClass"><a href="$renderResponse.createActionURL()?uri=$document.getUri()&portletAction_document.edit=selected">$document.getName()</a></td>
 				<td class="$cssClass">$document.getTitle()</td>
 				<td class="$cssClass">$document.getDescription()</td>
 				<td class="$cssClass">$!document.getCreationDate()</td>
@@ -83,9 +83,9 @@
 	#end
 	
 	<div class="portlet-menu">
-		<input type="submit" name="folder.add" value="$MESSAGES.getString('link.addfolder')"
class="portlet-dlg-icon-label" />	
-		<input type="submit" name="document.add" value="$MESSAGES.getString('link.adddocument')"
class="portlet-dlg-icon-label" />	
-		<input type="submit" name="cmsobject.delete" value="$MESSAGES.getString('link.delete')"
class="portlet-dlg-icon-label" />	
+		<input type="submit" name="portletAction_folder.create" value="$MESSAGES.getString('link.addfolder')"
class="portlet-dlg-icon-label" />	
+		<input type="submit" name="portletAction_document.createStep1" value="$MESSAGES.getString('link.adddocument')"
class="portlet-dlg-icon-label" />	
+		<input type="submit" name="portletAction_cmsobject.delete" value="$MESSAGES.getString('link.delete')"
class="portlet-dlg-icon-label" />	
 	</div>
 	
 </form>

Modified: incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuinit_form.js
URL: http://svn.apache.org/viewcvs/incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuinit_form.js?view=diff&r1=155831&r2=155832
==============================================================================
--- incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuinit_form.js (original)
+++ incubator/graffito/trunk/applications/browser/src/webapp/kupu/kupuinit_form.js Tue Mar
 1 14:36:28 2005
@@ -224,7 +224,7 @@
         var drawer = document.getElementById('kupu-librarydrawer');
         drawer.parentNode.removeChild(drawer);
         kupu.prepareForm(savebutton.form, 'content');
-        savebutton.form.action = savebutton.form.action + "?document.save";      
+        savebutton.form.action = savebutton.form.action + "?portletAction_document.save";
     
         savebutton.form.submit();
     };
     addEventHandler(savebutton, 'click', prepareForm, kupu);



Mime
View raw message