|
a/tool/run/plugins/spdx/create.java |
|
b/tool/run/plugins/spdx/create.java |
|
... |
|
... |
29 |
import org.rauschig.jarchivelib.ArchiverFactory;
|
29 |
import org.rauschig.jarchivelib.ArchiverFactory;
|
30 |
import org.rauschig.jarchivelib.CompressionType;
|
30 |
import org.rauschig.jarchivelib.CompressionType;
|
31 |
import script.DownloadBigFile;
|
31 |
import script.DownloadBigFile;
|
32 |
import script.RunningTask;
|
32 |
import script.RunningTask;
|
33 |
import utils.html;
|
33 |
import utils.html;
|
34 |
import www.Form;
|
|
|
35 |
import www.RequestOrigin;
|
34 |
import www.RequestOrigin;
|
36 |
import www.WebRequest;
|
35 |
import www.WebRequest;
|
37 |
|
36 |
|
38 |
|
37 |
|
39 |
/**
|
38 |
/**
|
|
... |
|
... |
48 |
LastFolderNewSPDX = "LastFolderNewSPDX";
|
47 |
LastFolderNewSPDX = "LastFolderNewSPDX";
|
49 |
|
48 |
|
50 |
final String acceptedExtension =
|
49 |
final String acceptedExtension =
|
51 |
".tar.gz"
|
50 |
".tar.gz"
|
52 |
+ ">>"
|
51 |
+ ">>"
|
53 |
+ "zip";
|
52 |
+ "zip",
|
|
|
53 |
templateFolderHTML = "spdxFolder.html";
|
|
|
54 |
|
54 |
|
55 |
|
55 |
int interval = 3;
|
56 |
int interval = 3;
|
56 |
|
57 |
|
57 |
@Override
|
58 |
@Override
|
58 |
public void startup(){
|
59 |
public void startup(){
|
|
... |
|
... |
78 |
*/
|
79 |
*/
|
79 |
@Override
|
80 |
@Override
|
80 |
public void main(WebRequest request){
|
81 |
public void main(WebRequest request){
|
81 |
//request.setPage("spdxDialog.html");
|
82 |
//request.setPage("spdxDialog.html");
|
82 |
String result = "<html>\n" +
|
83 |
String result = "<html>\n" +
|
83 |
"<head>\n" +
|
84 |
// "<head>\n" +
|
84 |
"<style type=\"text/css\">body {font-family:verdana,arial,"
|
85 |
// "<style type=\"text/css\">body {font-family:verdana,arial,"
|
85 |
+ "sans-serif;font-size:10pt;margin:30px;}</style>"
|
86 |
// + "sans-serif;font-size:10pt;margin:30px;}</style>"
|
86 |
+ "</head>\n" +
|
87 |
// + "</head>\n" +
|
87 |
"\n" +
|
88 |
// "\n" +
|
88 |
"<body>"
|
89 |
"<body>"
|
89 |
+ ""
|
90 |
+ ""
|
90 |
+ "Testing stuff!"
|
91 |
+ "Testing stuff!"
|
91 |
+ ""
|
92 |
+ ""
|
92 |
+ "</body>"
|
93 |
+ "</body>"
|
|
... |
|
... |
110 |
/**
|
111 |
/**
|
111 |
* Dialog for creating a new SPDX document from a folder on disk
|
112 |
* Dialog for creating a new SPDX document from a folder on disk
|
112 |
* @param request
|
113 |
* @param request
|
113 |
*/
|
114 |
*/
|
114 |
public void mainFolder(WebRequest request){
|
115 |
public void mainFolder(WebRequest request){
|
115 |
// no support for requests from the browser
|
116 |
|
116 |
// if(request.requestOrigin == RequestOrigin.BROWSER){
|
117 |
// load our template
|
117 |
// log.write(is.ERROR, "Support to SPDX creation from folder on disk "
|
118 |
request.setTemplate(templateFolderHTML);
|
118 |
// + "is not yet implemented");
|
119 |
|
119 |
// return;
|
|
|
120 |
// }
|
|
|
121 |
|
120 |
|
122 |
// get the value used before
|
121 |
// get the value used before
|
123 |
String selectedFolder = settings.read(LastFolderNewSPDX, "");
|
122 |
String selectedFolder = settings.read(LastFolderNewSPDX, "");
|
124 |
|
123 |
|
125 |
// if nothign is chosen, just show it as "none"
|
124 |
// if nothign is chosen, just show it as "none"
|
126 |
if(selectedFolder.isEmpty()){
|
125 |
if(selectedFolder.isEmpty()){
|
127 |
selectedFolder = "NONE";
|
126 |
selectedFolder = "NONE";
|
128 |
}
|
127 |
}
|
129 |
|
128 |
|
|
|
129 |
// add the value of our directory
|
|
|
130 |
request.changeTemplate("none-template", selectedFolder);
|
|
|
131 |
// all done
|
|
|
132 |
request.close();
|
|
|
133 |
|
|
|
134 |
//
|
130 |
String result =
|
135 |
// String result =
|
131 |
html.div()
|
136 |
// html.div()
|
132 |
+ html.h2("Create a new SPDX from folder on disk")
|
137 |
// + html.h2("Create a new SPDX from folder on disk")
|
133 |
+ "Use this page to create an SPDX document from a given "
|
138 |
// + "Use this page to choose a folder and create an SPDX document"
|
134 |
+ "folder on your disk. "
|
|
|
135 |
+ html.br
|
139 |
// + html.br
|
136 |
+ html.br
|
140 |
// + html.br
|
137 |
+ html.h3("Selected Folder")
|
141 |
// + html.h3("Selected Folder")
|
138 |
+ selectedFolder
|
142 |
// + selectedFolder
|
139 |
+ html.br
|
143 |
// + html.br
|
140 |
|
144 |
//
|
141 |
+ html.br
|
145 |
// + html.br
|
142 |
+ html.link("Choose a folder", "create?x=folder")
|
146 |
// + html.link("Choose a folder", "create?x=folder")
|
143 |
|
147 |
//
|
144 |
+ html.br
|
148 |
// + html.br
|
145 |
+ html.br
|
149 |
// + html.br
|
146 |
+ html.link("Start", "create?x=foldercreate")
|
150 |
// + html.link("Start", "create?x=foldercreate")
|
147 |
|
151 |
//
|
148 |
|
152 |
//
|
149 |
+ html._div
|
153 |
// + html._div
|
150 |
;
|
154 |
// ;
|
151 |
|
155 |
//
|
152 |
request.setAnswer(result);
|
156 |
// request.setAnswer(result);
|
153 |
}
|
157 |
}
|
154 |
|
158 |
|
155 |
|
159 |
|
156 |
|
160 |
|
157 |
/**
|
161 |
/**
|