package de.ddb.pdc.metadata;

import java.util.ArrayList;
import java.util.Calendar;
import java.util.GregorianCalendar;

/**
 * Aggregates the metadata of an item from the DDB.
 */
public class DDBItem {
  private String id;
  private String title;
  private String subtitle;
  private String imageUrl;
  private String media;
  private String category;
  private String type;

  //metadata
  private ArrayList<Author> authors;
  private String institute;
  private Calendar publishedYear = new GregorianCalendar();
 
  /**
   * Creates a new DDBItem.
   *
   * @param id item ID in the DDB databse
   */
  public DDBItem(String id) {
    this.id = id;
    this.authors = new ArrayList<Author>();
  }

  /**
   * Returns the item assigned to the item by the DDB.
   */
  public String getId() {
    return id;
  }

  void setId(String id) {
    this.id = id;
  }

  /**
   * Returns the title of the work represented by the item.
   */
  public String getTitle() {
    return title;
  }

  void setTitle(String title) {
    this.title = title;
  }

  /**
   * Returns the subtitle (if any) of the work represented by the item.
   * If the work has no subtitle, null is returned.
   */
  public String getSubtitle() {
    return subtitle;
  }

  void setSubtitle(String subtitle) {
    this.subtitle = subtitle;
  }

  /**
   * Returns the URL of an thumbnail image that can be used when displaying
   * the item in a user interface. The URL is always absolute.
   */
  public String getImageUrl() {
    return imageUrl;
  }

  void setImageUrl(String imageUrl) {
    this.imageUrl = imageUrl;
  }

  public String getMedia() {
    return media;
  }

  void setMedia(String media) {
    this.media = media;
  }

  public String getCategory() {
    return category;
  }

  void setCategory(String category) {
    this.category = category;
  }

  public String getType() {
    return type;
  }

  void setType(String type) {
    this.type = type;
  }

  public ArrayList<Author> getAuthors() {
    return authors;
  }

  public void setAuthor(Author author) {
    this.authors.add(author);
  }

  public String getInstitute() {
    return institute;
  }

  public void setInstitute(String institute) {
    this.institute = institute;
  }

  public Calendar getPublishedYear() {
    return publishedYear;
  }

  public void setPublishedYear(int publishedYear) {
    this.publishedYear.set(Calendar.YEAR, publishedYear);
  }

}

@@ -803,32 +803,39 @@
 turn id;%0A  %7D%0A%0A  
+public 
 void setId(Strin
@@ -834,32 +834,32 @@
 Id(String id) %7B%0A
-
     this.id = id
@@ -983,32 +983,39 @@
 n title;%0A  %7D%0A%0A  
+public 
 void setTitle(St
@@ -1245,32 +1245,39 @@
 ubtitle;%0A  %7D%0A%0A  
+public 
 void setSubtitle
@@ -1534,32 +1534,39 @@
 mageUrl;%0A  %7D%0A%0A  
+public 
 void setImageUrl
@@ -1666,32 +1666,39 @@
 n media;%0A  %7D%0A%0A  
+public 
 void setMedia(St
@@ -1792,32 +1792,39 @@
 ategory;%0A  %7D%0A%0A  
+public 
 void setCategory
@@ -1928,18 +1928,25 @@
 e;%0A  %7D%0A%0A
-
   
+public 
 void set

add puplic to setmethods for junit