Project

General

Profile

Download (2.62 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2007 EDIT
3
* European Distributed Institute of Taxonomy 
4
* http://www.e-taxonomy.eu
5
* 
6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/
9

    
10
package eu.etaxonomy.cdm.model.media;
11

    
12
import java.util.UUID;
13

    
14
import javax.persistence.Entity;
15
import javax.xml.bind.annotation.XmlAccessType;
16
import javax.xml.bind.annotation.XmlAccessorType;
17
import javax.xml.bind.annotation.XmlRootElement;
18
import javax.xml.bind.annotation.XmlType;
19

    
20
import org.apache.log4j.Logger;
21
import org.hibernate.envers.Audited;
22

    
23
import eu.etaxonomy.cdm.model.common.DefinedTermBase;
24
import eu.etaxonomy.cdm.model.common.TermVocabulary;
25

    
26
/**
27
 * @author m.doering
28
 * @version 1.0
29
 * @created 08-Nov-2007 13:06:50
30
 */
31
@XmlAccessorType(XmlAccessType.FIELD)
32
@XmlType(name = "RightsTerm")
33
@XmlRootElement(name = "RightsTerm")
34
@Entity
35
@Audited
36
public class RightsTerm extends DefinedTermBase<RightsTerm> {
37
	private static final long serialVersionUID = -5823263624000932116L;
38
	private static final Logger logger = Logger.getLogger(RightsTerm.class);
39
	private static RightsTerm LICENSE;
40
	private static RightsTerm COPYRIGHT;
41
	private static RightsTerm ACCESS_RIGHTS;
42

    
43
	
44
	/**
45
	 * Factory method
46
	 * @return
47
	 */
48
	public static RightsTerm NewInstance(){
49
		logger.debug("NewInstance");
50
		return new RightsTerm();
51
	}
52

    
53
	/**
54
	 * Factory method
55
	 * @return
56
	 */
57
	public static RightsTerm NewInstance(String text, String label, String labelAbbrev){
58
		return new RightsTerm(text, label, labelAbbrev);
59
	}
60
	
61
	/**
62
	 * Default Constructor
63
	 */
64
	public RightsTerm() {
65
	}
66

    
67
	/**
68
	 * Constructor
69
	 */
70
	public RightsTerm(String term, String label, String labelAbbrev) {
71
		super(term, label, labelAbbrev);
72
	}
73

    
74
	/**
75
	 * http://purl.org/dc/terms/accessRights
76
	 */
77
	public static final RightsTerm ACCESS_RIGHTS(){
78
		return ACCESS_RIGHTS;
79
	}
80

    
81
	public static final RightsTerm COPYRIGHT(){
82
		return COPYRIGHT;
83
	}
84

    
85
	public static final RightsTerm LICENSE(){
86
		return LICENSE;
87
	}
88
	
89
	private static final UUID uuidLicense = UUID.fromString("67c0d47e-8985-1014-8845-c84599f9992c");
90
	private static final UUID uuidCopyright = UUID.fromString("d1ef838e-b195-4f28-b8eb-0d3be080bd37");
91
	private static final UUID uuidAccessRights = UUID.fromString("a50b4def-b3ac-4508-b50a-e0f249e3a1d7");
92

    
93

    
94
	@Override
95
	protected void setDefaultTerms(TermVocabulary<RightsTerm> termVocabulary) {
96
		RightsTerm.ACCESS_RIGHTS = termVocabulary.findTermByUuid(RightsTerm.uuidAccessRights);
97
		RightsTerm.COPYRIGHT = termVocabulary.findTermByUuid(RightsTerm.uuidCopyright);
98
		RightsTerm.LICENSE = termVocabulary.findTermByUuid(RightsTerm.uuidLicense);		
99
	}
100

    
101
}
(12-12/13)