[jboss-svn-commits] JBoss Portal SVN: r5412 - in trunk/core/src/main/org/jboss/portal/core: cms cms/command portlet/cms portlet/cms/admin

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Tue Oct 10 19:46:45 EDT 2006


Author: julien at jboss.com
Date: 2006-10-10 19:46:36 -0400 (Tue, 10 Oct 2006)
New Revision: 5412

Added:
   trunk/core/src/main/org/jboss/portal/core/cms/StreamContentCommand.java
Removed:
   trunk/core/src/main/org/jboss/portal/core/cms/command/StreamContentCommand.java
Modified:
   trunk/core/src/main/org/jboss/portal/core/cms/CMSObjectCommandFactory.java
   trunk/core/src/main/org/jboss/portal/core/cms/CMSObjectURLFactory.java
   trunk/core/src/main/org/jboss/portal/core/portlet/cms/CMSPortlet.java
   trunk/core/src/main/org/jboss/portal/core/portlet/cms/admin/CMSAdminPortlet.java
Log:
just moved the streamcontentcommand to upper package

Modified: trunk/core/src/main/org/jboss/portal/core/cms/CMSObjectCommandFactory.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/cms/CMSObjectCommandFactory.java	2006-10-10 23:31:55 UTC (rev 5411)
+++ trunk/core/src/main/org/jboss/portal/core/cms/CMSObjectCommandFactory.java	2006-10-10 23:46:36 UTC (rev 5412)
@@ -26,7 +26,7 @@
 import org.jboss.portal.cms.Command;
 import org.jboss.portal.cms.model.Content;
 import org.jboss.portal.cms.model.File;
-import org.jboss.portal.core.cms.command.StreamContentCommand;
+import org.jboss.portal.core.cms.StreamContentCommand;
 import org.jboss.portal.core.controller.ControllerCommand;
 import org.jboss.portal.core.controller.command.InvokeWindowRenderCommand;
 import org.jboss.portal.core.controller.command.mapper.AbstractCommandFactory;

Modified: trunk/core/src/main/org/jboss/portal/core/cms/CMSObjectURLFactory.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/cms/CMSObjectURLFactory.java	2006-10-10 23:31:55 UTC (rev 5411)
+++ trunk/core/src/main/org/jboss/portal/core/cms/CMSObjectURLFactory.java	2006-10-10 23:46:36 UTC (rev 5412)
@@ -23,7 +23,7 @@
 
 import org.jboss.portal.core.controller.ControllerCommand;
 import org.jboss.portal.core.controller.command.mapper.URLFactoryDelegate;
-import org.jboss.portal.core.cms.command.StreamContentCommand;
+import org.jboss.portal.core.cms.StreamContentCommand;
 import org.jboss.portal.server.ServerInvocation;
 import org.jboss.portal.server.AbstractServerURL;
 import org.jboss.portal.server.ServerURL;

Copied: trunk/core/src/main/org/jboss/portal/core/cms/StreamContentCommand.java (from rev 5411, trunk/core/src/main/org/jboss/portal/core/cms/command/StreamContentCommand.java)
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/cms/command/StreamContentCommand.java	2006-10-10 23:31:55 UTC (rev 5411)
+++ trunk/core/src/main/org/jboss/portal/core/cms/StreamContentCommand.java	2006-10-10 23:46:36 UTC (rev 5412)
@@ -0,0 +1,103 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.portal.core.cms;
+
+import org.jboss.mx.util.MBeanProxy;
+import org.jboss.mx.util.MBeanServerLocator;
+import org.jboss.portal.cms.CMS;
+import org.jboss.portal.cms.Command;
+import org.jboss.portal.cms.model.Content;
+import org.jboss.portal.cms.model.File;
+import org.jboss.portal.common.invocation.InvocationException;
+import org.jboss.portal.core.controller.command.info.CommandInfo;
+import org.jboss.portal.core.controller.command.info.ViewCommandInfo;
+import org.jboss.portal.core.controller.command.response.StreamContentResponse;
+import org.jboss.portal.core.controller.ControllerCommand;
+import org.jboss.portal.core.controller.ControllerException;
+import org.jboss.portal.server.ServerInvocation;
+
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+import java.io.InputStream;
+import java.util.Locale;
+
+/**
+ * Renders content from the cms.
+ *
+ * @author <a href="mailto:roy at jboss.org">Roy Russo</a>
+ */
+public class StreamContentCommand extends ControllerCommand
+{
+
+   private static final CommandInfo info = new ViewCommandInfo(false, null);
+
+   private String path;
+
+   public StreamContentCommand(String path)
+         throws IllegalArgumentException
+   {
+      this.path = path;
+   }
+
+   public String getPath()
+   {
+      return path;
+   }
+
+   public CommandInfo getInfo()
+   {
+      return info;
+   }
+
+   public Object execute() throws InvocationException, ControllerException
+   {
+      try
+      {
+         MBeanServer mbeanServer = MBeanServerLocator.locateJBoss();
+         CMS CMSService = (CMS) MBeanProxy.get(CMS.class, new ObjectName("portal:service=CMS"), mbeanServer);
+         ServerInvocation serverInvocation = getControllerContext().getServerInvocation();
+         Command getCMD = CMSService.getCommandFactory().createFileGetCommand(path, serverInvocation.getRequest().getLocale());
+         File file = (File) CMSService.execute(getCMD);
+         if(file == null)
+         {
+            getCMD = CMSService.getCommandFactory().createFileGetCommand(path, new Locale(CMSService.getDefaultLocale()));
+            file = (File) CMSService.execute(getCMD);
+         }
+         Content content = file.getContent();
+         String mimeType = content.getMimeType();
+         InputStream inputStream = content.getStream();
+         return new StreamContentResponse(mimeType, inputStream);
+      }
+      catch(Exception e)
+      {
+//         try
+//         {
+//            resp.sendError(HttpServletResponse.SC_NOT_FOUND, e.getMessage());
+//         }
+//         catch(IOException e1)
+//         {
+//            log.error("An error occured when wanting to stream the command", e);
+//         }
+         throw new ControllerException(e);
+      }
+   }
+}
\ No newline at end of file


