Package org.jasig.portal.security

Examples of org.jasig.portal.security.IPerson


     */
    public void portalEvent(ChannelStaticData channelStaticData, PortalControlStructures portalControlStructures, PortalEvent portalEvent) {
        switch (portalEvent.getEventNumber()) {
            case PortalEvent.UNSUBSCRIBE: {
                final String channelSubscribeId = channelStaticData.getChannelSubscribeId();
                final IPerson person = channelStaticData.getPerson();
                final IPortletEntity portletEntity = this.portletEntityRegistry.getPortletEntity(channelSubscribeId, person.getID());
               
                this.portletEntityRegistry.deletePortletEntity(portletEntity);
            }
            break;
           
View Full Code Here


   
    /**
     * Build a 'nice' summary string of relavent ChannelStaticData information
     */
    protected String getChannelLogInfo(ChannelStaticData channelStaticData, IPortletWindow portletWindow) {
        final IPerson person = channelStaticData.getPerson();
        return  "[channelPublishId=" + channelStaticData.getChannelPublishId() + ", " +
                "channelSubscribeId=" + channelStaticData.getChannelSubscribeId() + ", " +
                "portletApplicationId=" + portletWindow.getContextPath() + ", " +
                "portletName=" + portletWindow.getPortletName() + ", " +
                "user=" + person.getAttribute(IPerson.USERNAME) + "]";
    }
View Full Code Here

  }

  protected UserPreferences getUserPreferencesFromStore(UserProfile profile) throws Exception {
      up = ulsdb.getUserPreferences(getUserPreferencesManager().getPerson(), profile);
      IUserLayoutStore uls = UserLayoutStoreFactory.getUserLayoutStoreImpl();
      IPerson person = getUserPreferencesManager().getPerson();
      UserProfile currProfile = getCurrentUserPreferences().getProfile();
      Document layout = uls.getUserLayout(person, currProfile);
      up.synchronizeWithUserLayoutXML(layout);
      return up;
  }
View Full Code Here

        // Decide whether to render a friendly or detailed screen
        this.ssTitle = "friendly";
        try {
            final AuthorizationService authService = AuthorizationService.instance();
            final IPerson person = userPreferencesManager.getPerson();
            final EntityIdentifier ei = person.getEntityIdentifier();
            final IAuthorizationPrincipal ap = authService.newPrincipal(ei.getKey(), ei.getType());
           
            if (ap.hasPermission(SupportedPermissions.OWNER, SupportedPermissions.VIEW_ACTIVITY, SupportedPermissions.DETAILS_TARGET)) {
                this.ssTitle = "detailed";
            }
View Full Code Here

        if (channelRuntimeData != null && pcs != null && channelRuntimeData.isTargeted()) {
            final HttpServletRequest httpServletRequest = pcs.getHttpServletRequest();
            final IPortletWindowId targetedPortletWindowId = this.portletRequestParameterManager.getTargetedPortletWindowId(httpServletRequest);
            if (targetedPortletWindowId != null) {
                final String channelSubscribeId = channelStaticData.getChannelSubscribeId();
                final IPerson person = channelStaticData.getPerson();
                final IPortletEntity portletEntity = this.portletEntityRegistry.getPortletEntity(channelSubscribeId, person.getID());
               
                final IPortletEntity targetParentPortletEntity = this.portletWindowRegistry.getParentPortletEntity(httpServletRequest, targetedPortletWindowId);
               
              
                if (portletEntity.getPortletEntityId().equals(targetParentPortletEntity.getPortletEntityId())) {
View Full Code Here

            throw new InconsistentPortletModelException("No IPortletDefinition exists for channelPublishId: " + channelPublishId, null);
        }
       
        final IPortletDefinitionId portletDefinitionId = portletDefinition.getPortletDefinitionId();
        final String channelSubscribeId = channelStaticData.getChannelSubscribeId();
        final IPerson person = channelStaticData.getPerson();
        final IPortletEntity portletEntity = this.portletEntityRegistry.getOrCreatePortletEntity(portletDefinitionId, channelSubscribeId, person.getID());

        //Get/create the portlet window to init
        final HttpServletRequest httpServletRequest = portalControlStructures.getHttpServletRequest();
        final HttpServletResponse httpServletResponse = portalControlStructures.getHttpServletResponse();
       
View Full Code Here

          pstmt = con.prepareStatement("SELECT USER_DFLT_USR_ID FROM UP_USER WHERE USER_ID=?");
          pstmt.setInt(1, person.getID());
          rs = pstmt.executeQuery();
          if(rs.next()) {
            int defaultProfileUser = rs.getInt(1);
            IPerson defaultProfilePerson = new PersonImpl();
            defaultProfilePerson.setID(defaultProfileUser);
            if(defaultProfilePerson.getID() != person.getID()) {
              UserProfile templateProfile = getUserProfileByFname(defaultProfilePerson,profileFname);
              if(templateProfile != null) {
                  final UserProfile newUserProfile = new UserProfile(templateProfile);
                  newUserProfile.setLayoutId(0);
                return addUserProfile(person,newUserProfile);
View Full Code Here

public class CPersonAttributes extends BaseChannel implements IMimeResponse {

  private static final String sslLocation = "CPersonAttributes/CPersonAttributes.ssl";

  public void renderXML (ContentHandler out) throws PortalException {
    IPerson person = staticData.getPerson();
    Document doc = DocumentFactory.getNewDocument();

    Element attributesE = doc.createElement("attributes");
   
    IPersonAttributeDao pa = PersonDirectory.getPersonAttributeDao();
    Set<String> possibleAttrs = pa.getPossibleUserAttributeNames();
   
    if (possibleAttrs != null)
        possibleAttrs = new HashSet<String>(possibleAttrs);
    else
        possibleAttrs = new HashSet<String>();
       
    for (Map.Entry<String,List<Object>> y : pa.getPerson(person.getUserName()).getAttributes().entrySet()) {
       
      // Remove this attr from the list of possible attrs
      possibleAttrs.remove(y.getKey());
     
      // Set the attribute
View Full Code Here

     * Returns the MIME content in the form of an input stream.
     * Returns null if the code needs the OutputStream object
     */
    public java.io.InputStream getInputStream () throws IOException {
        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

      this.context = context;
    }

    public void setRuntimeData(ChannelRuntimeData rd) throws PortalException {
      try {
        IPerson user  = staticData.getPerson();
        editedUserProfile.setLayoutId(0);
        ulStore.updateUserProfile(user, editedUserProfile);
        user.setAttribute( Constants.PLF, null );
        ulm.loadUserLayout(true);
      } catch (Exception e) {
        throw new PortalException(e);
      }
      // return to the default state
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.