Package org.apache.jetspeed.fusion.portal.portlets

Examples of org.apache.jetspeed.fusion.portal.portlets.JetspeedFusionPortlet


       
        if (!(real instanceof JetspeedFusionPortlet))
        {
            return super.buildActionList(rundata, portlet);
        }
        JetspeedFusionPortlet fusion = (JetspeedFusionPortlet)real;
       
        List actions = new Vector();
        JetspeedRunData jdata = (JetspeedRunData)rundata;

        // disable actions option
        if (JetspeedSecurity.areActionsDisabledForAllUsers())
        {
            return actions;
        }
        JetspeedUser user = jdata.getJetspeedUser();
        if (JetspeedSecurity.areActionsDisabledForAnon() && false == user.hasLoggedIn())
        {
            return actions;
        }

        // the portlet is state aware
        PortletState state = (PortletState)portlet;
               
        String entityId = instance.getAttribute(J2_ENTITY, "");
        serviceNavsPipeline(rundata, entityId);
       
        String pa = getPortletConfig().getInitParameter(PORTLET_APPLICATION_NAME, null);
        String pd = getPortletConfig().getInitParameter(PORTLET_DEFINITION_NAME, null);
        String registryKey = pa + "::" + pd;
       
        PortletWindow window = fusion.getPortletWindow(entityId, registryKey);
        if (window == null)
        {
            return super.buildActionList(rundata, portlet);
        }
        PortletMode mode2 = PortletMode.VIEW;
        WindowState state2 = WindowState.NORMAL;
        NavigationalState nav = fusion.getNavigationalState(jdata);
        if (nav == null)
        {
            mode2 = PortletMode.VIEW;
            state2 = WindowState.NORMAL;
        }
        else
        {
            mode2 = nav.getMode(window);
            state2 = nav.getState(window);
        }

        int m = jdata.getMode();
        System.out.println("j1 mode = " + m);
       
        String action = jdata.getAction();       
        boolean targeted = fusion.isTargeted(jdata, instance, action);               
        boolean restoring = false;
        if (targeted && action != null && action.equals(J1_RESTORE_ACTION))
        {
            restoring = true;
            MutableNavigationalState mnav = (MutableNavigationalState)nav;
            mnav.setMode(window, PortletMode.VIEW);
            //nav.sync(context);           
        }
       
        boolean customized = (!restoring && (jdata.getMode() == JetspeedRunData.CUSTOMIZE ||
                              targeted && action.equals(J1_EDIT_ACTION) ||
                              mode2 == PortletMode.EDIT));
       
        boolean maximized = (!restoring && (jdata.getMode() == JetspeedRunData.MAXIMIZE ||
                            state2 == WindowState.MAXIMIZED));
        boolean helped = (!restoring && (mode2 == PortletMode.HELP || (targeted && action.equals(J1_HELP_ACTION))));
 
        boolean minimized = (!restoring && (state.isMinimized( rundata ) || state2 == WindowState.MINIMIZED));
       
        if (!customized && fusion.getAllowEdit(rundata))// state.allowCustomize(rundata))
        {
            actions.add( new PortletAction("customize", "Customize") );
        }
        if (state.allowPrintFriendly(rundata))
        {
            actions.add( new PortletAction("print", "Print Friendly Format") );
        }

        if (!helped && fusion.getAllowInfo(rundata))//state.allowInfo(rundata))
        {
            actions.add( new PortletAction("info", "Information") );
        }
                  
        if (state.allowClose(rundata))
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.fusion.portal.portlets.JetspeedFusionPortlet

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.