Bug 483588: [RobotML][releng] deploy an update site at
downloads.eclipse.org 

Change-Id: I55c7ad245d029c4f0ca535a9a20cbab36c199b8d
Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=483588
Signed-off-by: Francois Le Fevre - CEA <francois.le-fevre@cea.fr>
diff --git a/releng/org.eclipse.papyrus.robotml.p2/pom.xml b/releng/org.eclipse.papyrus.robotml.p2/pom.xml
index 234daa0..70698af 100644
--- a/releng/org.eclipse.papyrus.robotml.p2/pom.xml
+++ b/releng/org.eclipse.papyrus.robotml.p2/pom.xml
@@ -16,45 +16,55 @@
 			<url>http://repository.jboss.org/nexus/content/groups/public/</url>
 		</pluginRepository>
 	</pluginRepositories>
-	<profiles>
-		<profile>
-			<id>NEON.target</id>
-			<activation>
-				<activeByDefault>true</activeByDefault>
-			</activation>
-			<build>
-				<plugins>
-					<plugin>
-						<!-- https://github.com/jbosstools/jbosstools-maven-plugins/wiki -->
-						<groupId>org.jboss.tools.tycho-plugins</groupId>
-						<artifactId>repository-utils</artifactId>
-						<version>0.23.2</version>
-						<executions>
-							<execution>
-								<id>generate-facade</id>
-								<phase>package</phase>
-								<goals>
-									<goal>generate-repository-facade</goal>
-								</goals>
-								<configuration>
-									<associateSites>
-										<site>http://download.eclipse.org/releases/neon</site>
-									</associateSites>
-								</configuration>
-							</execution>
-						</executions>
-						<dependencies>
-							<dependency>
-								<groupId>org.eclipse.tycho</groupId>
-								<artifactId>tycho-packaging-plugin</artifactId>
-								<version>${tycho-version}</version>
-							</dependency>
-						</dependencies>
-					</plugin>
-				</plugins>
-			</build>
-		</profile>
-	</profiles>
+	<build>
+		<plugins>
+			<plugin>
+				<!-- https://github.com/jbosstools/jbosstools-maven-plugins/wiki -->
+				<groupId>org.jboss.tools.tycho-plugins</groupId>
+				<artifactId>repository-utils</artifactId>
+				<version>0.23.2</version>
+				<executions>
+					<execution>
+						<id>generate-facade</id>
+						<phase>package</phase>
+						<goals>
+							<goal>generate-repository-facade</goal>
+						</goals>
+						<configuration>
+							<symbols>
+								<update.site.name>RobotML</update.site.name>
+								<update.site.description>Use this URL in Eclipse to install RobotML</update.site.description>
+								<update.site.version>${project.version}</update.site.version>
+								<project.website>https://hudson.eclipse.org/papyrus/view/Sysml/job/papyrus-robotml-website/ws/site-staging/index.html</project.website>
+								<project.issues>${project.issueManagement.url}</project.issues>
+								<eclipse.target>${eclipse.targetrelease}</eclipse.target>
+								<update.site.nightly>https://hudson.eclipse.org/papyrus/view/Sysml/job/papyrus-robotml/ws/releng/org.eclipse.papyrus.robotml.p2/target/repository/</update.site.nightly>
+							</symbols>
+							<associateSites>
+								<site>https://hudson.eclipse.org/papyrus/view/Sysml/job/papyrus-sysml-website/ws/site-staging/index.html</site>
+							</associateSites>
+							<siteTemplateFolder>siteTemplate</siteTemplateFolder>
+							<p2StatsUrl>http://download.eclipse.org/stats</p2StatsUrl>
+						</configuration>
+					</execution>
+				</executions>
+				<dependencies>
+					<dependency>
+						<groupId>org.eclipse.tycho</groupId>
+						<artifactId>tycho-packaging-plugin</artifactId>
+						<version>${tycho-version}</version>
+					</dependency>
+				</dependencies>
+			</plugin>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-deploy-plugin</artifactId>
+				<configuration>
+					<skip>true</skip>
+				</configuration>
+			</plugin>
+		</plugins>
+	</build>
 	<name>org.eclipse.papyrus.robotml.p2</name>
 	<description>This plugin defines the update site of RobotML plugins and feature.</description>
 </project>
