Package org.jasig.portal

Examples of org.jasig.portal.ChannelStaticData


    private String xsltUri = "CSqlQuery/sqlquery.xsl";
   
    SqlToXml sqlToXml;
   
    protected final void staticDataSet() {
        ChannelStaticData csd = getStaticData();
        String sqlQuery = csd.getParameter(SQL_QUERY_PARAM_NAME);
        String datasourceJndiName = csd.getParameter(DATASOURCE_JNDI_NAME_PARAM_NAME);
       
        if (datasourceJndiName == null) {
            datasourceJndiName = PropertiesManager.getProperty("org.jasig.portal.RDBMServices.PortalDatasourceJndiName", "PortalDb");
        }
       
        DataSource ds = RDBMServices.getDataSource(datasourceJndiName);
       
        sqlToXml = new SqlToXml(ds, sqlQuery);
       
        this.xsltUri = csd.getParameter(XSLT_URI_PARAM_NAME);
       
       
   
    }
View Full Code Here


        if (targets == null) {
            targets = owner.getTargetTokens();
        }
        if (staticData != null) {
            try {
                ChannelStaticData slaveSD = (ChannelStaticData)staticData.clone();
                Enumeration srd = slaveSD.keys();
                while (srd.hasMoreElements()) {
                    slaveSD.remove(srd.nextElement());
                }
                HashMap tHash = new HashMap(1);
                tHash.put(owner.getOwnerToken(), targets);
                HashMap aHash = new HashMap(1);
                aHash.put(owner.getOwnerToken(), activities);
                if (principals != null) {
                    slaveSD.put("prmPrincipals", principals);
                }
                slaveSD.put("prmOwners", owners);
                slaveSD.put("prmActivities", aHash);
                slaveSD.put("prmTargets", tHash);
                slaveSD.put("prmView", "Assign By Owner");
                ((IChannel)servant).setStaticData(slaveSD);
            } catch (Exception e) {
                isOK = false;
            }
        }
