@Override
  public int compareTo(TasksEntry tasksEntry) {
    int value = 0;

    if (getPriority() < tasksEntry.getPriority()) {
      value = -1;
    } else if (getPriority() > tasksEntry.getPriority()) {
      value = 1;
    } else {
      value = 0;
    }

    if (value != 0) {
      return value;
    }

    value = DateUtil.compareTo(getDueDate(), tasksEntry.getDueDate());

    if (value != 0) {
      return value;
    }

    value = DateUtil.compareTo(getCreateDate(), tasksEntry.getCreateDate());

    if (value != 0) {
      return value;
    }

    return 0;
  }
  public int compareTo(MBThread mbThread) {
    int value = 0;

    if (getPriority() < mbThread.getPriority()) {
      value = -1;
    } else if (getPriority() > mbThread.getPriority()) {
      value = 1;
    } else {
      value = 0;
    }

    value = value * -1;

    if (value != 0) {
      return value;
    }

    value = DateUtil.compareTo(getLastPostDate(), mbThread.getLastPostDate());

    value = value * -1;

    if (value != 0) {
      return value;
    }

    return 0;
  }
  @Override
  public int compareTo(PasswordTracker passwordTracker) {
    int value = 0;

    if (getUserId() < passwordTracker.getUserId()) {
      value = -1;
    } else if (getUserId() > passwordTracker.getUserId()) {
      value = 1;
    } else {
      value = 0;
    }

    value = value * -1;

    if (value != 0) {
      return value;
    }

    value = DateUtil.compareTo(getCreateDate(), passwordTracker.getCreateDate());

    value = value * -1;

    if (value != 0) {
      return value;
    }

    return 0;
  }
  public int compareTo(CdsPerformanceAppraisalSlotRating cdsPerformanceAppraisalSlotRating) {
    int value = 0;

    value = DateUtil.compareTo(getRatingAt(), cdsPerformanceAppraisalSlotRating.getRatingAt());

    if (value != 0) {
      return value;
    }

    return 0;
  }
Ejemplo n.º 5
0
  public int compareTo(VcmsArticleStatus vcmsArticleStatus) {
    int value = 0;

    value = DateUtil.compareTo(getCreatedDate(), vcmsArticleStatus.getCreatedDate());

    if (value != 0) {
      return value;
    }

    return 0;
  }
Ejemplo n.º 6
0
  @Override
  public int compareTo(Phone phone) {
    int value = 0;

    value = DateUtil.compareTo(getCreateDate(), phone.getCreateDate());

    if (value != 0) {
      return value;
    }

    return 0;
  }
  @Override
  public int compareTo(BackgroundTask backgroundTask) {
    int value = 0;

    value = DateUtil.compareTo(getCreateDate(), backgroundTask.getCreateDate());

    if (value != 0) {
      return value;
    }

    return 0;
  }
  public int compareTo(MeetupsEntry meetupsEntry) {
    int value = 0;

    value = DateUtil.compareTo(getStartDate(), meetupsEntry.getStartDate());

    value = value * -1;

    if (value != 0) {
      return value;
    }

    return 0;
  }
  public int compareTo(DLFileRank dlFileRank) {
    int value = 0;

    value = DateUtil.compareTo(getCreateDate(), dlFileRank.getCreateDate());

    value = value * -1;

    if (value != 0) {
      return value;
    }

    return 0;
  }
  public int compareTo(MeetupsRegistration meetupsRegistration) {
    int value = 0;

    value = DateUtil.compareTo(getModifiedDate(), meetupsRegistration.getModifiedDate());

    value = value * -1;

    if (value != 0) {
      return value;
    }

    return 0;
  }
  public int compareTo(MemberRequest memberRequest) {
    int value = 0;

    value = DateUtil.compareTo(getCreateDate(), memberRequest.getCreateDate());

    value = value * -1;

    if (value != 0) {
      return value;
    }

    return 0;
  }
  public int compareTo(WarrantUserUniqueId warrantUserUniqueId) {
    int value = 0;

    value = DateUtil.compareTo(getCreateDate(), warrantUserUniqueId.getCreateDate());

    value = value * -1;

    if (value != 0) {
      return value;
    }

    return 0;
  }
Ejemplo n.º 13
0
  public int compareTo(VcmsLogger vcmsLogger) {
    int value = 0;

    value = DateUtil.compareTo(getCreatedDate(), vcmsLogger.getCreatedDate());

    value = value * -1;

    if (value != 0) {
      return value;
    }

    return 0;
  }
Ejemplo n.º 14
0
  @Override
  public int compare(Object obj1, Object obj2) {
    TrashEntry entry1 = (TrashEntry) obj1;
    TrashEntry entry2 = (TrashEntry) obj2;

    int value = DateUtil.compareTo(entry1.getCreateDate(), entry2.getCreateDate());

    if (_ascending) {
      return value;
    } else {
      return -value;
    }
  }
  public int compareTo(JIRAChangeGroup jiraChangeGroup) {
    int value = 0;

    value = DateUtil.compareTo(getCreateDate(), jiraChangeGroup.getCreateDate());

    value = value * -1;

    if (value != 0) {
      return value;
    }

    return 0;
  }
