Package org.apache.pluto.om.common

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


                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


    }
   
    private void addParameters(Element parent, String paramElementName, ParameterSetImpl parameters) {
        if (parameters != null && parameters.size() > 0) {
            for (Iterator iter = parameters.iterator(); iter.hasNext();) {
                Parameter parameter = (Parameter)iter.next();
                Document doc = parent.getOwnerDocument();
                Element paramE = doc.createElement(paramElementName);
                addTextElement(paramE, "param-name", parameter.getName());
                addTextElement(paramE, "param-value", parameter.getValue());
                Description paramDescription = parameter.getDescription(Locale.getDefault());
                if (paramDescription != null) {
                    addTextElement(paramE, "description", paramDescription.getDescription());
                }           
                parent.appendChild(paramE);
            }
View Full Code Here

                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

        {
            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

        PortletDefinitionComposite portletDef;
        Mock portletDefInitParamsMock;
        ParameterSet portletDefInitParams;

        Mock portletSizesParamMock;
        Parameter portletSizesParam;
       
        portletRegistryMock = new Mock(PortletRegistry.class);
        portletRegistry = (PortletRegistry) portletRegistryMock.proxy();
       
        portletDefMock = new Mock(PortletDefinitionComposite.class);
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

       
        // 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

          {
            // 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

       
        // 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

                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

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.