Source Code Cross Referenced for MSVSSHISTORY.java in  » Build » ANT » org » apache » tools » ant » taskdefs » optional » vss » 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 » Build » ANT » org.apache.tools.ant.taskdefs.optional.vss 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *  Licensed to the Apache Software Foundation (ASF) under one or more
003:         *  contributor license agreements.  See the NOTICE file distributed with
004:         *  this work for additional information regarding copyright ownership.
005:         *  The ASF licenses this file to You under the Apache License, Version 2.0
006:         *  (the "License"); you may not use this file except in compliance with
007:         *  the License.  You may obtain a copy of the License at
008:         *
009:         *      http://www.apache.org/licenses/LICENSE-2.0
010:         *
011:         *  Unless required by applicable law or agreed to in writing, software
012:         *  distributed under the License is distributed on an "AS IS" BASIS,
013:         *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014:         *  See the License for the specific language governing permissions and
015:         *  limitations under the License.
016:         *
017:         */
018:
019:        package org.apache.tools.ant.taskdefs.optional.vss;
020:
021:        import java.io.File;
022:        import java.text.SimpleDateFormat;
023:
024:        import org.apache.tools.ant.BuildException;
025:        import org.apache.tools.ant.types.Commandline;
026:        import org.apache.tools.ant.types.EnumeratedAttribute;
027:
028:        /**
029:         * Performs History commands to Microsoft Visual SourceSafe.
030:         *
031:         * @ant.task name="vsshistory" category="scm"
032:         */
033:        public class MSVSSHISTORY extends MSVSS {
034:
035:            /**
036:             * Builds a command line to execute ss.
037:             * @return     The constructed commandline.
038:             */
039:            Commandline buildCmdLine() {
040:                Commandline commandLine = new Commandline();
041:
042:                // first off, make sure that we've got a command and a vssdir and a label ...
043:                if (getVsspath() == null) {
044:                    String msg = "vsspath attribute must be set!";
045:                    throw new BuildException(msg, getLocation());
046:                }
047:
048:                // build the command line from what we got the format is
049:                // ss History elements [-H] [-L] [-N] [-O] [-V] [-Y] [-#] [-?]
050:                // as specified in the SS.EXE help
051:                commandLine.setExecutable(getSSCommand());
052:                commandLine.createArgument().setValue(COMMAND_HISTORY);
053:
054:                // VSS items
055:                commandLine.createArgument().setValue(getVsspath());
056:                // -I-
057:                commandLine.createArgument().setValue(FLAG_AUTORESPONSE_DEF); // ignore all errors
058:                // -Vd
059:                commandLine.createArgument().setValue(getVersionDate());
060:                // -VL
061:                commandLine.createArgument().setValue(getVersionLabel());
062:                // -R
063:                commandLine.createArgument().setValue(getRecursive());
064:                // -B / -D / -F-
065:                commandLine.createArgument().setValue(getStyle());
066:                // -Y
067:                commandLine.createArgument().setValue(getLogin());
068:                // -O
069:                commandLine.createArgument().setValue(getOutput());
070:
071:                return commandLine;
072:            }
073:
074:            /**
075:             * Retrieve history recursively. Defaults to false.
076:             *
077:             * @param recursive  The boolean value for recursive.
078:             */
079:            public void setRecursive(boolean recursive) {
080:                super .setInternalRecursive(recursive);
081:            }
082:
083:            /**
084:             * Name of the user whose change history is generated.
085:             *
086:             * @param   user The username.
087:             */
088:            public void setUser(String user) {
089:                super .setInternalUser(user);
090:            }
091:
092:            /**
093:             * Date representing the 'start' of the range.
094:             *
095:             * @param   fromDate    The start date.
096:             */
097:            public void setFromDate(String fromDate) {
098:                super .setInternalFromDate(fromDate);
099:            }
100:
101:            /**
102:             * Date representing the 'end' of the range.
103:             *
104:             * @param   toDate    The end date.
105:             */
106:            public void setToDate(String toDate) {
107:                super .setInternalToDate(toDate);
108:            }
109:
110:            /**
111:             * Label representing the 'start' of the range.
112:             *
113:             * @param   fromLabel    The start label.
114:             */
115:            public void setFromLabel(String fromLabel) {
116:                super .setInternalFromLabel(fromLabel);
117:            }
118:
119:            /**
120:             * Label representing the 'end' of the range.
121:             *
122:             * @param   toLabel    The end label.
123:             */
124:            public void setToLabel(String toLabel) {
125:                super .setInternalToLabel(toLabel);
126:            }
127:
128:            /**
129:             * Number of days for comparison.
130:             * Defaults to 2 days.
131:             *
132:             * @param   numd    The number of days.
133:             */
134:            public void setNumdays(int numd) {
135:                super .setInternalNumDays(numd);
136:            }
137:
138:            /**
139:             * Output file name for the history.
140:             *
141:             * @param   outfile The output file name.
142:             */
143:            public void setOutput(File outfile) {
144:                if (outfile != null) {
145:                    super .setInternalOutputFilename(outfile.getAbsolutePath());
146:                }
147:            }
148:
149:            /**
150:             * Format of dates in <code>fromDate</code and <code>toDate</code>.
151:             * Used when calculating dates with the numdays attribute.
152:             * This string uses the formatting rules of <code>SimpleDateFormat</code>.
153:             * Defaults to <code>DateFormat.SHORT</code>.
154:             *
155:             * @param   dateFormat  The date format.
156:             */
157:            public void setDateFormat(String dateFormat) {
158:                super .setInternalDateFormat(new SimpleDateFormat(dateFormat));
159:            }
160:
161:            /**
162:             * Output style. Valid options are:
163:             * <ul>
164:             * <li>brief:    -B Display a brief history.
165:             * <li>codediff: -D Display line-by-line file changes.
166:             * <li>nofile:   -F- Do not display individual file updates in the project history.
167:             * <li>default:  No option specified. Display in Source Safe's default format.
168:             * </ul>
169:             *
170:             * @param attr The history style:
171:             */
172:            public void setStyle(BriefCodediffNofile attr) {
173:                String option = attr.getValue();
174:                if (option.equals(STYLE_BRIEF)) {
175:                    super .setInternalStyle(FLAG_BRIEF);
176:                } else if (option.equals(STYLE_CODEDIFF)) {
177:                    super .setInternalStyle(FLAG_CODEDIFF);
178:                } else if (option.equals(STYLE_DEFAULT)) {
179:                    super .setInternalStyle("");
180:                } else if (option.equals(STYLE_NOFILE)) {
181:                    super .setInternalStyle(FLAG_NO_FILE);
182:                } else {
183:                    throw new BuildException("Style " + attr + " unknown.",
184:                            getLocation());
185:                }
186:            }
187:
188:            /**
189:             * Extention of EnumeratedAttribute to hold the values for style.
190:             */
191:            public static class BriefCodediffNofile extends EnumeratedAttribute {
192:                /**
193:                 * Gets the list of allowable values.
194:                 * @return The values.
195:                 */
196:                public String[] getValues() {
197:                    return new String[] { STYLE_BRIEF, STYLE_CODEDIFF,
198:                            STYLE_NOFILE, STYLE_DEFAULT };
199:                }
200:            }
201:        }
w___ww__.___j___av___a__2__s___._com___ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.