Ejemplo n.º 16
0
  @Override
  public int compare(Object obj1, Object obj2) {
    Date createDate1 = getCreateDate(obj1);
    Date createDate2 = getCreateDate(obj2);

    int value = DateUtil.compareTo(createDate1, createDate2);

    if (_ascending) {
      return value;
    } else {
      return -value;
    }
  }
  public int compare(Object obj1, Object obj2) {
    PmlHoSoCongViec pmlHoSoCongViec1 = (PmlHoSoCongViec) obj1;
    PmlHoSoCongViec pmlHoSoCongViec2 = (PmlHoSoCongViec) obj2;

    int value =
        DateUtil.compareTo(pmlHoSoCongViec1.getNgayMoHSCV(), pmlHoSoCongViec2.getNgayMoHSCV());

    if (_asc) {
      return value;
    } else {
      return -value;
    }
  }
  public int compareTo(PollsQuestion pollsQuestion) {
    int value = 0;

    value = DateUtil.compareTo(getCreateDate(), pollsQuestion.getCreateDate());

    value = value * -1;

    if (value != 0) {
      return value;
    }

    return 0;
  }
Ejemplo n.º 19
0
  public int compareTo(PaymentMethod paymentMethod) {
    int value = 0;

    value = DateUtil.compareTo(getModifiedDate(), paymentMethod.getModifiedDate());

    value = value * -1;

    if (value != 0) {
      return value;
    }

    return 0;
  }
  @Override
  public int compare(Object obj1, Object obj2) {
    DDMStructure template1 = (DDMStructure) obj1;
    DDMStructure template2 = (DDMStructure) obj2;

    int value = DateUtil.compareTo(template1.getModifiedDate(), template2.getModifiedDate());

    if (_ascending) {
      return value;
    } else {
      return -value;
    }
  }
Ejemplo n.º 21
0
  @Override
  public int compareTo(KBArticle kbArticle) {
    int value = 0;

    value = DateUtil.compareTo(getModifiedDate(), kbArticle.getModifiedDate());

    value = value * -1;

    if (value != 0) {
      return value;
    }

    return 0;
  }
  @Override
  public int compareTo(MicroblogsEntry microblogsEntry) {
    int value = 0;

    value = DateUtil.compareTo(getCreateDate(), microblogsEntry.getCreateDate());

    value = value * -1;

    if (value != 0) {
      return value;
    }

    return 0;
  }
  @Override
  public int compareTo(JIRAIssue jiraIssue) {
    int value = 0;

    value = DateUtil.compareTo(getModifiedDate(), jiraIssue.getModifiedDate());

    value = value * -1;

    if (value != 0) {
      return value;
    }

    return 0;
  }
Ejemplo n.º 24
0
  public void validateModifiedDate(
      AuditedModel auditedModel, Class<? extends PortalException> clazz) throws PortalException {

    int value = DateUtil.compareTo(auditedModel.getModifiedDate(), _formDate);

    if (value > 0) {
      try {
        throw clazz.newInstance();
      } catch (IllegalAccessException iae) {
        throw new RuntimeException(iae);
      } catch (InstantiationException ie) {
        throw new RuntimeException(ie);
      }
    }
  }
Ejemplo n.º 25
0
  public int compareTo(CalendarBooking calendarBooking) {
    int value = 0;

    value = DateUtil.compareTo(getStartDate(), calendarBooking.getStartDate());

    if (value != 0) {
      return value;
    }

    value = getTitle().toLowerCase().compareTo(calendarBooking.getTitle().toLowerCase());

    if (value != 0) {
      return value;
    }

    return 0;
  }
Ejemplo n.º 26
0
  @Override
  protected void validateImport(
      StagedModel stagedModel,
      StagedModelAssets stagedModelAssets,
      Map<String, List<StagedModel>> dependentStagedModelsMap,
      Group group)
      throws Exception {

    ManifestSummary manifestSummary = ExportImportHelperUtil.getManifestSummary(portletDataContext);

    Map<String, LongWrapper> modelAdditionCounters = manifestSummary.getModelAdditionCounters();

    Assert.assertEquals(4, modelAdditionCounters.size());
    Assert.assertEquals(
        1, manifestSummary.getModelAdditionCount(DDMStructure.class, JournalArticle.class));
    Assert.assertEquals(
        1, manifestSummary.getModelAdditionCount(DDMTemplate.class, DDMStructure.class));
    Assert.assertEquals(1, manifestSummary.getModelAdditionCount(JournalArticle.class));
    Assert.assertEquals(1, manifestSummary.getModelAdditionCount(JournalFolder.class));
    Assert.assertTrue(DateUtil.equals(_exportDate, manifestSummary.getExportDate(), true));
  }
  @Override
  protected void validateImportedStagedModel(
      StagedModel stagedModel, StagedModel importedStagedModel) throws Exception {

    Assert.assertTrue(
        stagedModel.getCreateDate() + " " + importedStagedModel.getCreateDate(),
        DateUtil.equals(stagedModel.getCreateDate(), importedStagedModel.getCreateDate()));
    Assert.assertEquals(stagedModel.getUuid(), importedStagedModel.getUuid());

    Layout layout = (Layout) stagedModel;
    Layout importedLayout = (Layout) importedStagedModel;

    Assert.assertEquals(layout.getName(), importedLayout.getName());
    Assert.assertEquals(layout.getTitle(), importedLayout.getTitle());
    Assert.assertEquals(layout.getDescription(), importedLayout.getDescription());
    Assert.assertEquals(layout.getKeywords(), importedLayout.getKeywords());
    Assert.assertEquals(layout.getRobots(), importedLayout.getRobots());
    Assert.assertEquals(layout.getType(), importedLayout.getType());
    Assert.assertEquals(layout.getFriendlyURL(), importedLayout.getFriendlyURL());
    Assert.assertEquals(layout.getCss(), importedLayout.getCss());
  }
  @Override
  public int compare(Object obj1, Object obj2) {
    JournalArticle article1 = (JournalArticle) obj1;
    JournalArticle article2 = (JournalArticle) obj2;

    int value = DateUtil.compareTo(article1.getDisplayDate(), article2.getDisplayDate());

    if (value == 0) {
      if (article1.getVersion() < article2.getVersion()) {
        value = -1;
      } else if (article1.getVersion() > article2.getVersion()) {
        value = 1;
      }
    }

    if (_ascending) {
      return value;
    } else {
      return -value;
    }
  }
