| 1 | // $Id$ |
|---|
| 2 | /** |
|---|
| 3 | * Copyright (C) 2007 EDIT |
|---|
| 4 | * European Distributed Institute of Taxonomy |
|---|
| 5 | * http://www.e-taxonomy.eu |
|---|
| 6 | * |
|---|
| 7 | * The contents of this file are subject to the Mozilla Public License Version 1.1 |
|---|
| 8 | * See LICENSE.TXT at the top of this package for the full license terms. |
|---|
| 9 | */ |
|---|
| 10 | |
|---|
| 11 | package eu.etaxonomy.cdm.model.common; |
|---|
| 12 | |
|---|
| 13 | import eu.etaxonomy.cdm.model.reference.Reference; |
|---|
| 14 | |
|---|
| 15 | /** |
|---|
| 16 | * An original source can be used in different ways.<BR> |
|---|
| 17 | * 1.) As a referencing system. The original source holds all information about the reference, |
|---|
| 18 | * the microReference (page, figure, ...), the identifier used in for the referenced object in the |
|---|
| 19 | * reference, a namespace that makes this identifier unique, the original name string that in |
|---|
| 20 | * general stores the representation of the referenced object within the source (if the string representation |
|---|
| 21 | * in the source differs from that one unsed in the CDM object) |
|---|
| 22 | * |
|---|
| 23 | * 2.) Dataprovenance: When importing data from another datasource important information like the identifier |
|---|
| 24 | * and it's namespace (e.g. tablename) as well as the datasource itself maybe stored in an original source. |
|---|
| 25 | * E.g. when importing SDD data here you may store the filename and the id used in the SDD file here. |
|---|
| 26 | * |
|---|
| 27 | * @author a.mueller |
|---|
| 28 | * @created 18.09.2009 |
|---|
| 29 | * @version 1.0 |
|---|
| 30 | */ |
|---|
| 31 | public interface IOriginalSource<T extends ISourceable> { |
|---|
| 32 | |
|---|
| 33 | /*************** GETTER /SETTER ************************************/ |
|---|
| 34 | |
|---|
| 35 | /** |
|---|
| 36 | * Returns the (unique) identifier used in the source. |
|---|
| 37 | * If the identifier is not unique, {@link #getIdNamespace() namespace} should be defined. |
|---|
| 38 | * The namespace together with the identifier should be unique. |
|---|
| 39 | */ |
|---|
| 40 | public String getIdInSource(); |
|---|
| 41 | |
|---|
| 42 | /** |
|---|
| 43 | * @see #getIdInSource() |
|---|
| 44 | * @param idInSource |
|---|
| 45 | */ |
|---|
| 46 | public void setIdInSource(String idInSource); |
|---|
| 47 | |
|---|
| 48 | /** |
|---|
| 49 | * Returns the id namespace. The id namespace is a String that further defines the origin of |
|---|
| 50 | * the original record. In the combination with the id it should be unique within one a source. |
|---|
| 51 | * E.g. if a record comes from table ABC and has the id 345, 'ABC' is a suitable namespace and the |
|---|
| 52 | * combination of 'ABC' and 345 is a unique id for this source. |
|---|
| 53 | * The namespace is meant to distinguish import records that come from two different tables, elements, objects, ... |
|---|
| 54 | * and end up in the same CDM class. In this case the id may not be enough to identify the original record. |
|---|
| 55 | * @return the idNamespace |
|---|
| 56 | */ |
|---|
| 57 | public String getIdNamespace(); |
|---|
| 58 | |
|---|
| 59 | /** |
|---|
| 60 | * @see #getIdNamespace() |
|---|
| 61 | * @param idNamespace the idNamespace to set |
|---|
| 62 | */ |
|---|
| 63 | public void setIdNamespace(String idNamespace); |
|---|
| 64 | |
|---|
| 65 | /** |
|---|
| 66 | * The object this original source is the source for |
|---|
| 67 | * @return |
|---|
| 68 | */ |
|---|
| 69 | public T getSourcedObj(); |
|---|
| 70 | |
|---|
| 71 | /** |
|---|
| 72 | * @see #getSourcedObj() |
|---|
| 73 | * @param sourcedObj |
|---|
| 74 | */ |
|---|
| 75 | public void setSourcedObj(T sourcedObj); |
|---|
| 76 | |
|---|
| 77 | /** |
|---|
| 78 | * Returns the micro citation of the according citation. This may be a String |
|---|
| 79 | * defining a page or a page range, a figure in a citation, etc. |
|---|
| 80 | * Examples: 'p.345', 'pp.345-367', 'fig. 3a', ... |
|---|
| 81 | * @return |
|---|
| 82 | */ |
|---|
| 83 | public String getCitationMicroReference(); |
|---|
| 84 | |
|---|
| 85 | /** |
|---|
| 86 | * @see #getCitationMicroReference() |
|---|
| 87 | * @param microCitation |
|---|
| 88 | */ |
|---|
| 89 | public void setCitationMicroReference(String microCitation); |
|---|
| 90 | |
|---|
| 91 | |
|---|
| 92 | /** |
|---|
| 93 | * Returns the citation. |
|---|
| 94 | * @return |
|---|
| 95 | */ |
|---|
| 96 | public Reference getCitation(); |
|---|
| 97 | |
|---|
| 98 | /** |
|---|
| 99 | * @see #getCitation() |
|---|
| 100 | * @param citation |
|---|
| 101 | */ |
|---|
| 102 | public void setCitation(Reference citation); |
|---|
| 103 | |
|---|
| 104 | } |
|---|