Property changes on: trunk/core/src/main/org/jboss/portal/core/cms/StreamContentCommand.java
___________________________________________________________________
Name: svn:executable
   + *
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native

Deleted: trunk/core/src/main/org/jboss/portal/core/cms/command/StreamContentCommand.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/cms/command/StreamContentCommand.java	2006-10-10 23:31:55 UTC (rev 5411)
+++ trunk/core/src/main/org/jboss/portal/core/cms/command/StreamContentCommand.java	2006-10-10 23:46:36 UTC (rev 5412)
@@ -1,103 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
-*/
-package org.jboss.portal.core.cms.command;
-
-import org.jboss.mx.util.MBeanProxy;
-import org.jboss.mx.util.MBeanServerLocator;
-import org.jboss.portal.cms.CMS;
-import org.jboss.portal.cms.Command;
-import org.jboss.portal.cms.model.Content;
-import org.jboss.portal.cms.model.File;
-import org.jboss.portal.common.invocation.InvocationException;
-import org.jboss.portal.core.controller.command.info.CommandInfo;
-import org.jboss.portal.core.controller.command.info.ViewCommandInfo;
-import org.jboss.portal.core.controller.command.response.StreamContentResponse;
-import org.jboss.portal.core.controller.ControllerCommand;
-import org.jboss.portal.core.controller.ControllerException;
-import org.jboss.portal.server.ServerInvocation;
-
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-import java.io.InputStream;
-import java.util.Locale;
-
-/**
- * Renders content from the cms.
- *
- * @author <a href="mailto:roy at jboss.org">Roy Russo</a>
- */
-public class StreamContentCommand extends ControllerCommand
-{
-
-   private static final CommandInfo info = new ViewCommandInfo(false, null);
-
-   private String path;
-
-   public StreamContentCommand(String path)
-         throws IllegalArgumentException
-   {
-      this.path = path;
-   }
-
-   public String getPath()
-   {
-      return path;
-   }
-
-   public CommandInfo getInfo()
-   {
-      return info;
-   }
-
-   public Object execute() throws InvocationException, ControllerException
-   {
-      try
-      {
-         MBeanServer mbeanServer = MBeanServerLocator.locateJBoss();
-         CMS CMSService = (CMS) MBeanProxy.get(CMS.class, new ObjectName("portal:service=CMS"), mbeanServer);
-         ServerInvocation serverInvocation = getControllerContext().getServerInvocation();
-         Command getCMD = CMSService.getCommandFactory().createFileGetCommand(path, serverInvocation.getRequest().getLocale());
-         File file = (File) CMSService.execute(getCMD);
-         if(file == null)
-         {
-            getCMD = CMSService.getCommandFactory().createFileGetCommand(path, new Locale(CMSService.getDefaultLocale()));
-            file = (File) CMSService.execute(getCMD);
-         }
-         Content content = file.getContent();
-         String mimeType = content.getMimeType();
-         InputStream inputStream = content.getStream();
-         return new StreamContentResponse(mimeType, inputStream);
-      }
-      catch(Exception e)
-      {
-//         try
-//         {
-//            resp.sendError(HttpServletResponse.SC_NOT_FOUND, e.getMessage());
-//         }
-//         catch(IOException e1)
-//         {
-//            log.error("An error occured when wanting to stream the command", e);
-//         }
-         throw new ControllerException(e);
-      }
-   }
-}
\ No newline at end of file

Modified: trunk/core/src/main/org/jboss/portal/core/portlet/cms/CMSPortlet.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/portlet/cms/CMSPortlet.java	2006-10-10 23:31:55 UTC (rev 5411)
+++ trunk/core/src/main/org/jboss/portal/core/portlet/cms/CMSPortlet.java	2006-10-10 23:46:36 UTC (rev 5412)
@@ -27,7 +27,7 @@
 import org.jboss.portal.cms.Command;
 import org.jboss.portal.cms.model.File;
 import org.jboss.portal.cms.util.FileUtil;
-import org.jboss.portal.core.cms.command.StreamContentCommand;
+import org.jboss.portal.core.cms.StreamContentCommand;
 import org.jboss.portal.core.controller.portlet.ControllerPortletInvocationContext;
 import org.jboss.portal.portlet.invocation.PortletInvocation;
 import org.jboss.portlet.JBossRenderResponse;

Modified: trunk/core/src/main/org/jboss/portal/core/portlet/cms/admin/CMSAdminPortlet.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/portlet/cms/admin/CMSAdminPortlet.java	2006-10-10 23:31:55 UTC (rev 5411)
+++ trunk/core/src/main/org/jboss/portal/core/portlet/cms/admin/CMSAdminPortlet.java	2006-10-10 23:46:36 UTC (rev 5412)
@@ -36,7 +36,7 @@
 import org.jboss.portal.cms.model.Folder;
 import org.jboss.portal.cms.util.FileUtil;
 import org.jboss.portal.cms.util.NodeUtil;
-import org.jboss.portal.core.cms.command.StreamContentCommand;
+import org.jboss.portal.core.cms.StreamContentCommand;
 import org.jboss.portal.core.controller.portlet.ControllerPortletInvocationContext;
 import org.jboss.portal.portlet.invocation.PortletInvocation;
 import org.jboss.portal.server.request.URLContext;




More information about the jboss-svn-commits mailing list