Package org.apache.pluto.om.common

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


                desc.setDescription("Automated generated Portlet Wrapper");
                desc.setLocale(Locale.ENGLISH);
                DescriptionSetImpl descSet = new DescriptionSetImpl();
                descSet.add(desc);
                servletCtrl.setDescriptions(descSet);
                ParameterSet parameters = servlet.getInitParameterSet();

                ParameterSetCtrl parameterSetCtrl =
                    (ParameterSetCtrl) controllerFactory.get(parameters);

                Parameter parameter1 = parameters.get("portlet-class");
                if (parameter1 == null) {
                    parameterSetCtrl.add(
                        "portlet-class",
                        portlet.getClassName());
                } else {
                    ParameterCtrl parameterCtrl =
                        (ParameterCtrl) controllerFactory.get(parameter1);
                    parameterCtrl.setValue(portlet.getClassName());

                }
                Parameter parameter2 = parameters.get("portlet-guid");
                if (parameter2 == null) {
                    parameterSetCtrl.add(
                        "portlet-guid",
                        portlet.getId().toString());
                } else {
View Full Code Here


            IconImpl icon = getIcon(filterE);
            String filterName = XML.getChildElementText(filterE, "filter-name");
            DisplayNameSet displayNames = getDisplayNames(filterE);
            DescriptionSet descriptions = getDescriptions(filterE);
            String filterClass = XML.getChildElementText(filterE, "filter-class");
            ParameterSet initParameters = getParameters(filterE, "init-param");
            FilterImpl filter = new FilterImpl();
            filter.setIcon(icon);
            filter.setFilterName(filterName);
            filter.setDisplayNames(displayNames);
            filter.setDescriptions(descriptions);
View Full Code Here

                desc.setDescription("Automated generated Portlet Wrapper");
                desc.setLocale(Locale.getDefault());
                DescriptionSetImpl descSet = new DescriptionSetImpl();
                descSet.add(desc);
                servletCtrl.setDescriptions(descSet);
                ParameterSet parameters = servlet.getInitParameterSet();

                ParameterSetCtrl parameterSetCtrl = (ParameterSetCtrl)controllerFactory.get(parameters);

                Parameter parameter1 = parameters.get("portlet-class");
                if (parameter1 == null) {
                    parameterSetCtrl.add("portlet-class", portlet.getClassName());
                } else {
                    ParameterCtrl parameterCtrl = (ParameterCtrl)controllerFactory.get(parameter1);
                    parameterCtrl.setValue(portlet.getClassName());

                }
                Parameter parameter2 = parameters.get("portlet-guid");
                if (parameter2 == null) {
                    parameterSetCtrl.add("portlet-guid", portlet.getId().toString());
                } else {
                    ParameterCtrl parameterCtrl = (ParameterCtrl)controllerFactory.get(parameter2);
                    parameterCtrl.setValue(portlet.getId().toString());
View Full Code Here

        if ( name == null )
        {
            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();
View Full Code Here

        Mock portletRegistryMock;
        PortletRegistry portletRegistry;
        Mock portletDefMock;
        PortletDefinitionComposite portletDef;
        Mock portletDefInitParamsMock;
        ParameterSet portletDefInitParams;

        Mock portletSizesParamMock;
        Parameter portletSizesParam;
       
        portletRegistryMock = new Mock(PortletRegistry.class);
View Full Code Here

        assertTrue(
            "Portlet.DisplayName invalid: " + displayName.getDisplayName(),
            displayName.getDisplayName().equals("HelloWorld Portlet Wrapper"));

        // Init Parameters
        ParameterSet paramsList = portlet.getInitParameterSet();
        Iterator it = paramsList.iterator();
        int count = 0;
        while (it.hasNext())
        {
            ParameterComposite parameter = (ParameterComposite) it.next();
            assertTrue("InitParam.Name invalid: " + parameter.getName(), parameter.getName().equals("hello"));
View Full Code Here

        return new PortletPreferencesImpl(org.apache.pluto.Constants.METHOD_NOOP, this.portletWindow.getPortletEntity());
    }
   
    public String getInitParameter( String name )
    {
        ParameterSet iParamSet = this.initParamSet;
        if ( iParamSet == null )
        {
            iParamSet = this.portletWindow.getPortletEntity().getPortletDefinition().getInitParameterSet();
            this.initParamSet = iParamSet;
        }
        if ( iParamSet != null )
        {
            Parameter initParam = iParamSet.get( name );
            if ( initParam != null )
            {
                return initParam.getValue();
            }
        }
View Full Code Here

          if ( layoutName != null && layoutName.length() > 0 )
          {
            // 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

                desc.setDescription("Automated generated Portlet Wrapper");
                desc.setLocale(Locale.ENGLISH);
                DescriptionSetImpl descSet = new DescriptionSetImpl();
                descSet.add(desc);
                servletCtrl.setDescriptions(descSet);
                ParameterSet parameters = servlet.getInitParameterSet();

                ParameterSetCtrl parameterSetCtrl =
                    (ParameterSetCtrl) controllerFactory.get(parameters);

                Parameter parameter1 = parameters.get("portlet-class");
                if (parameter1 == null) {
                    parameterSetCtrl.add(
                        "portlet-class",
                        portlet.getClassName());
                } else {
                    ParameterCtrl parameterCtrl =
                        (ParameterCtrl) controllerFactory.get(parameter1);
                    parameterCtrl.setValue(portlet.getClassName());

                }
                Parameter parameter2 = parameters.get("portlet-guid");
                if (parameter2 == null) {
                    parameterSetCtrl.add(
                        "portlet-guid",
                        portlet.getId().toString());
                } else {
View Full Code Here

    else
      {   // get layout fragment sizes
        String sizesVal = layoutFragment.getProperty( "sizes" );
        String layoutName = layoutFragment.getName();
        layoutName = ( (layoutName != null && layoutName.length() > 0) ? layoutName : (String)null );
        ParameterSet paramSet = null;
        PortletDefinition portletDef = null;
        if ( sizesVal == null || sizesVal.length() == 0 )
        {
          if ( layoutName != null )
          {
            // logic below is copied from org.apache.jetspeed.portlets.MultiColumnPortlet
            portletDef = registry.getPortletDefinitionByUniqueName( layoutName );
                    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
          {
View Full Code Here

TOP

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

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.