Package com.agiletec.aps.system.common.entity.model

Examples of com.agiletec.aps.system.common.entity.model.IApsEntity


    try {
      Collection<String> usernames = new HashSet<String>();
      IUserProfileManager profileManager = this.getUserProfileManager();
      Iterator<IApsEntity> prototypes = profileManager.getEntityPrototypes().values().iterator();
      while (prototypes.hasNext()) {
        IApsEntity prototype = prototypes.next();
        AttributeInterface eMailAttr = prototype.getAttributeByRole(SystemConstants.USER_PROFILE_ATTRIBUTE_ROLE_MAIL);
        if (eMailAttr!=null) {
          EntitySearchFilter[] filters = {
              new EntitySearchFilter(IEntityManager.ENTITY_TYPE_CODE_FILTER_KEY, false, prototype.getTypeCode(), false),
              new EntitySearchFilter(eMailAttr.getName(), true, email, false) };
          usernames.addAll(profileManager.searchId(filters));
        }
      }
      return usernames;
View Full Code Here


  public List<IApsEntity> getProfileTypes() {
    if (this._profileTypes == null) {
      this._profileTypes = new ArrayList<IApsEntity>();
      Iterator<IApsEntity> prototypesIter = this.getUserProfileManager().getEntityPrototypes().values().iterator();
      while (prototypesIter.hasNext()) {
        IApsEntity profile = prototypesIter.next();
        if (profile.getAttributeByRole(SystemConstants.USER_PROFILE_ATTRIBUTE_ROLE_MAIL) != null) {
          this._profileTypes.add(profile);
        }
      }
    }
    return this._profileTypes;
View Full Code Here

    return contact;
  }
 
  protected IApsEntity createEntityFromXml(String entityTypeCode, String xml) throws ApsSystemException {
    try {
      IApsEntity entityPrototype = this.getUserProfileManager().getProfileType(entityTypeCode);
      SAXParserFactory parseFactory = SAXParserFactory.newInstance();     
      SAXParser parser = parseFactory.newSAXParser();
      InputSource is = new InputSource(new StringReader(xml));
      EntityHandler handler = this.getEntityHandler();
      handler.initHandler(entityPrototype, "profile", null);
View Full Code Here

    Map<String, RssContentMapping> mappings = new HashMap<String, RssContentMapping>();
    try {
      Map<String, IApsEntity> contentTypes = this.getContentManager().getEntityPrototypes();
      Iterator<IApsEntity> contentTypeIter = contentTypes.values().iterator();
      while (contentTypeIter.hasNext()) {
        IApsEntity contentType = contentTypeIter.next();
        AttributeInterface attributeTitle = contentType.getAttributeByRole(JpRssSystemConstants.ATTRIBUTE_ROLE_RSS_CONTENT_TITLE);
        if (null != attributeTitle) {
          RssContentMapping mapping = new RssContentMapping();
          mapping.setContentType(contentType.getTypeCode());
          mapping.setTitleAttributeName(attributeTitle.getName());
          AttributeInterface attributeDescr = contentType.getAttributeByRole(JpRssSystemConstants.ATTRIBUTE_ROLE_RSS_CONTENT_DESCRIPTION);
          if (null != attributeDescr) {
            mapping.setDescriptionAttributeName(attributeDescr.getName());
          }
          mappings.put(contentType.getTypeCode(), mapping);
        }
      }
    } catch (Throwable t) {
      ApsSystemUtils.logThrowable(t, this, "loadMappingConfig");
      throw new ApsSystemException("Error loading rss content mapping", t);
View Full Code Here

    super.validate();
    Map<String, String> profileMapping = new HashMap<String, String>();
    try {
      List<VCardContactField> vCardFields = this.getVcardManager().getVCardFields();
      Set<String> selectedFields = this.getSelectedFields();
      IApsEntity apsEntity = this.getUserProfileManager().getDefaultProfileType();
      for (VCardContactField field : vCardFields) {
        String fieldCode = field.getCode();
        if (selectedFields.contains(fieldCode)) {
          String paramName = "sel_" + fieldCode;
          String profileAttribute = this.getRequest().getParameter(paramName);
          if (profileAttribute == null || apsEntity.getAttribute(profileAttribute) == null) {
            String[] args = { this.getText("jpaddressbook.vcard.field." + fieldCode) };
            this.addFieldError(paramName, this.getText("Errors.vcardConfig.attribute.notValid", args));
          } else {
            profileMapping.put(fieldCode, profileAttribute);
          }
View Full Code Here

   * Returns the valid VCard fields
   * @return the valid VCard fields
   */
  public List<AttributeInterface> getEntityFields() {
    List<AttributeInterface> entityFields = new ArrayList<AttributeInterface>();
    IApsEntity apsEntity = this.getUserProfileManager().getDefaultProfileType();
    List<AttributeInterface>  attributeInterfaces = apsEntity.getAttributeList();
    if(attributeInterfaces != null){
      for (int i = 0; i < attributeInterfaces.size(); i++) {
        AttributeInterface attribute = attributeInterfaces.get(i);
        if(JpaddressbookSystemConstants.ATTRIBUTE_TYPE_DATE.equals(attribute.getType().trim())
            || JpaddressbookSystemConstants.ATTRIBUTE_TYPE_ENUMERATOR.equals(attribute.getType().trim())
View Full Code Here

  public List<AttributeInterface> getSelectableAttributes() {
    String typeCode = this.getWidget().getConfig().getProperty("typeCode");
    List<AttributeInterface> attributesForSelect = new ArrayList<AttributeInterface>();
    if (null != typeCode && typeCode.length() > 0) {
      IApsEntity  contentType =  getContentManager().getEntityPrototype(typeCode);
      List<AttributeInterface> attributes =  contentType.getAttributeList();
      for (AttributeInterface attribute : attributes) {
        if (attribute.isTextAttribute()) {
          attributesForSelect.add(attribute);
        }
      }
View Full Code Here

TOP

Related Classes of com.agiletec.aps.system.common.entity.model.IApsEntity

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.