Source Code Cross Referenced for VersionedItem.java in  » Search-Engine » semweb4j » org » ontoware » semversion » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Search Engine » semweb4j » org.ontoware.semversion 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * generated by RDFReactor on 9:59 on 29.2005
003:         */package org.ontoware.semversion;
004:
005:        import java.util.Calendar;
006:
007:        import org.ontoware.rdf2go.model.Model;
008:        import org.ontoware.rdf2go.model.node.URI;
009:        import org.ontoware.rdfreactor.runtime.RDFDataException;
010:        import org.ontoware.semversion.impl.UserImpl;
011:
012:        /**
013:         * Any item that is versioned. Versioned items have a comment, label, creation
014:         * time, deletion time, provenance, tags, a URI, a User who created it, optional
015:         * user-define meta-data.
016:         * 
017:         * @author voelkel
018:         */
019:        public abstract class VersionedItem {
020:
021:            private org.ontoware.semversion.impl.generated.VersionedItem versionedItem;
022:            private Session session;
023:
024:            /**
025:             * Returns a Java wrapper over an RDF object, identified by URI. Creating
026:             * two wrappers for the same instanceURI is legal.
027:             * 
028:             * @param model
029:             *            RDF2GO Model implementation, see http://rdf2go.ontoware.org
030:             * @param uri
031:             *            URI of this instance
032:             */
033:            public VersionedItem(Model model, Session session, URI uri) {
034:                this .versionedItem = new org.ontoware.semversion.impl.generated.VersionedItem(
035:                        model, uri, true);
036:                this .session = session;
037:            }
038:
039:            public Session getSession() {
040:                return this .session;
041:            }
042:
043:            /**
044:             * @return one of the comments. 
045:             */
046:            public String getComment() {
047:                // this is dropping all other comments besides the first
048:                return this .versionedItem.getAllComment_as().firstValue();
049:            }
050:
051:            /**
052:             * @return the creation time of this item
053:             */
054:            public Calendar getCreationTime() throws RDFDataException {
055:                return this .versionedItem.getCreationTime();
056:            }
057:
058:            //	/**
059:            //	 * @return the deletionTime, or FOREVER if no deletion time has been set
060:            //	 *         yet. A version with no deletion time is considered to be 'live'.
061:            //	 */
062:            //	public Calendar getDeletionTime() throws RDFDataException {
063:            //		Calendar deletionTime = this.versionedItem.getDeletionTime();
064:            //		if (deletionTime == null)
065:            //			return TransactionTime.FOREVER;
066:            //		else
067:            //			return deletionTime;
068:            //	}
069:
070:            public String getLabel() {
071:                return this .versionedItem.getAllLabel_as().firstValue();
072:            }
073:
074:            /**
075:             * @return the provenance URI or null if none has been set
076:             */
077:            public URI getProvenance() throws RDFDataException {
078:                return this .versionedItem.getProvenance();
079:            }
080:
081:            protected SemVersion getSemVersion() {
082:                return (SemVersion) versionedItem.getModel().getProperty(
083:                        SemVersion.SEMVERSIONIMPL);
084:            }
085:
086:            /**
087:             * Tags are used e.g. to tag things as 'suggestion'
088:             * 
089:             * @return a tag, if this item has one. Otherwise null.
090:             */
091:            protected String getTag() throws RDFDataException {
092:                return this .versionedItem.getAllTag_as().firstValue();
093:            }
094:
095:            //	/**
096:            //	 * @return the transaction time, which contains creation and deletio time
097:            //	 */
098:            //	public TransactionTime getTransactionTime() {
099:            //		try {
100:            //			Calendar start = this.getCreationTime();
101:            //			Calendar end = this.getDeletionTime();
102:            //			TransactionTime t = new TransactionTime(start, end);
103:            //			return t;
104:            //		} catch (RDFDataException e) {
105:            //			throw new RuntimeException(e);
106:            //		}
107:            //	}
108:
109:            public URI getURI() {
110:                return this .versionedItem.getResource().asURI();
111:            }
112:
113:            /**
114:             * @return the creator of this item
115:             */
116:            public User getUser() {
117:                org.ontoware.semversion.impl.generated.User u = this .versionedItem
118:                        .getAuthor();
119:                if (u == null)
120:                    return null;
121:                else
122:                    return new UserImpl(u);
123:            }
124:
125:            /**
126:             * @return the URI of the graph which contains additional metadata in RDF
127:             */
128:            public URI getUserdefinedMetadata() {
129:                return this .versionedItem.getUserdefinedMetadata();
130:            }
131:
132:            //	/**
133:            //	 * removes a value
134:            //	 */
135:            //	protected void removeCreationTime(long value) {
136:            //		this.versionedItem.removeCreationTime();
137:            //	}
138:            //
139:            //	/**
140:            //	 * removes a value
141:            //	 */
142:            //	protected void removeDeletionTime(long value) {
143:            //		this.versionedItem.removeDeletionTime();
144:            //	}
145:
146:            public void setComment(String comment) {
147:                this .versionedItem.setComment(comment);
148:            }
149:
150:            /**
151:             * removes all values and sets this one
152:             */
153:            protected void setCreationTime(Calendar value)
154:                    throws RDFDataException {
155:                this .versionedItem.setCreationTime(value);
156:            }
157:
158:            //	/**
159:            //	 * removes all values and sets this one
160:            //	 */
161:            //	protected void setDeletionTime(Calendar value) throws RDFDataException {
162:            //		this.versionedItem.setDeletionTime(value);
163:            //	}
164:
165:            public void setLabel(String label) {
166:                this .versionedItem.setLabel(label);
167:            }
168:
169:            /**
170:             * removes all values and sets this one
171:             */
172:            protected void setProvenance(URI value) throws RDFDataException {
173:                if (value != null)
174:                    this .versionedItem.setProvenance(value);
175:            }
176:
177:            /**
178:             * removes all values and sets this one
179:             */
180:            protected void setTag(String value) throws RDFDataException {
181:                this .versionedItem.setTag(value);
182:            }
183:
184:            /**
185:             * removes all values and sets this one
186:             */
187:            protected void setUser(User value) throws RDFDataException {
188:                this .versionedItem
189:                        .setAuthor(((org.ontoware.semversion.impl.UserImpl) value)
190:                                .getUser());
191:            }
192:
193:            /**
194:             * removes all values and sets this one
195:             */
196:            protected void setUserdefinedMetadata(URI value) {
197:                this.versionedItem.setUserdefinedMetadata(value);
198:            }
199:
200:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.