Package org.apache.jetspeed.util.template

Examples of org.apache.jetspeed.util.template.JetspeedLink


        Context context = TurbineVelocity.getContext(rundata);
        assertNotNull( "Got context", context);
        TurbinePull.populateContext( context, rundata);
       
        // Verify tool are in the context
        JetspeedLink jsLink = (JetspeedLink) context.get("jslink");
        assertNotNull( "Got jslink from context", jsLink);
       
        // Generate the link
        String link = jsLink.toString();
        System.out.println("Page Link = " + link);
        assertTrue( "Verifing base Link",
          link.startsWith("http://" + TEST_HOST + TEST_CONTEXT + TEST_SERVLET));

        assertTrue( "Verify link contains /" + Profiler.PARAM_USER + "/anon",
View Full Code Here


        Context context = TurbineVelocity.getContext(rundata);
        assertNotNull( "Got context", context);
        TurbinePull.populateContext( context, rundata);
       
        // Verify tool are in the context
        JetspeedLink jsLink = (JetspeedLink) context.get("jslink");
        assertNotNull( "Got jslink from context", jsLink);
       
        // Generate the link
        String link = jsLink.toString();
        System.out.println("Group/Page Link = " + link);
        assertTrue( "Verifing base Link",
          link.startsWith("http://" + TEST_HOST + TEST_CONTEXT + TEST_SERVLET));

        assertTrue( "Verify link contains /" + Profiler.PARAM_GROUP + "/apache",
View Full Code Here

     * Test the User link
     * @throws Exception
     */
    public void testGroupPage2() throws Exception
    {
        JetspeedLink jetspeedLink = null;
       
        // Create the RunData object to be used during testing.
        RunData rundata = RunDataFactory.getRunData( request, response, config );
        assertNotNull( "Got rundata", rundata);
        TurbineTestUtilities.setupRunData(rundata);
       
        // Get and populate the context
        Context context = TurbineVelocity.getContext(rundata);
        assertNotNull( "Got context", context);
        TurbinePull.populateContext( context, rundata);
       
        // Verify tool are in the context
        JetspeedLink jsLink = (JetspeedLink) context.get("jslink");
        assertNotNull( "Got jslink from context", jsLink);
       
        // Generate the link
        String link = jsLink.toString();
        System.out.println("Group/Page Link = " + link);
       
        // Generate the link from JetspeedLink
        jetspeedLink = JetspeedLinkFactory.getInstance(rundata);
        System.out.println("Group/Page jetspeedLink = " + jetspeedLink.toString());
View Full Code Here

     * Test the User link
     * @throws Exception
     */
    public void testGetLink() throws Exception
    {
        JetspeedLink jetspeedLink = null;
       
        // Create the RunData object to be used during testing.
        RunData rundata = RunDataFactory.getRunData( request, response, config );
        assertNotNull( "Got rundata", rundata);
        TurbineTestUtilities.setupRunData(rundata);
       
        // Get and populate the context
        Context context = TurbineVelocity.getContext(rundata);
        assertNotNull( "Got context", context);
        TurbinePull.populateContext( context, rundata);
       
        // Verify tool are in the context
        JetspeedLink jsLink = (JetspeedLink) context.get("jslink");
        assertNotNull( "Got jslink from context", jsLink);
       
        // Generate the link from JetspeedLink
        jetspeedLink = JetspeedLinkFactory.getInstance(rundata);
        String baseLink = new String("http://" + TEST_HOST + TEST_CONTEXT + TEST_SERVLET);
View Full Code Here

     @param portlet The portlet to build the link for by id.
     *  @return DynamicURI A new Dynamic URI with the query parameter
     */
    public DynamicURI getPortletURI( Portlet portlet, RunData rundata )
    {
        JetspeedLink jsLink = null;
        try
        {
            jsLink = JetspeedLinkFactory.getInstance(rundata);
        }
        catch( Exception e)
        {
            Log.error( e );
        }
        DynamicURI uri = jsLink.setPaneById(portlet.getID());
        JetspeedLinkFactory.putInstance(jsLink);
       
        return uri;
    }
View Full Code Here

        t.addElement( new TR().addElement( new TD()
            .addElement( new B().addElement( "Actions:" ) ) ) );
           
        String internal = null;
        JetspeedLink jsLink = null;

        try
        {
            jsLink = JetspeedLinkFactory.getInstance(rundata);
            String mtype = rundata.getParameters().getString("mtype");
            if (mtype != null)
            {
                jsLink.setMediaType(mtype);
                jsLink.addQueryData("mtype", mtype);
            }
            String js_peid = rundata.getParameters().getString("js_peid");
            // FIX ME: If the portlet is viewed in Avantgo and then portlet info is restored, the portlet will
            // be maximized (similar to customizing certain portlet types. The desired effect would be to
            // set the portlet's mode to normal.
            internal = jsLink.addPathInfo("js_peid", js_peid).setAction("controls.Maximize").toString();
        }
        catch (Exception e)
        {
            Log.error(e);
        }
View Full Code Here

        {
            String portletName =
                rundata.getParameters().getString(PORTLET_NAME);
            if (portletName == null || portletName.length() == 0)
            {
                JetspeedLink link = JetspeedLinkFactory.getInstance(rundata);
                DynamicURI duri =
                    link
                        .getPaneByName(PORTLET_UPDATE_PANE)
                        .addPathInfo(
                            SecurityConstants.PARAM_MODE,
                            SecurityConstants.PARAM_MODE_INSERT)
                        .addPathInfo(
                            SecurityConstants.PARAM_MSGID,
                            SecurityConstants.MID_INVALID_ENTITY_NAME);
                JetspeedLinkFactory.putInstance(link);
                rundata.setRedirectURI(duri.toString());

                resetForm(rundata);
            }
            else
            {
                PortletEntry existingEntry =
                    (PortletEntry) Registry.getEntry(
                        Registry.PORTLET,
                        portletName);
                if (existingEntry != null)
                {
                    throw new EntityExistsException(
                        "PortletEntry: " + portletName + " Already Exists!");
                }

                PortletEntry portletEntry = new BasePortletEntry();
                portletEntry.setName(portletName);
                setPortletEntryInfo(rundata, portletEntry);

                Registry.addEntry(Registry.PORTLET, portletEntry);
            }
        }
        catch (EntityExistsException e)
        {
            //
            // dup key found - display error message - bring back to same screen
            //
            JetspeedLink link = JetspeedLinkFactory.getInstance(rundata);
            DynamicURI duri =
                link
                    .getPaneByName(PORTLET_UPDATE_PANE)
                    .addPathInfo(
                        SecurityConstants.PARAM_MODE,
                        SecurityConstants.PARAM_MODE_INSERT)
                    .addPathInfo(
                        SecurityConstants.PARAM_MSGID,
                        SecurityConstants.MID_ENTITY_ALREADY_EXISTS);
            JetspeedLinkFactory.putInstance(link);
            rundata.setRedirectURI(duri.toString());

            resetForm(rundata);
        }
        catch (Exception e)
        {
            JetspeedLink link = JetspeedLinkFactory.getInstance(rundata);
            DynamicURI duri =
                link
                    .getPaneByName(PORTLET_UPDATE_PANE)
                    .addPathInfo(
                        SecurityConstants.PARAM_MODE,
                        SecurityConstants.PARAM_MODE_INSERT)
                    .addPathInfo(
View Full Code Here

            PortletEntry portletEntry =
                (PortletEntry) Registry.getEntry(Registry.PORTLET, portletName);
            if (portletEntry == null)
            {
                String tab = rundata.getParameters().getString(TAB_PARAMETER);
                JetspeedLink link = JetspeedLinkFactory.getInstance(rundata);
                DynamicURI duri =
                    link
                        .getPaneByName(PORTLET_UPDATE_PANE)
                        .addPathInfo(
                            SecurityConstants.PARAM_MODE,
                            SecurityConstants.PARAM_MODE_UPDATE)
                        .addPathInfo(
                            SecurityConstants.PARAM_MSGID,
                            SecurityConstants.MID_INVALID_ENTITY_NAME)
                        .addQueryData(TAB_PARAMETER, tab);

                JetspeedLinkFactory.putInstance(link);
                rundata.setRedirectURI(duri.toString());

                resetForm(rundata);
            }
            else
            {
                setPortletEntryInfo(rundata, portletEntry);
                Registry.addEntry(Registry.PORTLET, portletEntry);
                clearUserData(rundata);
            }
        }
        catch (Exception e)
        {
            String tab = rundata.getParameters().getString(TAB_PARAMETER);
            JetspeedLink link = JetspeedLinkFactory.getInstance(rundata);
            DynamicURI duri =
                link
                    .getPaneByName(PORTLET_UPDATE_PANE)
                    .addPathInfo(
                        SecurityConstants.PARAM_MODE,
                        SecurityConstants.PARAM_MODE_UPDATE)
                    .addPathInfo(
View Full Code Here

                }
                else
                {
                    String tab =
                        rundata.getParameters().getString(TAB_PARAMETER);
                    JetspeedLink link =
                        JetspeedLinkFactory.getInstance(rundata);
                    DynamicURI duri =
                        link
                            .getPaneByName(PORTLET_UPDATE_PANE)
                            .addPathInfo(
                                SecurityConstants.PARAM_MODE,
                                SecurityConstants.PARAM_MODE_UPDATE)
                            .addPathInfo(
                                SecurityConstants.PARAM_MSGID,
                                SecurityConstants.MID_MISSING_PARAMETER)
                            .addQueryData(TAB_PARAMETER, tab)
                            .addQueryData(PORTLET_NAME, portletName);

                    JetspeedLinkFactory.putInstance(link);
                    rundata.setRedirectURI(duri.toString());

                    resetForm(rundata);
                }
            }
            else
            {
                String tab = rundata.getParameters().getString(TAB_PARAMETER);
                JetspeedLink link = JetspeedLinkFactory.getInstance(rundata);
                DynamicURI duri =
                    link
                        .getPaneByName(PORTLET_UPDATE_PANE)
                        .addPathInfo(
                            SecurityConstants.PARAM_MODE,
                            SecurityConstants.PARAM_MODE_UPDATE)
                        .addPathInfo(
                            SecurityConstants.PARAM_MSGID,
                            SecurityConstants.MID_INVALID_ENTITY_NAME)
                        .addQueryData(TAB_PARAMETER, tab);

                JetspeedLinkFactory.putInstance(link);
                rundata.setRedirectURI(duri.toString());

                resetForm(rundata);
            }
        }
        catch (Exception e)
        {
            String tab = rundata.getParameters().getString(TAB_PARAMETER);
            JetspeedLink link = JetspeedLinkFactory.getInstance(rundata);
            DynamicURI duri =
                link
                    .getPaneByName(PORTLET_UPDATE_PANE)
                    .addPathInfo(
                        SecurityConstants.PARAM_MODE,
                        SecurityConstants.PARAM_MODE_UPDATE)
                    .addPathInfo(
View Full Code Here

                }
                else
                {
                    String tab =
                        rundata.getParameters().getString(TAB_PARAMETER);
                    JetspeedLink link =
                        JetspeedLinkFactory.getInstance(rundata);
                    DynamicURI duri =
                        link
                            .getPaneByName(PORTLET_UPDATE_PANE)
                            .addPathInfo(
                                SecurityConstants.PARAM_MODE,
                                SecurityConstants.PARAM_MODE_UPDATE)
                            .addPathInfo(
                                SecurityConstants.PARAM_MSGID,
                                SecurityConstants.MID_MISSING_PARAMETER)
                            .addQueryData(TAB_PARAMETER, tab)
                            .addQueryData(PORTLET_NAME, portletName);
                    JetspeedLinkFactory.putInstance(link);
                    rundata.setRedirectURI(duri.toString());

                    resetForm(rundata);
                }
            }
            else
            {
                String tab = rundata.getParameters().getString(TAB_PARAMETER);
                JetspeedLink link = JetspeedLinkFactory.getInstance(rundata);
                DynamicURI duri =
                    link
                        .getPaneByName(PORTLET_UPDATE_PANE)
                        .addPathInfo(
                            SecurityConstants.PARAM_MODE,
                            SecurityConstants.PARAM_MODE_UPDATE)
                        .addPathInfo(
                            SecurityConstants.PARAM_MSGID,
                            SecurityConstants.MID_INVALID_ENTITY_NAME)
                        .addQueryData(TAB_PARAMETER, tab);

                JetspeedLinkFactory.putInstance(link);
                rundata.setRedirectURI(duri.toString());

                resetForm(rundata);
            }
        }
        catch (Exception e)
        {
            String tab = rundata.getParameters().getString(TAB_PARAMETER);
            JetspeedLink link = JetspeedLinkFactory.getInstance(rundata);
            DynamicURI duri =
                link
                    .getPaneByName(PORTLET_UPDATE_PANE)
                    .addPathInfo(
                        SecurityConstants.PARAM_MODE,
                        SecurityConstants.PARAM_MODE_UPDATE)
                    .addPathInfo(
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.util.template.JetspeedLink

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.