2 * This file is part of the Vamsas Client version 0.2.
\r
3 * Copyright 2010 by Jim Procter, Iain Milne, Pierre Marguerite,
\r
4 * Andrew Waterhouse and Dominik Lindner.
\r
6 * Earlier versions have also been incorporated into Jalview version 2.4
\r
7 * since 2008, and TOPALi version 2 since 2007.
\r
9 * The Vamsas Client is free software: you can redistribute it and/or modify
\r
10 * it under the terms of the GNU Lesser General Public License as published by
\r
11 * the Free Software Foundation, either version 3 of the License, or
\r
12 * (at your option) any later version.
\r
14 * The Vamsas Client is distributed in the hope that it will be useful,
\r
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
17 * GNU Lesser General Public License for more details.
\r
19 * You should have received a copy of the GNU Lesser General Public License
\r
20 * along with the Vamsas Client. If not, see <http://www.gnu.org/licenses/>.
\r
22 package uk.ac.vamsas.objects.utils;
\r
24 import java.util.Date;
\r
26 import org.apache.commons.logging.Log;
\r
27 import org.apache.commons.logging.LogFactory;
\r
29 import uk.ac.vamsas.objects.core.Entry;
\r
30 import uk.ac.vamsas.objects.core.Provenance;
\r
32 public class ProvenanceStuff {
\r
35 * stuff for making and doing things with provenance objects.
\r
37 static Log log = LogFactory.getLog(ProvenanceStuff.class);
\r
43 * text for action entry
\r
44 * @return new Provenance entry for ArchiveWriter created docs. TODO: Verify
\r
45 * and move to SimpleClient class for provenance handling
\r
47 public static Entry newProvenanceEntry(String app, String user, String action) {
\r
48 log.debug("Adding ProvenanceEntry(" + user + "," + action + ")");
\r
49 Entry e = new Entry();
\r
51 e.setAction(action);
\r
53 e.setDate(new Date());
\r
57 public static Provenance newProvenance(Entry entry) {
\r
58 Provenance list = new Provenance();
\r
59 list.addEntry(entry);
\r
63 public static Provenance newProvenance(String user, String action) {
\r
64 return newProvenance(ProvenanceStuff.newProvenanceEntry(
\r
65 "vamsasApp:ExampleVamsasClient/alpha", user, action));
\r
68 public static Provenance newProvenance(String app, String user, String action) {
\r
69 return newProvenance(ProvenanceStuff.newProvenanceEntry(app, user, action));
\r