\ No newline at end of file
diff --git a/releng/org.eclipse.papyrus.robotml.p2/publish.README b/releng/org.eclipse.papyrus.robotml.p2/publish.README
new file mode 100644
index 0000000..66b977d
--- /dev/null
+++ b/releng/org.eclipse.papyrus.robotml.p2/publish.README
@@ -0,0 +1,3 @@
+The publish.sh script may be used to publish the build results (update site). The script may be called
+without parameters and prompts for everything it requires for publishing an update site, or it may be 
+invoked with respective command line parameters.
\ No newline at end of file
diff --git a/releng/org.eclipse.papyrus.robotml.p2/publish.sh b/releng/org.eclipse.papyrus.robotml.p2/publish.sh
new file mode 100755
index 0000000..4d6cc2c
--- /dev/null
+++ b/releng/org.eclipse.papyrus.robotml.p2/publish.sh
@@ -0,0 +1,406 @@
+#!/bin/sh
+#Based upon Gef4 publish.sh script
+
+#causes the shell to exit if any subcommand or pipeline returns a non-zero status.
+#set -e
+
+# Script may take 10-11 command line parameters:
+# $1: Hudson job name: <name>
+# $2: Hudson build id: <id>
+# $3: Build type: i(ntegration), s(table), r(elease)
+# $4: Whether to promote to an update-site: (y)es, (n)o
+# $5: Whether to merge the site with an existing one: (y)es, (n)o
+# $6: Whether to generate drop files: (y)es, (n)o
+# $7: The release label used to label the drop files and (nested) update site, e.g. 3.10.0 or 3.10.1
+# $8: The eclipse target version, e.g. mars or neon
+# $9: Whether to generate rcp files: (y)es, (n)o
+# $10: Papyrus component 
+# $11: An optional release label suffix to be appended to drop files and (nested) update site name, e.g. M1, RC1 
+
+#The publish.sh script may be used to publish the build results (update site and drop files and rcp). The script may be called
+#without parameters and prompts for everything it requires for publishing an update site, or it may be 
+#invoked with respective command line parameters.
+if [ $# -eq 10 -o $# -eq 11  ];
+then
+	jobName=${1}
+	echo "jobName: $jobName"
+	buildId=${2}
+	echo "buildId: $buildId"
+	buildType=${3}
+	echo "buildType: $buildType"
+	site=${4}
+	echo "site: $site"
+	merge=${5}
+	echo "merge: $merge"
+	dropFiles=${6}
+	echo "dropFiles: $dropFiles"
+	releaseLabel=${7}	
+	echo "releaseLabel: $releaseLabel"
+	eclipseTarget=${8}	
+	echo "eclipseTarget: $eclipseTarget"
+	rcpFiles=${9}	
+	echo "rcpFiles: $rcpFiles"
+	component=${10}	
+	echo "component: $component"
+	if [ -n "${11}" ];
+	then
+		releaseLabelSuffix=${11}
+		echo "releaseLabelSuffix: $releaseLabelSuffix"
+	fi
+else
+	if [ $# -ne 0 ];
+	then
+		exit 1
+	fi
+fi
+
+#The root url that enables to find the job with ${hudsonJobRootUrl}/$jobName/$buildId
+hudsonJobRootUrl="https://hudson.eclipse.org/papyrus/job/"
+
+#The localization of the local build target update site
+targetUpdateSite="archive/releng/org.eclipse.papyrus.${component}.p2/target/repository"
+targetRCPRoot="archive/releng/org.eclipse.papyrus.${component}.product/target/products/org.eclipse.papyrus.${component}.product"
+
+#The feature to parse to retrieve the qualifierversion
+feature2Parse4QualifierVersion="org.eclipse.papyrus.${component}.feature"
+
+#The specific localization
+hudsonRoot="/home/data/httpd/download.eclipse.org/"
+
+remoteUpdateSiteRoot="modeling/mdt/papyrus/components/${component}"
+remoteDropDir=${hudsonRoot}/${remoteUpdateSiteRoot}/downloads/${releaseLabel}/drops
+remoteUpdateSite="${hudsonRoot}/${remoteUpdateSiteRoot}/${remoteSite}"
+remoteRcpDir=${hudsonRoot}/${remoteUpdateSiteRoot}/downloads/${releaseLabel}/rcps
+
+
+
+if [ -z "$jobName" ];
+then
+	echo -n "Please enter the name of the Hudson job you want to promote:"
+	read jobName
+fi
+
+if [ -z "$buildId" ];
+then
+	for i in $( find ~/.hudson/jobs/$jobName/builds -type l | sed 's!.*/!!' | sort)
+	do
+		echo -n "$i, "
+	done
+	echo "lastStable, lastSuccessful"
+	echo -n "Please enter the id of the $jobName build you want to promote:"
+	read buildId
+fi
+
+if [ "$buildId" = "lastStable" -o "$buildId" = "lastSuccessful" ];
+then
+	# Reverse lookup the build id (in case lastSuccessful or lastStable was used)
+	for i in $(find ~/.hudson/jobs/$jobName/builds/ -type l)
+	do
+		if [ "$(readlink -f $i)" = "$(readlink -f ~/.hudson/jobs/$jobName/$buildId)" ];
+		then
+			buildId=${i##*/}
+		fi
+	done
+	echo "Reverse lookup (lastStable/lastSuccessful) yielded buildId: $buildId"
+fi
+
+# Determine the local update site we want to publish to
+jobDir=$(readlink -f ~/.hudson/jobs/${jobName}/builds/${buildId})
+if [ ! -d $jobDir ];
+then
+	echo "The specified buildId does not refer to an existing build: $buildId"
+	exit 1
+fi
+
+
+localUpdateSite=${jobDir}/${targetUpdateSite}
+echo "jobDir=${jobDir}"
+echo "targetUpdateSite=${targetUpdateSite}"
+echo "localUpdateSite=${localUpdateSite}"
+
+localRCPSiteRoot=${jobDir}/${targetRCPRoot}
+echo "localRCPSiteRoot=${localRCPSiteRoot}"
+
+echo "Publishing from local update site: $localUpdateSite"
+
+# Select the build type
+if [ -z "$buildType" ];
+then
+    echo -n "Please select which type of build you want to publish to [i(integration), s(table), r(elease)]: "
+    read buildType
+fi
+echo "Publishing as $buildType build"
+
+# check if we are going to promote to an update-site
+if [ -z "$site" ];
+then
+	echo -n "Do you want to promote to an remote update site? [(y)es, (n)o]:"
+	read site
+fi
+if [ "$site" != y -a "$site" != n ];
+then
+	echo "Parameter site has to be 'y'(es) or 'n'(o) but was: $site"
+    exit 0
+fi
+echo "Promoting to remote update site: $site"
+
+if [ "$site" = y ];
+then
+	# Determine remote update site we want to promote to
+	case $buildType in
+		i|I) remoteSite=integration;;
+		s|S) remoteSite=milestones;;
+		r|R) remoteSite=releases;;
+		*) 
+		echo "Parameter buildType has to be 'i'(ntegration), 's'(stable), or 'r'(elease), but was: $buildType"
+		exit 1 ;;
+	esac
+
+	echo "Publishing to remote update-site: $remoteUpdateSite"
+
+	if [ -d "$remoteUpdateSite" ];
+	then
+		if [ -z "$merge" ];
+		then
+			echo -n "Do you want to merge with the existing update-site? [(y)es, (n)o]:"
+			read merge
+		fi
+		if [ "$merge" != y -a "$merge" != n ];
+		then
+			echo "Parameter merge has to be 'y'(es) or 'n'(o) but was: $merge"
+			exit 1
+		fi
+	else
+		merge=n
+	fi
+	echo "Merging with existing site: $merge"
+fi
+
+# check if we are going to create drop files
+if [ -z "$dropFiles" ];
+then
+	echo -n "Do you want to create drop files? [(y)es, (n)o]:"
+	read dropFiles
+fi
+if [ "$dropFiles" != y -a "$dropFiles" != n ];
+then
+	echo "Parameter dropFiles has to be 'y'(es) or 'n'(o) but was: $dropFiles"
+	exit 1
+fi
+echo "Generating drop files: $dropFiles"
+
+# Determine releaseLabel
+if [ -z "$releaseLabel" ];
+then
+    echo -n "Please enter release label (e.g. 3.10.0, 3.10.1M2):"
+    read releaseLabel
+fi
+
+# Prepare a temp directory
+mkdir -p target
+cd target
+tmpDir="$jobName-publish-tmp"
+rm -fr $tmpDir
+mkdir -p $tmpDir
+cd $tmpDir
+
+# Download and prepare Eclipse SDK, which is needed to merge update site and postprocess repository 
+echo "Downloading eclipse to $PWD"
+
+cp /home/data/httpd/download.eclipse.org/eclipse/downloads/drops4/R-4.4.2-201502041700/eclipse-SDK-4.4.2-linux-gtk-x86_64.tar.gz .
+tar -xzf eclipse-SDK-4.4.2-linux-gtk-x86_64.tar.gz
+cd eclipse
+chmod 700 eclipse
+cd ..
+if [ ! -d "eclipse" ];
+then
+    echo "Failed to download an Eclipse SDK, being needed for provisioning."
+    exit
+fi
+# Prepare Eclipse SDK to provide WTP releng tools (used to postprocess repository, i.e set p2.mirrorsURL property)
+echo "Installing WTP Releng tools"
+./eclipse/eclipse -nosplash --launcher.suppressErrors -clean -debug -application org.eclipse.equinox.p2.director -repository http://download.eclipse.org/webtools/releng/repository/ -installIUs org.eclipse.wtp.releng.tools.feature.feature.group
+# Clean up
+echo "Cleaning up"
+rm eclipse-SDK-4.4.2-linux-gtk-x86_64.tar.gz
+
+# Generate drop files
+if [ "$dropFiles" = y ];
+	then
+	
+	# Prepare local update site (for drop files)
+	mkdir -p update-site
+	cp -R $localUpdateSite/* update-site/
+	echo "Copied $localUpdateSite to local directory update-site."
+	
+	qualifiedVersion=$(find update-site/features/ -maxdepth 1 | grep "${feature2Parse4QualifierVersion}")
+	qualifiedVersion=${qualifiedVersion%.jar}
+    qualifiedVersion=${qualifiedVersion#*_}
+    qualifier=${qualifiedVersion##*.}
+    dropDir="${releaseLabel}/$(echo $buildType | tr '[:lower:]' '[:upper:]')$qualifier"
+    localDropDir=drops/$dropDir
+    echo "Creating drop files in local directory $localDropDir"
+    mkdir -p $localDropDir
+    
+    cd update-site
+    zip -r ../$localDropDir/${component}-Update-${releaseLabel}${releaseLabelSuffix}.zip features plugins artifacts.jar content.jar
+    md5sum ../$localDropDir/${component}-Update-${releaseLabel}${releaseLabelSuffix}.zip > ../$localDropDir/${component}-Update-${releaseLabel}${releaseLabelSuffix}.zip.md5
+    echo "Created ${component}-Update-Site-${releaseLabel}${releaseLabelSuffix}.zip" 
+    cd ..  
+
+    # Cleanup local update site (for drop files generation)
+	rm -fr update-site
+
+	#generating build.cfg file to be referenced from downloads web page
+	echo "generating build.cfg file to be referenced from downloads web page"
+    echo "hudson.job.name=$jobName" > $localDropDir/build.cfg
+    echo "hudson.job.id=$buildId (${jobDir##*/})" >> $localDropDir/build.cfg
+    echo "hudson.job.url= ${hudsonJobRootUrl}/$jobName/$buildId" >> $localDropDir/build.cfg
+    
+	mkdir -p ${remoteDropDir}
+    cp -R $localDropDir/* ${remoteDropDir}/
+         
+fi
+
+# Generate RCP files
+if [ "$rcpFiles" = y ];
+	then
+	
+	# Prepare local rcp site (for rcp files)
+	mkdir -p rcp-site
+	cp ${localRCPSiteRoot}-linux.gtk.x86_64.zip rcp-site/org.eclipse.papyrus.${component}.product-${releaseLabel}-${releaseLabelSuffix}-linux.gtk.x86_64.zip
+	echo "Copied ${localRCPSiteRoot}-linux.gtk.x86_64.zip to local directory rcp-site."
+	cp ${localRCPSiteRoot}-macosx.cocoa.x86_64.tar.gz rcp-site/org.eclipse.papyrus.${component}.product-${releaseLabel}-${releaseLabelSuffix}-macosx.cocoa.x86_64.tar.gz
+	echo "Copied ${localRCPSiteRoot}-macosx.cocoa.x86_64.tar.gz to local directory rcp-site."
+	cp ${localRCPSiteRoot}-win32.win32.x86_64.zip rcp-site/org.eclipse.papyrus.${component}.product-${releaseLabel}-${releaseLabelSuffix}-win32.win32.x86_64.zip
+	echo "Copied ${localRCPSiteRoot}-win32.win32.x86_64.zip to local directory rcp-site."
+	
+	qualifiedVersion=$(find update-site/features/ -maxdepth 1 | grep "${feature2Parse4QualifierVersion}")
+	qualifiedVersion=${qualifiedVersion%.jar}
+    qualifiedVersion=${qualifiedVersion#*_}
+    qualifier=${qualifiedVersion##*.}
+    dropDir="${releaseLabel}/$(echo $buildType | tr '[:lower:]' '[:upper:]')$qualifier"
+
+	localRcpDir=rcps/$dropDir
+    echo "Creating rcp files in local directory $localRcpDir"
+    mkdir -p $localRcpDir
+    
+    cd rcp-site
+    cp * ../$localRcpDir/
+    
+    echo "Created org.eclipse.papyrus.${component}.product-${releaseLabel}-${releaseLabelSuffix}-linux.gtk.x86_64.zip in ../$localRcpDir/" 
+    cd ..  
+
+    # Cleanup local update site (for drop files generation)
+	rm -fr rcp-site
+
+	mkdir -p ${remoteRcpDir}/
+    cp -R $localRcpDir/* ${remoteRcpDir}/
+       
+fi
+
+if [ "$site" = y ];
+then
+	mkdir -p update-site
+	updateSiteLabel=${releaseLabel}${releaseLabelSuffix}_${jobName}_${buildId}
+	# Prepare composite local update site (transfer into composite if needed)
+	if [ "$merge" = y ];
+	then
+		# check if the remote site is a composite update site
+		echo "Merging existing site into local one."
+		#if [ -e "$remoteUpdateSite/compositeArtifacts.xml" ];
+		#then
+			cp -R $remoteUpdateSite/* update-site/
+		#else
+		#	mkdir -p update-site/pre_${updateSiteLabel}
+		#	cp -R $remoteUpdateSite/* update-site/pre_${updateSiteLabel}/
+		#fi
+	else 
+		echo "Skipping merge operation."    
+	fi
+	# move local update site below composite one
+	mkdir -p update-site/${updateSiteLabel}
+	cp -R $localUpdateSite/* update-site/${updateSiteLabel}/
+    	
+	cd update-site
+	children=$(find . -maxdepth 1 -type d -print | wc -l)
+	children=$(($children-1))
+	timestamp=$(date +%s000)
+
+content="
+<?xml version='1.0' encoding='UTF-8'?>
+<?compositeMetadataRepository version='1.0.0'?>
+<repository name='${component} ${remoteSite}' type='org.eclipse.equinox.internal.p2.metadata.repository.CompositeMetadataRepository' version='1.0.0'>
+<properties size='1'>
+<property name='p2.timestamp' value='${timestamp}'/>
+</properties>
+<children size='${children}'>
+$(
+for file in *; do
+  if [ -d $file ]; then
+printf "<child location='${file}'/>"
+  fi
+done
+)
+</children>
+</repository>
+"
+	echo $content > compositeContent.xml
+
+artifact="
+<?xml version='1.0' encoding='UTF-8'?>
+<?compositeArtifactRepository version='1.0.0'?>
+<repository name='${component} ${remoteSite}' type='org.eclipse.equinox.internal.p2.artifact.repository.CompositeArtifactRepository' version='1.0.0'>
+<properties size='1'>
+<property name='p2.timestamp' value='${timestamp}'/>
+</properties>
+<children size='${children}'>
+$(
+for file in *; do
+  if [ -d $file ]; then
+printf "<child location='${file}'/>"
+  fi
+done
+)
+</children>
+</repository>
+"
+	echo $artifact > compositeArtifacts.xml
+
+	cd ..
+
+	# Ensure p2.mirrorURLs property is used in update site
+	echo "Updating p2.mirrorURLs property."
+	./eclipse/eclipse -nosplash --launcher.suppressErrors -clean -debug -application org.eclipse.wtp.releng.tools.addRepoProperties -vmargs -DartifactRepoDirectory=$PWD/update-site/${updateSiteLabel} -Dp2MirrorsURL="http://www.eclipse.org/downloads/download.php?format=xml&file=/${remoteUpdateSiteRoot}/${remoteSite}/${updateSiteLabel}"
+
+	# Create p2.index file
+	if [ ! -e "update-site/p2.index" ];
+	then
+		echo "Creating p2.index file."
+		echo "version = 1" > update-site/p2.index
+		echo "metadata.repository.factory.order=compositeContent.xml,\!" >> update-site/p2.index
+		echo "artifact.repository.factory.order=compositeArtifacts.xml,\!" >> update-site/p2.index
+	fi
+
+	# Backup then clean remote update site
+	echo "Creating backup of remote update site."
+	if [ -d "$remoteUpdateSite" ];
+	then
+		if [ -d BACKUP ];
+		then
+			rm -fr BACKUP
+		fi
+		mkdir BACKUP
+		cp -R $remoteUpdateSite/* BACKUP/
+		rm -fr $remoteUpdateSite
+	fi
+
+	echo "Publishing contents of local update-site directory to remote update site $remoteUpdateSite"
+	mkdir -p $remoteUpdateSite
+	cp -R update-site/* $remoteUpdateSite/
+fi
+
+# Clean up
+echo "Cleaning up"
+rm -fr eclipse
+rm -fr update-site
\ No newline at end of file
diff --git a/releng/org.eclipse.papyrus.robotml.p2/siteTemplate/index.html b/releng/org.eclipse.papyrus.robotml.p2/siteTemplate/index.html
new file mode 100644
index 0000000..42e33f7
--- /dev/null
+++ b/releng/org.eclipse.papyrus.robotml.p2/siteTemplate/index.html
@@ -0,0 +1,113 @@
+<html>
+<head>
+<title>${update.site.name} Update Site: ${update.site.version}</title>
+<link rel="stylesheet" type="text/css" href="web/site.css">
+</head>
+<body marginheight="0" marginwidth="0" leftmargin="0" topmargin="0">
+<center>
+<table cellspacing="0" cellpadding="0" class="table">
+	<tr>
+		<td colspan="3" class="td_header">&nbsp;</td>
+	</tr>
+	<tr>
+		<td>&#160;&#160;&#160;&#160;&#160;&#160;</td>
+		<td>&#160;&#160;&#160;&#160;&#160;&#160;</td>
+		<td>&#160;&#160;&#160;&#160;&#160;&#160;</td>
+	</tr>
+	<tr>
+		<td>&#160;&#160;&#160;&#160;&#160;&#160;</td>
+		<td>
+		<h2 class="title">${update.site.name} Update Site</h2>
+		<table width="100%">
+			<tr class="header">
+				<td class="sub-header" width="100%"><span>Latest Build: ${update.site.version}</span></td>
+			</tr>
+
+			<tr class="light-row" style="height: 30px">
+				<td class="bodyText">
+				<p class="bodyText">This is the <b>${update.site.description}</b>
+				Update Site for ${update.site.name}.
+								<blockquote style="border: 1px dashed #1778be; padding: 2px">
+									<ol>
+										<li>To install
+											from this site, start up Eclipse ${eclipse.target}, then do:
+											<ul>
+												<code><strong>Help > Install New Software... ></strong></code>
+											</ul>
+										</li>
+										<li>Copy this site's URL into Eclipse, and hit Enter.</li>
+										<li>When the site loads, select the features to install,
+											or click the <code><strong>Select All</strong></code> button.</li>
+										<li>To properly resolve all dependencies, check
+										<ul><code><strong>[x] Contact all update sites during install to find required software</strong></code></ul>
+
+										<li>Click <code><strong>Next</strong></code>, agree to the license
+											terms, and install.</li>
+
+										<p class="bodyText">
+											You can also download SysML 1.4 as individual zips for
+											offline installation. See <a class="link"
+												href="../downloads/${update.site.version}/rcps/">SysML 1.4 product
+												Downloads</a>.<br />
+										</p>
+									</ol>
+								</blockquote>
+							</td>
+						</tr>
+		</table>
+		</td>
+		<td>&#160;&#160;&#160;&#160;&#160;&#160;</td>
+	</tr>
+	<tr>
+		<td></td>
+		<td>
+	        ${site.contents}
+		</td>
+		<td></td>
+	</tr>
+	<tr>
+		<td></td>
+		<td>
+		<table width="100%">
+			<tr class="header">
+				<td class="sub-header" width="100%"><span> More informations</span></td>
+			</tr>
+			<tr class="light-row" style="height: 30px">
+				<td class="bodyText">
+				<h4>Documentation</h4>
+				<p class="bodyText">You can check here the web site <a href="${project.website}">documentation</a>.</p>
+				<br />
+
+				</td>
+			</tr>
+
+			<tr class="dark-row" style="height: 30px">
+				<td class="bodyText">
+				<h4>Report issues</h4>
+
+				<p>We'd greatly
+				appreciate the assistance in testing and <a
+					href="${project.issues}">reporting of
+				issues in our issue tracker</a>.</p><br/>
+
+				</td>
+			</tr>
+
+			<tr class="light-row" style="height: 30px">
+				<td class="bodyText">
+				<h4>Nightly Builds</h4>
+
+				<p>The <a
+					href="${update.site.nightly}">bleeding
+				edge</a> contains the latest and greatest new features, but nothing is
+				stable or guaranteed - yet. If you're using a Milestone and need a
+				fix, you can update to the latest Nightly, or wait for the next
+				Milestone.</p><br/>
+				</td>
+			</tr>
+		</table>
+		</td>
+	</tr>
+</table>
+</center>
+</html>
diff --git a/releng/org.eclipse.papyrus.robotml.p2/siteTemplate/web/img/robotml-banner.png b/releng/org.eclipse.papyrus.robotml.p2/siteTemplate/web/img/robotml-banner.png
new file mode 100644
index 0000000..2797993
--- /dev/null
+++ b/releng/org.eclipse.papyrus.robotml.p2/siteTemplate/web/img/robotml-banner.png
Binary files differ
diff --git a/releng/org.eclipse.papyrus.robotml.p2/siteTemplate/web/site.css b/releng/org.eclipse.papyrus.robotml.p2/siteTemplate/web/site.css
new file mode 100644
index 0000000..d1493ed
--- /dev/null
+++ b/releng/org.eclipse.papyrus.robotml.p2/siteTemplate/web/site.css
@@ -0,0 +1,82 @@
+<
+STYLE type ="text/css">td.spacer {
+	padding-bottom: 10px;
+	padding-top: 10px;
+}
+
+.title {
+	font-family: sans-serif;
+	color: #1778be;
+}
+
+.table {
+	margin-top: 0px;
+	margin-left: 0px;
+	width: 920px;
+}
+
+.bodyText {
+	font-family: sans-serif;
+	font-size: 9pt;
+	color: #000000;
+	width: 100%
+}
+
+.sub-header {
+	background: url('http://download.eclipse.org/eclipse.org-common/themes/solstice/public/images/template/breadcrumbs-large-bg.jpg') center #1b1732;
+    background-size: 100%;
+    color: #fff;
+    text-align: center;
+}
+
+.log-text {
+	font-family: sans-serif;
+	font-style: normal;
+	font-weight: lighter;
+	font-size: 8pt;
+	color: black;
+}
+
+.big-header {
+	font-family: sans-serif;
+	font-style: normal;
+	font-weight: bold;
+	font-size: 9pt;
+	color: white;
+	border-top: 10px solid white;
+}
+
+.light-row {
+	background: #FFFFFF
+}
+
+.dark-row {
+	background: #EEEEEE
+}
+
+.header {
+	background: #445562
+}
+
+#indent {
+	word-wrap: break-word;
+	width: 300px;
+	text-indent: 10px;
+}
+
+.link {
+	color: #187dc6;
+}
+
+.td_header {
+	background: url("img/robotml-banner.png") 0 no-repeat;
+	height: 100px;
+}
+
+.column-header {
+	font-size:small;
+}
+
+</
+STYLE
+>
\ No newline at end of file
diff --git a/releng/org.eclipse.papyrus.robotml.p2/siteTemplate/xslt/site.properties.xsl b/releng/org.eclipse.papyrus.robotml.p2/siteTemplate/xslt/site.properties.xsl
new file mode 100644
index 0000000..127c98d
--- /dev/null
+++ b/releng/org.eclipse.papyrus.robotml.p2/siteTemplate/xslt/site.properties.xsl
@@ -0,0 +1,20 @@
+<xsl:stylesheet version="2.0"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xalan="http://xml.apache.org/xalan"
+	xmlns:saxon="http://saxon.sf.net/" xmlns="http://www.w3.org/1999/xhtml"
+	extension-element-prefixes="saxon">
+	<xsl:output method="text" indent="yes" />
+	<xsl:template match="/site">
+		<xsl:for-each select="category-def">
+			<xsl:sort select="@name" />
+			<xsl:variable name="catg"><xsl:value-of select="@name"/></xsl:variable>
+# 
+<xsl:value-of select="$catg" />.category.features = \
+<xsl:for-each select="//feature">
+				<xsl:sort select="@id" />
+				<xsl:if test="count(./category[contains(@name,$catg)])>0"><xsl:value-of select="@id" />,
+</xsl:if>
+			</xsl:for-each>
+		</xsl:for-each>
+# 
+	</xsl:template>
+</xsl:stylesheet>
diff --git a/releng/org.eclipse.papyrus.robotml.p2/siteTemplate/xslt/site.xsl b/releng/org.eclipse.papyrus.robotml.p2/siteTemplate/xslt/site.xsl
new file mode 100644
index 0000000..235f683
--- /dev/null
+++ b/releng/org.eclipse.papyrus.robotml.p2/siteTemplate/xslt/site.xsl
@@ -0,0 +1,128 @@
+<xsl:stylesheet version="2.0"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xalan="http://xml.apache.org/xalan"
+	xmlns:saxon="http://saxon.sf.net/" xmlns="http://www.w3.org/1999/xhtml"
+	extension-element-prefixes="saxon">
+	<xsl:output method="html" indent="yes" />
+	<xsl:template match="/site">
+		<table cellspacing="2" cellpadding="0" border="0">
+			<xsl:if test="count(feature[contains(@id,'papyrus')])>0">
+				<tr style="background-color:#DDDDDD">
+					<th class="column-header">Feature</th>
+					<th class="column-header">Version</th>
+					<th class="column-header">Feature Categor(ies)</th>
+				</tr>
+				<!-- papyrus features -->
+				<xsl:for-each select="feature[contains(@id,'papyrus')]">
+					<xsl:sort select="@id" />
+					<xsl:variable name="rowCol">
+						<xsl:if test="position() mod 2 = 1">
+							#EEEEEE
+						</xsl:if>
+						<xsl:if test="position() mod 2 = 0">
+							#FFFFFF
+						</xsl:if>
+					</xsl:variable>
+
+					<tr style="background-color:{$rowCol}">
+						<td class="rowLine">
+							<a href="{@url}" style="font-size:x-small">
+								<xsl:value-of select="@id" />
+							</a>
+						</td>
+						<td>
+							<span style="font-size:x-small">
+								<xsl:value-of select="@version" />
+							</span>
+						</td>
+						<td>
+							<xsl:choose>
+								<xsl:when test="category">
+									<xsl:for-each select="category">
+										<span style="font-size:x-small">
+											|
+											<xsl:value-of select="@name" />
+										</span>
+									</xsl:for-each>
+								</xsl:when>
+							</xsl:choose>
+						</td>
+					</tr>
+				</xsl:for-each>
+			</xsl:if>
+			<!-- xsl:if test="count(feature[not(contains(@id,'papyrus'))])>0">
+				<tr style="background-color:#DDDDDD">
+					<th class="column-header">Feature</th>
+					<th class="column-header">Version</th>
+					<th class="column-header">Feature Categor(ies)</th>
+				</tr>
+				<xsl:for-each select="feature[not(contains(@id,'papyrus'))]">
+					<xsl:sort select="@id" />
+					<xsl:variable name="rowCol">
+						<xsl:if test="position() mod 2 = 1">
+							#EEEEEE
+						</xsl:if>
+						<xsl:if test="position() mod 2 = 0">
+							#FFFFFF
+						</xsl:if>
+					</xsl:variable>
+
+					<tr style="background-color:{$rowCol}">
+						<td class="rowLine">
+							<a href="{@url}" style="font-size:x-small">
+								<xsl:value-of select="@id" />
+							</a>
+						</td>
+						<td>
+							<span style="font-size:x-small">
+								<xsl:value-of select="@version" />
+							</span>
+						</td>
+						<td>
+							<xsl:choose>
+								<xsl:when test="category">
+									<xsl:for-each select="category">
+										<span style="font-size:x-small">
+											|
+											<xsl:value-of select="@name" />
+										</span>
+									</xsl:for-each>
+								</xsl:when>
+							</xsl:choose>
+						</td>
+					</tr>
+				</xsl:for-each>
+			</xsl:if-->
+
+			<tr style="background-color:#DDDDDD">
+				<th class="column-header">Feature</th>
+				<th class="column-header">Version</th>
+				<th class="column-header">Feature Categor(ies)</th>
+			</tr>
+			<tr style="background-color:#EEEEEE">
+				<td class="rowLine" colspan="1">
+					<a href="artifacts.jar" style="font-size:x-small">artifacts.jar</a>
+					::
+					<a href="content.jar" style="font-size:x-small">content.jar</a>
+				</td>
+				<td class="rowLine" colspan="1">
+					::
+					<a href="plugins/" style="font-size:x-small">plugins</a>
+				<xsl:if test="count(feature)>0">
+					::
+					<a href="features/" style="font-size:x-small">features</a>
+				</xsl:if>
+				</td>
+				<td class="rowLine" colspan="1">
+				<xsl:if test="count(feature[contains(@id,'papyrus')])>0">
+					<a href="category.xml" style="font-size:x-small">category.xml</a>
+					::
+					<a href="buildinfo.json" style="font-size:x-small">buildinfo.json</a>
+					::
+					<a href="site.properties" style="font-size:x-small">site.properties</a>
+				</xsl:if>
+				</td>
+			</tr>
+		</table>
+		<br />
+	</xsl:template>
+</xsl:stylesheet>