Ejemplo n.º 29
0
  public int compareTo(MBMessage mbMessage) {
    int value = 0;

    value = DateUtil.compareTo(getCreateDate(), mbMessage.getCreateDate());

    if (value != 0) {
      return value;
    }

    if (getMessageId() < mbMessage.getMessageId()) {
      value = -1;
    } else if (getMessageId() > mbMessage.getMessageId()) {
      value = 1;
    } else {
      value = 0;
    }

    if (value != 0) {
      return value;
    }

    return 0;
  }
Ejemplo n.º 30
0
  protected void addURLElement(
      Element element,
      String url,
      UnicodeProperties typeSettingsProperties,
      Date modifiedDate,
      String canonicalURL,
      Map<Locale, String> alternateURLs) {

    Element urlElement = element.addElement("url");

    Element locElement = urlElement.addElement("loc");

    locElement.addText(encodeXML(url));

    if (typeSettingsProperties == null) {
      if (Validator.isNotNull(PropsValues.SITES_SITEMAP_DEFAULT_CHANGE_FREQUENCY)) {

        Element changefreqElement = urlElement.addElement("changefreq");

        changefreqElement.addText(PropsValues.SITES_SITEMAP_DEFAULT_CHANGE_FREQUENCY);
      }

      if (Validator.isNotNull(PropsValues.SITES_SITEMAP_DEFAULT_PRIORITY)) {

        Element priorityElement = urlElement.addElement("priority");

        priorityElement.addText(PropsValues.SITES_SITEMAP_DEFAULT_PRIORITY);
      }
    } else {
      String changefreq = typeSettingsProperties.getProperty("sitemap-changefreq");

      if (Validator.isNotNull(changefreq)) {
        Element changefreqElement = urlElement.addElement("changefreq");

        changefreqElement.addText(changefreq);
      } else if (Validator.isNotNull(PropsValues.SITES_SITEMAP_DEFAULT_CHANGE_FREQUENCY)) {

        Element changefreqElement = urlElement.addElement("changefreq");

        changefreqElement.addText(PropsValues.SITES_SITEMAP_DEFAULT_CHANGE_FREQUENCY);
      }

      String priority = typeSettingsProperties.getProperty("sitemap-priority");

      if (Validator.isNotNull(priority)) {
        Element priorityElement = urlElement.addElement("priority");

        priorityElement.addText(priority);
      } else if (Validator.isNotNull(PropsValues.SITES_SITEMAP_DEFAULT_PRIORITY)) {

        Element priorityElement = urlElement.addElement("priority");

        priorityElement.addText(PropsValues.SITES_SITEMAP_DEFAULT_PRIORITY);
      }
    }

    if (modifiedDate != null) {
      Element modifiedDateElement = urlElement.addElement("lastmod");

      DateFormat iso8601DateFormat = DateUtil.getISO8601Format();

      modifiedDateElement.addText(iso8601DateFormat.format(modifiedDate));
    }

    if (alternateURLs != null) {
      for (Map.Entry<Locale, String> entry : alternateURLs.entrySet()) {
        Locale locale = entry.getKey();
        String href = entry.getValue();

        Element alternateURLElement =
            urlElement.addElement("xhtml:link", "http://www.w3.org/1999/xhtml");

        alternateURLElement.addAttribute("href", href);
        alternateURLElement.addAttribute("hreflang", LocaleUtil.toW3cLanguageId(locale));
        alternateURLElement.addAttribute("rel", "alternate");
      }

      Element alternateURLElement =
          urlElement.addElement("xhtml:link", "http://www.w3.org/1999/xhtml");

      alternateURLElement.addAttribute("rel", "alternate");
      alternateURLElement.addAttribute("hreflang", "x-default");
      alternateURLElement.addAttribute("href", canonicalURL);
    }
  }