Package org.apache.jetspeed.om.portlet

Examples of org.apache.jetspeed.om.portlet.InitParam


        d4.setDescription("Mon Filtre 1");
        DisplayName dn3 = filter.addDisplayName("en");
        dn3.setDisplayName("This is my filter 1");
        DisplayName dn4 = filter.addDisplayName("fr");
        dn4.setDisplayName("Ceci est mon filtre 1");
        InitParam ip3 = filter.addInitParam("filter init param 1");
        ip3.setParamValue("value for filter init param 1");
        InitParam ip4 = filter.addInitParam("filter init param 2");
        ip4.setParamValue("value for filter init param 2");
        filter.addLifecycle("lifecycle-1");
        filter.addLifecycle("lifecycle-2");
        filter.addLifecycle("lifecycle-3");
       
        FilterMapping mapping1 = app.addFilterMapping("filter-1");
View Full Code Here


        DisplayName dn4 = dnames.get(1);       
        assertEquals(dn4.getLang(), "fr");
        assertEquals(dn4.getDisplayName(), "Ceci est mon filtre 1");
        List<InitParam> iparams = filter.getInitParams();       
        assertEquals(iparams.size(), 2);       
        InitParam ip3 = iparams.get(0);
        assertEquals(ip3.getParamName(),"filter init param 1");
        assertEquals(ip3.getParamValue(), "value for filter init param 1");
        InitParam ip4 = iparams.get(1);
        assertEquals(ip4.getParamName(), "filter init param 2");
        assertEquals(ip4.getParamValue(), "value for filter init param 2");
        List<String> lcycles = filter.getLifecycles();       
        assertEquals(lcycles.size(), 3);       
        assertEquals(lcycles.get(0), "lifecycle-1");
        assertEquals(lcycles.get(1), "lifecycle-2");
        assertEquals(lcycles.get(2), "lifecycle-3");       
View Full Code Here

        PortletDefinition portlet = app.addPortlet("Portlet 1");
        portlet.setPortletClass("org.apache.Portlet");
        portlet.addDescription(lang).setDescription("Portlet description.");
        portlet.addDisplayName(lang).setDisplayName("Portlet display Name.");

        InitParam initParam = portlet.addInitParam("testparam");
        initParam.setParamValue("test value");
        initParam.addDescription(lang).setDescription("This is a test portlet parameter");

        addDublinCore(portlet.getMetadata());

        Preferences prefs = portlet.getPortletPreferences();
        Preference pref = prefs.addPreference("preference 1");
View Full Code Here

            copyDesc.setDescription(desc.getDescription());
        }

        for (InitParam initParam : source.getInitParams())
        {
            InitParam copyInitParam = copy.addInitParam(initParam.getParamName());
            copyInitParam.setParamValue(initParam.getParamValue());
           
            for (Description desc : initParam.getDescriptions())
            {
                Description copyDesc = copyInitParam.addDescription(desc.getLang());
                copyDesc.setDescription(desc.getDescription());
            }
        }
       
        for (EventDefinitionReference eventDefRef : source.getSupportedProcessingEvents())
View Full Code Here

        PortletDefinition portlet = app.addPortlet("Portlet 1");
        portlet.setPortletClass("org.apache.Portlet");
        portlet.addDescription(lang).setDescription("Portlet description.");
        portlet.addDisplayName(lang).setDisplayName("Portlet display Name.");

        InitParam initParam = portlet.addInitParam("testparam");
        initParam.setParamValue("test value");
        initParam.addDescription(lang).setDescription("This is a test portlet parameter");

        addDublinCore(portlet.getMetadata());

        Preferences prefs = portlet.getPortletPreferences();
        Preference pref = prefs.addPreference("preference 1");
View Full Code Here

          {
            // logic below is copied from org.apache.jetspeed.portlets.MultiColumnPortlet
            portletDef = registry.getPortletDefinitionByUniqueName( layoutName, true );
                    if ( portletDef != null )
                    {
                        InitParam sizesParam = portletDef.getInitParam( "sizes" );
                        sizesVal = ( sizesParam == null ) ? null : sizesParam.getParamValue();
                    }
          }
        }
        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 ( portletDef == null || portletDef.getInitParams().isEmpty() )
      {
        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
      {
        InitParam colsParam = portletDef.getInitParam( "columns" );
        String colsParamVal = ( colsParam == null ) ? null : colsParam.getParamValue();
        if ( colsParamVal != null && colsParamVal.length() > 0 )
        {
          try
          {
            columnCount = Integer.parseInt( colsParamVal );
View Full Code Here

                DisplayName jdn = jf.addDisplayName(dn.getLang());
                jdn.setDisplayName(dn.getDisplayName());
            }
            for (org.apache.pluto.container.om.portlet.InitParam ip : f.getInitParams())
            {
                InitParam jip = jf.addInitParam(ip.getParamName());
                jip.setParamValue(ip.getParamValue());
                for (org.apache.pluto.container.om.portlet.Description desc : ip.getDescriptions())
                {
                    Description jdesc = jip.addDescription(desc.getLang());
                    jdesc.setDescription(desc.getDescription());
                }                                       
            }
            for (String lc : f.getLifecycles())
            {
View Full Code Here

            DisplayName jdn = jpd.addDisplayName(dn.getLang());
            jdn.setDisplayName(dn.getDisplayName());
        }
        for (org.apache.pluto.container.om.portlet.InitParam ip : pd.getInitParams())
        {
            InitParam jip = jpd.addInitParam(ip.getParamName());
            jip.setParamValue(ip.getParamValue());
            for (org.apache.pluto.container.om.portlet.Description desc : ip.getDescriptions())
            {
                Description jdesc = jip.addDescription(desc.getLang());
                jdesc.setDescription(desc.getDescription());
            }                                       
        }
        for (org.apache.pluto.container.om.portlet.SecurityRoleRef srr : pd.getSecurityRoleRefs())
        {
View Full Code Here

        PortletRegistry portletRegistry;
        Mock portletDefMock;
        PortletDefinition portletDef;

        Mock portletSizesParamMock;
        InitParam portletSizesParam;
       
        portletRegistryMock = new Mock(PortletRegistry.class);
        portletRegistry = (PortletRegistry) portletRegistryMock.proxy();
       
        portletDefMock = new Mock(PortletDefinition.class);
View Full Code Here

       
        // SECURITY filtering
        String uniqueName = pa.getName() + "::" + portlet.getPortletName();
        if (securityAccessController.checkPortletAccess(portlet, JetspeedActions.MASK_VIEW))
        {
            InitParam param = portlet.getInitParam(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.getParamValue();
                if (imagePath == null)
                {
                    image = DEFAULT_IMAGES[rand.nextInt(DEFAULT_IMAGES.length)];
                }
                else
                {
                    if (-1 == imagePath.indexOf("/"))
                        image = "images/portlets/" + param.getParamValue();
                    else
                        image = param.getParamValue();
                }
            }
            else
            {
                image = DEFAULT_IMAGES[rand.nextInt(DEFAULT_IMAGES.length)];
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.om.portlet.InitParam

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.