Examples of ITextAttribute


Examples of com.agiletec.aps.system.common.entity.model.attribute.ITextAttribute

    }
  }
 
  protected IUserProfile createProfile(String nome, String cognome, String email, boolean cat1, boolean cat2) {
    IUserProfile profile = _profileManager.getDefaultProfileType();
    ITextAttribute fullnameAttr = (ITextAttribute) profile.getAttribute("fullname");
    fullnameAttr.setText(nome, null);
    ITextAttribute emailAttr = (ITextAttribute) profile.getAttribute("email");
    emailAttr.setText(email, null);
    BooleanAttribute boolean1 = (BooleanAttribute) profile.getAttribute("boolean1");
    boolean1.setBooleanValue(new Boolean(cat1));
    BooleanAttribute boolean2 = (BooleanAttribute) profile.getAttribute("boolean2");
    boolean2.setBooleanValue(new Boolean(cat2));
    return profile;
View Full Code Here

Examples of com.agiletec.aps.system.common.entity.model.attribute.ITextAttribute

  protected boolean checkEmailAddress() {
    boolean validated = false;
    Message message = this.getMessage();
    String mailAttributeName = this.getMessageManager().getMailAttributeName(message.getTypeCode());
    if (null!=mailAttributeName) {
      ITextAttribute mailAttribute = (ITextAttribute) this.getMessage().getAttribute(mailAttributeName);
      if (null!=mailAttribute) {
        String eMail = mailAttribute.getText();
        if (null!=eMail && eMail.length()>0 && EmailAddressValidator.isValidEmailAddress(eMail)) {
          validated = true;
        }
      }
    }
View Full Code Here

Examples of com.agiletec.aps.system.common.entity.model.attribute.ITextAttribute

  protected String extractUserMail(Message message, MessageTypeNotifierConfig config) {
    String email = null;
    if (null!=config) {
      String mailAttrName = config.getMailAttrName();
      if (null!=mailAttrName && mailAttrName.length()>0) {
        ITextAttribute mailAttribute = (ITextAttribute) message.getAttribute(mailAttrName);
        if (mailAttribute!=null) {
          email = mailAttribute.getText();
        }
      }
    }
    return email;
  }
View Full Code Here

Examples of com.agiletec.aps.system.common.entity.model.attribute.ITextAttribute

  private SyndEntry createEntry(ContentRecordVO contentVO, String langCode, String feedLink, HttpServletRequest req, HttpServletResponse resp) throws ApsSystemException {
    SyndEntry entry = new SyndEntryImpl();
    RssContentMapping mapping = this.getContentMapping().get(contentVO.getTypeCode());
    try {
      Content content = (Content) this.getContentManager().loadContent(contentVO.getId(), true);
      ITextAttribute titleAttr = (ITextAttribute) content.getAttribute(mapping.getTitleAttributeName());
      String title = (titleAttr.getTextForLang(langCode));
      if (null == title || title.trim().length() == 0) {
        title = titleAttr.getText();
      }
      entry.setTitle(title);
      String link = this.createLink(content, feedLink);
      entry.setLink(link);
      entry.setPublishedDate(contentVO.getModify());
      ITextAttribute descrAttr = (ITextAttribute) content.getAttribute(mapping.getDescriptionAttributeName());
      if (null != descrAttr) {
        SyndContent description = new SyndContentImpl();
        description.setType(JpRssSystemConstants.SYNDCONTENT_TYPE_TEXTHTML);
        String inLang = descrAttr.getTextForLang(langCode);
        //TODO Ottimizzare!
        RequestContext requestContext = new RequestContext();
        requestContext.setRequest(req);
        requestContext.setResponse(resp);
        if (null != inLang && inLang.length() >0) {
          String textValue = this.getLinkResolver().resolveLinks(inLang, requestContext);
          if (null != textValue && textValue.trim().length()>0) {
            description.setValue(textValue);
          } else {
            description.setValue(descrAttr.getText());
          }
        } else {
          String textValue =  this.getLinkResolver().resolveLinks(descrAttr.getText(), requestContext);
          description.setValue(textValue);
        }
        entry.setDescription(description);
      }
    } catch (Throwable t) {
View Full Code Here

Examples of com.agiletec.aps.system.common.entity.model.attribute.ITextAttribute

    super.updateEntity(content, request);
    try {
            if (null == content) return;
          String authorAttrName = this.getAuthorAttributeName(request);
        if (authorAttrName != null) {
          ITextAttribute authorAttribute = (ITextAttribute) content.getAttribute(authorAttrName);
          if (null != authorAttribute) {
            UserDetails user =  (UserDetails) request.getSession().getAttribute(SystemConstants.SESSIONPARAM_CURRENT_USER);
            Lang defaultLang = super.getLangManager().getDefaultLang();
            authorAttribute.setText(user.getUsername(), defaultLang.getCode());
          }
        }
        } catch (Throwable t) {
          ApsSystemUtils.logThrowable(t, this, "updateEntity");
          throw new RuntimeException("Errore on updateEntity", t);
View Full Code Here

Examples of com.agiletec.aps.system.common.entity.model.attribute.ITextAttribute

  }

  @Override
  public String getAuthor(Content content, HttpServletRequest request) {
    String authorAttrName = this.getAuthorAttributeName(request);
    ITextAttribute authorAttribute = (ITextAttribute) content.getAttribute(authorAttrName);
    if (null != authorAttribute && null != authorAttribute.getText()) {
      return authorAttribute.getText();
    } else {
      return content.getLastEditor();
    }
  }
View Full Code Here

Examples of com.agiletec.aps.system.common.entity.model.attribute.ITextAttribute

  protected String getMailAddress(String username) throws Throwable {
    String email = null;
    IUserProfileManager profileManager = (IUserProfileManager) super.getBeanFactory().getBean(SystemConstants.USER_PROFILE_MANAGER);
    IUserProfile profile = profileManager.getProfile(username);
    if (null != profile) {
      ITextAttribute mailAttribute = (ITextAttribute) profile.getAttributeByRole(SystemConstants.USER_PROFILE_ATTRIBUTE_ROLE_MAIL);
      if (null != mailAttribute && mailAttribute.getText().trim().length() > 0) {
        email = mailAttribute.getText();
      }
    }
    return email;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.