summaryrefslogtreecommitdiffstats
path: root/sandbox/rfeng/eclipse-workspace-updatesite/index.html
blob: 8ff20bfc7acbf0f2dbde07a3cabb3c56d9bb4188 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<html>
<head>
<title>tuscany-eclipse-workspace-updatesite</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style>@import url("web/site.css");</style>
<script type="text/javascript">
	var returnval = 0;
	var stylesheet, xmlFile, cache, doc;
	function init(){
		// NSCP 7.1+ / Mozilla 1.4.1+ / Safari
		// Use the standard DOM Level 2 technique, if it is supported
		if (document.implementation && document.implementation.createDocument) {
			xmlFile = document.implementation.createDocument("", "", null);
			stylesheet = document.implementation.createDocument("", "", null);
			if (xmlFile.load){
				xmlFile.load("site.xml");
				stylesheet.load("web/site.xsl");
			} else {
				alert("Document could not be loaded by browser.");
			}
			xmlFile.addEventListener("load", transform, false);
			stylesheet.addEventListener("load", transform, false);
		}
		//IE 6.0+ solution
		else if (window.ActiveXObject) {
			xmlFile = new ActiveXObject("msxml2.DOMDocument.3.0");
			xmlFile.async = false;
			xmlFile.load("site.xml");
			stylesheet = new ActiveXObject("msxml2.FreeThreadedDOMDocument.3.0");
			stylesheet.async = false;
			stylesheet.load("web/site.xsl");
			cache = new ActiveXObject("msxml2.XSLTemplate.3.0");
			cache.stylesheet = stylesheet;
			transformData();
		}
	}
	// separate transformation function for IE 6.0+
	function transformData(){
		var processor = cache.createProcessor();
		processor.input = xmlFile;
		processor.transform();
		data.innerHTML = processor.output;
	}
	// separate transformation function for NSCP 7.1+ and Mozilla 1.4.1+ 
	function transform(){
		returnval+=1;
		if (returnval==2){
			var processor = new XSLTProcessor();
			processor.importStylesheet(stylesheet); 
			doc = processor.transformToDocument(xmlFile);
			document.getElementById("data").innerHTML = doc.documentElement.innerHTML;
		}
	}
</script>
</head>
<body onload="init();">
<!--[insert static HTML here]-->
<h1>Headless Eclipse Workspace Configurator</h1>
To develop Tuscany SCA using Eclipse, you are required to configure the workspace as follows:
<ul>
<li>Create a classpath variable M2_REPO that points to the maven local repository
<li>Set the target platform from the target definition file generated by Tuscany distribution
<li>Import the projects from the directory where Tuscany source code is checked out and built
<li>Refresh and build the Eclipse workspace
</ul>
All these steps only work manually with Eclipse UI. It's time consuming and error-prone. With this
tiny Eclipse application, we can now confiure an Eclipse workspace on a command line. For example,
you can run the following command on Windows:

<p>
eclipsec -nosplash -data c:\workspace\tuscany -application org.apache.tuscany.eclipse.workspace.WorkspaceConfigurator -source.root c:\temp\trunk -target.definition C:\tuscany\sca-java-2.x\trunk\distribution\all\target\features\tuscany-distribution-all\tuscany-pde35.target
<br>
<ul>
<li>-data <workspace location>
<li>-application org.apache.tuscany.eclipse.workspace.WorkspaceConfigurator
<li>-source.root <the source directory where Tuscany is checked out and built> 
<li>-target.definition <the target definition file>
</ul>
<p>
<div id="data"><!-- this is where the transformed data goes --></div>
</body>
</html>