portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tay...@apache.org
Subject cvs commit: jakarta-jetspeed-2/components/web-content/src/java/org/apache/jetspeed/portlet IFramePortlet.java
Date Wed, 22 Sep 2004 22:27:41 GMT
taylor      2004/09/22 15:27:41

  Added:       components/web-content/src/test log4j.properties
               components/web-content maven.xml .cvsignore
                        project.properties project.xml locator.ent
               components/web-content/xdocs navigation.xml
               components/web-content/src/java/org/apache/jetspeed/portlet
                        IFramePortlet.java
  Log:
  start of web content component
  i will be working with Randy on a new web content architecture based on extending the J1
services
  IFramePortlet contributed by Randy Watler
  
  CVS: ----------------------------------------------------------------------
  CVS: PR:
  CVS:   If this change addresses a PR in the problem report tracking
  CVS:   database, then enter the PR number(s) here.
  CVS: Obtained from:
  CVS:   If this change has been taken from another system, such as NCSA,
  CVS:   then name the system in this line, otherwise delete it.
  CVS: Submitted by:
  CVS:   If this code has been contributed to Apache by someone else; i.e.,
  CVS:   they sent us a patch or a new module, then include their name/email
  CVS:   address here. If this is your work then delete this line.
  CVS: Reviewed by:
  CVS:   If we are doing pre-commit code reviews and someone else has
  CVS:   reviewed your changes, include their name(s) here.
  CVS:   If you have not had it reviewed then delete this line.
  
  Revision  Changes    Path
  1.1                  jakarta-jetspeed-2/components/web-content/src/test/log4j.properties
  
  Index: log4j.properties
  ===================================================================
  # 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.
  
  # ------------------------------------------------------------------------
  #
  # Logging Configuration
  #
  # $Id: log4j.properties,v 1.1 2004/09/22 22:27:40 taylor Exp $
  #
  # ------------------------------------------------------------------------
  
  #
  # If we don't know the logging facility, put it into the jetspeed.log
  # 
  #
  log4j.rootLogger = INFO, console
  
  #
  # Jetspeed goes into Jetspeed Log
  #
  log4j.category.org.apache.jetspeed = DEBUG, console
  log4j.additivity.org.apache.jetspeed = false
  
  #
  # Velocity Logfile
  #
  log4j.category.velocity = INFO, console
  log4j.additivity.velocity = false
  
  #
  # OJB Logfile
  #
  log4j.category.org.apache.ojb= INFO, console
  log4j.additivity.org.apache.ojb= false
  
  
  
  
  #
  # Console
  #
  log4j.appender.console=org.apache.log4j.ConsoleAppender
  log4j.appender.console.layout=org.apache.log4j.PatternLayout
  
  # Pattern to output the caller's file name and line number.
  log4j.appender.console.layout.ConversionPattern=%5p: %m%n
  
  
  
  1.1                  jakarta-jetspeed-2/components/web-content/maven.xml
  
  Index: maven.xml
  ===================================================================
  <!--
  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.
  -->
  <project default="java:jar"
           xmlns:j="jelly:core" 
           xmlns:define="jelly:define">
  
     <property name='testcase' value='org.apache.jetspeed.components.portletentity.TestPortletEntityAccessComponent'/>

    
     <goal name="deployJar">
      <property name='maven.test.skip' value='true'/> 
    	<attainGoal name="jar:install"/>
    	<copy file="${basedir}/target/${maven.final.name}.jar" todir="${org.apache.jetspeed.deploy.war.dir}/jetspeed/WEB-INF/lib"/>
    </goal>
    
  </project>
  
  
  
  1.1                  jakarta-jetspeed-2/components/web-content/.cvsignore
  
  Index: .cvsignore
  ===================================================================
  target
  *.log
  jcoverage.ser
  
  
  1.1                  jakarta-jetspeed-2/components/web-content/project.properties
  
  Index: project.properties
  ===================================================================
  # 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.
  #
  # $Id: project.properties,v 1.1 2004/09/22 22:27:40 taylor Exp $
  #
  
  maven.multiproject.type=jar
  maven.license.licenseFile=${basedir}/../../LICENSE.TXT
  
  
  
  
  1.1                  jakarta-jetspeed-2/components/web-content/project.xml
  
  Index: project.xml
  ===================================================================
  <?xml version="1.0" encoding="UTF-8"?>
  <!DOCTYPE project [
    <!ENTITY % locator-entities SYSTEM "file:locator.ent"> %locator-entities;	
  ]>
  <!--
  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.
  -->
  <project>
    <extend>${basedir}/../../project.xml</extend>
    <pomVersion>3</pomVersion>
    <id>jetspeed-web-content</id>
    <groupId>jetspeed2</groupId>
    <name>Jetspeed-2 Web Content</name>
    <currentVersion>2.0-a1-dev</currentVersion>
    <package>org.apache.jetspeed</package>
    <description>
  	  Web content service and portlet implementations.
    </description>
  
    <repository>                 
      <connection>scm:cvs:pserver:anoncvs@cvs.apache.org:/home/cvspublic:jakarta-jetspeed-2/components/registry</connection>
      <url>http://cvs.apache.org/viewcvs/jakarta-jetspeed-2/components/registry/</url>
    </repository>
  
    <shortDescription>Web Content</shortDescription>
    <dependencies>  
    	&pico-nano-groovy;
     	<dependency>
        <id>jetspeed2:jetspeed-commons</id>
        <version>2.0-a1-dev</version>
      </dependency>
      <dependency>
        <id>commons-httpclient</id>
        <version>2.0</version>
      </dependency>
      <!-- Testing only -->
      <dependency>
        <id>commons-lang</id>
        <version>2.0</version>
      </dependency>
      <dependency>
        <id>commons-logging</id>
        <version>1.0.3</version>
      </dependency>
      <dependency>
        <id>commons-beanutils</id>
        <version>1.6.1</version>
      </dependency>
      <dependency>
        <id>commons-configuration</id>
        <version>1.0-dev</version>
      </dependency>
      <dependency>
        <id>junit</id>
        <version>3.8.1</version>
      </dependency>
      <dependency>
        <id>log4j</id>
        <version>1.2.6</version>
      </dependency>   
      <dependency>
        <id>commons-collections</id>
        <version>3.0</version>
      </dependency>
      <dependency>
        <id>commons-io</id>
        <version>0.1</version>
      </dependency>
      <dependency>
        <id>xerces</id>
        <version>2.3.0</version>
      </dependency>
      <dependency>
        <id>xml-apis</id>
        <version>2.0.2</version>
      </dependency>
      <dependency>
        <id>pluto</id>
        <groupId>pluto</groupId>
        <version>1.0.1-SNAPSHOT</version>
      </dependency>
      <dependency>
        <!-- portlet-api.jar must be in %MAVEN_HOME%respository/portlet-api/jars -->
        <id>portlet-api</id>
        <version>1.0</version>
      </dependency>
       <dependency>
        <id>servletapi</id>
        <version>2.3</version>
      </dependency>
    </dependencies>
    <build>
      <sourceDirectory>src/java</sourceDirectory>
   
      
      <unitTestSourceDirectory>${basedir}/src/test</unitTestSourceDirectory>
      <unitTest>
        <resources>
          <resource>
            <directory>${basedir}/src/test</directory>
            <excludes>
             <exclude>**/*.java</exclude>
            </excludes>
          </resource>
          <resource>
          <directory>${basedir}/src/java</directory>
          <excludes>
            <exclude>**/*.java</exclude>
            <exclude>**/META-INF/**</exclude>
          </excludes>
        </resource>
        </resources>
      </unitTest>
      
      <resources>
        <resource>
          <directory>${basedir}/src/java</directory>
          <excludes>
            <exclude>**/*.java</exclude>
          </excludes>
        </resource>
      </resources>
      
    </build>
    <reports>
      <report>maven-jdepend-plugin</report>
  <!--
      <report>maven-checkstyle-plugin</report>
  -->
      <report>maven-pmd-plugin</report>
      <report>maven-changelog-plugin</report>
      <report>maven-file-activity-plugin</report>
      <report>maven-developer-activity-plugin</report>
      <report>maven-license-plugin</report>
      <report>maven-javadoc-plugin</report>
      <report>maven-jxr-plugin</report>
      <report>maven-junit-report-plugin</report>
      <report>maven-jcoverage-plugin</report>
      <report>maven-linkcheck-plugin</report>
      <report>maven-tasklist-plugin</report>
    </reports>  
  </project>
  
  
  
  1.1                  jakarta-jetspeed-2/components/web-content/locator.ent
  
  Index: locator.ent
  ===================================================================
  <!ENTITY pico-nano-groovy SYSTEM "file:../../etc/project-dependencies/pico-nano-groovy.xml">

  
  
  1.1                  jakarta-jetspeed-2/components/web-content/xdocs/navigation.xml
  
  Index: navigation.xml
  ===================================================================
  <?xml version="1.0" encoding="ISO-8859-1"?>
  <!--
  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.
  -->
  <project>
    <body>
      <links>
        <item name="Jetspeed 2" href="../../index.html"/>
      </links>
    </body>
  </project>
  
  
  
  1.1                  jakarta-jetspeed-2/components/web-content/src/java/org/apache/jetspeed/portlet/IFramePortlet.java
  
  Index: IFramePortlet.java
  ===================================================================
  /*
   * 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.jetspeed.portlet;
  
  import java.io.IOException;
  import java.io.PrintWriter;
  import javax.portlet.GenericPortlet;
  import javax.portlet.PortletConfig;
  import javax.portlet.PortletException;
  import javax.portlet.PortletPreferences;
  import javax.portlet.RenderRequest;
  import javax.portlet.RenderResponse;
  import javax.portlet.WindowState;
  
  /**
   * IFramePortlet
   *
   * TODO:
   * - add capabilities test for IFRAME
   * - add locale specific "no iframes" message
   *
   * @author <a href="mailto:rwatler@finali.com">Randy Watler</a>
   * @version $Id: IFramePortlet.java,v 1.1 2004/09/22 22:27:41 taylor Exp $
   */
  public class IFramePortlet extends GenericPortlet
  {
      /**
       * Configuration constants.
       */
      public static final String ENABLE_SOURCE_PREFERENCES_PARAM = "enableSourcePreferences";
      public static final String CUSTOM_SOURCE_PARAM = "customSource";
      public static final String MAXIMIZED_CUSTOM_SOURCE_PARAM = "maximizedCustomSource";
      public static final String EDIT_SOURCE_PARAM = "editSource";
      public static final String MAXIMIZED_EDIT_SOURCE_PARAM = "maximizedEditSource";
      public static final String HELP_SOURCE_PARAM = "helpSource";
      public static final String MAXIMIZED_HELP_SOURCE_PARAM = "maximizedHelpSource";
      public static final String VIEW_SOURCE_PARAM = "viewSource";
      public static final String MAXIMIZED_VIEW_SOURCE_PARAM = "maximizedViewSource";
      public static final String ALIGN_ATTR_PARAM = "align";
      public static final String CLASS_ATTR_PARAM = "class";
      public static final String FRAME_BORDER_ATTR_PARAM = "frameBorder";
      public static final String HEIGHT_ATTR_PARAM = "height";
      public static final String ID_ATTR_PARAM = "id";
      public static final String MARGIN_HEIGHT_ATTR_PARAM = "marginHeight";
      public static final String MARGIN_WIDTH_ATTR_PARAM = "marginWidth";
      public static final String MAXIMIZED_HEIGHT_ATTR_PARAM = "maximizedHeight";
      public static final String MAXIMIZED_SCROLLING_ATTR_PARAM = "maximizedScrolling";
      public static final String MAXIMIZED_STYLE_ATTR_PARAM = "maximizedStyle";
      public static final String MAXIMIZED_WIDTH_ATTR_PARAM = "maximizedWidth";
      public static final String NAME_ATTR_PARAM = "name";
      public static final String SCROLLING_ATTR_PARAM = "scrolling";
      public static final String STYLE_ATTR_PARAM = "style";
      public static final String WIDTH_ATTR_PARAM = "width";
  
      /**
       * Configuration default constants.
       */
      public static final String ALIGN_ATTR_DEFAULT = "BOTTOM";
      public static final String FRAME_BORDER_ATTR_DEFAULT = "0";
      public static final String HEIGHT_ATTR_DEFAULT = "100%";
      public static final String MARGIN_HEIGHT_ATTR_DEFAULT = "0";
      public static final String MARGIN_WIDTH_ATTR_DEFAULT = "0";
      public static final String MAXIMIZED_HEIGHT_ATTR_DEFAULT = "100%";
      public static final String MAXIMIZED_SCROLLING_ATTR_DEFAULT = "AUTO";
      public static final String MAXIMIZED_WIDTH_ATTR_DEFAULT = "100%";
      public static final String SCROLLING_ATTR_DEFAULT = "NO";
      public static final String WIDTH_ATTR_DEFAULT = "100%";
  
      /**
       * Enable source parameter preferences overrides member.
       */
      private boolean enableSourcePreferences;
  
      /**
       * Default IFRAME source attribute members.
       */
      private String defaultCustomSource;
      private String defaultMaximizedCustomSource;
      private String defaultEditSource;
      private String defaultMaximizedEditSource;
      private String defaultHelpSource;
      private String defaultMaximizedHelpSource;
      private String defaultViewSource;
      private String defaultMaximizedViewSource;
  
      /**
       * IFRAME attribute members.
       */
      private String alignAttr;
      private String classAttr;
      private String frameBorderAttr;
      private String heightAttr;
      private String idAttr;
      private String marginHeightAttr;
      private String marginWidthAttr;
      private String maximizedHeightAttr;
      private String maximizedScrollingAttr;
      private String maximizedStyleAttr;
      private String maximizedWidthAttr;
      private String nameAttr;
      private String scrollingAttr;
      private String styleAttr;
      private String widthAttr;
  
      /**
       * Portlet constructor.
       */
      public IFramePortlet()
      {
      }
  
      /**
       * Initialize portlet configuration.
       */
      public void init(PortletConfig config)
          throws PortletException
      {
          super.init(config);
  
          String initParam = config.getInitParameter(ENABLE_SOURCE_PREFERENCES_PARAM);
          if (initParam != null)
              enableSourcePreferences = (new Boolean(initParam)).booleanValue();
  
          defaultCustomSource = config.getInitParameter(CUSTOM_SOURCE_PARAM);
          defaultMaximizedCustomSource = config.getInitParameter(MAXIMIZED_CUSTOM_SOURCE_PARAM);
          defaultEditSource = config.getInitParameter(EDIT_SOURCE_PARAM);
          defaultMaximizedEditSource = config.getInitParameter(MAXIMIZED_EDIT_SOURCE_PARAM);
          defaultHelpSource = config.getInitParameter(HELP_SOURCE_PARAM);
          defaultMaximizedHelpSource = config.getInitParameter(MAXIMIZED_HELP_SOURCE_PARAM);
          defaultViewSource = config.getInitParameter(VIEW_SOURCE_PARAM);
          defaultMaximizedViewSource = config.getInitParameter(MAXIMIZED_VIEW_SOURCE_PARAM);
  
          alignAttr = getAttributeParam(config, ALIGN_ATTR_PARAM, ALIGN_ATTR_DEFAULT);
          classAttr = getAttributeParam(config, CLASS_ATTR_PARAM, null);
          frameBorderAttr = getAttributeParam(config, FRAME_BORDER_ATTR_PARAM, FRAME_BORDER_ATTR_DEFAULT);
          heightAttr = getAttributeParam(config, HEIGHT_ATTR_PARAM, HEIGHT_ATTR_DEFAULT);
          idAttr = getAttributeParam(config, ID_ATTR_PARAM, null);
          marginHeightAttr = getAttributeParam(config, MARGIN_HEIGHT_ATTR_PARAM, MARGIN_HEIGHT_ATTR_DEFAULT);
          marginWidthAttr = getAttributeParam(config, MARGIN_WIDTH_ATTR_PARAM, MARGIN_WIDTH_ATTR_DEFAULT);
          maximizedHeightAttr = getAttributeParam(config, MAXIMIZED_HEIGHT_ATTR_PARAM, MAXIMIZED_HEIGHT_ATTR_DEFAULT);
          maximizedScrollingAttr = getAttributeParam(config, MAXIMIZED_SCROLLING_ATTR_PARAM,
MAXIMIZED_SCROLLING_ATTR_DEFAULT);
          maximizedStyleAttr = getAttributeParam(config, MAXIMIZED_STYLE_ATTR_PARAM, null);
          maximizedWidthAttr = getAttributeParam(config, MAXIMIZED_WIDTH_ATTR_PARAM, MAXIMIZED_WIDTH_ATTR_DEFAULT);
          nameAttr = getAttributeParam(config, NAME_ATTR_PARAM, null);
          scrollingAttr = getAttributeParam(config, SCROLLING_ATTR_PARAM, SCROLLING_ATTR_DEFAULT);
          styleAttr = getAttributeParam(config, STYLE_ATTR_PARAM, null);
          widthAttr = getAttributeParam(config, WIDTH_ATTR_PARAM, WIDTH_ATTR_DEFAULT);
      }
      
      /**
       * Generate IFRAME with custom source.
       */
      public void doCustom(RenderRequest request, RenderResponse response)
          throws PortletException, IOException
      {
          // get IFRAME source
          String source = null;
          if (request.getWindowState().equals(WindowState.MAXIMIZED))
              source = getSourcePreference(request, MAXIMIZED_CUSTOM_SOURCE_PARAM, defaultMaximizedCustomSource);
          if (source == null)
              source = getSourcePreference(request, CUSTOM_SOURCE_PARAM, defaultCustomSource);
          if ((source == null) && request.getWindowState().equals(WindowState.MAXIMIZED))
              source = getSourcePreference(request, MAXIMIZED_VIEW_SOURCE_PARAM, defaultMaximizedViewSource);
          if (source == null)
              source = getSourcePreference(request, VIEW_SOURCE_PARAM, defaultViewSource);
          if (source == null)
              throw new PortletException("IFRAME source not specified for custom portlet mode.");
  
          // render IFRAME content
          doIFrame(request, source, response);
      }
  
      /**
       * Generate IFRAME with edit source.
       */
      public void doEdit(RenderRequest request, RenderResponse response)
          throws PortletException, IOException
      {
          // get IFRAME source
          String source = null;
          if (request.getWindowState().equals(WindowState.MAXIMIZED))
              source = getSourcePreference(request, MAXIMIZED_EDIT_SOURCE_PARAM, defaultMaximizedEditSource);
          if (source == null)
              source = getSourcePreference(request, EDIT_SOURCE_PARAM, defaultEditSource);
          if ((source == null) && request.getWindowState().equals(WindowState.MAXIMIZED))
              source = getSourcePreference(request, MAXIMIZED_VIEW_SOURCE_PARAM, defaultMaximizedViewSource);
          if (source == null)
              source = getSourcePreference(request, VIEW_SOURCE_PARAM, defaultViewSource);
          if (source == null)
              throw new PortletException("IFRAME source not specified for edit portlet mode.");
  
          // render IFRAME content
          doIFrame(request, source, response);
      }
  
      /**
       * Generate IFRAME with help source.
       */
      public void doHelp(RenderRequest request, RenderResponse response)
          throws PortletException, IOException
      {
          // get IFRAME source
          String source = null;
          if (request.getWindowState().equals(WindowState.MAXIMIZED))
              source = getSourcePreference(request, MAXIMIZED_HELP_SOURCE_PARAM, defaultMaximizedHelpSource);
          if (source == null)
              source = getSourcePreference(request, HELP_SOURCE_PARAM, defaultHelpSource);
          if ((source == null) && request.getWindowState().equals(WindowState.MAXIMIZED))
              source = getSourcePreference(request, MAXIMIZED_VIEW_SOURCE_PARAM, defaultMaximizedViewSource);
          if (source == null)
              source = getSourcePreference(request, VIEW_SOURCE_PARAM, defaultViewSource);
          if (source == null)
              throw new PortletException("IFRAME source not specified for help portlet mode.");
  
          // render IFRAME content
          doIFrame(request, source, response);
      }
  
      /**
       * Generate IFRAME with view source.
       */
      public void doView(RenderRequest request, RenderResponse response)
          throws PortletException, IOException
      {
          // get IFRAME source
          String source = null;
          if (request.getWindowState().equals(WindowState.MAXIMIZED))
              source = getSourcePreference(request, MAXIMIZED_VIEW_SOURCE_PARAM, defaultMaximizedViewSource);
          if (source == null)
              source = getSourcePreference(request, VIEW_SOURCE_PARAM, defaultViewSource);
          if (source == null)
              throw new PortletException("IFRAME source not specified for view portlet mode.");
  
          // render IFRAME content
          doIFrame(request, source, response);
      }
  
      /**
       * Render IFRAME content
       */
      protected void doIFrame(RenderRequest request, String sourceAttr, RenderResponse response)
          throws IOException
      {
          // generate HTML IFRAME content
          StringBuffer content = new StringBuffer(4096);
          content.append("<IFRAME");
          content.append(" SRC=\"").append(sourceAttr).append("\"");
          if (alignAttr != null)
              content.append(" ALIGN=\"").append(alignAttr).append("\"");
          if (classAttr != null)
              content.append(" CLASS=\"").append(classAttr).append("\"");
          if (frameBorderAttr != null)
              content.append(" FRAMEBORDER=\"").append(frameBorderAttr).append("\"");
          if (idAttr != null)
              content.append(" ID=\"").append(idAttr).append("\"");
          if (marginHeightAttr != null)
              content.append(" MARGINHEIGHT=\"").append(marginHeightAttr).append("\"");
          if (marginWidthAttr != null)
              content.append(" MARGINWIDTH=\"").append(marginWidthAttr).append("\"");
          if (nameAttr != null)
              content.append(" NAME=\"").append(nameAttr).append("\"");
          if (request.getWindowState().equals(WindowState.MAXIMIZED))
          {
              if (maximizedHeightAttr != null)
                  content.append(" HEIGHT=\"").append(maximizedHeightAttr).append("\"");
              if (maximizedScrollingAttr != null)
                  content.append(" SCROLLING=\"").append(maximizedScrollingAttr).append("\"");
              if (maximizedStyleAttr != null)
                  content.append(" STYLE=\"").append(maximizedStyleAttr).append("\"");
              if (maximizedWidthAttr != null)
                  content.append(" WIDTH=\"").append(maximizedWidthAttr).append("\"");
          }
          else
          {
              if (heightAttr != null)
                  content.append(" HEIGHT=\"").append(heightAttr).append("\"");
              if (scrollingAttr != null)
                  content.append(" SCROLLING=\"").append(scrollingAttr).append("\"");
              if (styleAttr != null)
                  content.append(" STYLE=\"").append(styleAttr).append("\"");
              if (widthAttr != null)
                  content.append(" WIDTH=\"").append(widthAttr).append("\"");
          }
          content.append(">");
          content.append("<P STYLE=\"textAlign:center\"><A HREF=\"").append(sourceAttr).append("\">").append(sourceAttr).append("</A></P>");
          content.append("</IFRAME>");
  
          // set required content type and write HTML IFRAME content
          response.setContentType("text/html");
          response.getWriter().print(content.toString());
      }
  
      /**
       * Get IFRAME attribute parameter.
       */
      private String getAttributeParam(PortletConfig config, String name, String defaultValue)
      {
          String value = config.getInitParameter(name);
          if (value == null)
              value = defaultValue;
          return (((value != null) && (value.length() > 0) && ! value.equalsIgnoreCase("none"))
? value : null);
      }
  
      /**
       * Get IFRAME source preference value if enabled.
       */
      private String getSourcePreference(RenderRequest request, String name, String defaultValue)
      {
          if (! enableSourcePreferences)
              return defaultValue;
          PortletPreferences prefs = request.getPreferences();
          return ((prefs != null) ? prefs.getValue(name, defaultValue) : defaultValue);
      }
  }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jetspeed-dev-help@jakarta.apache.org


Mime
View raw message