Source Code Cross Referenced for ProjectManager.java in  » Project-Management » memoranda » net » sf » memoranda » 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 » Project Management » memoranda » net.sf.memoranda 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * ProjectManager.java
003:         * Created on 11.02.2003, 17:50:27 Alex
004:         * Package: net.sf.memoranda
005:         *
006:         * @author Alex V. Alishevskikh, alex@openmechanics.net
007:         * Copyright (c) 2003 Memoranda Team. http://memoranda.sf.net
008:         */package net.sf.memoranda;
009:
010:        import java.util.Vector;
011:
012:        import net.sf.memoranda.date.CalendarDate;
013:        import net.sf.memoranda.util.CurrentStorage;
014:        import net.sf.memoranda.util.Local;
015:        import net.sf.memoranda.util.Util;
016:        import nu.xom.Attribute;
017:        import nu.xom.Document;
018:        import nu.xom.Element;
019:        import nu.xom.Elements;
020:
021:        /**
022:         *
023:         */
024:        /*$Id: ProjectManager.java,v 1.9 2005/12/01 08:12:26 alexeya Exp $*/
025:        public class ProjectManager {
026:            //    public static final String NS_JNPROJECT = "http://www.openmechanics.org/2003/jnotes-projects-file";
027:
028:            public static Document _doc = null;
029:            static Element _root = null;
030:
031:            static {
032:                init();
033:            }
034:
035:            public static void init() {
036:                CurrentStorage.get().openProjectManager();
037:                if (_doc == null) {
038:                    _root = new Element("projects-list");
039:                    //            _root.addNamespaceDeclaration("jnotes", NS_JNPROJECT);
040:                    //            _root.appendChild(new Comment("This is JNotes 2 data file. Do not modify."));
041:                    _doc = new Document(_root);
042:                    createProject("__default", Local
043:                            .getString("Default project"),
044:                            CalendarDate.today(), null);
045:                } else
046:                    _root = _doc.getRootElement();
047:            }
048:
049:            public static Project getProject(String id) {
050:                Elements prjs = _root.getChildElements("project");
051:                for (int i = 0; i < prjs.size(); i++) {
052:                    String pid = ((Element) prjs.get(i)).getAttribute("id")
053:                            .getValue();
054:                    if (pid.equals(id)) {
055:                        return new ProjectImpl((Element) prjs.get(i));
056:                    }
057:                }
058:                return null;
059:            }
060:
061:            public static Vector getAllProjects() {
062:                Elements prjs = _root.getChildElements("project");
063:                Vector v = new Vector();
064:                for (int i = 0; i < prjs.size(); i++)
065:                    v.add(new ProjectImpl((Element) prjs.get(i)));
066:                return v;
067:            }
068:
069:            public static int getAllProjectsNumber() {
070:                int i;
071:                try {
072:                    i = ((Elements) _root.getChildElements("project")).size();
073:                } catch (NullPointerException e) {
074:                    i = 1;
075:                }
076:                return i;
077:            }
078:
079:            public static Vector getActiveProjects() {
080:                Elements prjs = _root.getChildElements("project");
081:                Vector v = new Vector();
082:                for (int i = 0; i < prjs.size(); i++) {
083:                    Project prj = new ProjectImpl((Element) prjs.get(i));
084:                    if (prj.getStatus() == Project.ACTIVE)
085:                        v.add(prj);
086:                }
087:                return v;
088:            }
089:
090:            public static int getActiveProjectsNumber() {
091:                Elements prjs = _root.getChildElements("project");
092:                int count = 0;
093:                for (int i = 0; i < prjs.size(); i++) {
094:                    Project prj = new ProjectImpl((Element) prjs.get(i));
095:                    if (prj.getStatus() == Project.ACTIVE)
096:                        count++;
097:                }
098:                return count;
099:            }
100:
101:            public static Project createProject(String id, String title,
102:                    CalendarDate startDate, CalendarDate endDate) {
103:                Element el = new Element("project");
104:                el.addAttribute(new Attribute("id", id));
105:                _root.appendChild(el);
106:                Project prj = new ProjectImpl(el);
107:                prj.setTitle(title);
108:                prj.setStartDate(startDate);
109:                prj.setEndDate(endDate);
110:                CurrentStorage.get().createProjectStorage(prj);
111:                return prj;
112:            }
113:
114:            public static Project createProject(String title,
115:                    CalendarDate startDate, CalendarDate endDate) {
116:                return createProject(Util.generateId(), title, startDate,
117:                        endDate);
118:            }
119:
120:            public static void removeProject(String id) {
121:                Project prj = getProject(id);
122:                if (prj == null)
123:                    return;
124:                History.removeProjectHistory(prj);
125:                CurrentStorage.get().removeProjectStorage(prj);
126:                Elements prjs = _root.getChildElements("project");
127:                for (int i = 0; i < prjs.size(); i++) {
128:                    String pid = ((Element) prjs.get(i)).getAttribute("id")
129:                            .getValue();
130:                    if (pid.equals(id)) {
131:                        _root.removeChild(prjs.get(i));
132:                        return;
133:                    }
134:                }
135:            }
136:
137:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.