Package com.ibm.xsp.designer.context

Examples of com.ibm.xsp.designer.context.XSPContext


    
    /* mypic image */
    boolean isAnonymous = true;
    String commonName = "";
    String canonicalName = "";
    XSPContext ctx = XSPContext.getXSPContext(FacesContext.getCurrentInstance());
    if(ctx!=null) {
      com.ibm.designer.runtime.directory.DirectoryUser user = ctx.getUser();
      isAnonymous = user.isAnonymous();
      commonName = user.getCommonName();
      canonicalName = user.getFullName();
    } else {
      isAnonymous = false;
View Full Code Here


      Document settings = settingsView.getFirstDocument();

      if (null == settings) {

        settingsView.recycle();
        XSPContext context = (XSPContext) resolveVariable("context");

        UIViewRootEx2 view = (UIViewRootEx2) resolveVariable("view");
        if (!view.getPageName().equals("/admin.xsp")) {
          System.out.println("mypic: invalid configuration - " + view.getPageName());
          validConfig = false;
          context.redirectToPage("/admin.xsp");
        }

      } else {

        SaveUrlInNab = settings.getItemValueString("saveMypicURLToNab");
        EnableProfiles = settings.getItemValueString("enableProfiles");
        StoreProfilesInNab = settings.getItemValueString("saveProfileToNab");
        NabServer = settings.getItemValueString("nabServer");
        NabFilePath = settings.getItemValueString("nabFilePath");
        ShowApiInNav = settings.getItemValueString("enableAPIPage");
        DefaultFormat = settings.getItemValueString("defaultFormat");
        DefaultSize = settings.getItemValueString("defaultSize");
       
        if (DefaultSize.trim().compareTo("") == 0) {
          DefaultSize = "50";
        }
       
        if (DefaultFormat.trim().compareTo("") == 0) {
          DefaultFormat = "png";
        }

        if ((SaveUrlInNab.equals("Yes") || StoreProfilesInNab.equals("Yes")) && (NabServer.isEmpty() || NabFilePath.isEmpty())) {
          Messages.clear();
          Messages.add("To save mypic URLs or Profile information to a Names and address book, "
              + "the NAB Server and File Path must be specified.");

          UIViewRootEx2 view = (UIViewRootEx2) resolveVariable("view");
          if (!view.getPageName().equals("/admin.xsp")) {
            XSPContext context = (XSPContext) resolveVariable("context");
            validConfig = false;
            context.redirectToPage("/admin.xsp");
          }

        }

        settings.recycle();
View Full Code Here

          String userAbbrev = session.createName(profile.getItemValueString("User")).getAbbreviated();
          View VIMPeople = nab.getView("($VIMPeople)");
         
          Document nabEntry = VIMPeople.getDocumentByKey(userAbbrev, true);
          if (null != nabEntry) {
            XSPContext context = (XSPContext) resolveVariable("context");

            profile.replaceItemValue("PhotoURL",
                context.getUrl().getScheme() + "://" + context.getUrl().getHost() + '/' + database.getFilePath() +
                "/api.xsp?method=getmypic&id=" +
                UNIDEncoder.encode(session.createName(profile.getItemValueString("User")).getCanonical()) + "&size=" +
                this.DefaultSize + "&format=" + this.DefaultFormat);
           
            if (this.StoreProfilesInNab == "Yes") {
View Full Code Here

TOP

Related Classes of com.ibm.xsp.designer.context.XSPContext

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.