Package org.apache.jetspeed.om.portlet

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


        if (StringUtils.isBlank(sizes))
        {
            if (portletRegistry != null)
            {
                PortletDefinition layoutPortletDef = portletRegistry.getPortletDefinitionByUniqueName(layoutFragment.getName(), true);
                InitParam initParam = layoutPortletDef.getInitParam("sizes");
               
                if (initParam != null)
                {
                    sizes = initParam.getParamValue();
                }
                else
                {
                    initParam = layoutPortletDef.getInitParam("columns");
                   
                    if (initParam != null)
                    {
                        return Integer.parseInt(initParam.getParamValue());
                    }
                }
            }
        }
       
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
                    image = "images/portlets/" + param.getParamValue();
                }
                else
                {                                       
                    image = "images/portlets/applications-internet.png";
                }
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( getId( layoutFragment ), 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 - " + getId( layoutFragment ) + " / " + layoutName + " count=" + columnCount + " sizes=" + sizesVal );
                }
            }
            else if ( portletDef == null || portletDef.getInitParams().isEmpty() )
            {
                if ( ! suppressErrorLogging )
                {
                    if ( layoutName == null )
                    {
                        log.error( "getColumnCountAndSizes null sizes, null layoutName - " + getId( layoutFragment ) );
                    }
                    else if ( portletDef == null )
                    {
                        log.error( "getColumnCountAndSizes null sizes, null PortletDefinition - " + getId( layoutFragment ) + " / " + layoutName );
                    }
                    else
                    {
                        log.error( "getColumnCountAndSizes null sizes, null ParameterSet - " + getId( layoutFragment ) + " / " + 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

        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

            {
                PortletDefinition portletDef = registry.getPortletDefinitionByUniqueName( portletName, true );
               
                if ( portletDef != null && portletIcons != null )
                {
                    InitParam iconParam = portletDef.getInitParam("portlet-icon");
                    String iconParamVal = ( iconParam == null ) ? null : iconParam.getParamValue();
                    if ( iconParamVal != null && iconParamVal.length() > 0 )
                    {
                        portletIcons.put( frag.getId(), iconParamVal );
                    }
                }
View Full Code Here

        String portletIcon = null;
        PortletWindow window = context.getPortletWindow(windowId);
       
        if (window != null && window.getPortletDefinition() != null)
        {
            InitParam portletIconInitParam = window.getPortletDefinition().getInitParam("portlet-icon");
           
            if (portletIconInitParam != null)
            {
                portletIcon = portletIconInitParam.getParamValue();
            }
        }
       
        return (portletIcon != null ? portletIcon : defaultPortletIcon);
    }
View Full Code Here

        PortletDefinition portlet = app.addPortlet(portletName);
        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

        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");

        Preferences prefs = portlet.getPortletPreferences();
        Preference pref = prefs.addPreference("preference 1");
        pref.addValue("value 1");
        pref.addValue("value 2");
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.