Project

General

Profile

Revision 8e602421

ID8e60242186e754e68d092d52f2ee294132bc0159
Parent eb23c4e2
Child d4aa7f24

Added by Andreas Müller over 3 years ago

ref #5258 add accessed to Reference (WebPage)

View differences:

cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/reference/IWebPage.java
9 9

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

  
12
import org.joda.time.DateTime;
13

  
12 14
/**
13 15
 * This interface represents electronic publications available on the world wide web.
14 16
 * <P>
......
31 33
	 */
32 34
	public void setInReference(Reference inReference);
33 35

  
36
    /**
37
     * Date (and time) when a WebPage was accessed.
38
     * @return the accessed date
39
     */
40
	//#5258
41
    public DateTime getAccessed();
42

  
43
    /**
44
     * @param accessed
45
     * @see #getAccessed()
46
     */
47
    public void setAccessed(DateTime accessed);
34 48

  
35 49
}
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/reference/Reference.java
14 14
import java.net.URI;
15 15
import java.util.List;
16 16

  
17
import javax.persistence.Basic;
17 18
import javax.persistence.Column;
18 19
import javax.persistence.Embedded;
19 20
import javax.persistence.Entity;
......
33 34
import javax.xml.bind.annotation.XmlRootElement;
34 35
import javax.xml.bind.annotation.XmlSchemaType;
35 36
import javax.xml.bind.annotation.XmlType;
37
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
36 38

  
37 39
import org.apache.commons.lang.StringUtils;
38 40
import org.apache.log4j.Logger;
......
45 47
import org.hibernate.search.annotations.Field;
46 48
import org.hibernate.search.annotations.FieldBridge;
47 49
import org.hibernate.search.annotations.IndexedEmbedded;
50
import org.joda.time.DateTime;
48 51

  
49 52
import eu.etaxonomy.cdm.common.DOI;
53
import eu.etaxonomy.cdm.hibernate.search.DateTimeBridge;
50 54
import eu.etaxonomy.cdm.hibernate.search.DoiBridge;
55
import eu.etaxonomy.cdm.jaxb.DateTimeAdapter;
51 56
import eu.etaxonomy.cdm.model.agent.Institution;
52 57
import eu.etaxonomy.cdm.model.agent.TeamOrPersonBase;
53 58
import eu.etaxonomy.cdm.model.common.IIntextReferenceTarget;
......
107 112
    "institution",
108 113
    "school",
109 114
    "organization",
110
    "inReference"
115
    "inReference",
116
    "accessed"
111 117
})
112 118
@XmlRootElement(name = "Reference")
113 119
@Entity
......
286 292
	@IndexedEmbedded
287 293
	private TimePeriod datePublished = TimePeriod.NewInstance();
288 294

  
289
	@XmlElement(name ="Abstract" )
295
    //#5258
296
    @XmlElement (name = "Accessed", type= String.class)
297
    @XmlJavaTypeAdapter(DateTimeAdapter.class)
298
    @Type(type="dateTimeUserType")
299
    @Basic(fetch = FetchType.LAZY)
300
    @Match(MatchMode.EQUAL)
301
    @FieldBridge(impl = DateTimeBridge.class)
302
    private DateTime accessed;
303

  
304
    @XmlElement(name ="Abstract" )
290 305
	@Column(length=65536, name="referenceAbstract")
291 306
	@Lob
292 307
    @Field
......
654 669
		return result;
655 670
	}
656 671

  
672

  
673
	@Override
674
    public DateTime getAccessed() {
675
        return accessed;
676
    }
677

  
678
	@Override
679
    public void setAccessed(DateTime accessed) {
680
        this.accessed = accessed;
681
    }
