Examples of JetspeedRunData


Examples of org.apache.jetspeed.services.rundata.JetspeedRunData

        }
    }

    public void doDelete(RunData data, Context context)
    {
        JetspeedRunData jdata = (JetspeedRunData) data;

        // get the customization state for this page
        SessionState customizationState = jdata.getPageSessionState();

        PortletSet customizedSet = (PortletSet) jdata.getCustomized();

        customizationState.setAttribute(REFERENCES_REMOVED, "false");

        int col = data.getParameters().getInt("col", -1);
        int row = data.getParameters().getInt("row", -1);
        List[] columns = (List[]) customizationState.getAttribute("customize-columns");
        if (columns == null)
        {
            return;
        }

        if ((col > -1) && (row > -1))
        {
            try
            {
                IdentityElement identityElement = (IdentityElement) columns[col].get(row);
                columns[col].remove(row);

                Portlets portlets = jdata.getCustomizedProfile()
                                          .getDocument()
                                          .getPortletsById(customizedSet.getID());

                if (portlets != null)
                {
View Full Code Here

Examples of org.apache.jetspeed.services.rundata.JetspeedRunData

        }
    }

    public void doControl(RunData data, Context context)
    {
        JetspeedRunData jdata = (JetspeedRunData) data;

        String controlName = data.getParameters().getString("control");
        String id = data.getParameters().getString("js_peid");

        try
        {
            Entry entry = jdata.getCustomizedProfile().getDocument().getEntryById(id);

            if (entry != null)
            {
                if (controlName != null && controlName.trim().length() > 0)
                {
View Full Code Here

Examples of org.apache.jetspeed.services.rundata.JetspeedRunData

     *
     * @return SKIP_BODY, as it is intended to be a single tag.
     */
    public int doStartTag() throws JspException
    {
        JetspeedRunData data = (JetspeedRunData) pageContext.getAttribute(JspService.RUNDATA, PageContext.REQUEST_SCOPE);
       
        try
        {
            ConcreteElement result = null;
            Profile baseProfile = null;
            ProfileLocator baseLocator = Profiler.createLocator();
            int rootType = JetspeedLink.DEFAULT;
            String rootValue = null;
            int elementType = JetspeedLink.DEFAULT;
            String elementValue = null;

            // Create locator to retrieve profile settings
            if (this.psml != null)
            {
               baseLocator.createFromPath(this.psml);
               if (baseLocator.getUser() != null)
               {
                   rootType = JetspeedLink.USER;
                   rootValue = baseLocator.getUserName();
               }
               else if (baseLocator.getRole() != null)
               {
                   rootType = JetspeedLink.ROLE;
                   rootValue = baseLocator.getRoleName();
               }
               else if (baseLocator.getGroup() != null)
               {
                   rootType = JetspeedLink.GROUP;
                   rootValue = baseLocator.getGroupName();
               }
            }
            else
            {
               rootType = JetspeedLink.CURRENT;
               rootValue = "";
               baseProfile = data.getProfile();
               baseLocator.createFromPath(baseProfile.getPath());
            }

            //  Determine search method
            if (baseLocator != null)
            {               
                // search by portlet name
                if (this.name != null)
                {
                    elementType = JetspeedLink.PORTLET_ID_QUERY;
                    elementValue = this.name;
                }
                else if (this.jspeid != null)
                {
                    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)
            {
                pageContext.getOut().print(result);
            }

        }
        catch (Exception e)
        {
            String message = "Error processing name '" + name + "'.";
            logger.error(message, e);
            try
            {
                data.getOut().print("Error processing portlet '" + name + "'. See log for more information.");
            }
            catch (java.io.IOException ioe)
            {
            }
        }
View Full Code Here

Examples of org.apache.jetspeed.services.rundata.JetspeedRunData

        }
    }

  public void doSkin(RunData data, Context context)
  {
    JetspeedRunData jdata = (JetspeedRunData) data;

    String skinName = data.getParameters().getString("portletSkin");
    String id = data.getParameters().getString("js_peid");

    try
    {
      Entry entry = jdata.getCustomizedProfile().getDocument().getEntryById(id);

      if (entry != null)
      {
        if (skinName != null && skinName.trim().length() > 0)
        {
View Full Code Here

Examples of org.apache.jetspeed.services.rundata.JetspeedRunData

    }
  }

  public void doSecurity(RunData data, Context context)
  {
    JetspeedRunData jdata = (JetspeedRunData) data;

    String securityRefName = data.getParameters().getString("portletSecurityRef");
    String id = data.getParameters().getString("js_peid");

    try
    {
      Entry entry = jdata.getCustomizedProfile().getDocument().getEntryById(id);

      if (entry != null)
      {
        if (securityRefName != null && securityRefName.trim().length() > 0)
        {
View Full Code Here

Examples of org.apache.jetspeed.services.rundata.JetspeedRunData

     * @param data Turbine information.
     * @exception Exception, a generic exception.
     */
    public void doPerform( RunData rundata ) throws Exception
    {
        JetspeedRunData data = (JetspeedRunData)rundata;
        /*
         * Pull user from session.
         */
        data.populate();

        // The user may have not logged in, so create a "guest" user.
        if ( data.getUser() == null)
        {
            data.setUser(JetspeedSecurity.getAnonymousUser());
            data.save();
        }

        // make sure we have some way to return a response
        if ( !data.hasScreen() &&
             data.getTemplateInfo().getScreenTemplate() == null )
        {
            String template = JetspeedResources.getString(
                TurbineConstants.TEMPLATE_HOMEPAGE);

            if (template != null)
            {
                data.getTemplateInfo().setScreenTemplate(template);
            }
            else
            {
                data.setScreen(JetspeedResources.getString(
                    TurbineConstants.SCREEN_HOMEPAGE));
            }
        }
        // the session_access_counter can be placed as a hidden field in
        // forms.  This can be used to prevent a user from using the
        // browsers back button and submitting stale data.
        else if ( data.getParameters().containsKey("_session_access_counter") )
        {
            // See comments in screens.error.InvalidState.
            if ( data.getParameters().getInt("_session_access_counter") <
                (((Integer)data.getUser().getTemp("_session_access_counter"))
                .intValue()-1) )
            {
                if (data.getTemplateInfo().getScreenTemplate() != null)
                {
                    data.getUser().setTemp( "prev_template",
                        data.getTemplateInfo().getScreenTemplate()
                        .replace('/', ',') );
                    data.getTemplateInfo().setScreenTemplate(
                        JetspeedResources.getString(
                        TurbineConstants.TEMPLATE_INVALID_STATE) );
                }
                else
                {
                    data.getUser().setTemp( "prev_screen",
                        data.getScreen().replace('/', ',') );
                    data.setScreen( JetspeedResources.getString(
                        TurbineConstants.SCREEN_INVALID_STATE) );
                }
                data.getUser().setTemp("prev_parameters", data.getParameters());
                data.setAction( "" );
            }
        }

        // we do not want to allow both a screen and template parameter.
        // The template parameter is dominant.
        if ( data.getTemplateInfo().getScreenTemplate() != null )
        {
            data.setScreen(null);
        }
    }
View Full Code Here

Examples of org.apache.jetspeed.services.rundata.JetspeedRunData

        //pc.setSecurityRef(portletEntry.getSecurityRef());
        pc.setSecurityRef(getSecurityReference(null, portletEntry));

        if (runDataService != null)
        {
            JetspeedRunData rundata = runDataService.getCurrentRunData();
            if (rundata != null)
            {
                Profile profile = rundata.getProfile();
                if (profile != null)
                {
                    pc.setPageId(profile.getId());
                }
            }
View Full Code Here

Examples of org.apache.jetspeed.services.rundata.JetspeedRunData

        {
            this.runDataService =
                (JetspeedRunDataService) TurbineServices.getInstance().getService(
                    RunDataService.SERVICE_NAME);
        }
        JetspeedRunData rundata = runDataService.getCurrentRunData();
       
        return JetspeedSecurity.getSecurityReference(entry,  rundata);
    }
View Full Code Here

Examples of org.apache.jetspeed.services.rundata.JetspeedRunData

          }
        }

        // now, define Jetspeed specific properties, using the customized
        // RunData properties
        JetspeedRunData jdata = null;
       
        try
        {
            jdata = (JetspeedRunData)data;
        }
        catch (ClassCastException e)
        {
            logger.error("The RunData object does not implement the expected interface, "
                       + "please verify the RunData factory settings", e);
            return;
        }
        String language = (String) data.getRequest().getParameter("js_language");

        if (null != language)
        {
            user.setPerm("language", language);
        }
       
        // Get the locale store it in the user object
        CustomLocalizationService locService = (CustomLocalizationService) ServiceUtil.getServiceByName(
            LocalizationService.SERVICE_NAME);
        Locale locale = locService.getLocale(data);

        if (locale == null) {
            locale = new Locale(
                     TurbineResources.getString("locale.default.language", "en"),
                     TurbineResources.getString("locale.default.country", "US"));
        }
       
        data.getUser().setTemp("locale", locale);

        // if a portlet is referenced in the parameters request, store it
        // in the RunData object
        String paramPortlet = jdata.getParameters().getString("js_peid");
        if (paramPortlet != null && paramPortlet.length() > 0) {
            jdata.setJs_peid(paramPortlet);
        }
       
    }
View Full Code Here

Examples of org.apache.jetspeed.services.rundata.JetspeedRunData

       
        context.put( "action", controller.getConfig().getInitParameter("action"));

        // We want the save button to say different things based on whether we're about to save to persistent storage
        // (Save and Apply) or just go the next screen (Apply).
        JetspeedRunData jdata = (JetspeedRunData) rundata;

        // get the customization state for this page
        SessionState customizationState = jdata.getPageSessionState();

        String saveLabel = null;
        if (((String) customizationState.getAttribute("customize-paneName")).equalsIgnoreCase("*"))
        {
            saveLabel = CustomLocalization.getString("CUSTOMIZER_SAVEAPPLY", rundata);   
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.