Add a script for generating an open bug list from exported SourceForge XML data.
[scons.git] / bin / xml_export
1 #!/usr/bin/perl -w
2 #
3 # xml_export - Retrieve data from the SF.net XML export for project data
4 #
5 # Copyright (C) 2002 Open Source Development Network, Inc. ("OSDN")
6 #
7 # Permission is hereby granted, free of charge, to any person obtaining a
8 # copy of this software and associated documentation files (the "Software"),
9 # to deal in the Software without restriction, including without limitation
10 # the rights to use, copy, modify, merge, publish, distribute, sublicense,
11 # and/or sell copies of the Software, and to permit persons to whom the
12 # Software is furnished to do so, subject to the license details found
13 # below in the section marked "$LICENSE_TEXT".
14 #
15 # SCons: modified the following RCS Id line so it won't expand during
16 # our checkins.
17 #
18 # $_Id: adocman,v 1.51 2002/06/07 18:56:35 moorman Exp _$
19 #
20 # Written by Nate Oostendorp <oostendo@sourceforge.net>
21 # and Jacob Moorman <moorman@sourceforge.net>
22 ###########################################################################
23
24 use strict;
25 use Alexandria::Client;
26 use HTTP::Request::Common;
27 my $client = new Alexandria::Client;
28
29 util_verifyvariables("groupid");
30
31 my $res = $ua->simple_request(GET "$config{hosturl}/export/xml_export.php?group_id=$config{groupid}");
32
33 if (not $res->is_success()) {
34     die "Failed to connect: ".$res->as_string();
35 }
36 print $res->content;
37
38 ###########################################################################
39
40 __END__
41 =head1 NAME
42
43 xml_export - Retrieve data for a project via the SF.net XML export facility
44
45 =head1 DESCRIPTION
46
47 B<This program> provides a simple mechanism to download data from the
48 XML data export facility on SourceForge.net.  This utility is needed
49 (in place of a downloader like wget or curl) since authentication by
50 a project administrator is required to access the XML export facility.
51
52 =head1 SYNOPSIS
53
54 xml_export [options] > output_file
55
56  OPTIONS
57  --login                Login to the SourceForge.net site
58  --logout               Logout of the SourceForge.net site
59  --groupid=GROUPID      Group ID of the project whose data you wish to export
60
61 =head1 ERROR LEVELS
62
63 The following error levels are returned upon exit of this program:
64
65  0 success
66
67  1 failure: general (requested DocManager operation failed)
68
69  2 failure: authentication failure
70
71  3 failure: must --login before performing this operation
72
73  4 failure: bad command-line option specified or variable setting problem
74
75  5 failure: error in accessing/creating a file or directory
76
77  6 failure: failed to enter requested input before timeout expired
78
79 =head1 AUTHORITATIVE SOURCE
80
81 The original version of B<this program> may be found in the materials
82 provided from the SourceForge.net Site Documentation project (sitedocs)
83 on the SourceForge.net site.  The latest version of this program
84 may be found in the CVS repository for the sitedocs project on
85 SourceForge.net.  The sitedocs project pages may be accessed at:
86 http://sourceforge.net/projects/sitedocs
87
88 =head1 SECURITY
89
90 For security-related information for this application, please review
91 the documentation provided for the adocman utility.
92
93 =head1 EXAMPLES
94
95 The following are examples for using this program to export project
96 data via the XML data export facility on SourceForge.net.  It is presumed
97 that you have a valid SourceForge.net user account, which is listed as
98 a project administrator on the project in question.  This tool will
99 only work for project administrators.  The group ID for the project
100 may be derived from the URL for the Admin page for the project, or by
101 viewing the Project Admin page for the project (look for the text
102 "Your Group ID is: xxxxxx").
103
104 To login to the SourceForge.net site via the command-line:
105
106   adocman --username=myusername --password=mypassword --login \
107           --groupid=8675309
108
109 To login to the SourceForge.net site, and be prompted to enter your
110 password interactively:
111
112   adocman --username=myusername --interactive --login --groupid=8675309
113
114 To perform an export (after logging-in):
115
116   xml_export --groupid=8675309 > output.xml
117
118 To logout of SourceForge.net:
119
120   adocman --logout
121
122 Additional capabilities (including the use of configuration files to
123 specify information that would otherwise be provided interactively
124 or on the command-line) are detailed in the documentation provided for
125 the adocman utility.
126
127 To obtain output for debugging a problem, perform the same command
128 as originally tested, but first add the --verbose flag, and determine
129 whether you are able to solve the issue on your own.  If the problem
130 persists, see the "SUPPORT AND BUGS" section, below.
131
132 =head1 SUPPORT AND BUGS
133
134 This program was written by a member of the SourceForge.net staff
135 team.  This software has been released under an Open Source license,
136 for the greater benefit of the SourceForge.net developer community.
137
138 The SourceForge.net Site Documentation project is the caretaker of
139 this software.  Issues related to the use of this program, or bugs
140 found in using this program, may be reported to the SourceForge.net
141 Site Documentation project using their Support Request Tracker at:
142 https://sourceforge.net/tracker/?func=add&group_id=52614&atid=467457
143
144 Any support that is provided for this program is provided as to
145 further enhance the stability and functionality of this program
146 for SourceForge.net users.  The SourceForge.net Site Documentation
147 project makes use of this software for its own internal purposes,
148 in managing the Site Documentation collection for the SourceForge.net
149 site.
150
151 =head1 AUTHOR
152
153 Nathan Oostendorp <oostendo@sourceforge.net> and
154 Jacob Moorman <moorman@sourceforge.net>
155
156 =head1 PREREQUISITES
157
158 C<LWP::UserAgent>, C<HTML::TokeParser>, C<Crypt::SSLeay>, C<Digest::MD5>,
159 C<Term::ReadKey>
160
161 These prerequisites may be installed in an interactive, but automated
162 fashion through the use of perl's CPAN module, invoked as:
163
164   perl -MCPAN -e shell;
165
166 =head1 LICENSE
167
168 Copyright (c) 2002 Open Source Development Network, Inc. ("OSDN")
169
170 Permission is hereby granted, free of charge, to any person obtaining a
171 copy of this software and associated documentation files (the "Software"),
172 to deal in the Software without restriction, including without limitation
173 the rights to use, copy, modify, merge, publish, distribute, sublicense,
174 and/or sell copies of the Software, and to permit persons to whom the
175 Software is furnished to do so, subject to the following conditions:
176
177 1. The above copyright notice and this permission notice shall be included
178 in all copies or substantial portions of the Software.
179
180 2. Neither the names of VA Software Corporation, OSDN, SourceForge.net,
181 the SourceForge.net Site Documentation project, nor the names of its
182 contributors may be used to endorse or promote products derived from
183 the Software without specific prior written permission of OSDN. 
184
185 3. The name and trademarks of copyright holders may NOT be used in
186 advertising or publicity pertaining to the Software without specific,
187 written prior permission. Title to copyright in the Software and
188 any associated documentation will at all times remain with copyright
189 holders.
190
191 4. If any files are modified, you must cause the modified files to carry
192 prominent notices stating that you changed the files and the date of
193 any change.  We recommend that you provide URLs to the location from which
194 the code is derived.
195
196 5. Altered versions of the Software must be plainly marked as such, and
197 must not be misrepresented as being the original Software.
198
199 6. The origin of the Software must not be misrepresented; you must not
200 claim that you wrote the original Software. If you use the Software in a
201 product, an acknowledgment in the product documentation would be
202 appreciated but is not required.
203
204 7. The data files supplied as input to, or produced as output from,
205 the programs of the Software do not automatically fall under the
206 copyright of the Software, but belong to whomever generated them, and may
207 be sold commercially, and may be aggregated with the Software.
208
209 8. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
210 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
211 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
212 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
213 CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
214 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
215 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE OR DOCUMENTATION.
216
217 This Software consists of contributions made by OSDN and many individuals
218 on behalf of OSDN.  Specific attributions are listed in the accompanying
219 credits file.
220
221 =head1 HISTORY
222
223 B<2002-12-03> Completed version 0.10 - move to classes, added POD
224
225 =cut