Permalink
Browse files

Added getting started in java documentation.

git-svn-id: https://vmwaretasks.svn.codeplex.com/svn/trunk@26855 9b283d60-5439-405e-af05-b73fd8c4d996
  • Loading branch information...
dblock committed Aug 13, 2009
1 parent 80e5c76 commit 02e67a5e3fda6997c956f0336f5d6f742e8a849a
@@ -32,23 +32,22 @@
These are thin wrappers on top of
<codeEntityReference qualifyHint="true">N:Vestris.VMWareLib</codeEntityReference> and
<codeEntityReference qualifyHint="true">N:Vestris.VMWareLib.Tools</codeEntityReference> respectively.
- They expose the vast majority of functionality within the managed C# interface. The functions that
- don't take timeouts carry identical names to the managed C# interface.
+ They expose the vast majority of functionality available in the managed C# interface.
<alert class="tip">
- The functions that require
- a timeout parameter end with a <literal>2</literal>. For example, the COM interface exposes
- <codeEntityReference qualifyHint="true">
+ The functions that don't take timeouts carry identical names to the managed C# ones.
+ The functions that require a timeout parameter end with a <literal>2</literal>. For example, the COM interface
+ exposes <codeEntityReference qualifyHint="true">
M:Vestris.VMWareComLib.IVMWareVirtualHost.ConnectToVMWareWorkstation
</codeEntityReference>
- with no parameters and
+ with no parameters and
<codeEntityReference qualifyHint="true">
M:Vestris.VMWareComLib.IVMWareVirtualHost.ConnectToVMWareWorkstation2(System.Int32)
</codeEntityReference>
that takes a timeout.
</alert>
</para>
<para>
- The following example creates, restores, powers on and removes a snapshot on a VMWare Workstation host.
+ The following VBScript example creates, restores, powers on and removes a snapshot on a VMWare Workstation host.
<code language="vbs" source="..\Source\VMWareComLibScriptSamples\GettingStartedWorkstation.vbs" />
</para>
</content>
@@ -4,10 +4,71 @@
<introduction>
<para>This section explains how to get started with VMWareTasks library using Java.</para>
</introduction>
- <section address="usingvmwaretasksjava">
- <title>Using the Library (Java)</title>
+ <section address="usingvmwaretaskscom">
+ <title>Registering the COM Library</title>
<content>
<para>
+ VMWareTasks COM interfaces are implemented in <localUri>VMWareComLib.dll</localUri> and <localUri>VMWareComTools.dll</localUri>.
+ These interfaces are exposed to Java via JNI using
+ <externalLink>
+ <linkHref>https://com4j.dev.java.net</linkHref>
+ <linkText>Com4j</linkText>
+ </externalLink>. The COM DLLs require .NET Framework 2.0 and must be registered on the system with
+ <localUri>%FrameworkDir%\v2.0.50727\RegAsm.exe</localUri>.
+ <code language="cmd">
+ <![CDATA[
+%FrameworkDir%\v2.0.50727\regasm.exe /codebase VMWareComLib.dll /tlb:VMWareComLib.tlb
+%FrameworkDir%\v2.0.50727\regasm.exe /codebase VMWareComTools.dll /tlb:VMWareComTools.tlb
+ ]]>
+ </code>
+ </para>
+ </content>
+ </section>
+ <section address="javapackages">
+ <title>Java Interop Packages</title>
+ <content>
+ <para>
+ VMWareTasks Com4j interfaces are packaged as <localUri>vestris-vmwarecomlib.jar</localUri> and
+ <localUri>vestris-vmwarecomtools.jar</localUri> along with their respective <localUri>-src.jar</localUri>
+ source code packages in the distribution's <localUri>JavaBin</localUri> folder. These JARs are generated
+ with Com4j's tlbimp tools. Add the JAR as a library to your Java project and copy <localUri>com4j.dll</localUri>
+ to the execution directory and import the library to get started.
+ <code language="Java">
+ import com.vestris.vmwarecomlib.*;
+ </code>
+ </para>
+ </content>
+ </section>
+ <section address="usingthecom4jinterface">
+ <title>Using the Com4j Interfaces</title>
+ <content>
+ <para>
+ The following example creates, restores, powers on and removes a snapshot on a VMWare Workstation host.
+ <code language="Java">
+ <![CDATA[
+IVMWareVirtualHost virtualHost = ClassFactory.createVMWareVirtualHost();
+// connect to a local VMWare Workstation virtual host
+virtualHost.connectToVMWareWorkstation();
+// open an existing virtual machine
+IVMWareVirtualMachine virtualMachine = virtualHost.open("c:\\vm\\vm.vmx");
+// power on this virtual machine
+virtualMachine.powerOn();
+// wait for VMWare Tools
+virtualMachine.waitForToolsInGuest();
+// login to the virtual machine
+virtualMachine.loginInGuest("Administrator", "admin123");
+// create a new snapshot
+virtualMachine.snapshots().createSnapshot("test", "a new test snapshot");
+// power off
+virtualMachine.powerOff();
+// find the newly created snapshot
+IVMWareSnapshot snapshot = virtualMachine.snapshots().getNamedSnapshot("test");
+// revert to the new snapshot
+snapshot.revertToSnapshot();
+// delete snapshot
+snapshot.removeSnapshot();
+ ]]>
+ </code>
</para>
</content>
</section>
@@ -1,32 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<topic id="bfd78578-6e10-47e5-8b41-44426e0a1ac1" revisionNumber="1">
- <developerConceptualDocument xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5" xmlns:xlink="http://www.w3.org/1999/xlink">
- <introduction>
- <para>You may freely use and distribute this software under the terms of the following license agreement.</para>
- </introduction>
- <section address="mitlicense">
- <title>MIT License</title>
- <content>
- <para>
- Copyright (c) 2008-2009 Vestris Inc.
- </para>
- <para>
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
- documentation files (the "Software"), to deal in the Software without restriction, including without limitation
- the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
- to permit persons to whom the Software is furnished to do so, subject to the following conditions:
- </para>
- <para>
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of
- the Software.
- </para>
- <para>
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
- THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- </para>
- </content>
- </section>
- </developerConceptualDocument>
+ <developerConceptualDocument xmlns="http://ddue.schemas.microsoft.com/authoring/2003/5" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <introduction>
+ <para>
+ You may freely use and distribute this software under the terms of the following license agreement.
+ </para>
+ </introduction>
+ <section address="mitlicense">
+ <title>MIT License</title>
+ <content>
+ <para>
+ Copyright (c) 2008-2009 Daniel Doubrovkine, Vestris Inc, All Rights Reserved.
+ </para>
+ <para>
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
+ to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ </para>
+ <para>
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of
+ the Software.
+ </para>
+ <para>
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
+ THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ </para>
+ </content>
+ </section>
+ </developerConceptualDocument>
</topic>
@@ -9,9 +9,10 @@
</para>
<para>
The VMWare SDK, specifically VixCOM, offers a rich set of programmable interfaces that enable developers to drive virtual machines
- programmatically with an asynchronous, job-based programming model. Unfortunately that turns out to be too comhplicated for 99.9%
- of scenarios and most developers want to use a simple object-oriented interface for common VMWare virtual machine automation tasks.
- The VMWareTasks library implements that interface and makes programming against virtual machines a no brainer.
+ programmatically with an asynchronous, job-based programming model. Unfortunately that turns out to be too complicated for most
+ scenarios where developers want to use a simple object-oriented interface for common VMWare virtual machine automation tasks.
+ The VMWareTasks is a commercial-grade library that implements this simple interface and makes programming against virtual
+ machines a no-brainer.
</para>
<para>
VMWareTasks contains a complete VixCOM wrapper
@@ -22,13 +23,17 @@
</para>
<para>
VMWareTasks exposes a C# interface, a COM-enabled interface for script clients and a Java bridge for Java programs.
+ VMWareTasks is completely free and distributed under the
+ <link topicType_id="DAC3A6A0-C863-4E5B-8F65-79EFC6A4BA09" xlink:href="bfd78578-6e10-47e5-8b41-44426e0a1ac1">
+ MIT license
+ </link>.
</para>
<para>
The VMWareTasks library is maintained on CodePlex at
<externalLink>
<linkHref>http://vmwaretasks.codeplex.com/</linkHref>
<linkText>http://vmwaretasks.codeplex.com</linkText>
- </externalLink>.
+ </externalLink>. Contributors are welcome.
</para>
</introduction>
<relatedTopics>
@@ -2,10 +2,9 @@
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="Com4j"/>
- <classpathentry kind="src" path="Vestris.VMWareTasks"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/>
- <classpathentry kind="lib" path="Vestris.VMWareTasks/1.3/Bin/vestris-vmwarecomlib.jar"/>
<classpathentry kind="lib" path="Com4j/com4j.jar"/>
+ <classpathentry kind="lib" path="C:/Users/dblock/Source/CodePlex/vmwaretasks/trunk/Vestris.VMWareTasks/1.3/Bin/vestris-vmwarecomlib.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
@@ -20,10 +20,5 @@
<type>2</type>
<location>C:/Users/dblock/Source/CodePlex/vmwaretasks/trunk/Tools/Com4j</location>
</link>
- <link>
- <name>Vestris.VMWareTasks</name>
- <type>2</type>
- <location>C:/Users/dblock/Source/CodePlex/vmwaretasks/trunk/Vestris.VMWareTasks</location>
- </link>
</linkedResources>
</projectDescription>
View
@@ -67,10 +67,13 @@
<BinaryFiles Include="Source/VMWareLib/bin/$(Configuration)/Interop.VixCOM.dll" />
<BinaryFiles Include="Source/VMWareComLib/bin/$(Configuration)/Vestris.VMWareComLib.dll.config" />
<BinaryFiles Include="Source/VMWareComLib/bin/$(Configuration)/Vestris.VMWareComLib.dll" />
- <BinaryFiles Include="Source/VMWareComLibJava/Bin/vestris-vmwarecomlib.jar" />
- <BinaryFiles Include="Source/VMWareComLibJava/Bin/vestris-vmwarecomlib-src.zip" />
- <BinaryFiles Include="Source/VMWareComToolsJava/Bin/vestris-vmwarecomtools.jar" />
- <BinaryFiles Include="Source/VMWareComToolsJava/Bin/vestris-vmwarecomtools-src.zip" />
+ </ItemGroup>
+ <ItemGroup>
+ <JavaBinaryFiles Include="Tools/Com4j/com4j.dll" />
+ <JavaBinaryFiles Include="Source/VMWareComLibJava/Bin/vestris-vmwarecomlib.jar" />
+ <JavaBinaryFiles Include="Source/VMWareComLibJava/Bin/vestris-vmwarecomlib-src.zip" />
+ <JavaBinaryFiles Include="Source/VMWareComToolsJava/Bin/vestris-vmwarecomtools.jar" />
+ <JavaBinaryFiles Include="Source/VMWareComToolsJava/Bin/vestris-vmwarecomtools-src.zip" />
</ItemGroup>
<ItemGroup>
<ArticleFiles Include="Article/**/*.html" />
@@ -84,6 +87,7 @@
<Copy SourceFiles="@(SourceCodeProjects)" DestinationFolder="$(ReleaseDir)\$(Major).$(Minor)\Source\%(RecursiveDir)" />
<Copy SourceFiles="@(SourceCodeFiles)" DestinationFolder="$(ReleaseDir)\$(Major).$(Minor)\Source\Source\%(RecursiveDir)" />
<Copy SourceFiles="@(BinaryFiles)" DestinationFolder="$(ReleaseDir)\$(Major).$(Minor)\Bin" />
+ <Copy SourceFiles="@(JavaBinaryFiles)" DestinationFolder="$(ReleaseDir)\$(Major).$(Minor)\JavaBin" />
<Copy SourceFiles="@(ArticleFiles)" DestinationFolder="$(ReleaseDir)\$(Major).$(Minor)\Article\%(RecursiveDir)" />
<Copy SourceFiles="@(DocumentationFiles)" DestinationFolder="$(ReleaseDir)\$(Major).$(Minor)" />
<CreateItem Include="$(ReleaseDir)/**/*">

0 comments on commit 02e67a5

Please sign in to comment.