[jboss-cvs] jboss-portal/core/src/main/org/jboss/portal/core/cms ...

Roy Russo russo at jboss.com
Tue Jul 11 17:07:00 EDT 2006


  User: russo   
  Date: 06/07/11 17:07:00

  Modified:    core/src/main/org/jboss/portal/core/cms 
                        CMSObjectCommandFactory.java
  Log:
  JBPORTAL-947 - done.
  
  Revision  Changes    Path
  1.10      +20 -8     jboss-portal/core/src/main/org/jboss/portal/core/cms/CMSObjectCommandFactory.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: CMSObjectCommandFactory.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-portal/core/src/main/org/jboss/portal/core/cms/CMSObjectCommandFactory.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -b -r1.9 -r1.10
  --- CMSObjectCommandFactory.java	9 Jul 2006 12:04:14 -0000	1.9
  +++ CMSObjectCommandFactory.java	11 Jul 2006 21:07:00 -0000	1.10
  @@ -21,17 +21,17 @@
   */
   package org.jboss.portal.core.cms;
   
  -import org.jboss.portal.portlet.Mode;
  -import org.jboss.portal.portlet.ParametersStateString;
   import org.jboss.portal.cms.CMS;
  -import org.jboss.portal.cms.Command;
   import org.jboss.portal.cms.CMSException;
  +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.command.ControllerCommand;
   import org.jboss.portal.core.command.InvokeWindowRenderCommand;
   import org.jboss.portal.core.command.mapper.CommandFactoryDelegate;
  +import org.jboss.portal.portlet.Mode;
  +import org.jboss.portal.portlet.ParametersStateString;
   import org.jboss.portal.server.ServerInvocation;
   
   import java.util.Locale;
  @@ -44,10 +44,14 @@
   public class CMSObjectCommandFactory extends CommandFactoryDelegate
   {
   
  -   /** . */
  +   /**
  +    * .
  +    */
      protected CMS CMSService;
   
  -   /** . */
  +   /**
  +    * .
  +    */
      protected String targetWindowRef;
   
      public CMS getCMSService()
  @@ -74,9 +78,11 @@
      {
         try
         {
  +/*
            Command itemExistsCMD = CMSService.getCommandFactory().createItemExistsCommand(portalRequestPath + "/" + invocation.getRequest().getLocale().getLanguage());
            Boolean bExists = (Boolean) CMSService.execute(itemExistsCMD);
            Command getCMD;
  +
            if(bExists.booleanValue())
            {
               getCMD = CMSService.getCommandFactory().createFileGetCommand(portalRequestPath, invocation.getRequest().getLocale());
  @@ -85,14 +91,20 @@
            {
               getCMD = CMSService.getCommandFactory().createFileGetCommand(portalRequestPath, new Locale(CMSService.getDefaultLocale()));
            }
  -
  +*/
  +         Command getCMD = CMSService.getCommandFactory().createFileGetCommand(portalRequestPath, invocation.getRequest().getLocale());
            File file = (File) CMSService.execute(getCMD);
  +         if(file == null)
  +         {
  +            getCMD = CMSService.getCommandFactory().createFileGetCommand(portalRequestPath, new Locale(CMSService.getDefaultLocale()));
  +            file = (File) CMSService.execute(getCMD);
  +         }
   
            if(file != null)
            {
               Content content = file.getContent();
   
  -            if (content != null)
  +            if(content != null)
               {
                  boolean isStreamable = false;
                  if(!"text/html".equalsIgnoreCase(content.getMimeType()) && !"text/plain".equalsIgnoreCase(content.getMimeType()))
  @@ -116,7 +128,7 @@
               }
            }
         }
  -      catch (CMSException e)
  +      catch(CMSException e)
         {
            log.error("CMS error", e);
         }
  
  
  



More information about the jboss-cvs-commits mailing list