Examples of DynamicURI


Examples of org.apache.turbine.util.DynamicURI

        }
        catch( Exception e)
        {
            logger.error("Exception",  e);
        }
        DynamicURI uri = jsLink.getPaneById(portlet.getID());
        JetspeedLinkFactory.putInstance(jsLink);
       
        return uri;
    }
View Full Code Here

Examples of org.apache.turbine.util.DynamicURI

            AbstractVTLPortlet xPortlet = (AbstractVTLPortlet)portlet;
   
            // configure button
            if( xPortlet.getAllowEdit( rundata ) )
            {
                hrefConfigure=new DynamicURI( rundata )
                                    .addPathInfo("portlet", portletName)
                                    .addPathInfo("button","configure")
                                    .toString();
            }
   
            // minimize/restore button
            if( xPortlet.getAllowMinimize( rundata ) )
            {
                if( xPortlet.isMinimized( rundata ) )
                {
                    hrefRestore=new DynamicURI( rundata )
                                    .addPathInfo("action", "portlets.RestorePortlet")
                                    .addPathInfo("portletName", portletName)
                                    .toString();
                }
                else
                {
                    hrefMinimize=new DynamicURI( rundata )
                                    .addPathInfo("action", "portlets.MinimizePortlet")
                                    .addPathInfo("portletName", portletName)
                                    .toString();
                }
            }
   
            // maximize button
            if( xPortlet.getAllowMaximize( rundata ) )
            {
                hrefMaximize=new DynamicURI( rundata )
                                    .addPathInfo("portlet", portletName)
                                    .addPathInfo("button","maximize")
                                    .toString();
            }
   
            // close button
            if( xPortlet.getAllowClose( rundata ) )
            {
                hrefClose=new DynamicURI( rundata )
                                    .addPathInfo("action", "portlets.ClosePortlet")
                                    .addPathInfo("portletName", portletName)
                                    .toString();
            }
        }
View Full Code Here

Examples of org.apache.turbine.util.DynamicURI

                    elementType = JetspeedLink.PORTLET_ID;
                    elementValue = this.jspeid;
                }
                // Build the link
                JetspeedLink link = JetspeedLinkFactory.getInstance(data);
                DynamicURI uri = link.getLink(rootType,
                                              rootValue,
                                              baseLocator.getName(),
                                              elementType,
                                              elementValue,
                                              this.action == null ? "controls.Maximize" : this.action,
                                              null,
                                              baseLocator.getMediaType(),
                                              baseLocator.getLanguage(),
                                              baseLocator.getCountry());
                result = new StringElement(uri.toString());
                JetspeedLinkFactory.putInstance(link);
            }

            // Output the result
            if (result != null)
View Full Code Here

