Author: jjohnstn
Date: 2010-09-30 16:52:21 -0400 (Thu, 30 Sep 2010)
New Revision: 25357
Added:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/.classpath
trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/.project
trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/.settings/
trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/.settings/org.eclipse.jdt.core.prefs
trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/ChangeLog
trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/META-INF/
trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/META-INF/MANIFEST.MF
trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/README.txt
trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/about.html
trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/build-helper.xml
trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/build.properties
trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/doc/
trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/doc/notices.html
trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/extract-markup.xsl
trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/plugin.properties
trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/plugin.xml
trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/src/
trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/src/org/
trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/src/org/jboss/
trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/src/org/jboss/tools/
trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/src/org/jboss/tools/internal/
trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/src/org/jboss/tools/internal/deltacloud/
trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/src/org/jboss/tools/internal/deltacloud/doc/
trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/src/org/jboss/tools/internal/deltacloud/doc/anttask/
trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/src/org/jboss/tools/internal/deltacloud/doc/anttask/MediaWikiImageFetcher.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/src/org/jboss/tools/internal/deltacloud/doc/anttask/tasks.properties
trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/tmp/
trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/toc.xml
trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/userguide/
trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/userguide/deltacloud.html
trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/userguide/images/
trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/userguide/images/bgpreferences.png
trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/userguide/images/cloudconnection.png
trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/userguide/images/createInstance.png
trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/userguide/images/createkey.png
trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/userguide/images/imagesview.png
trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/userguide/images/instancesview.png
trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/userguide/images/managekeys.png
trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/userguide/images/rsecloud.png
Log:
2010-09-30 Jeff Johnston <jjohnstn(a)redhat.com>
* Initial check-in.
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/.classpath
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/.classpath
(rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/.classpath 2010-09-30
20:52:21 UTC (rev 25357)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con"
path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con"
path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/.project
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/.project
(rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/.project 2010-09-30 20:52:21
UTC (rev 25357)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.deltacloud-docs</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/.settings/org.eclipse.jdt.core.prefs
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/.settings/org.eclipse.jdt.core.prefs
(rev 0)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/.settings/org.eclipse.jdt.core.prefs 2010-09-30
20:52:21 UTC (rev 25357)
@@ -0,0 +1,8 @@
+#Wed Sep 29 15:45:55 EDT 2010
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/ChangeLog
(rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/ChangeLog 2010-09-30 20:52:21
UTC (rev 25357)
@@ -0,0 +1,3 @@
+2010-09-30 Jeff Johnston <jjohnstn(a)redhat.com>
+
+ * Initial check-in.
\ No newline at end of file
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/META-INF/MANIFEST.MF
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/META-INF/MANIFEST.MF
(rev 0)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/META-INF/MANIFEST.MF 2010-09-30
20:52:21 UTC (rev 25357)
@@ -0,0 +1,10 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Deltacloud_docs
+Bundle-SymbolicName: org.jboss.tools.deltacloud_docs; singleton:=true
+Bundle-Version: 0.0.1.qualifier
+Bundle-Vendor: Red Hat Inc.
+Bundle-Localization: plugin
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
+Require-Bundle: org.apache.ant;bundle-version="1.7.1",
+ org.eclipse.help;bundle-version="3.4.1"
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/README.txt
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/README.txt
(rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/README.txt 2010-09-30
20:52:21 UTC (rev 25357)
@@ -0,0 +1,20 @@
+This plug-in currently has a manually edited html file userguide/deltacloud.html
+initially based upon the Wiki documentation found at:
+
+http://community.jboss.org/wiki/DeltaCloudTools001UserGuide.
+
+Ideally, this plug-in should use the Wiki to create the help docs via the
+build-helper.xml file. The build-helper.xml file in this project is not
+correct for accessing the JBoss wiki, nor likely is the MediaWikiImageFetcher
+which is for accessing a mediaWiki page. JBoss Tools uses Confluence instead.
+The build-helper.xml file requires changes so it will work with JBoss Tools and
+should be modified to not refer to mediaWiki ant tasks.
+
+The mylyn wikitext confluence plug-ins would need to be checked out locally
+to make its ant tasks available and the build-helper.xml file would need to
+reference these tasks as appropriate. Apparently, there are tasks for mediaWiki
+that don't have corresponding tasks set up in the Confluence plug-ins.
+
+The rewrite to use mylyn wikitext is a future work item that will be done as
+time permits. For the time-being, edit the userguide/deltacloud.html file and
+change the toc.xml file as new headings are added or removed.
\ No newline at end of file
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/about.html
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/about.html
(rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/about.html 2010-09-30
20:52:21 UTC (rev 25357)
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 5, 2006</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in
("Content"). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is
available
+at <a
href="http://www.eclipse.org/legal/epl-v10.html">http://www....;.
+For purposes of the EPL, "Program" will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the
Content is
+being redistributed by another party ("Redistributor") and different
terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's
license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless
otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in
the Content
+and such source code may be obtained at <a
href="http://www.eclipse.org/">http://www.eclipse.org</a&...
+
+</body>
+</html>
\ No newline at end of file
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/build-helper.xml
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/build-helper.xml
(rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/build-helper.xml 2010-09-30
20:52:21 UTC (rev 25357)
@@ -0,0 +1,136 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="org.jboss.tools.deltacloud.docs" default="all">
+ <description>
+ Generate Eclipse help content for the Linux Tools deltacloud user guide
+ </description>
+
+ <property name="deltacloud.help.doc.url.base"
value="http://community.jboss.org"/>
+ <property name="deltacloud.wiki.url.base"
value="${deltacloud.help.doc.url.base}/wiki"/>
+ <property name="imageFolder" value="images"/>
+
+ <path id="tasks.classpath" path="bin"/>
+ <path id="wikitext.tasks.classpath">
+ <pathelement location="../org.eclipse.mylyn.wikitext.core/@dot"/>
+ <pathelement location="../org.eclipse.mylyn.wikitext.core/bin"/>
+ <pathelement
location="../org.eclipse.mylyn.wikitext.mediawiki.core/@dot"/>
+ <pathelement
location="../org.eclipse.mylyn.wikitext.mediawiki.core/bin"/>
+ </path>
+
+ <taskdef classpathref="tasks.classpath"
resource="org/jboss/tools/internal/deltacloud/doc/anttask/tasks.properties"/>
+ <taskdef classpathref="wikitext.tasks.classpath"
resource="org/eclipse/mylyn/wikitext/core/util/anttask/tasks.properties"/>
+
+ <target name="init">
+ <mkdir dir="tmp"/>
+ </target>
+
+ <target name="clean" depends="init">
+ <delete includeemptydirs="true" failonerror="false">
+ <fileset dir="tmp"/>
+ </delete>
+ </target>
+
+ <target name="all" depends="init" description="Generate
Eclipse help content for the Linux Tools deltacloud user guide">
+ <eclipse-wiki-to-help
+ help.doc.filenamenoextension="Deltacloud Plugins User Guide"
+ help.doc.url.base="${deltacloud.help.doc.url.base}"
+
help.doc.url.html="${deltacloud.wiki.url.base}/DeltaCloudTools001UserGuide"
+
help.doc.url.xml="${deltacloud.help.doc.url.base}/Special:Export/wiki/DeltaCloudTools001UserGuide"
+ help.imagefolder="${imageFolder}"
+ targetfolder="userguide"
+ wiki.url.base="${deltacloud.help.doc.url.base}/wiki"/>
+ </target>
+
+ <macrodef name="eclipse-wiki-to-help">
+ <attribute name="help.doc.url.base"/>
+ <attribute name="wiki.url.base"/>
+ <attribute name="help.doc.url.html"/>
+ <attribute name="help.doc.url.xml"/>
+ <attribute name="help.doc.filenameNoExtension"/>
+ <attribute name="help.imageFolder"/>
+ <attribute name="targetFolder"/>
+ <sequential>
+ <get dest="tmp/help.doc.xml" src="(a){help.doc.url.xml}"/>
+ <get dest="tmp/help.doc.html"
src="(a){help.doc.url.html}"/>
+
+ <!--
+ <copy todir="tmp">
+ <fileset dir="images"/>
+ </copy>
+ -->
+ <mediawiki-fetch-images src="tmp/help.doc.html" dest="tmp"
base="(a){help.doc.url.base}"/>
+
+ <xslt style="extract-markup.xsl" in="tmp/help.doc.xml"
out="tmp/(a){help.doc.filenameNoExtension}.mediawiki"/>
+ <echo append="true"
file="tmp/(a){help.doc.filenameNoExtension}.mediawiki">
+
+= Updating This Document =
+
+This document is maintained in a collaborative wiki. If you wish to update or modify
this document please visit
+(a){help.doc.url.html}
+ </echo>
+
+ <!-- Removing Phoenix extensions -->
+ <replaceregexp match="\{\{\#eclipseproject.*" replace=""
flags="g" byline="true">
+ <fileset dir="tmp" includes="**/*.mediawiki"/>
+ </replaceregexp>
+
+ <wikitext-to-eclipse-help
markupLanguage="org.eclipse.mylyn.wikitext.mediawiki.core.MediaWikiLanguage"
+ multipleOutputFiles="true"
+ navigationImages="true"
+ helpPrefix="@{targetFolder}"
+ internallinkpattern="(a){wiki.url.base}/{0}"
+ validate="true"
+ failonvalidationerror="true"
+ prependImagePrefix="${imageFolder}"
+ formatoutput="true">
+ <fileset dir="tmp" includes="**/*.mediawiki"/>
+ <stylesheet url="book.css"/>
+ </wikitext-to-eclipse-help>
+
+ <mkdir dir="@{targetFolder}/${imageFolder}"/>
+ <copy todir="@{targetFolder}/${imageFolder}"
overwrite="true">
+ <fileset dir="tmp">
+ <include name="*.gif"/>
+ <include name="*.png"/>
+ </fileset>
+ </copy>
+ <copy todir="@{targetFolder}" overwrite="true">
+ <fileset dir="tmp">
+ <include name="*.html"/>
+ <include name="*toc.xml"/>
+ <exclude name="help.doc.html"/>
+ </fileset>
+ </copy>
+ <antcall target="test"/>
+ </sequential>
+ </macrodef>
+
+
+ <target name="test" depends="init" description="verify that
all of the HTML files are well-formed XML">
+ <echo level="info">
+Validating help content XML and HTML files: The Eclipse help system expects well-formed
XML
+
+If validation fails it is because either:
+
+* the userguide source code is poorly formed, or
+* the WikiText MediaWiki parser has a bug
+
+Problems with userguide source are usually caused by improper use of HTML markup in the
MediaWiki source,
+or inadvertently starting a line with a space character (in MediaWiki this starts a
preformatted block)
+ </echo>
+
+ <!--
+ Don't bother with DTD validation: we only care if the files are well-formed.
+ We therefore provide an empty DTD
+ -->
+ <echo file="tmp/__empty.dtd" message=""/>
+ <xmlvalidate lenient="true">
+ <fileset dir="userguide">
+ <include name="**/*.xml"/>
+ </fileset>
+ <fileset dir="userguide">
+ <include name="**/*.html"/>
+ </fileset>
+ <dtd publicid="-//W3C//DTD XHTML 1.0 Transitional//EN"
location="${basedir}/tmp/__empty.dtd"/>
+ </xmlvalidate>
+ </target>
+</project>
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/build.properties
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/build.properties
(rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/build.properties 2010-09-30
20:52:21 UTC (rev 25357)
@@ -0,0 +1,8 @@
+source.. = src/
+output.. = bin/
+bin.includes = plugin.xml,\
+ META-INF/,\
+ .,\
+ toc.xml,\
+ userguide/,\
+ plugin.properties
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/doc/notices.html
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/doc/notices.html
(rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/doc/notices.html 2010-09-30
20:52:21 UTC (rev 25357)
@@ -0,0 +1,22 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+
+<meta name="copyright" content="© Copyright 2010 Eclipse Linux
Tools project committers and others. This page is made available under license. For full
details see the LEGAL in the documentation book that contains this page." >
+
+ <meta http-equiv="Content-Type" content="text/html;
charset=utf-8">
+ <LINK REL="STYLESHEET" HREF="book.css"
CHARSET="ISO-8859-1" TYPE="text/css">
+ <title>Legal Notices</title>
+</head>
+<body>
+
+<h3>
+<a NAME="Notices"></a>Notices</h3>
+<p>
+The material in this guide is © Copyright 2010 Eclipse Linux Tools project
committers and others.
+</p>
+<p>
+<a href="../about.html">Terms and conditions regarding the use of this
guide.</a>
+</p>
+</body>
+</html>
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/extract-markup.xsl
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/extract-markup.xsl
(rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/extract-markup.xsl 2010-09-30
20:52:21 UTC (rev 25357)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+
xmlns:mw="http://www.mediawiki.org/xml/export-0.3/">
+ <xsl:output method="text"/>
+
+ <xsl:template match="/">
+ <xsl:value-of select="//mw:text"/>
+ </xsl:template>
+</xsl:stylesheet>
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/plugin.properties
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/plugin.properties
(rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/plugin.properties 2010-09-30
20:52:21 UTC (rev 25357)
@@ -0,0 +1,2 @@
+Help.category=DeltaCloud Tools
+Help.userguide=User Guide
\ No newline at end of file
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/plugin.xml
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/plugin.xml
(rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/plugin.xml 2010-09-30
20:52:21 UTC (rev 25357)
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+
+ <extension
+ point="org.eclipse.help.toc">
+ <toc
+ file="toc.xml"
+ primary="true">
+ </toc>
+ </extension>
+
+</plugin>
Added:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/src/org/jboss/tools/internal/deltacloud/doc/anttask/MediaWikiImageFetcher.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/src/org/jboss/tools/internal/deltacloud/doc/anttask/MediaWikiImageFetcher.java
(rev 0)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/src/org/jboss/tools/internal/deltacloud/doc/anttask/MediaWikiImageFetcher.java 2010-09-30
20:52:21 UTC (rev 25357)
@@ -0,0 +1,150 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2008 David Green and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ *
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * David Green - initial API and implementation
+ *
+ * Re-namespaced 2009-04-14 without changes from org.eclipse.mylyn.help.ui.
+ *******************************************************************************/
+
+package org.jboss.tools.internal.deltacloud.doc.anttask;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+import java.io.Reader;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.Task;
+import org.apache.tools.ant.taskdefs.Get;
+
+
+/**
+ * Fetch images from a MediaWiki-generated HTML page source
+ *
+ * @author David Green
+ */
+public class MediaWikiImageFetcher extends Task {
+
+ private String base;
+
+ private File dest;
+
+ private File src;
+
+ @Override
+ public void execute() throws BuildException {
+ if (dest == null) {
+ throw new BuildException("Must specify @dest"); //$NON-NLS-1$
+ }
+ if (!dest.exists()) {
+ throw new BuildException("@dest does not exist: " + dest); //$NON-NLS-1$
+ }
+ if (!dest.isDirectory()) {
+ throw new BuildException("@dest is not a directory: " + dest);
//$NON-NLS-1$
+ }
+ if (src == null) {
+ throw new BuildException("Must specify @src"); //$NON-NLS-1$
+ }
+ if (!src.exists()) {
+ throw new BuildException("@src does not exist: " + src); //$NON-NLS-1$
+ }
+ if (!src.isFile()) {
+ throw new BuildException("@src is not a file: " + src); //$NON-NLS-1$
+ }
+ if (base == null) {
+ throw new BuildException("Must specify @base"); //$NON-NLS-1$
+ }
+ if (base.endsWith("/")) { //$NON-NLS-1$
+ base = base.substring(0, base.length() - 1);
+ }
+ Pattern fragmentUrlPattern =
Pattern.compile("src=\"([^\"]+)\""); //$NON-NLS-1$
+ Pattern imagePattern =
Pattern.compile("alt=\"Image:([^\"]*)\"([^>]+)",
Pattern.MULTILINE); //$NON-NLS-1$
+ String htmlSrc;
+ try {
+ htmlSrc = readSrc();
+ } catch (IOException e) {
+ throw new BuildException("Cannot read src: " + src + ": " +
e.getMessage(), e); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ log("Parsing " + src, Project.MSG_INFO); //$NON-NLS-1$
+ int fileCount = 0;
+ Matcher imagePatternMatcher = imagePattern.matcher(htmlSrc);
+ while (imagePatternMatcher.find()) {
+ String alt = imagePatternMatcher.group(1);
+ String imageFragment = imagePatternMatcher.group(2);
+ if (imageFragment != null) {
+ Matcher fragmentUrlMatcher = fragmentUrlPattern.matcher(imageFragment);
+ if (fragmentUrlMatcher.find()) {
+ String url = fragmentUrlMatcher.group(1);
+ String qualifiedUrl = base + url;
+ log("Fetching " + qualifiedUrl, Project.MSG_INFO); //$NON-NLS-1$
+ Get get = new Get();
+ get.setProject(getProject());
+ get.setLocation(getLocation());
+ try {
+ get.setSrc(new URL(qualifiedUrl));
+ } catch (MalformedURLException e) {
+ log("Skipping " + url + ": " + e.getMessage(),
Project.MSG_WARN); //$NON-NLS-1$ //$NON-NLS-2$
+ continue;
+ }
+ // note: we use the alt text for the name since for some files there is a
case-difference between
+ // the server URL and the text used in the image src of the markup
+ String name = alt == null ? url.substring(url.lastIndexOf('/')) : alt;
+ get.setDest(new File(dest, name));
+ get.execute();
+ ++fileCount;
+ }
+ }
+ }
+ log("Fetched " + fileCount + " image files for " + src,
Project.MSG_INFO); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ public String getBase() {
+ return base;
+ }
+
+ public File getDest() {
+ return dest;
+ }
+
+ public File getSrc() {
+ return src;
+ }
+
+ private String readSrc() throws IOException {
+ StringBuilder buf = new StringBuilder((int) src.length());
+ Reader reader = new BufferedReader(new FileReader(src));
+ try {
+ int i;
+ while ((i = reader.read()) != -1) {
+ buf.append((char) i);
+ }
+ } finally {
+ reader.close();
+ }
+ return buf.toString();
+ }
+
+ public void setBase(String base) {
+ this.base = base;
+ }
+
+ public void setDest(File dest) {
+ this.dest = dest;
+ }
+
+ public void setSrc(File src) {
+ this.src = src;
+ }
+
+}
Added:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/src/org/jboss/tools/internal/deltacloud/doc/anttask/tasks.properties
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/src/org/jboss/tools/internal/deltacloud/doc/anttask/tasks.properties
(rev 0)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/src/org/jboss/tools/internal/deltacloud/doc/anttask/tasks.properties 2010-09-30
20:52:21 UTC (rev 25357)
@@ -0,0 +1 @@
+mediawiki-fetch-images=org.jboss.tools.internal.deltacloud.doc.anttask.MediaWikiImageFetcher
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/toc.xml
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/toc.xml
(rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/toc.xml 2010-09-30 20:52:21
UTC (rev 25357)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?NLS TYPE="org.eclipse.help.toc"?>
+
+<toc label="DeltaCloud Tools User-Guide"
topic="userguide/deltacloud.html">
+ <topic label="Introduction"
href="userguide/deltacloud.html#Introduction">
+ </topic>
+ <topic href="userguide/deltacloud.html#Connecting" label="Connecting
to a DeltaCloud Server">
+ </topic>
+ <topic href="userguide/deltacloud.html#CloudViewer" label="Cloud
Viewer">
+ </topic>
+ <topic href="userguide/deltacloud.html#CreateInstance" label="Creating
an Instance">
+ </topic>
+ <topic href="userguide/deltacloud.html#InstancesView" label="Instances
View">
+ </topic>
+ <topic href="userguide/deltacloud.html#RSEPerspective" label="RSE
Perspective">
+ </topic>
+ <topic href="userguide/deltacloud.html#ImagesView" label="Images
View">
+ </topic>
+ <topic href="userguide/deltacloud.html#ManageKeys" label="Manage
Keys">
+ </topic>
+</toc>
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/userguide/deltacloud.html
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/userguide/deltacloud.html
(rev 0)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/userguide/deltacloud.html 2010-09-30
20:52:21 UTC (rev 25357)
@@ -0,0 +1,190 @@
+<?xml version='1.0' encoding='utf-8' ?><!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html
xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <meta http-equiv="Content-Type" content="text/html;
charset=utf-8"/>
+ <title>DeltaCloud Tools User Guide</title>
+ <link type="text/css" rel="stylesheet"
href="book.css"/>
+ </head>
+<body>
+<h1>DeltaCloud Tools User Guide</h1>
+<a name="Introduction"></a>
+<h2 id="Introduction">Introduction</h2>
+<p>
+The DeltaCloud Tools provides a set of Eclipse plug-ins to manage clouds via one or more
DeltaCloud servers. The plug-ins use a REST interface to communicate with the DeltaCloud
server which in turn communicates with a remote cloud.</p>
+<p>
+Each DeltaCloud server is started outside of Eclipse via the deltacloudd command and
specifies the type of cloud it is accessing and the port one must communicate with. For
example,
+</p>
+<example>
+deltacloudd -i ec2 -p 3002
+</example>
+<p>
+will start a server that will talk to an Amazon EC2 cloud and is accessed via port 3002
on the localhost. By default, the DeltaCloud server will listen on port 3001. It should
be noted that the DeltaCloud server does not support ssh encryption so it is recommended
that the server be run on the localhost or else behind a proxy such as is described
+<a
href="http://httpd.apache.org/docs/2.0/mod/mod_proxy.html">h...;.
This is recommended due to the fact that a userid and password is communicated with the
server for accessing the cloud.</p>
+<p>
+Under Eclipse, the DeltaCloud Tools has its own perspective which includes 4 views which
will be discussed in more detail later:
+<ul>
+<li>Cloud View - tree view for displaying cloud connections to DeltaCloud
servers</li>
+<li>Instances View - for displaying instances of a particular cloud
connection</li>
+<li>Images View - for displaying images of a particular cloud
connection</li>
+<li>Properties View - general Eclipse view which displays properties of selected
items in Cloud View</li>
+</ul>
+</p>
+<p>
+Each view may be brought directly via <noformat>Windows->Show
View</noformat> or the entire perspective may be brought up via
<noformat>Windows->Show Perspective->Other...->Delta
Cloud</noformat></p>
+
+<a name="Connecting"></a>
+<h2 id="Connecting to a DeltaCloud Server">Connecting to a DeltaCloud
Server</h2>
+<p>
+To start accessing a cloud from Eclipse, select
<noformat>File->New->Other...->Delta Cloud</noformat> and hit the
Next button.</p>
+<p>
+This brings up the Cloud Connection dialog:</p>
+
+<img border="0" src="images/cloudconnection.png"/>
+
+<p>
+The following fields are described:
+<ul>
+<li>Name - the name you wish to assign the connection. This must be a unique
name.</li>
+<li>URL - the URL of the deltacloud server to use. The server should already be
started externally. If the URL is invalid or does not point to an existing server, this
is noted by the dialog.</li>
+<li>Type - this field is filled in based upon the -i argument passed to the
DeltaCloud server referenced.</li>
+<li>Username - the username used to access the cloud. For EC2, this is the Access
Id. Details regarding the EC2 access id can be found at:
+<a
href="https://console.aws.amazon.com/ec2/home">https://conso...
+<li>Password - the password used to access the cloud. For EC2, this is the Access
Secret Key. Details regarding the EC2 access key can be found at:
+<a
href="https://console.aws.amazon.com/ec2/home">https://conso...
+</ul>
+</p>
+<p>
+When the URL, username, and password fields are filled in appropriately, you may press
the Test button to verify if the values are valid for accessing the cloud.</p>
+<p>
+After all fields are filled in and the URL is valid, the Finish button can be pressed to
complete the creation process.</p>
+<p>
+The values can be edited in the future if necessary from the Cloud View and this
described later in this document. Editing the connection is useful if the password was
misentered or one wishes to use a different username/password combination or the server
URL changes.
+The connection is stored securely across an Eclipse session so reentering the data is not
required if using an equivalent server instantiation (i.e. cloud type and URL are the
same).</p>
+
+<a name="CloudViewer"></a>
+<h2 id="Cloud Viewer">Cloud Viewer</h2>
+<p>
+The Cloud Viewer shows the various cloud connections created in a Tree view format.
Cloud connections have Instances and Images as children. The following shows an example
of the Cloud View with two connections:</p>
+
+
+<img border="0" src="images/cloudconnection.png"/>
+
+<p>
+This example also demonstrates the Properties View. The Properties viewer will show
properties details for any object selected in the Cloud Viewer. In this particular
instance, it is showing the properties of the cloud connection named "Red Hat
Cloud". Note that the properties are read-only in the viewer. If instead an
Instance or Image is selected in the tree view, appropriate details are provided for the
Instance or Image specified.</p>
+<p>
+If a Cloud Connection is selected and right-clicked, a menu pops up that allows one to
"Edit Connection" or to "Disconnect Cloud". Both actions are obvious.
The Edit Connection menu-item brings up the Cloud Connection Dialog with all the current
values filled in (including password hidden from view). When the edit is complete,
selecting Finish changes the values. To abort, select Cancel.</p>
+
+
+<a name="CreateInstance"></a>
+<h2 id="Creating an Instance">Creating an Instance</h2>
+<p>
+An Instance is a running system based upon an Image. One way to think about this is that
an Image is a template whereas an Instance is an instantiation of the template. To launch
an Instance, open up the tree view such that the desired Image to base upon is shown.
Select the Image and right-click on it. This will bring up a popup menu which includes
"Launch Instance". Clicking on this menu item causes the Launch Instance dialog
to appear.</p>
+
+
+
+<img border="0" src="images/createInstance.png"/>
+
+<p>
+The dialog contains a number of fields to fill in:
+<ul>
+<li>Name - name you wish to give the Instance. It should be noted that for Amazon
EC2 clouds, this name is ignored and the name of the Image will be used instead. It is
possible to have multiple Instances with the same name.* Image - filled in based on the
Image you chose to invoke this dialog for</li>
+<li>Architecture - filled in with the architecture for the Image chosen</li>
+<li>Realm - a list of available realms (locations) to launch the
Instance</li>
+<li>Key name - the name of an existing key file to use when creating the Instance.
This is required to access the Instance remotely such as through Remote System Explorer in
Eclilpse. Keys can be created or deleted via the Manage Keys dialog which is invoked by
pressing the Manage button. A key may be reused and by default, the last key used will be
filled in for the dialog so that you may set up one key and not have to do so again. Note
that the key field will not appear for a mock cloud which doesn't use require or use
keys.</li>
+<li>Hardware Profile - a set of available hardware profiles for the Image. When
one is selected, this may bring up additional options such as the number of cpus, the
amount of memory, or the disk storage available to the Instance. Some of these values may
be preset or will restrict the setting to a limited set or a range.</li>
+</ul>
+</p>
+<p>
+Once the dialog is filled in, select Finish to complete the creation of the Instance. A
confirmation dialog is brought up to ensure the user wants to launch the Instance and
perhaps start paying money. This confirmation dialog has the option of never showing
again and this can be modified later in the DeltaCloud preferences found via
<noformat>Window-:>Preferences->Delta Cloud</noformat>.
+The Instance will appear in the Cloud Viewer for its parent Cloud Connection. It should
be noted that an Instance begins its life in Pending state. This is due to the fact that
starting of an Instance takes some time. The state of the Instance can be found in the
Properties View. The Instance will also appear in the Instances View which we will
discuss next.</p>
+
+<a name="InstancesView"></a>
+<h2 id="Instances">Instances View</h2>
+<p>
+The Instances View shows all Instances for a specified Cloud Connection in a Table view
format. Each row has columns detailing a separate Instance for the Cloud. The following
shows the view:</p>
+
+
+<img border="0" src="images/instancesview.png"/>
+
+<p>
+At the top of the Instances View is a selector for the Cloud Connection. This will
contain the list of known Cloud connections shown in the Cloud Viewer.</p>
+<p>
+The Instances View table contains:
+<ul>
+<li>Name - name of the Instance (note for EC2, this is not the name chosen in the
Launch Instance dialog)</li>
+<li>ID - the unique Instance id</li>
+<li>State - the state of the Instance which can be one of: (RUNNING, STOPPED,
TERMINATED)</li>
+<li>Public Hostname - for a running Instance, this is a URL that is used to connect
to the Instance and access it</li>
+</ul>
+</p>
+<p>
+For each Instance (row) selected, right-clicking brings up a set of available actions.
Actions are available only if pertinent to the current state of the Instance. The actions
include:
+<ul>
+<li>Start - start a stopped Instance (in some cases, such as EC2, stopping an
Instance results in termination and it cannot be restarted)</li>
+<li>Stop - stop a running Instance</li>
+<li>Reboot - reboot an Instance</li>
+<li>Destroy - stop and destroy an Instance (this is not always enabled, such as in
the case of EC2 where stopping terminates the Instance)</li>
+<li>Show in Remote System Explorer - this action creates an SSL connection to the
Instance using the key specified earlier in the Launch Instance dialog. Note: the key
name corresponds to a file on the local system and this file must be placed on the list of
private SSH2 keys prior to trying to connect to the Instance, otherwise the connection
will fail. To make the key file accessible, go to
<noformat>Window->Preferences->General->Network
Connections->SSH2</noformat> and select the "Add Private Key"
button.</li>
+</ul>
+</p>
+<p>
+The Start, Stop, Reboot, and Destroy actions are also available directly from the
tool-bar of the view. Actions that are not applicable for the currently selected
+Instance are likewise disabled as they are when right-clicking.</p>
+<p>
+Actions requiring time may bring up a Progress Dialog which can be moved to the
Background. If the Progress Dialog is desired to be in the Foreground again, this can be
achieved by accessing the preference found at:
<noformat>Windows->Preferences</noformat> and selecting General.</p>
+
+<img border="0" src="images/bgpreferences.png"/>
+
+<a name="RSEPerspective"></a>
+<h2 id="RSE Perspective">RSE Perspective</h2>
+<p>
+The Remote System Explorer perspective can be accessed by going to
<noformat>Windows->Show Perspectives</noformat></p>
+<p>
+The Eclipse RSE perspective allows one to access files on the remote Instance and to
modify them, if desired. The following image shows a remote file being accessed:
+
+<img border="0" src="images/rsecloud.png"/>
+</p>
+<p>
+Note how the file system can be accessed via the Sftp Files node in the Remote Systems
tree view. In this example, the remote fstab file has been selected and shows in the
editor. It can be edited and saved just as if it was a local file.</p>
+<p>
+For more details on Remote System Explorer, see <a
href="http://dsdp.eclipse.org/help/latest/index.jsp?topic=/org.eclip...
or consult <noformat>Help->Help Contents</noformat> for your Eclipse
session.</p>
+
+<a name="ImagesView"></a>
+<h2 id="Images View">Images View</h2>
+<p>
+The Images View is similiar to the Instances View in that it is a Table view of the
Images of a particular Cloud connection. Each row details information about an Image in
the Cloud. The following demonstrates:</p>
+
+<img border="0" src="images/imagesview.png"/>
+
+<p>
+Like the Instances View, the Cloud connection to use is specified by the Select Cloud
drop-down. For a selected Image (row), right-clicking allows one to Launch Instance.
This is identical to performing the action from the Cloud Viewer and this brings up the
Launch Instance dialog.</p>
+<p>
+Each row contains details about the Images including:
+<ul>
+<li>Name - name of the Image</li>
+<li>ID - unique id of the Image</li>
+<li>Architecture - specified architecture for the Image</li>
+<li>Description - free form text that describes the Image</li>
+</ul>
+</p>
+
+<a name="ManageKeys"></a>
+<h2 id="Manage Keys">Manage Keys</h2>
+<p>
+The Manage Keys dialog is accessed via the Launch Instance dialog. This dialog allows
one to Create and Delete key files as well as to select which key to use for the current
Instance launch.</p>
+
+<img border="0" src="images/managekeys.png"/>
+
+<p>
+The Directory field is where key files are stored. To select a different directory,
click on the Browse... button.</p>
+<p>
+To create a key, hit the "New..." button. This brings up a simple dialog:
+
+<img border="0" src="images/createkey.png"/>
+</p>
+<p>
+where the key name is entered. The name must be unique for the Cloud (i.e. not just the
directory). When OK is pressed, the key file will be created in the specified directory
chosen for the Manage Keys dialog.</p>
+<p>
+From there, a key file may be selected. If OK is pressed, the name of the file (minus
the extension) is the key name used for the Launch Instance dialog. Alternatively, the
selected key may be deleted by pressing the Delete button. A confirmation dialog will
appear in this case to confirm or cancel the deletion. Deleting a key removes it from the
Cloud and the name may be reused later.</p>
+</body>
+</html>
Added:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/userguide/images/bgpreferences.png
===================================================================
(Binary files differ)
Property changes on:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/userguide/images/bgpreferences.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/userguide/images/cloudconnection.png
===================================================================
(Binary files differ)
Property changes on:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/userguide/images/cloudconnection.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/userguide/images/createInstance.png
===================================================================
(Binary files differ)
Property changes on:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/userguide/images/createInstance.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/userguide/images/createkey.png
===================================================================
(Binary files differ)
Property changes on:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/userguide/images/createkey.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/userguide/images/imagesview.png
===================================================================
(Binary files differ)
Property changes on:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/userguide/images/imagesview.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/userguide/images/instancesview.png
===================================================================
(Binary files differ)
Property changes on:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/userguide/images/instancesview.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/userguide/images/managekeys.png
===================================================================
(Binary files differ)
Property changes on:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/userguide/images/managekeys.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/userguide/images/rsecloud.png
===================================================================
(Binary files differ)
Property changes on:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud-docs/userguide/images/rsecloud.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream