Package org.apache.jetspeed.om.portlet

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


            {
                try
                {
                    PortletRegistry registry = ((AbstractAdminWebApplication) getApplication()).getServiceLocator().getPortletRegistry();
                    PortletApplication app = registry.getPortletApplication(paNodeBean.getApplicationName());
                    PortletDefinition def = null;
                   
                    if (paNodeBean.getName() != null)
                    {
                        def = app.getPortlet(paNodeBean.getName());
                    }
                   
                    if (newName != null && newValue != null && newLocale != null)
                    {
                        GenericMetadata metadata = (def == null ? app.getMetadata() : def.getMetadata());
                        LocalizedFieldBean fieldBean = new LocalizedFieldBean(metadata.createLocalizedField());
                        fieldBean.setName(newName);
                        fieldBean.setLocaleString(newLocale);
                        fieldBean.setValue(newValue);
                        metadata.addField(fieldBean.getLocalizedField());
View Full Code Here


    @Override
    public void delete(IModel<LocalizedFieldBean>[] fieldBeans)
    {
        PortletRegistry registry = ((AbstractAdminWebApplication) getApplication()).getServiceLocator().getPortletRegistry();
        PortletApplication app = registry.getPortletApplication(paNodeBean.getApplicationName());
        PortletDefinition def = null;
       
        if (paNodeBean.getName() != null)
        {
            def = app.getPortlet(paNodeBean.getName());
        }
       
        GenericMetadata metadata = (def == null ? app.getMetadata() : def.getMetadata());

        for (Iterator<LocalizedField> it = metadata.getFields().iterator(); it.hasNext(); )
        {
            LocalizedFieldBean tempBean = new LocalizedFieldBean(it.next());
           
View Full Code Here

    @Override
    public Iterator<IModel<LocalizedFieldBean>> getItemModels()
    {
        JetspeedServiceLocator locator = ((AbstractAdminWebApplication) getApplication()).getServiceLocator();
        PortletApplication app = locator.getPortletRegistry().getPortletApplication(paNodeBean.getApplicationName());
        PortletDefinition def = null;
       
        if (paNodeBean.getName() != null)
        {
            def = app.getPortlet(paNodeBean.getName());
        }
       
        List<IModel<LocalizedFieldBean>> list = new ArrayList<IModel<LocalizedFieldBean>>();
        GenericMetadata metadata = (def == null ? app.getMetadata() : def.getMetadata());

        for (LocalizedField field : metadata.getFields())
        {
            list.add(new LocalizedFieldBeanModel(locator, paNodeBean, new LocalizedFieldBean(field)));
        }
View Full Code Here

                            {
                                paName = (String)pa;
                            }
                        }
                        name = paName + "::" + id;
                        PortletDefinition pd = serviceLocator.getPortletRegistry().getPortletDefinitionByUniqueName(name);
                        if (pd != null)
                        {
                            searchResults.add(new PortletDefinitionBean(pd, paName, locale));
                        }                       
                    }
View Full Code Here

    protected void doPreview(RenderRequest request, RenderResponse response) throws PortletException, IOException
    {
        String previewImage = "";
       
        RequestContext rc = (RequestContext) request.getAttribute(RequestContext.REQUEST_PORTALENV);
        PortletDefinition def = rc.getCurrentPortletWindow().getPortletDefinition();
        Collection<LocalizedField> colMetaData = null;
       
        if (def != null)
        {
            colMetaData = def.getMetadata().getFields(PortalReservedParameters.PORTLET_EXTENDED_DESCRIPTOR_PREVIEW_IMAGE);
        }
       
        if (colMetaData != null && !colMetaData.isEmpty())
        {
            previewImage = def.getApplication().getContextPath() + colMetaData.iterator().next().getValue();
        }
       
        request.setAttribute("previewImage", previewImage);
       
        String previewPage = this.defaultPreviewPage;
View Full Code Here

        Map portlets = new HashMap();
        while (outOfService.hasNext())
        {
            PortletWindow window = (PortletWindow)outOfService.next();
            String id = window.getId().toString();
            PortletDefinition pd = window.getPortletDefinition();
            String uniqueName = pd.getUniqueName();
            if (!portlets.containsKey(uniqueName))
            {
                portlets.put(uniqueName, id);
                result.add(pd);             
            }
View Full Code Here

   
    @Override
    protected DisplayNameBean load()
    {
        PortletApplication app = locator.getPortletRegistry().getPortletApplication(paNodeBean.getApplicationName());
        PortletDefinition def = app.getPortlet(paNodeBean.getName());
        DisplayName displayName = def.getDisplayName(locale);
        return new DisplayNameBean(displayName);
    }
View Full Code Here

               
                try
                {
                    PortletRegistry registry = ((AbstractAdminWebApplication) getApplication()).getServiceLocator().getPortletRegistry();
                    PortletApplication app = registry.getPortletApplication(paNodeBean.getApplicationName());
                    PortletDefinition def = app.getPortlet(paNodeBean.getName());
                   
                    if (newTitle != null && newShortTitle != null && newKeywords != null && newLocale != null)
                    {
                        Locale locale = new Locale(newLocale);
                        Language newLanguage = def.addLanguage(locale);
                        newLanguage.setTitle(newTitle);
                        newLanguage.setShortTitle(newShortTitle);
                        newLanguage.setKeywords(newKeywords);

                        newTitle = null;
View Full Code Here

            PortletWindow portletWindow = requestContext.getPortletWindow(fragment);
            if (!portletWindow.isValid())
            {
                return null;
            }
            PortletDefinition portletDefinition = portletWindow.getPortletDefinition();    

            long timeoutMetadata = this.getTimeoutOnJob(portletDefinition);
            portletTracking.setExpiration(portletWindow, timeoutMetadata);           
           
            if (checkSecurityConstraints && !checkSecurityConstraint(portletDefinition, fragment))
            {
                throw new PortletAccessDeniedException("Access Denied.");
            }
            if (portletTracking.isOutOfService(portletWindow))
            {
                log.info("Taking portlet out of service: " + portletDefinition.getUniqueName() + " for window " + portletWindow.getId());
                fragment.overrideRenderedContent(outOfServiceMessage);
                return null;
            }
            int expirationCache = getExpirationCache(portletDefinition);
            if (expirationCache != 0)
View Full Code Here

        PortletWindow window = requestContext.getPortletWindow(fragment);
        if (!window.isValid())
        {
            return fragmentSupportsActions; // allow nothing
        }
        PortletDefinition portlet = window.getPortletDefinition();

        List actions = Collections.EMPTY_LIST;
       
        PortletMode currentMode = requestContext.getPortalURL().getNavigationalState().getMode(window);
        WindowState currentState = requestContext.getPortalURL().getNavigationalState().getState(window);
        List<Supports> supports = portlet.getSupports();
       
        if ( fragment.equals(requestContext.getPage().getRootFragment()) )
        {
            fragmentSupportsActions = true;
            actions = getPageModes(requestContext, window, supports, currentMode, currentState, pageActionAccess, decoration, isAjaxRequest);
        }
        else if ( !Fragment.LAYOUT.equals(fragment.getType()) )
        {
            fragmentSupportsActions = true;
            String fragmentId = fragment.getId();
            PortletApplication pa = window.getPortletDefinition().getApplication();

            String portletName = portlet.getUniqueName();

            PortletMode currentMappedMode = pa.getMappedPortletMode(currentMode);
            WindowState currentMappedState = pa.getMappedWindowState(currentState);

            Object action;
View Full Code Here

TOP

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

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.