682

  
657 683
	/**
658 684
	 * Returns the {@link eu.etaxonomy.cdm.model.agent.TeamOrPersonBase author (team)} who created the
659 685
	 * content of <i>this</i> reference.
cdmlib-persistence/src/test/resources/eu/etaxonomy/cdm/persistence/dao/hibernate/common/CdmEntityDaoBaseTest.xml
6 6
  <HOMOTYPICALGROUP_AUD ID="1" REV="1000" REVTYPE="0" CREATED="2008-12-10 09:56:07.0" UUID="7b214eb9-a6ac-48e5-af02-bbea634d2a03" UPDATED="2008-12-10 09:56:07.238"/>
7 7
  <HOMOTYPICALGROUP_AUD ID="2" REV="1000" REVTYPE="0" CREATED="2008-12-10 09:56:07.0" UUID="6c241a4c-e5a0-4344-8e5e-a81f17b75973" UPDATED="2008-12-10 09:56:07.253"/>
8 8

  
9
  <REFERENCE ID="1" CREATED="2008-12-10 09:56:07.0" UUID="596b1325-be50-4b0a-9aa2-3ecd610215f2" UPDATED="2008-12-10 09:56:07.253" TITLECACHE="Lorem ipsum" PROTECTEDTITLECACHE="true" PROTECTEDABBREVTITLECACHE="false" ABBREVTITLECACHE="Sp. Pl." ABBREVTITLE="Sp. Pl." NOMENCLATURALLYRELEVANT="false" PARSINGPROBLEM="0" PROBLEMENDS="-1" PROBLEMSTARTS="-1"/>
10
  <REFERENCE_AUD REV="1000" REVTYPE="0" ID="1" CREATED="2008-12-10 09:56:07.0" UUID="596b1325-be50-4b0a-9aa2-3ecd610215f2" UPDATED="2008-12-10 09:56:07.253" TITLECACHE="Lorem ipsum" PROTECTEDTITLECACHE="true" PROTECTEDABBREVTITLECACHE="false" ABBREVTITLECACHE="Sp. Pl." ABBREVTITLE="Sp. Pl." NOMENCLATURALLYRELEVANT="false" PARSINGPROBLEM="0" PROBLEMENDS="-1" PROBLEMSTARTS="-1"/>
9
  <REFERENCE ID="1" CREATED="2008-12-10 09:56:07.0" UUID="596b1325-be50-4b0a-9aa2-3ecd610215f2" UPDATED="2008-12-10 09:56:07.253" TITLECACHE="Lorem ipsum" PROTECTEDTITLECACHE="true" PROTECTEDABBREVTITLECACHE="false" ABBREVTITLECACHE="Sp. Pl." ABBREVTITLE="Sp. Pl." NOMENCLATURALLYRELEVANT="false" PARSINGPROBLEM="0" PROBLEMENDS="-1" PROBLEMSTARTS="-1" ACCESSED="[null]"/>
10
  <REFERENCE_AUD REV="1000" REVTYPE="0" ID="1" CREATED="2008-12-10 09:56:07.0" UUID="596b1325-be50-4b0a-9aa2-3ecd610215f2" UPDATED="2008-12-10 09:56:07.253" TITLECACHE="Lorem ipsum" PROTECTEDTITLECACHE="true" PROTECTEDABBREVTITLECACHE="false" ABBREVTITLECACHE="Sp. Pl." ABBREVTITLE="Sp. Pl." NOMENCLATURALLYRELEVANT="false" PARSINGPROBLEM="0" PROBLEMENDS="-1" PROBLEMSTARTS="-1" ACCESSED="[null]"/>
11 11

  
12 12
  <TAXONBASE DTYPE="Taxon" ID="1" SEC_ID="1" CREATED="2008-12-10 09:56:07.0" CREATEDBY_ID="1" UUID="8d77c380-c76a-11dd-ad8b-0800200c9a66" UPDATED="2008-12-10 09:56:07.253" UPDATEDBY_ID="1" TITLECACHE=" sec. ???" PROTECTEDTITLECACHE="true" DOUBTFUL="false"  PUBLISH="true" USENAMECACHE="false" TAXONSTATUSUNKNOWN="false" NAME_ID="1"/>
13 13
  <TAXONBASE DTYPE="Taxon" ID="2" SEC_ID="1" CREATED="2008-12-10 09:56:07.0" CREATEDBY_ID="1" UUID="822d98dc-9ef7-44b7-a870-94573a3bcb46" UPDATED="2008-12-10 09:56:07.253" UPDATEDBY_ID="1" TITLECACHE="  sec. ???" PROTECTEDTITLECACHE="true" DOUBTFUL="false" PUBLISH="true" USENAMECACHE="false" TAXONSTATUSUNKNOWN="false" NAME_ID="2"/>
cdmlib-test/src/main/resources/dbscripts/001-cdm.h2.sql
3375 3375
    REFTYPE VARCHAR(4),
3376 3376
    URI CLOB,
3377 3377
    VOLUME VARCHAR(255),
3378
	ACCESSED TIMESTAMP,
3378 3379
    CREATEDBY_ID INTEGER,
3379 3380
    UPDATEDBY_ID INTEGER,
3380 3381
    AUTHORSHIP_ID INTEGER,
......
3424 3425
    REFTYPE  VARCHAR(4),
3425 3426
    URI CLOB,
3426 3427
    VOLUME VARCHAR(255),
3428
    ACCESSED TIMESTAMP,
3427 3429
    CREATEDBY_ID INTEGER,
3428 3430
    UPDATEDBY_ID INTEGER,
3429 3431
    AUTHORSHIP_ID INTEGER,
cdmlib-test/src/main/resources/eu/etaxonomy/cdm/database/schema/dataset.dtd
2367 2367
    SERIESPART CDATA #IMPLIED
2368 2368
    ISBN CDATA #IMPLIED
2369 2369
    ISSN CDATA #IMPLIED
2370
    ACCESSED CDATA #IMPLIED
2370 2371
    CREATEDBY_ID CDATA #IMPLIED
2371 2372
    UPDATEDBY_ID CDATA #IMPLIED
2372 2373
    AUTHORSHIP_ID CDATA #IMPLIED
......
2447 2448
    REPORTTYPE CDATA #IMPLIED
2448 2449
    SCHOOL CDATA #IMPLIED
2449 2450
    YEAR CDATA #IMPLIED
2451
    ACCESSED CDATA #IMPLIED
2450 2452
    CROSSREF_ID CDATA #IMPLIED
2451 2453
    TYPE_ID CDATA #IMPLIED
2452 2454
    INBOOK_ID CDATA #IMPLIED

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)