Package org.jasig.portal.security

Examples of org.jasig.portal.security.IPerson


    print(CR + "***** ENTERING PAGSTester.testIntegerLTTester() *****" + CR);
    String msg = null;
  
    msg = "Creating a new IPerson";
    print(msg);
    IPerson newPerson = getIPerson("de3");
    assertNotNull(msg, newPerson);
      
    print("Adding attributes to IPerson.");
    newPerson.setAttribute(key1, randomIntStrings[0]);
    newPerson.setAttribute(key2, randomIntStrings[1]);
    newPerson.setAttribute(key3, intStringVector);

    msg = "Testing IPerson " + newPerson;
    print(msg);

    // test value == attribute value.  Should answer false.
View Full Code Here


    print(CR + "***** ENTERING PAGSTester.testIntegerGETester() *****" + CR);
    String msg = null;
   
    msg = "Creating a new IPerson";
    print(msg);
    IPerson newPerson = getIPerson("de3");
    assertNotNull(msg, newPerson);
      
    print("Adding attributes to IPerson.");
    newPerson.setAttribute(key1, randomIntStrings[0]);
    newPerson.setAttribute(key2, randomIntStrings[1]);
    newPerson.setAttribute(key3, intStringVector);

    msg = "Testing IPerson " + newPerson;
    print(msg);

    // test value == attribute value.  Should answer true.
View Full Code Here

    print(CR + "***** ENTERING PAGSTester.testIntegerLETester() *****" + CR);
    String msg = null;
  
    msg = "Creating a new IPerson";
    print(msg);
    IPerson newPerson = getIPerson("de3");
    assertNotNull(msg, newPerson);
   
    print("Adding attributes to IPerson.");
    newPerson.setAttribute(key1, randomIntStrings[0]);
    newPerson.setAttribute(key2, randomIntStrings[1]);
    newPerson.setAttribute(key3, intStringVector);


    // test value == attribute value.  Should answer true.
    IPersonTester tester1 = new IntegerLETester(key1, randomIntStrings[0]);
    // test value < attribute value.  Should answer false.
View Full Code Here

    print(CR + "***** ENTERING PAGSTester.testRegexTester() *****" + CR);
    String msg = null;
  
    msg = "Creating a new IPerson";
    print(msg);
    IPerson newPerson = getIPerson("de3");
    assertNotNull(msg, newPerson);
       
    print("Adding attributes to IPerson.");
    newPerson.setAttribute(key1, randomStrings[0]);
    newPerson.setAttribute(key2, randomStrings[1]);
    newPerson.setAttribute(key3, stringVector);
   
    msg = "Testing IPerson " + newPerson;
    print(msg);

    //  test equals attribute.  Should return true.
View Full Code Here

    print(CR + "***** ENTERING PAGSTester.testValueExistsTester() *****" + CR);
    String msg = null;
  
    msg = "Creating a new IPerson";
    print(msg);
    IPerson newPerson = getIPerson("de3");
    assertNotNull(msg, newPerson);
       
    print("Adding attributes to IPerson.");
    newPerson.setAttribute(key1, randomStrings[0]);
    newPerson.setAttribute(key2, randomStrings[1].toLowerCase());
    msg = "Testing IPerson " + newPerson;
    print(msg);

    String testKey = randomStrings[0].toLowerCase();
View Full Code Here

    print(CR + "***** ENTERING PAGSTester.testValueMissingTester() *****" + CR);
    String msg = null;
  
    msg = "Creating a new IPerson";
    print(msg);
    IPerson newPerson = getIPerson("de3");
    assertNotNull(msg, newPerson);
       
    print("Adding attributes to IPerson.");
    newPerson.setAttribute(key1, randomStrings[0]);
    newPerson.setAttribute(key2, new String());
    msg = "Testing IPerson " + newPerson;
    print(msg);

    String testKey = randomStrings[0].toLowerCase();
View Full Code Here

  public void renderXML (ContentHandler out, String uid) throws PortalException {
    ChannelState channelState = (ChannelState)channelStateMap.get(uid);
    ChannelStaticData staticData = channelState.getStaticData();
    ChannelRuntimeData runtimeData = channelState.getRuntimeData();
    IPerson person = staticData.getPerson();
    Document doc = DocumentFactory.getNewDocument();

    Element attributesE = doc.createElement("attributes");
   
    IPersonAttributeDao pa = PersonDirectory.getPersonAttributeDao();
    Set possibleAttrs = pa.getPossibleUserAttributeNames();
   
    if (possibleAttrs != null)
        possibleAttrs = new HashSet(possibleAttrs);
    else
        possibleAttrs = new HashSet();
   
    for (Enumeration attribs = person.getAttributeNames(); attribs.hasMoreElements(); ) {
      // Get the attribute name
      String attName = (String) attribs.nextElement();
     
      // Remove this attr from the list of possible attrs
      possibleAttrs.remove(attName);
     
      // Set the attribute
      Element attributeE = doc.createElement("attribute");

      Element nameE = doc.createElement("name");
      nameE.appendChild(doc.createTextNode(attName));
      attributeE.appendChild(nameE);

      // Get the IPerson attribute value for this eduPerson attribute name
      if (person.getAttributeValues(attName) != null) {
        Object[] values = person.getAttributeValues(attName);
        for (int i = 0; i < values.length; i++) {
           if (log.isTraceEnabled())
               log.trace("type of value["+i+"] is " + values[i].getClass().getName());
           String value = values[i].toString();
           Element valueE = doc.createElement("value");
View Full Code Here

        ChannelState channelState = (ChannelState)channelStateMap.get(uid);
        ChannelStaticData staticData = channelState.getStaticData();
        ChannelRuntimeData runtimeData = channelState.getRuntimeData();

        String attrName = runtimeData.getParameter("attribute");
        IPerson person = staticData.getPerson();

        if ( attrName == null ) {
            attrName = "";
        }

        // get the image out of the IPerson as a byte array.
        // Note:  I am assuming here that the only thing that this
        // IMimeResponse will return is a jpegPhoto.  Some other
        // generalized mechanism will need to be inserted here to
        // support other mimetypes and IPerson attributes.
        byte[] imgBytes = (byte [])person.getAttribute(attrName);

        // need to create a ByteArrayInputStream()

        if ( imgBytes == null ) {
            imgBytes = new byte[0]; // let's avoid a null pointer
View Full Code Here

    private IPerson person;
   
    private RestrictedPerson restrictedPerson;
   
    protected void setUp() {
        IPerson fullPerson = new PersonImpl();
        fullPerson.setAttribute("att1", "val1");
        fullPerson.setAttribute("att2", "val2");
       
        fullPerson.setFullName("George Washington");
       
        fullPerson.setID(27);
       
        fullPerson.setSecurityContext(new DummySecurityContext());
       
       
        this.person = fullPerson;
        this.restrictedPerson = new RestrictedPerson(fullPerson);
    }
View Full Code Here

    HttpSession session = request.getSession(false);

    if (session != null) {
        // Record that an authenticated user is requesting to log out
        try {
            IPerson person = PersonManagerFactory.getPersonManagerInstance().getPerson(request);
            if (person != null && person.getSecurityContext().isAuthenticated()) {
                StatsRecorder.recordLogout(person);
            }
        } catch (Exception e) {
            log.error("Exception recording logout " +
                    "associated with request " + request, e);
View Full Code Here

TOP

Related Classes of org.jasig.portal.security.IPerson

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.