Package edu.hawaii.ics.csdl.jupiter.file.review

Examples of edu.hawaii.ics.csdl.jupiter.file.review.ReviewIssueMeta


   * @throws XMLStreamException Thrown if there is an error writing to the stream writer.
   */
  public static void writeReviewIssueMeta(XMLStreamWriter writer, ReviewIssue reviewIssue)
      throws XMLStreamException {
    writer.writeStartElement(ELEMENT_REVIEW_ISSUE_META);
    ReviewIssueMeta reviewIssueMeta = reviewIssue.getReviewIssueMeta();
   
    writer.writeStartElement(ELEMENT_CREATION_DATE);
    CreationDate creationDate = reviewIssueMeta.getCreationDate();
    writer.writeAttribute(ATTRIBUTE_FORMAT, creationDate.getFormat());
    writer.writeCharacters(creationDate.getValue());
    writer.writeEndElement(); // CreationDate
   
    writer.writeStartElement(ELEMENT_LAST_MODIFICATION_DATE);
    LastModificationDate lastModificationDate = reviewIssueMeta.getLastModificationDate();
    writer.writeAttribute(ATTRIBUTE_FORMAT, lastModificationDate.getFormat());
    writer.writeCharacters(lastModificationDate.getValue());
    writer.writeEndElement(); // LastModificationDate
   
    writer.writeEndElement(); // ReviewIssueMeta
View Full Code Here


   * @param review The review issue to add the metadata to.
   * @throws XMLStreamException Thrown if there is an error while reading from the stream.
   */
  private static void parseReviewIssueMeta(XMLStreamReader reader, ReviewIssue reviewIssue)
      throws XMLStreamException {
    ReviewIssueMeta meta = new ReviewIssueMeta();
   
    boolean endFound = false;
   
    while (!endFound) {
      if (reader.hasNext()) {
        int eventType = reader.next();

        if (eventType == XMLStreamConstants.START_ELEMENT) {
          QName elementQName = reader.getName();
          String elementName = elementQName.toString();

         
          if (ELEMENT_CREATION_DATE.equals(elementName)) {
            CreationDate creationDate = new CreationDate();
            creationDate.setFormat(reader.getAttributeValue(null, ATTRIBUTE_FORMAT));
           
            // get the CHARACTERS event to get the date string
            eventType = reader.next();
            if (eventType == XMLStreamConstants.CHARACTERS) {
              creationDate.setValue(reader.getText());
            }
            meta.setCreationDate(creationDate);
          }
          else if (ELEMENT_LAST_MODIFICATION_DATE.equals(elementName)) {
            LastModificationDate lastModDate = new LastModificationDate();
            lastModDate.setFormat(reader.getAttributeValue(null, ATTRIBUTE_FORMAT));
           
            // get the CHARACTERS event to get the date string
            eventType = reader.next();
            if (eventType == XMLStreamConstants.CHARACTERS) {
              lastModDate.setValue(reader.getText());
            }
            meta.setLastModificationDate(lastModDate);
          }
        }
        else if (eventType == XMLStreamConstants.END_ELEMENT) {
          QName elementQName = reader.getName();

View Full Code Here

    // Last modification date for review issue meta
    LastModificationDate lastModDate = new LastModificationDate();
    lastModDate.setFormat(DATE_FORMAT_PATTERN);
    lastModDate.setValue(DATE_FORMATTER.format(reviewIssue.getModificationDate()));
    // review issue meta
    ReviewIssueMeta meta = new ReviewIssueMeta();
    meta.setCreationDate(creationDate);
    meta.setLastModificationDate(lastModDate);
    xmlReviewIssue.setReviewIssueMeta(meta);
    // reviewer id
    xmlReviewIssue.setReviewerId(reviewIssue.getReviewer());
    // assigned to
    xmlReviewIssue.setAssignedTo(reviewIssue.getAssignedTo());
View Full Code Here

   */
  private static ReviewIssue createReviewIssue(
      edu.hawaii.ics.csdl.jupiter.file.review.ReviewIssue xmlReviewIssue, IFile reviewIFile)
      throws ReviewException {
    try {
      ReviewIssueMeta reviewIssueMeta = xmlReviewIssue.getReviewIssueMeta();
      CreationDate creationDate = reviewIssueMeta.getCreationDate();
      Date createDate = createDate(creationDate.getValue(), creationDate.getFormat());
      LastModificationDate lastModificationDate = reviewIssueMeta.getLastModificationDate();
      Date lastModDate = createDate(lastModificationDate.getValue(), lastModificationDate
          .getFormat());

      String reviewerId = xmlReviewIssue.getReviewerId();
      String assignedTo = xmlReviewIssue.getAssignedTo();
View Full Code Here

TOP

Related Classes of edu.hawaii.ics.csdl.jupiter.file.review.ReviewIssueMeta

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.