Examples of org.apache.turbine.util.DynamicURI

    public int doStartTag() throws JspException
    {
        RunData data = (RunData)pageContext.getAttribute(JspService.RUNDATA, PageContext.REQUEST_SCOPE);   
       
        TemplateLink link = new TemplateLink( data );
        DynamicURI uri = link.setPage( template );
        if ( action != null ) uri = uri.setAction( action );

        try
        {
            if (uri != null) {
                pageContext.getOut().print(uri.toString());
            }
        }
        catch (Exception e)
        {
            String message = "Error processing TemplateLink-tag, parameter: template='"+ template + "', action='" +action +"'";
View Full Code Here

Examples of org.apache.turbine.util.DynamicURI

        JetspeedRunData data = (JetspeedRunData) pageContext.getAttribute(JspService.RUNDATA, PageContext.REQUEST_SCOPE);
       
        try
        {
            ConcreteElement result = null;
            DynamicURI uri = null;
            ForwardService service = (ForwardService) ServiceUtil.getServiceByName(ForwardService.SERVICE_NAME);

            if (this.name != null && this.target != null)
            {
                uri = service.forward(data, this.name, this.target);
            }
            else if (this.getName() != null)
            {
                uri = service.forward(data, this.name);
            }
            if (uri != null)
            {
                result = new StringElement(uri.toString());
            }

            // Output the result
            if (result != null)
            {
View Full Code Here

Examples of org.apache.turbine.util.DynamicURI

     * @return A new dynamic URI representing all profile parameters from the locator.
     */
    public DynamicURI makeDynamicURI(RunData data, ProfileLocator locator)
        throws ProfileException
    {
        DynamicURI uri = new DynamicURI(data);

        // check mediatype to add to the uri
        String mtype = locator.getMediaType();
        if (null != mtype)
        {
            uri.addPathInfo(Profiler.PARAM_MEDIA_TYPE, mtype);
        }

        // check language to add to the uri
        String language = locator.getLanguage();
        if (null != language)
        {
            uri.addPathInfo(Profiler.PARAM_LANGUAGE, language);
        }

        // check language to add to the uri
        String country = locator.getCountry();
        if (null != country)
        {
            uri.addPathInfo(Profiler.PARAM_COUNTRY, country);
        }

        // check User, Group or Role to add to the uri
        JetspeedUser user = locator.getUser();
        if (null != user)
        {
            if (user.getUserName() != null)
                uri.addPathInfo(Profiler.PARAM_USER, user.getUserName());
        }
        else
        {
            Group group = locator.getGroup();
            if (null != group)
            {
                uri.addPathInfo(Profiler.PARAM_GROUP, group.getName());
            }
            else
            {
                Role role = locator.getRole();
                if (null != role)
                {
                    uri.addPathInfo(Profiler.PARAM_ROLE, role.getName());
                }
            }
        }

        // check Page to add to the uri
        String page = locator.getName();
        if (null != page)
        {
            uri.addPathInfo(Profiler.PARAM_PAGE, page);
        }

        return uri;
    }
View Full Code Here

Examples of org.apache.turbine.util.DynamicURI

            // validate that its not an 'blank' permissionname -- not allowed
            //
            String name = rundata.getParameters().getString("name");
            if (name == null || name.trim().length() == 0)
            {
                DynamicURI duri = new DynamicURI (rundata);
                duri.addPathInfo(SecurityConstants.PANE_NAME, SecurityConstants.PANEID_PERMISSION_UPDATE);
                duri.addPathInfo(SecurityConstants.PARAM_MSGID, SecurityConstants.MID_INVALID_ENTITY_NAME);
                rundata.setRedirectURI(duri.toString());
                rundata.getUser().setTemp(TEMP_PERMISSION, null);
                return;
            }

            //
            // generate a new permission
            //
            permission = JetspeedPermissionFactory.getInstance();
            permission.setName(name);

            //
            // add the permission
            ///
            JetspeedSecurity.addPermission(permission);

        }
        catch (JetspeedSecurityException e)
        {
            // log the error msg
            logger.error("Exception", e);

            //
            // dup key found - display error message - bring back to same screen
            //
            DynamicURI duri = new DynamicURI (rundata);
            duri.addPathInfo(SecurityConstants.PANE_NAME, SecurityConstants.PANEID_PERMISSION_UPDATE);
            duri.addPathInfo(SecurityConstants.PARAM_MSGID, SecurityConstants.MID_ENTITY_ALREADY_EXISTS);
            rundata.setRedirectURI(duri.toString());

            // save values that user just entered so they don't have to re-enter
           if (permission != null)
               rundata.getUser().setTemp(TEMP_PERMISSION, permission);
        }
View Full Code Here

Examples of org.apache.turbine.util.DynamicURI

            logger.error("Exception", e);

            //
            // error on update - display error message
            //
            DynamicURI duri = new DynamicURI (rundata);
            duri.addPathInfo(SecurityConstants.PANE_NAME, SecurityConstants.PANEID_PERMISSION_UPDATE);
            duri.addPathInfo(SecurityConstants.PARAM_MSGID, SecurityConstants.MID_UPDATE_FAILED);
            if (permission != null)
                duri.addPathInfo(SecurityConstants.PARAM_ENTITY_ID, permission.getName());
            duri.addQueryData(SecurityConstants.PARAM_MODE, SecurityConstants.PARAM_MODE_UPDATE);
            rundata.setRedirectURI(duri.toString());

           // save values that user just entered so they don't have to re-enter
           if (permission != null)
               rundata.getUser().setTemp(TEMP_PERMISSION, permission);
View Full Code Here

Examples of org.apache.turbine.util.DynamicURI

            logger.error("Exception", e);

            //
            // error on delete - display error message
            //
            DynamicURI duri = new DynamicURI (rundata);
            duri.addPathInfo(SecurityConstants.PANE_NAME, SecurityConstants.PANEID_PERMISSION_UPDATE);
            duri.addPathInfo(SecurityConstants.PARAM_MSGID, SecurityConstants.MID_DELETE_FAILED);
            if (permission != null)
                duri.addPathInfo(SecurityConstants.PARAM_ENTITY_ID, permission.getName());
            duri.addQueryData(SecurityConstants.PARAM_MODE, SecurityConstants.PARAM_MODE_DELETE);
            rundata.setRedirectURI(duri.toString());

            // save values that user just entered so they don't have to re-enter
           if (permission != null)
               rundata.getUser().setTemp(TEMP_PERMISSION, permission);
View Full Code Here

Examples of org.apache.turbine.util.DynamicURI

            // validate that its not an 'blank' rolename -- not allowed
            //
            String name = rundata.getParameters().getString("username");
            if (name == null || name.trim().length() == 0)
            {
                DynamicURI duri = new DynamicURI (rundata);
                duri.addPathInfo(SecurityConstants.PANE_NAME, SecurityConstants.PANEID_USER_UPDATE);
                duri.addPathInfo(SecurityConstants.PARAM_MSGID, SecurityConstants.MID_INVALID_ENTITY_NAME);
                rundata.setRedirectURI(duri.toString());
                // save values that user just entered so they don't have to re-enter
                if (user != null)
                   rundata.getUser().setTemp(TEMP_USER, user);
                return;
            }


            //
            // create a new user
            //
            user = JetspeedSecurity.getUserInstance();
            rundata.getParameters().setProperties(user);

            String password = rundata.getParameters().getString("password");
            if (password == null)
                password = "";

            user.setUserName(JetspeedSecurity.convertUserName(user.getUserName()));

            Date now = new Date();
            user.setCreateDate(now);
            user.setLastLogin(now);
            user.setConfirmed(JetspeedResources.CONFIRM_VALUE);

            String disabled = rundata.getParameters().getString("disabled");
            user.setDisabled( disabled != null );

            //
            // add the user
            ///
            user.setPassword(password);
            JetspeedSecurity.addUser(user);
        }
        catch (NotUniqueUserException e)
        {
            // log the error msg
            logger.error("Exception", e);

            //
            // dup key found - display error message - bring back to same screen
            //
            DynamicURI duri = new DynamicURI (rundata);
            duri.addPathInfo(SecurityConstants.PANE_NAME, SecurityConstants.PANEID_USER_UPDATE);
            duri.addPathInfo(SecurityConstants.PARAM_MSGID, SecurityConstants.MID_ENTITY_ALREADY_EXISTS);
            rundata.setRedirectURI(duri.toString());
            // save values that user just entered so they don't have to re-enter
            if (user != null)
               rundata.getUser().setTemp(TEMP_USER, user);
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.