View Full Code Here

        return doc;
  }

  protected final String getXsltUri() throws Exception {
        try {
            ChannelStaticData staticData = getStaticData();
            String xsltUri = staticData.getParameter(XSL_PARAM_KEY);
           
            if (xsltUri != null) {
                return xsltUri;
            }
           
View Full Code Here

    private final VersionsManager versionsManager = VersionsManager
            .getInstance();

    protected Map getStylesheetParams() throws Exception {

        ChannelStaticData staticData = getStaticData();
        String componentFunctionalName = (String) staticData
                .get("componentFunctionalName");

        Version componentVersion = versionsManager
                .getVersion(componentFunctionalName);
View Full Code Here

        return document;
    }

    protected String getXsltUri() throws Exception {
        ChannelStaticData staticData = getStaticData();
        String xsltUri = (String) staticData.get("xsltUri");
        if (xsltUri == null) {
            xsltUri = "cversion.xsl";
        }
        return xsltUri;
    }
View Full Code Here

  /** Constructs a CNumberGuess.
   */
  public CNumberGuess ()
  {
    this.staticData = new ChannelStaticData ();
    this.runtimeData = new ChannelRuntimeData ();
  }
View Full Code Here

    * This is the public method
    * @param sessionData
    * @throws Exception
    */
   public void execute (CGroupsManagerSessionData sessionData) throws Exception {
      ChannelStaticData staticData = sessionData.staticData;
      ChannelRuntimeData runtimeData= sessionData.runtimeData;
      Document model = getXmlDoc(sessionData);
      Utility.logMessage("DEBUG", "AddMembers::execute(): Start");
      String parentAddElemId = getCommandArg(runtimeData);

      IGroupMember pg = GroupsManagerXML.retrieveGroupMemberForElementId(model, parentAddElemId);
      sessionData.rootViewGroupID = Utility.translateKeytoID(GroupService.getRootGroup(pg.getLeafType()).getKey(),sessionData.getUnrestrictedData());
      // Parent was locked so no other thread or process could have changed it, but
      // child members could have changed.
      Element parentElem = GroupsManagerXML.getElementById(model, parentAddElemId);
      GroupsManagerXML.refreshAllNodesRecursivelyIfRequired(sessionData.getUnrestrictedData(), parentElem);
      sessionData.returnToMode = sessionData.mode;
      sessionData.mode=SELECT_MODE;
      sessionData.highlightedGroupID = sessionData.rootViewGroupID;
      Utility.logMessage("DEBUG", "AddMembers::execute(): Uid of parent element = " +
            parentAddElemId);
      staticData.setParameter("groupParentId", parentAddElemId);
   }
View Full Code Here

    * This is the public method
    * @param sessionData
    * @throws Exception
    */
   public void execute (CGroupsManagerSessionData sessionData) throws Exception {
      ChannelStaticData staticData = sessionData.staticData;

      Document model = getXmlDoc(sessionData);
      /** @todo move to GroupManagerCommand.cleanUp */
      Utility.logMessage("DEBUG", "CancelSelection::execute(): Start");
      clearSelected(sessionData);
      String parentId = getParentId(staticData);
      if (parentId != null) {
         // go back to stored mode
         sessionData.mode = sessionData.returnToMode;
         sessionData.highlightedGroupID = parentId;
         sessionData.rootViewGroupID=null;
         // Parent is locked so no other thread or process could have changed it, but
         // child members could have changed.
         Element parentElem = GroupsManagerXML.getElementById(model, parentId);
         GroupsManagerXML.refreshAllNodesRecursivelyIfRequired(sessionData.getUnrestrictedData(), parentElem);
         sessionData.staticData.remove("groupParentId");
      }
      else {
        // @todo refactor into separate servant finish command
        if (sessionData.lockedGroup!=null){
          try{
            sessionData.lockedGroup.getLock().release();
          }catch(LockingException e){
              log.error(e,e);
          }
        }
         staticData.setParameter("groupManagerFinished", "true");
      }
   }
View Full Code Here

    * @throws Exception
    */
   public static void createPermissions (CGroupsManagerSessionData sessionData, IEntityGroup childEntGrp) throws Exception {
      /** Grant all permissions for a group to the current user
       */
      ChannelStaticData staticData = sessionData.staticData;
      Document model = sessionData.model;
      ArrayList perms = new ArrayList();
      IUpdatingPermissionManager upm = AuthorizationService.instance().newUpdatingPermissionManager(OWNER);
      IAuthorizationPrincipal ap = staticData.getAuthorizationPrincipal();
      Utility.logMessage("DEBUG", "GroupManagerXML::createPermissions(): The IAuthorizationPrincipal: " + ap);
      String[] activities = ((IPermissible)Class.forName(OWNER).newInstance()).getActivityTokens();
      IPermission prm;
      for (int a = 0; a < activities.length; a++) {
         prm = upm.newPermission(ap);
View Full Code Here

    * This is the public method
    * @param sessionData
    * @throws Exception
    */
   public void execute (CGroupsManagerSessionData sessionData) throws Exception{
      ChannelStaticData staticData = sessionData.staticData;
      //ChannelRuntimeData runtimeData= sessionData.runtimeData;

      Utility.logMessage("DEBUG", "DoneWithSelection::execute(): Start");
      String parentId = null;
      boolean hasParentId = hasParentId(staticData);
      Utility.logMessage("DEBUG", "DoneWithSelection::execute(): Parent ID is set: "
            + hasParentId);
      IGroupMember[] princResults = null;
      Document model = getXmlDoc(sessionData);
      Element rootElem = model.getDocumentElement();
      NodeList nGroupList = rootElem.getElementsByTagName(GROUP_TAGNAME);
      NodeList nEntityList = rootElem.getElementsByTagName(ENTITY_TAGNAME);
      Vector gmCollection = new Vector();
      Element parentElem = null;
      Utility.logMessage("DEBUG", "DoneWithSelection::execute(): Starting group process");
      addGroupMemberToCollection(gmCollection, nGroupList);
      Utility.logMessage("DEBUG", "DoneWithSelection::execute(): Starting entity process");
      addGroupMemberToCollection(gmCollection, nEntityList);
      // check if selections were made
      if (gmCollection.size() <1) {
         sessionData.feedback = sessionData.feedback + "\n No groups or people were selected! ";
         return;
      }

      /** Presence of parentID means the process is not in servant mode. That is,
       * the master channel is the Groups Manager channel and AddMembers had
       * been selected
       */
      if (hasParentId) {
         parentId = getParentId(staticData);
         Utility.logMessage("DEBUG", "DoneWithSelection::execute(): Parent ID is set to: "
               + parentId);
         parentElem = GroupsManagerXML.getElementByTagNameAndId(model, GROUP_TAGNAME, parentId);
         if (parentElem == null) {
            Utility.logMessage("ERROR", "DoneWithSelection::execute: Error parent element not found");
            return;
         }
         addChildrenToGroup(gmCollection, sessionData, parentElem, model);
         clearSelected(sessionData);
         sessionData.mode = sessionData.returnToMode;;
         sessionData.highlightedGroupID = parentId;
         sessionData.rootViewGroupID=null;
         // Parent was locked so no other thread or process could have changed it, but
         // child members could have changed.
         GroupsManagerXML.refreshAllNodesRecursivelyIfRequired(sessionData.getUnrestrictedData(), parentElem);
         sessionData.staticData.remove("groupParentId");
      }
      else {
         princResults = (IGroupMember[])gmCollection.toArray(new IGroupMember[0]);
         if (princResults.length > 0) {
            staticData.put("princResults", princResults);
            staticData.setParameter("groupManagerFinished", "true");
         }
      }
   }
View Full Code Here

TOP

Related Classes of org.jasig.portal.ChannelStaticData

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.