Package com.hlcl.rql.as

Examples of com.hlcl.rql.as.StandardFieldTextElement


   */
  public String getResponsibleUserNameIfAvailable(String ifNotAvailable) throws RQLException {
    Page page = getPage();
    String templateElementName = getParameter("respNameTmpltElemName");
    if (page.contains(templateElementName)) {
      StandardFieldTextElement rdText = page.getStandardFieldTextElement(templateElementName);
      if (rdText != null) {
        return rdText.getText();
      }
    }
    return ifNotAvailable;
  }
View Full Code Here


   */
  public String getResponsibleUserIdIfAvailable(String ifNotAvailable) throws RQLException {
    Page page = getPage();
    String templateElementName = getParameter("respIdTmpltElemName");
    if (page.contains(templateElementName)) {
      StandardFieldTextElement rdText = page.getStandardFieldTextElement(templateElementName);
      if (rdText != null) {
        return rdText.getText();
      }
    }
    return ifNotAvailable;
  }
View Full Code Here

    // determine department number from responsible name
    String depNoToLinkOrNull = getResponsibleNameDepartmentNumber();

    // convert responsible id and type
    String respIdTmpltElemName = getParameter("respIdTmpltElemName");
    StandardFieldTextElement respIdElem = getStandardFieldTextElement(respIdTmpltElemName);
    if (!respIdElem.isEmpty()) {
      String newRespId = respIdElem.getText();

      // 1. remove invalid parts (like @hlag.com)
      String[] invalidSuffixes = StringHelper.split(getParameter("responsibleIdSuffixes2delete"), ",");
      newRespId = StringHelper.removeSuffixes(newRespId, invalidSuffixes, true); // ignore case

      // 2. replace group mailboxes with group mailbox ID (case insensitive)
      newRespId = convertResponsibleId(newRespId);

      // 3. update value
      if (!respIdElem.getText().equals(newRespId)) {
        addSetStandardFieldTextValue(respIdTmpltElemName, newRespId);
      }

      // set responsible type to nonPersonal for known group mailboxes
      java.util.List<String> knownGroupMailboxIds = getKnownGroupMailboxIds();
      if (knownGroupMailboxIds.contains(newRespId.toLowerCase())) {
        // change type to nonPersonal
        addSetOptionListValue(getParameter("responsibleIdTypeTmpltElemName"),
            getParameter("responsibleIdTypeGroupMailboxValue"));
      }

      // determine department number for group mailboxes
      Map<String, String> responsibleId2DepartmentNumberMap = getResponsibleId2DepartmentNumberMap();
      String mapDepNo = responsibleId2DepartmentNumberMap.get(newRespId.toLowerCase());
      if (mapDepNo != null) {
        depNoToLinkOrNull = mapDepNo;
      }
    }

    // try to link the department row for the determined department number, if no row linked
    boolean linked = false;
    if (!isResponsibleDepartmentLinked() && depNoToLinkOrNull != null) {
      Page newRowPg = getResponsibleDepartments().findByHeadline(depNoToLinkOrNull);
      if (newRowPg != null) {
        linkResponsibleDepartment(newRowPg);
        linked = true;
      }
    }

    // try to remove department text from responsible_name field, if a department was linked
    if (linked) {
      String separator = " - ";
      String respNameTmpltElemName = getParameter("respNameTmpltElemName");
      StandardFieldTextElement respNameElem = getStandardFieldTextElement(respNameTmpltElemName);
      if (!respNameElem.isEmpty()) {
        String respName = respNameElem.getText();
        int pos = respName.indexOf(separator);
        if (pos >= 0) {
          String newName = respName.substring(pos + separator.length());
          addSetStandardFieldTextValue(respNameTmpltElemName, newName);
        }
View Full Code Here

TOP

Related Classes of com.hlcl.rql.as.StandardFieldTextElement

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.