Source Code Cross Referenced for Node.java in  » ERP-CRM-Financial » sakai » org » theospi » portfolio » shared » model » 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 » ERP CRM Financial » sakai » org.theospi.portfolio.shared.model 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**********************************************************************************
002:         * $URL:https://source.sakaiproject.org/svn/osp/trunk/common/api/src/java/org/theospi/portfolio/shared/model/Node.java $
003:         * $Id:Node.java 9134 2006-05-08 20:28:42Z chmaurer@iupui.edu $
004:         ***********************************************************************************
005:         *
006:         * Copyright (c) 2005, 2006 The Sakai Foundation.
007:         *
008:         * Licensed under the Educational Community License, Version 1.0 (the "License");
009:         * you may not use this file except in compliance with the License.
010:         * You may obtain a copy of the License at
011:         *
012:         *      http://www.opensource.org/licenses/ecl1.php
013:         *
014:         * Unless required by applicable law or agreed to in writing, software
015:         * distributed under the License is distributed on an "AS IS" BASIS,
016:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017:         * See the License for the specific language governing permissions and
018:         * limitations under the License.
019:         *
020:         **********************************************************************************/package org.theospi.portfolio.shared.model;
021:
022:        import java.io.InputStream;
023:
024:        import org.sakaiproject.content.api.ContentResource;
025:        import org.sakaiproject.exception.ServerOverloadException;
026:        import org.sakaiproject.metaobj.shared.model.Agent;
027:        import org.sakaiproject.metaobj.shared.model.Id;
028:        import org.sakaiproject.metaobj.shared.model.MimeType;
029:
030:        public class Node {
031:
032:            private Id id;
033:            private String name;
034:            private String displayName;
035:            private TechnicalMetadata technicalMetadata;
036:            private MimeType mimeType;
037:            private String externalUri;
038:            private String fileType;
039:            private ContentResource resource;
040:            private boolean hasCopyright = false;
041:
042:            public Node(Id id, ContentResource resource, Agent owner) {
043:                this .resource = resource;
044:                this .id = id;
045:                name = resource.getProperties().getProperty(
046:                        resource.getProperties().getNamePropDisplayName());
047:                displayName = name;
048:
049:                //check for copyright
050:                hasCopyright = Boolean.getBoolean(resource.getProperties()
051:                        .getProperty(
052:                                resource.getProperties()
053:                                        .getNamePropCopyrightAlert()));
054:
055:                externalUri = resource.getUrl();
056:                mimeType = new MimeType(resource.getContentType());
057:                String propName = resource.getProperties()
058:                        .getNamePropStructObjType();
059:                String saType = resource.getProperties().getProperty(propName);
060:                fileType = (saType != null && !saType.equals("")) ? saType
061:                        : "fileArtifact";
062:
063:                setTechnicalMetadata(new TechnicalMetadata(id, resource, owner));
064:            }
065:
066:            /**
067:             * @return Returns the externalUri.
068:             */
069:            public String getExternalUri() {
070:                return externalUri;
071:            }
072:
073:            /**
074:             * @return Returns the externalUri.
075:             */
076:            public String getFixedExternalUri() {
077:                return externalUri.replaceAll(" ", "%20");
078:            }
079:
080:            /**
081:             * @param externalUri The externalUri to set.
082:             */
083:            public void setExternalUri(String externalUri) {
084:                this .externalUri = externalUri;
085:            }
086:
087:            /**
088:             * @return Returns the mimeType.
089:             */
090:            public MimeType getMimeType() {
091:                return mimeType;
092:            }
093:
094:            /**
095:             * @param mimeType The mimeType to set.
096:             */
097:            public void setMimeType(MimeType mimeType) {
098:                this .mimeType = mimeType;
099:            }
100:
101:            /**
102:             * @return Returns the name.
103:             */
104:            public String getName() {
105:                return name;
106:            }
107:
108:            /**
109:             * @param name The name to set.
110:             */
111:            public void setName(String name) {
112:                this .name = name;
113:            }
114:
115:            /**
116:             * @return Returns the displayName.
117:             */
118:            public String getDisplayName() {
119:                return displayName;
120:            }
121:
122:            /**
123:             * @param displayName The displayName to set.
124:             */
125:            public void setDisplayName(String displayName) {
126:                this .displayName = displayName;
127:            }
128:
129:            /**
130:             * @return Returns the technicalMetadata.
131:             */
132:            public TechnicalMetadata getTechnicalMetadata() {
133:                return technicalMetadata;
134:            }
135:
136:            /**
137:             * @param technicalMetadata The technicalMetadata to set.
138:             */
139:            public void setTechnicalMetadata(TechnicalMetadata technicalMetadata) {
140:                this .technicalMetadata = technicalMetadata;
141:            }
142:
143:            public Id getId() {
144:                return id;
145:            }
146:
147:            public void setId(Id id) {
148:                this .id = id;
149:            }
150:
151:            public InputStream getInputStream() {
152:                try {
153:                    return resource.streamContent();
154:                } catch (ServerOverloadException e) {
155:                    throw new RuntimeException(e);
156:                }
157:            }
158:
159:            public ContentResource getResource() {
160:                return resource;
161:            }
162:
163:            public String getFileType() {
164:                return fileType;
165:            }
166:
167:            public void setFileType(String fileType) {
168:                this .fileType = fileType;
169:            }
170:
171:            public boolean isHasCopyright() {
172:                return hasCopyright;
173:            }
174:
175:            public void setHasCopyright(boolean hasCopyright) {
176:                this.hasCopyright = hasCopyright;
177:            }
178:
179:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.