Source Code Cross Referenced for Commit.java in  » Groupware » LibreSource » org » libresource » so6 » core » exec » 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 » Groupware » LibreSource » org.libresource.so6.core.exec 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * LibreSource
003:         * Copyright (C) 2004-2008 Artenum SARL / INRIA
004:         * http://www.libresource.org - contact@artenum.com
005:         *
006:         * This file is part of the LibreSource software, 
007:         * which can be used and distributed under license conditions.
008:         * The license conditions are provided in the LICENSE.TXT file 
009:         * at the root path of the packaging that enclose this file. 
010:         * More information can be found at 
011:         * - http://dev.libresource.org/home/license
012:         *
013:         * Initial authors :
014:         *
015:         * Guillaume Bort / INRIA
016:         * Francois Charoy / Universite Nancy 2
017:         * Julien Forest / Artenum
018:         * Claude Godart / Universite Henry Poincare
019:         * Florent Jouille / INRIA
020:         * Sebastien Jourdain / INRIA / Artenum
021:         * Yves Lerumeur / Artenum
022:         * Pascal Molli / Universite Henry Poincare
023:         * Gerald Oster / INRIA
024:         * Mariarosa Penzi / Artenum
025:         * Gerard Sookahet / Artenum
026:         * Raphael Tani / INRIA
027:         *
028:         * Contributors :
029:         *
030:         * Stephane Bagnier / Artenum
031:         * Amadou Dia / Artenum-IUP Blois
032:         * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
033:         */package org.libresource.so6.core.exec;
034:
035:        import org.libresource.so6.core.StateMonitoring;
036:        import org.libresource.so6.core.WsConnection;
037:        import org.libresource.so6.core.client.WorkspaceListener;
038:        import org.libresource.so6.core.engine.log.LogUtils;
039:        import org.libresource.so6.core.engine.log.StandardOutputWriter;
040:        import org.libresource.so6.core.engine.log.monitoring.XMLMonitoringThread;
041:        import org.libresource.so6.core.exec.tools.CheckWscParameters;
042:
043:        import java.io.BufferedReader;
044:        import java.io.InputStreamReader;
045:
046:        import java.util.Properties;
047:        import java.util.logging.Logger;
048:
049:        /**
050:         * The <code>Commit</code> class is used to commit local changes
051:         *
052:         * @author Smack
053:         * @version 1.0, 26/05/04
054:         * @see org.libresource.so6.core.WsConnection
055:         * @since JDK1.4
056:         */
057:        public class Commit {
058:            private WsConnection ws;
059:            private String comment;
060:            private XMLMonitoringThread monitoringThread;
061:
062:            /**
063:             * Instantiate a commit process
064:             *
065:             * @param wsPath
066:             * @param comment
067:             * @throws Exception
068:             */
069:            public Commit(String wscPath, String comment) throws Exception {
070:                this .ws = new WsConnection(wscPath);
071:                this .comment = comment;
072:
073:                if (this .ws.getProperty("so6.clienti.name").equals(
074:                        "org.libresource.so6.core.client.ClientIServletImpl")) {
075:                    CheckWscParameters checkWscParameters = new CheckWscParameters(
076:                            wscPath);
077:                    Properties newProps = checkWscParameters.editProperties();
078:                    this .ws.updateProp(newProps);
079:                }
080:
081:                // init output
082:                LogUtils.removeAllHandlers(Logger.getLogger("ui.log"));
083:                LogUtils.removeAllHandlers(StateMonitoring.getInstance()
084:                        .getXMLMonitoringLogger());
085:                monitoringThread = new XMLMonitoringThread();
086:
087:                StandardOutputWriter outWriter = new StandardOutputWriter(
088:                        monitoringThread.getTreeContext());
089:                monitoringThread.attachMessageWriter(outWriter);
090:            }
091:
092:            public String readProperty(String property) throws Exception {
093:                BufferedReader br = new BufferedReader(new InputStreamReader(
094:                        System.in));
095:                System.out.print(property + " : ");
096:
097:                return br.readLine();
098:            }
099:
100:            /**
101:             * Execute the commit process
102:             *
103:             * @throws Exception
104:             */
105:            public void execute() throws Exception {
106:                ws.commit(comment);
107:
108:                if (ws.getClient() instanceof  WorkspaceListener) {
109:                    ((WorkspaceListener) ws.getClient())
110:                            .notifyQueue(ws.getNs());
111:                }
112:
113:                System.out.println("\n*** Report ***\n");
114:                System.out.println(ws.getReport());
115:            }
116:
117:            /**
118:             * Simulate the commit process
119:             *
120:             * @param outputDir
121:             * @throws Exception
122:             */
123:            public void simulate(String outputDir) throws Exception {
124:                ws.setSimulationMode(true, outputDir);
125:
126:                //
127:                ws.commit(comment);
128:            }
129:
130:            /**
131:             * Instantiate and execute the commit process
132:             *
133:             * @param args
134:             *            <ul>
135:             *            <li>Path of the connection property file</li>
136:             *            <li>Comment for the commit</li>
137:             *            </ul>
138:             * @throws Exception
139:             */
140:            public static void main(String[] args) throws Exception {
141:                if (args.length < 1) {
142:                    System.err.println("Usage: wsPath (comment)");
143:                    System.err.println(" (1) wsPath: path of the file "
144:                            + WsConnection.SO6_WSC_FILE);
145:                    System.err.println(" (2) comment: commit comment");
146:                } else {
147:                    String wsPath = args[0];
148:                    String comment = "No comment";
149:
150:                    if (args.length > 1) {
151:                        comment = "";
152:
153:                        for (int i = 1; i < args.length; i++)
154:                            comment += (args[i] + " ");
155:                    }
156:
157:                    Commit commit = new Commit(wsPath, comment);
158:                    commit.execute();
159:
160:                    //
161:                    System.out.println("\007");
162:                    System.exit(0);
163:                }
164:            }
165:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.