Mercurial > hg > LGDataverses
comparison src/main/java/edu/harvard/iq/dataverse/DataverseTheme.java @ 10:a50cf11e5178
Rewrite LGDataverse completely upgrading to dataverse4.0
| author | Zoe Hong <zhong@mpiwg-berlin.mpg.de> |
|---|---|
| date | Tue, 08 Sep 2015 17:00:21 +0200 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 9:5926d6419569 | 10:a50cf11e5178 |
|---|---|
| 1 /* | |
| 2 * To change this license header, choose License Headers in Project Properties. | |
| 3 * To change this template file, choose Tools | Templates | |
| 4 * and open the template in the editor. | |
| 5 */ | |
| 6 | |
| 7 package edu.harvard.iq.dataverse; | |
| 8 | |
| 9 import java.io.Serializable; | |
| 10 import java.util.Objects; | |
| 11 import javax.persistence.Entity; | |
| 12 import javax.persistence.EnumType; | |
| 13 import javax.persistence.Enumerated; | |
| 14 import javax.persistence.GeneratedValue; | |
| 15 import javax.persistence.GenerationType; | |
| 16 import javax.persistence.Id; | |
| 17 import javax.persistence.Index; | |
| 18 import javax.persistence.JoinColumn; | |
| 19 import javax.persistence.OneToOne; | |
| 20 import javax.persistence.Table; | |
| 21 | |
| 22 /** | |
| 23 * | |
| 24 * @author ellenk | |
| 25 */ | |
| 26 | |
| 27 @Entity | |
| 28 @Table(indexes = {@Index(columnList="dataverse_id")}) | |
| 29 public class DataverseTheme implements Serializable { | |
| 30 | |
| 31 private static final long serialVersionUID = 1L; | |
| 32 | |
| 33 @Id | |
| 34 @GeneratedValue(strategy = GenerationType.IDENTITY) | |
| 35 private Long id; | |
| 36 | |
| 37 public Long getId() { | |
| 38 return this.id; | |
| 39 } | |
| 40 | |
| 41 public void setId(Long id) { | |
| 42 this.id = id; | |
| 43 } | |
| 44 | |
| 45 @Enumerated(EnumType.STRING) | |
| 46 private ImageFormat logoFormat; | |
| 47 | |
| 48 public enum Alignment { | |
| 49 LEFT, CENTER, RIGHT | |
| 50 } | |
| 51 @Enumerated(EnumType.STRING) | |
| 52 private Alignment logoAlignment; | |
| 53 private String logoBackgroundColor; | |
| 54 private String logo; | |
| 55 private String tagline; | |
| 56 private String linkUrl; | |
| 57 private String linkColor; | |
| 58 private String textColor; | |
| 59 private String backgroundColor; | |
| 60 public enum ImageFormat { | |
| 61 | |
| 62 SQUARE, RECTANGLE | |
| 63 } | |
| 64 public ImageFormat getLogoFormat() { | |
| 65 return logoFormat; | |
| 66 } | |
| 67 | |
| 68 public void setLogoFormat(ImageFormat logoFormat) { | |
| 69 this.logoFormat = logoFormat; | |
| 70 } | |
| 71 | |
| 72 public Alignment getLogoAlignment() { | |
| 73 return logoAlignment; | |
| 74 } | |
| 75 | |
| 76 public void setLogoAlignment(Alignment logoAlignment) { | |
| 77 this.logoAlignment = logoAlignment; | |
| 78 } | |
| 79 | |
| 80 public String getLogoBackgroundColor() { | |
| 81 return logoBackgroundColor; | |
| 82 } | |
| 83 | |
| 84 public void setLogoBackgroundColor(String logoBackgroundColor) { | |
| 85 this.logoBackgroundColor = logoBackgroundColor; | |
| 86 } | |
| 87 | |
| 88 public String getLogo() { | |
| 89 return logo; | |
| 90 } | |
| 91 | |
| 92 public void setLogo(String logo) { | |
| 93 this.logo = logo; | |
| 94 } | |
| 95 | |
| 96 public String getTagline() { | |
| 97 return tagline; | |
| 98 } | |
| 99 | |
| 100 public void setTagline(String tagline) { | |
| 101 this.tagline = tagline; | |
| 102 } | |
| 103 | |
| 104 public String getLinkUrl() { | |
| 105 return linkUrl; | |
| 106 } | |
| 107 | |
| 108 public void setLinkUrl(String linkUrl) { | |
| 109 this.linkUrl = linkUrl; | |
| 110 } | |
| 111 | |
| 112 public String getLinkColor() { | |
| 113 return linkColor; | |
| 114 } | |
| 115 | |
| 116 public void setLinkColor(String linkColor) { | |
| 117 this.linkColor = linkColor; | |
| 118 } | |
| 119 | |
| 120 public String getTextColor() { | |
| 121 return textColor; | |
| 122 } | |
| 123 | |
| 124 public void setTextColor(String textColor) { | |
| 125 this.textColor = textColor; | |
| 126 } | |
| 127 | |
| 128 public String getBackgroundColor() { | |
| 129 return backgroundColor; | |
| 130 } | |
| 131 | |
| 132 public void setBackgroundColor(String backgroundColor) { | |
| 133 this.backgroundColor = backgroundColor; | |
| 134 } | |
| 135 @OneToOne | |
| 136 @JoinColumn(name="dataverse_id") | |
| 137 private Dataverse dataverse; | |
| 138 | |
| 139 public Dataverse getDataverse() { | |
| 140 return dataverse; | |
| 141 } | |
| 142 | |
| 143 public void setDataverse(Dataverse dataverse) { | |
| 144 this.dataverse = dataverse; | |
| 145 } | |
| 146 | |
| 147 @Override | |
| 148 public int hashCode() { | |
| 149 int hash = 0; | |
| 150 hash += (this.id != null ? this.id.hashCode() : 0); | |
| 151 return hash; | |
| 152 } | |
| 153 | |
| 154 @Override | |
| 155 public boolean equals(Object object) { | |
| 156 if (!(object instanceof DatasetFieldType)) { | |
| 157 return false; | |
| 158 } | |
| 159 DataverseTheme other = (DataverseTheme) object; | |
| 160 return !(!Objects.equals(this.id, other.id) && (this.id == null || !this.id.equals(other.id))); | |
| 161 } | |
| 162 | |
| 163 @Override | |
| 164 public String toString() { | |
| 165 return "edu.harvard.iq.dataverse.DataverseFacet[ id=" + id + " ]"; | |
| 166 } | |
| 167 | |
| 168 } |
