Package org.apache.pluto.om.common

Examples of org.apache.pluto.om.common.Parameter


       
        // SECURITY filtering
        String uniqueName = pa.getName() + "::" + portlet.getName();
        if (securityAccessController.checkPortletAccess(portlet, JetspeedActions.MASK_VIEW))
        {
            Parameter param = portlet.getInitParameterSet().get(PORTLET_ICON);
            String image;
            if (param != null)
            {               
                //String relativeImagePath = param.getValue();
                //String context = muta.getWebApplicationDefinition().getContextRoot();
                // Have to use a supported icon in jetspeed, otherwise image can be out of skew
                String  imagePath = param.getValue();
                if (imagePath == null)
                {
                    image = DEFAULT_IMAGES[rand.nextInt(DEFAULT_IMAGES.length)];
                }
                else
                {
                    if (-1 == imagePath.indexOf("/"))
                        image = "images/portlets/" + param.getValue();
                    else
                        image = param.getValue();
                }
            }
            else
            {
                image = DEFAULT_IMAGES[rand.nextInt(DEFAULT_IMAGES.length)];
View Full Code Here


                    if ( portletDef != null )
                    {
                      paramSet = portletDef.getInitParameterSet();
                      if ( paramSet != null )
                      {
                        Parameter sizesParam = paramSet.get( "sizes" );
                        sizesVal = ( sizesParam == null ) ? null : sizesParam.getValue();
                      }
                    }
          }
        }
        if ( sizesVal != null && sizesVal.length() > 0 )
        {
          if ( fragSizes != null )
            fragSizes.put( layoutFragment.getId(), sizesVal );
         
        int sepPos = -1, startPos = 0, sizesLen = sizesVal.length();
        columnCount = 0;
        do
        {
          sepPos = sizesVal.indexOf( ',', startPos );
          if ( sepPos != -1 )
          {
            if ( sepPos > startPos )
              columnCount++;
            startPos = sepPos +1;
          }
          else if ( startPos < sizesLen )
          {
            columnCount++;
          }
        } while ( startPos < sizesLen && sepPos != -1 );
        if ( ! suppressErrorLogging && columnCount <= 0 )
          log.error( "getColumnCountAndSizes invalid columnCount - " + layoutFragment.getId() + " / " + layoutName + " count=" + columnCount + " sizes=" + sizesVal );
      }
      else if ( paramSet == null )
      {
        if ( ! suppressErrorLogging )
        {
          if ( layoutName == null )
            log.error( "getColumnCountAndSizes null sizes, null layoutName - " + layoutFragment.getId() );
          else if ( portletDef == null )
            log.error( "getColumnCountAndSizes null sizes, null PortletDefinition - " + layoutFragment.getId() + " / " + layoutName );
          else
            log.error( "getColumnCountAndSizes null sizes, null ParameterSet - " + layoutFragment.getId() + " / " + layoutName );
        }
      }
      else
      {
        Parameter colsParam = paramSet.get( "columns" );
        String colsParamVal = ( colsParam == null ) ? null : colsParam.getValue();
        if ( colsParamVal != null && colsParamVal.length() > 0 )
        {
          try
          {
            columnCount = Integer.parseInt( colsParamVal );
View Full Code Here

       
        // SECURITY filtering
        String uniqueName = pa.getName() + "::" + portlet.getName();
        if (securityAccessController.checkPortletAccess(portlet, JetspeedActions.MASK_VIEW))
        {
            Parameter param = portlet.getInitParameterSet().get(PORTLET_ICON);
            String image;
            if (param != null)
            {               
                //String relativeImagePath = param.getValue();
                //String context = muta.getWebApplicationDefinition().getContextRoot();
                // Have to use a supported icon in jetspeed, otherwise image can be out of skew
                String  imagePath = param.getValue();
                if (imagePath == null)
                {
                    image = DEFAULT_IMAGES[rand.nextInt(DEFAULT_IMAGES.length)];
                }
                else
                {
                    if (-1 == imagePath.indexOf("/"))
                        image = "images/portlets/" + param.getValue();
                    else
                        image = param.getValue();
                }
            }
            else
            {
                image = DEFAULT_IMAGES[rand.nextInt(DEFAULT_IMAGES.length)];
View Full Code Here

                
            // SECURITY filtering
            String uniqueName = pa.getName() + "::" + portlet.getName();
            if (securityAccessController.checkPortletAccess(portlet, JetspeedActions.MASK_VIEW))
            {
                Parameter param = portlet.getInitParameterSet().get(PORTLET_ICON);
                String image;
                if (param != null)
                {
                    //String relativeImagePath = param.getValue();
                    //String context = muta.getWebApplicationDefinition().getContextRoot();
                    // Have to use a supported icon in jetspeed, otherwise image can be out of skew
                    image = "images/portlets/" + param.getValue();
                }
                else
                {                                       
                    image = "images/portlets/applications-internet.png";
                }               
View Full Code Here

        {
            throw new IllegalArgumentException("Required parameter name is null");
        }
        //if (log.isDebugEnabled()) log.debug("Getting init parameter for: " + name);
        ParameterSet parameters = portletDefinition.getInitParameterSet();
        Parameter param = parameters.get(name);

        if (param != null)
        {
            // if (log.isDebugEnabled()) log.debug("Param: [[name," + name + "], [value, " + param.getValue() + "]]");
            return param.getValue();
        }

        return null;
    }
View Full Code Here

            iParamSet = this.portletWindow.getPortletEntity().getPortletDefinition().getInitParameterSet();
            this.initParamSet = iParamSet;
        }
        if ( iParamSet != null )
        {
            Parameter initParam = iParamSet.get( name );
            if ( initParam != null )
            {
                return initParam.getValue();
            }
        }
        return null;
    }
View Full Code Here

          {
            // logic below is copied from org.apache.jetspeed.portlets.MultiColumnPortlet
            PortletDefinition portletDef = registry.getPortletDefinitionByUniqueName( layoutName );
                   
            ParameterSet paramSet = portletDef.getInitParameterSet();
            Parameter sizesParam = paramSet.get( "sizes" );
            String sizesParamVal = ( sizesParam == null ) ? null : sizesParam.getValue();
            if ( sizesParamVal != null && sizesParamVal.length() > 0 )
            {
              fragSizes.put( frag.getId(), sizesParamVal );
              //log.info( "GetPageAction settings sizes for " + frag.getId() + " to " + sizesParamVal);
            }
            else
            {
              Parameter colsParam = paramSet.get( "columns" );
              String colsParamVal = ( colsParam == null ) ? null : colsParam.getValue();
              if ( colsParamVal != null && colsParamVal.length() > 0 )
              {
                int cols = 0;
                try
                {
                  cols = Integer.parseInt( colsParamVal );
                }
                catch ( NumberFormatException ex )
                {
                }
                if ( cols < 1 )
                {
                  cols = 2;
                }
                switch (cols)
                      {
                        case 1: sizesParamVal = "100%"; break;
                        case 2: sizesParamVal = "50%,50%"; break;
                        case 3: sizesParamVal = "34%,33%,33%"; break;
                        default: sizesParamVal = "50%,50%"; break;
                      }
                fragSizes.put( frag.getId(), sizesParamVal );
                //log.info( "GetPageAction defaulting sizes for " + frag.getId() + " to " + sizesParamVal);
              }
            }
          }
        }
        List childFragments = frag.getFragments();
        if ( childFragments != null )
        {
          Iterator childFragIter = childFragments.iterator();
          while ( childFragIter.hasNext() )
          {
            Fragment childFrag = (Fragment)childFragIter.next();
                    retrieveFragmentSpecialProperties( requestContext, childFrag, fragSizes, portletIcons );
          }
        }
      }
        else if ( portletIcons != null && "portlet".equals( frag.getType() ) )
        {   // get portlet icon and locale specific portlet display name
            String portletName = frag.getName();
            if ( portletName != null && portletName.length() > 0 )
            {
                PortletDefinition portletDef = registry.getPortletDefinitionByUniqueName( portletName );
               
                if ( portletDef != null && portletIcons != null )
                {
                    ParameterSet paramSet = portletDef.getInitParameterSet();
                    Parameter iconParam = paramSet.get( "portlet-icon" );
                    String iconParamVal = ( iconParam == null ) ? null : iconParam.getValue();
                    if ( iconParamVal != null && iconParamVal.length() > 0 )
                    {
                        portletIcons.put( frag.getId(), iconParamVal );
                    }
                }
View Full Code Here

    public Parameter get(String name)
    {
        Iterator itr = innerCollection.iterator();
        while (itr.hasNext())
        {
            Parameter p = (Parameter) itr.next();
            if (p.getName().equals(name))
            {
                return p;
            }
        }
View Full Code Here

     * @see org.apache.pluto.om.common.ParameterSetCtrl#remove(java.lang.String)
     */
    public Parameter remove(String name)
    {
        Iterator itr = innerCollection.iterator();
        Parameter removeMe = null;
        while (itr.hasNext())
        {
            Parameter p = (Parameter) itr.next();
            if (p.getName().equals(name))
            {
                removeMe = p;
                break;
            }
        }
View Full Code Here

    /**
     * @see java.util.Collection#remove(java.lang.Object)
     */
    public boolean remove(Object o)
    {
        Parameter p = (Parameter) o;

        return innerCollection.remove(p);
    }
View Full Code Here

TOP

Related Classes of org.apache.pluto.om.common.Parameter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.