incubator-imperius-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jnee...@apache.org
Subject svn commit: r631683 [1/2] - in /incubator/imperius/trunk: ./ imperius-cimsplclientsideprovider/ imperius-cimsplclientsideprovider/META-INF/ imperius-cimsplextension/ imperius-cimsplextension/META-INF/ imperius-cimsplextension/src/ imperius-cimsplextens...
Date Wed, 27 Feb 2008 19:28:59 GMT
Author: jneeraj
Date: Wed Feb 27 11:28:54 2008
New Revision: 631683

URL: http://svn.apache.org/viewvc?rev=631683&view=rev
Log:
1. Added CIM-SPL editor extension
2. Updated the build with a new target that builds all cimspl related projects cimspl.all
3. Added manifest to cimsplclientsideprovider to allow it to run as a bundle
4. Updated the main pom.xml with a new profile to build all cimspl related projects

Added:
    incubator/imperius/trunk/imperius-cimsplclientsideprovider/META-INF/
    incubator/imperius/trunk/imperius-cimsplclientsideprovider/META-INF/MANIFEST.MF
    incubator/imperius/trunk/imperius-cimsplextension/
    incubator/imperius/trunk/imperius-cimsplextension/META-INF/
    incubator/imperius/trunk/imperius-cimsplextension/META-INF/MANIFEST.MF
    incubator/imperius/trunk/imperius-cimsplextension/README.txt   (with props)
    incubator/imperius/trunk/imperius-cimsplextension/build.properties   (with props)
    incubator/imperius/trunk/imperius-cimsplextension/plugin.properties   (with props)
    incubator/imperius/trunk/imperius-cimsplextension/plugin.xml   (with props)
    incubator/imperius/trunk/imperius-cimsplextension/pom.xml   (with props)
    incubator/imperius/trunk/imperius-cimsplextension/src/
    incubator/imperius/trunk/imperius-cimsplextension/src/org/
    incubator/imperius/trunk/imperius-cimsplextension/src/org/apache/
    incubator/imperius/trunk/imperius-cimsplextension/src/org/apache/imperius/
    incubator/imperius/trunk/imperius-cimsplextension/src/org/apache/imperius/cimspl/
    incubator/imperius/trunk/imperius-cimsplextension/src/org/apache/imperius/cimspl/client/
    incubator/imperius/trunk/imperius-cimsplextension/src/org/apache/imperius/cimspl/client/CIMPolicyClient.java   (with props)
    incubator/imperius/trunk/imperius-cimsplextension/src/org/apache/imperius/cimspl/extension/
    incubator/imperius/trunk/imperius-cimsplextension/src/org/apache/imperius/cimspl/extension/Activator.java   (with props)
    incubator/imperius/trunk/imperius-cimsplextension/src/org/apache/imperius/cimspl/extension/pluginResources.properties   (with props)
    incubator/imperius/trunk/imperius-cimsplextension/src/org/apache/imperius/cimspl/nls/
    incubator/imperius/trunk/imperius-cimsplextension/src/org/apache/imperius/cimspl/nls/Messages.java   (with props)
    incubator/imperius/trunk/imperius-cimsplextension/src/org/apache/imperius/cimspl/nls/messages.properties   (with props)
    incubator/imperius/trunk/imperius-cimsplextension/src/org/apache/imperius/cimspl/preferences/
    incubator/imperius/trunk/imperius-cimsplextension/src/org/apache/imperius/cimspl/preferences/CIMPolicyServerPreferencePage.java   (with props)
    incubator/imperius/trunk/imperius-cimsplextension/src/org/apache/imperius/cimspl/properties/
    incubator/imperius/trunk/imperius-cimsplextension/src/org/apache/imperius/cimspl/properties/CIMPolicyFilePropertyPage.java   (with props)
Modified:
    incubator/imperius/trunk/build.xml
    incubator/imperius/trunk/imperius-cimsplclientsideprovider/pom.xml
    incubator/imperius/trunk/pom.xml

Modified: incubator/imperius/trunk/build.xml
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/build.xml?rev=631683&r1=631682&r2=631683&view=diff
==============================================================================
--- incubator/imperius/trunk/build.xml (original)
+++ incubator/imperius/trunk/build.xml Wed Feb 27 11:28:54 2008
@@ -38,6 +38,7 @@
 	<property name="IMPERIUS_SVN_MODULES" value="."/>
 	<property name="SPL_EDITOR_CORE_DIR" value="${IMPERIUS_SVN_MODULES}/imperius-spleditorcore"/>
 	<property name="JAVASPL_EDITOR_EXTN_DIR" value="${IMPERIUS_SVN_MODULES}/imperius-javasplextension"/>
+	<property name="CIMSPL_EDITOR_EXTN_DIR" value="${IMPERIUS_SVN_MODULES}/imperius-cimsplextension"/>
 	<property name="IMPERIUS_SPLCORE_DIR" value="${IMPERIUS_SVN_MODULES}/imperius-splcore"/>
 	<property name="IMPERIUS_JAVASPL_DIR" value="${IMPERIUS_SVN_MODULES}/imperius-javaspl"/>
 	<property name="JAVASPL_SAMPLES_DIR" value="${IMPERIUS_SVN_MODULES}/javaspl-samples"/>
@@ -128,6 +129,9 @@
 		    <arg line="co http://svn.apache.org/repos/asf/incubator/imperius/trunk/imperius-javasplextension "/>
 		</exec> 
 		<exec executable="svn" searchpath="true" dir="." failonerror="true">
+		    <arg line="co http://svn.apache.org/repos/asf/incubator/imperius/trunk/imperius-cimsplextension "/>
+		</exec>
+		<exec executable="svn" searchpath="true" dir="." failonerror="true">
 		    <arg line="co http://svn.apache.org/repos/asf/incubator/imperius/trunk/imperius-cimsplcommon"/>
 		</exec> 
 		<exec executable="svn" searchpath="true" dir="." failonerror="true">
@@ -138,7 +142,7 @@
 		</exec> 
 		<exec executable="svn" searchpath="true" dir="." failonerror="true">
 			<arg line="co http://svn.apache.org/repos/asf/incubator/imperius/trunk/imperius-cimsplprovider"/>
-		</exec> 
+		</exec>  
 		
 		
      <!--   <exec executable="svn" searchpath="true" dir="." failonerror="true">
@@ -654,7 +658,59 @@
 	 	<delete dir="${TMP}"/>
 	 	
 	   </target>
-	   
+	
+	
+	
+	<!-- PACKAGE CIMSPL CLIENT SIDE PROVIDER AND EDITOR-->
+	<target name="package.cimspl.all" depends="build.cimspl.all">
+	    <echo message="packaging all cim-spl projects"/>
+		<antcall target="package.cimspl.runtime"/>
+	    <delete dir="${TMP}"/>	
+		
+	    <property name="spleditor" value="SPLEditor"/>
+	    <property name="installpackagedir" value ="${TMP}/eclipse/plugins"/>
+	    <mkdir dir="${installpackagedir}"/>
+		
+
+		<!-- Copy all pre-req jars -->	
+	    <copy todir="${installpackagedir}" failonerror="true" overwrite="true">
+		<!-- Copy splcore jar -->
+	      <fileset dir="${IMPERIUS_SPLCORE_DIR}/target">
+	         <include name="*.jar"/>
+	      </fileset>
+	  <!-- Copy javaspl jar -->  
+	      <fileset dir="${IMPERIUS_CIMSPLCLIENTSIDE_DIR}/target">
+	         <include name="*.jar"/>
+	      </fileset>
+	  <!-- Copy javasplextn jar-->   
+	      <fileset dir="${CIMSPL_EDITOR_EXTN_DIR}/target">
+	         <include name="*.jar"/>
+	      </fileset>
+	  <!-- Copy spleditor core jar-->   
+	      <fileset dir="${SPL_EDITOR_CORE_DIR}/target">
+	        <include name="*.jar"/>
+	      </fileset>
+	  	
+	    </copy>
+	    
+	    <!-- Get rid of SNAPSHOT suffix-->
+	    
+	    <move file="${installpackagedir}/imperius-splcore-1.0.0-SNAPSHOT.jar" tofile="${installpackagedir}/imperius-splcore-${VERSION}.jar"/>
+	    
+	    <move file="${installpackagedir}/imperius-cimsplclientsideprovider-1.0.0-SNAPSHOT.jar" tofile="${installpackagedir}/imperius-cimsplclientsideprovider-${VERSION}.jar"/>
+	    
+	    <move file="${installpackagedir}/imperius-spleditorcore-1.0.0-SNAPSHOT.jar" tofile="${installpackagedir}/imperius-spleditorcore-${VERSION}.jar"/>
+	    
+	    <move file="${installpackagedir}/imperius-cimsplextension-1.0.0-SNAPSHOT.jar" tofile="${installpackagedir}/imperius-cimsplextension-${VERSION}.jar"/>
+	    
+	    <!-- Zip up the contents-->
+			
+	    <zip destfile="${IMPERIUS_DIST}/${spleditor}.zip"  basedir="${TMP}/eclipse"/>
+				
+		<!-- Clean up -->	
+	    <delete dir="${TMP}" />
+		
+	</target>	
 	<!-- PACKAGE CIMSPL CLIENT SIDE PROVIDER -->
 	<target name="package.cimspl.clientside.runtime" depends="build.cimspl.clientside.runtime">
     <antcall target="package.cimsplclientsideprovider" />
@@ -663,18 +719,57 @@
 	</target>
 	
 	 <!-- PACKAGE CIMSPL RUNTIME -->  
-	<target name="package.cimspl.runtime" depends="build.cimspl.runtime">
+	<target name="package.cimspl.runtime">
 	  
 	  <antcall target="package.cimsplprovider"/>	
 	  <antcall target="package.cimsplsamples"/>
 			
-	  <!-- get maven to clean up the generated files -->
+	  <!-- get maven to clean up the generated files 
 	  <exec executable="${MAVEN_EXECUTABLE}" searchpath="true" dir="${IMPERIUS_SVN_MODULES}" failonerror="true">
 	  	<arg line="clean"/>
 	  	<env key="MAVEN_TERMINATE_CMD" value="on" />
-	  </exec>
+	  </exec>-->
 	</target>
 	
+	<!-- BUILD ALL CIMSPL projects-->
+	<target name="build.cimspl.all">
+		<!-- get maven to clean up any existing generated files -->
+		<exec executable="${MAVEN_EXECUTABLE}" searchpath="true" dir="${IMPERIUS_SVN_MODULES}" failonerror="true">
+			<arg line="clean -Dbuild=cimspl-all"/>
+			<env key="MAVEN_TERMINATE_CMD" value="on" />
+		</exec>
+
+		<!-- call maven directly -->
+		<exec executable="${MAVEN_EXECUTABLE}" searchpath="true" dir="${IMPERIUS_SVN_MODULES}" failonerror="true">
+			<arg line="-ff -e -Dbuild=cimspl-all"/>
+			<env key="MAVEN_TERMINATE_CMD" value="on" />
+		</exec>
+
+		<!-- copy in the notice -->
+		<copy todir="${TEMP_BIN_DIST_DIR}" file="${APACHE_NOTICE_FILE}"/>
+
+		<!-- copy in the license -->
+		<copy todir="${TEMP_BIN_DIST_DIR}" file="${APACHE_LICENSE_FILE}"/>
+
+		<!-- create the javadoc -->
+		<javadoc destdir="${IMPERIUS_JAVADOC_DIR}" useexternalfile="yes" failonerror="true">
+            <fileset dir="${TEMP_SRC_DIST_DIR}">
+           	<include name="**/external/**"/>
+            	<include name="**/manager/PolicyManager.java"/>
+            	<include name="**/manager/PolicyDataStore.java"/>
+            	<include name="**/manager/PolicyParser.java"/>
+            	<include name="**/manager/PolicyRepository.java"/>
+            	<include name="**/manager/PolicyEvaluator.java"/>
+            	<include name="**/CIM_SPLPolicyRuleClientProvider.java"/>
+     				  <exclude name="**/*.xml"/>
+            	<exclude name="**/*.class"/>
+            	<exclude name="**/*.bat"/>
+            	<exclude name="**/*.sh"/>
+            </fileset>	
+        </javadoc>
+		
+	</target>	
+	
 	<!-- BUILD CIMSPL CLIENT SIDE PROVIDER -->
 	<target name="build.cimspl.clientside.runtime">
 		<!-- get maven to clean up any existing generated files -->
@@ -810,6 +905,10 @@
 	
 	<target name="cimspl.clientside.runtime" depends="src.dist.all,build.cimspl.clientside.runtime,package.cimspl.clientside.runtime,cleanup">
 		<record name="${LOG_FILE}" append="yes" action="stop"/>
+	</target>
+	
+	<target name="cimspl.all" depends="src.dist.all,build.cimspl.all,package.cimspl.all,cleanup">
+			<record name="${LOG_FILE}" append="yes" action="stop"/>
 	</target>
 
 	<target name="javaspl.runtime.editor" depends="src.dist.all,build.javaspl.runtime.editor,package.javaspl.runtime.editor,cleanup">

Added: incubator/imperius/trunk/imperius-cimsplclientsideprovider/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-cimsplclientsideprovider/META-INF/MANIFEST.MF?rev=631683&view=auto
==============================================================================
--- incubator/imperius/trunk/imperius-cimsplclientsideprovider/META-INF/MANIFEST.MF (added)
+++ incubator/imperius/trunk/imperius-cimsplclientsideprovider/META-INF/MANIFEST.MF Wed Feb 27 11:28:54 2008
@@ -0,0 +1,9 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: imperius.cimsplclientsideprovider
+Bundle-SymbolicName: org.apache.imperius.cimsplclientsideprovider
+Bundle-Version: 1.0.0
+Export-Package: org.apache.imperius.cimspl.client
+Require-Bundle: org.apache.imperius.splcore;bundle-version="1.0.0",
+  org.sblim.cim.client
+Bundle-ClassPath: .

Modified: incubator/imperius/trunk/imperius-cimsplclientsideprovider/pom.xml
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-cimsplclientsideprovider/pom.xml?rev=631683&r1=631682&r2=631683&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-cimsplclientsideprovider/pom.xml (original)
+++ incubator/imperius/trunk/imperius-cimsplclientsideprovider/pom.xml Wed Feb 27 11:28:54 2008
@@ -8,26 +8,40 @@
   <name>imperius-cimsplclientsideprovider</name>
    <dependencies>
     <dependency>
-	<groupId>imperius</groupId>
-	<artifactId>imperius-splcore</artifactId>
-	<version>1.0.0-SNAPSHOT</version>
-    </dependency>
-     <dependency>
-	<groupId>imperius</groupId>
-	<artifactId>imperius-cimsplcommon</artifactId>
-	<version>1.0.0-SNAPSHOT</version>
-    </dependency>
-    <dependency>
-	<groupId>sblim</groupId>
-	<artifactId>sblimCIMClient</artifactId>
-	<version>1.0.0</version>
-    </dependency>
-    <dependency>
-	<groupId>junit</groupId>
-	<artifactId>junit</artifactId>
-	<version>3.8.1</version>
+      <groupId>imperius</groupId>
+      <artifactId>imperius-splcore</artifactId>
+      <version>1.0.0-SNAPSHOT</version>
     </dependency>
+   <dependency>
+     <groupId>imperius</groupId>
+     <artifactId>imperius-cimsplcommon</artifactId>
+     <version>1.0.0-SNAPSHOT</version>
+   </dependency>
+   <dependency>
+     <groupId>sblim</groupId>
+     <artifactId>sblimCIMClient</artifactId>
+     <version>1.0.0</version>
+   </dependency>
+   <dependency>
+     <groupId>junit</groupId>
+     <artifactId>junit</artifactId>
+     <version>3.8.1</version>
+   </dependency>
     
   </dependencies>
+  
+  <build>
+   <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jar-plugin</artifactId>
+        <configuration>
+          <archive>
+            <manifestFile>META-INF/MANIFEST.MF</manifestFile>
+          </archive>
+        </configuration>
+      </plugin>
+    </plugins>  
+  </build>
  
 </project>

Added: incubator/imperius/trunk/imperius-cimsplextension/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-cimsplextension/META-INF/MANIFEST.MF?rev=631683&view=auto
==============================================================================
--- incubator/imperius/trunk/imperius-cimsplextension/META-INF/MANIFEST.MF (added)
+++ incubator/imperius/trunk/imperius-cimsplextension/META-INF/MANIFEST.MF Wed Feb 27 11:28:54 2008
@@ -0,0 +1,20 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: CIMSPL Extension Plug-in
+Bundle-SymbolicName: org.apache.imperius.cimspl.extension;singleton:=true
+Bundle-Version: 1.0.0
+Bundle-Activator: org.apache.imperius.cimspl.extension.Activator
+Bundle-Vendor: IBM
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.core.resources,
+ org.eclipse.ui,
+ org.apache.imperius.cimsplclientsideprovider;bundle-version="1.0.0",
+ org.apache.imperius.splcore;bundle-version="1.0.0",
+ org.apache.imperius.spl.editor.tool,
+ org.sblim.cim.client
+Eclipse-LazyStart: true
+Bundle-ClassPath: .,
+ sblimCIMClient.jar
+Export-Package: org.apache.imperius.cimspl.client
+ 
\ No newline at end of file

Added: incubator/imperius/trunk/imperius-cimsplextension/README.txt
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-cimsplextension/README.txt?rev=631683&view=auto
==============================================================================
--- incubator/imperius/trunk/imperius-cimsplextension/README.txt (added)
+++ incubator/imperius/trunk/imperius-cimsplextension/README.txt Wed Feb 27 11:28:54 2008
@@ -0,0 +1,168 @@
+
+                                CIM-SPL Editor
+ 
+
+ 
+ What is it? 
+  
+-----------
+  
+CIM-SPL Editor is an eclipse plugin to author CIM-SPL policies.
+
+
+Prerequisites
+-------------
+
+1. A CIM Server: Like OpenPegasus 2.7.x download and install from http://www.openpegasus.org
+
+2. Install the JMPIImpl.jar found in <PEGASUS_HOME>/lib folder using the following command
+
+mvn install:install-file -Dfile=<PEGASUS_HOME>/JMPIImpl.jar -DgroupId=openpegasus \
+    -DartifactId=jmpiimpl -Dversion=1.0.0 -Dpackaging=jar
+
+2. SBLIM CIM client plugin: Download the latest SBLIM Java CIM client jars from
+http://sblim.wiki.sourceforge.net/CimClient and create a eclipse plugin out of it as follows:
+a. Create a folder  META-INF in a temporary location (say TMP).
+b. Create a a file MANIFEST.MF under META-INF and paste the following into it:
+
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Client Plug-in
+Bundle-SymbolicName: org.sblim.cim.client
+Bundle-Version: 1.0.0
+Bundle-ClassPath: sblimCIMClient.jar
+Export-Package: org.sblim.wbem.cim,
+ org.sblim.wbem.cimxml,
+ org.sblim.wbem.client,
+ org.sblim.wbem.client.indications,
+ org.sblim.wbem.client.operations,
+ org.sblim.wbem.http,
+ org.sblim.wbem.http.io,
+ org.sblim.wbem.util,
+ org.sblim.wbem.xml,
+ org.sblim.wbem.xml.parser
+
+c. Create another file build.properties under TMP/ and paste the following into it:
+
+bin.includes = META-INF/,\
+               sblimCIMClient.jar
+               
+d. Jar the META-INF and the build.properties to org.sblim.cim.client.jar
+             
+
+
+
+
+Build
+------
+1. Install the SBLIM jar into the Maven local repository using the following commands
+
+mvn install:install-file -Dfile=c:/sblim.jar -DgroupId=sblim \
+    -DartifactId=sblimCIMClient -Dversion=1.0.0 -Dpackaging=jar
+    
+2. Install the JMPIImpl.jar found in <PEGASUS_HOME>/lib folder using the following command
+
+mvn install:install-file -Dfile=<PEGASUS_HOME>/JMPIImpl.jar -DgroupId=openpegasus \
+    -DartifactId=jmpiimpl -Dversion=1.0.0 -Dpackaging=jar
+    
+
+3. In the top level directory issue the command
+
+ant cimspl.all
+
+Deploy
+-------
+The CIM-SPL Provider needs to be deployed into OpenPegasus before use. To
+deploy the provider do the following:
+
+1. Build OpenPegasus with JMPI enabled. Refer to the OpenPegasus documentation for more
+information. 
+
+2. Unzip the generated imperius-cimsplprovider-1.0.0.zip into a temporary location <TEMP>
+
+3. Copy the contents of <TEMP>/imperius-cimsplprovider-1.0.0/lib to <PEGASUS_HOME>/lib
+
+4. Copy the <ANTLR_HOME>/lib/antlr.jar to <PEGASUS_HOME>/lib
+
+5. Add the above jars to the CLASSPATH and LD_LIBRARY_PATH variables as follows:
+
+set  LD_LIBRARY_PATH=%LD_LIBRARY_PATH%;%PEGASUS_HOME%\lib\imperius-cimsplprovider-1.0.0.jar;
+set  LD_LIBRARY_PATH=%LD_LIBRARY_PATH%;%PEGASUS_HOME%\lib\imperius-splcore-1.0.0.jar;
+set  LD_LIBRARY_PATH=%LD_LIBRARY_PATH%;%PEGASUS_HOME%\lib\imperius-cimsplcommon-1.0.0.jar;
+set  LD_LIBRARY_PATH=%LD_LIBRARY_PATH%;%PEGASUS_HOME%\lib\antlr.jar;
+
+set  CLASSPATH=%CLASSPATH%;%PEGASUS_HOME%\lib\imperius-cimsplprovider-1.0.0.jar;
+set  CLASSPATH=%CLASSPATH%;%PEGASUS_HOME%\lib\imperius-splcore-1.0.0.jar;
+set  CLASSPATH=%CLASSPATH%;%PEGASUS_HOME%\lib\imperius-cimsplcommon-1.0.0.jar;
+set  CLASSPATH=%CLASSPATH%;%PEGASUS_HOME%\lib\antlr.jar;
+
+6. Copy <TEMP>/imperius-cimsplprovider-1.0.0/customexpressions.properties to <PEGASUS_ROOT>
+
+7. Start the CIM Server
+
+> cimserver
+
+8. Register the CIM-SPL Policy class as follows
+
+> cimmof -n root/cimv2 <TEMP>/imperius-cimsplprovider-1.0.0/CIM_SPLPolicyRule.mof
+
+9. Register the CIM-SPL Provider as follows
+
+> cimmof -n root/PG_InterOp <TEMP>/imperius-cimsplprovider-1.0.0/CIM_SPLPolicyRuleProviderR.mof
+
+9. Make sure the provider is installed and operational by running the following command:
+
+> cimcli -n root/cimv2 ei CIM_SPLPolicyRule
+
+10. Unzip the SPLEditor.zip into your <ECLIPSE_HOME> folder
+
+11. Copy the org.sblim.cim.client.jar into <ECLIPSE_HOME>/plugins folder
+
+12. Restart Eclipse
+
+
+ The Latest Version
+  
+------------------
+
+  
+Details of the latest version can be found on the Apache Imperius
+  
+Project web site <http://incubator.apache.org/Imperius/>.
+
+
+  
+
+Documentation
+  
+-------------
+
+ 
+ Documentation is available online at the project website
+
+
+Samples
+--------
+Sample polices are located under the cimspl-samples project.
+
+
+
+
+ Licensing
+  
+---------
+
+  
+This software is licensed under the terms you may find in the file 
+ 
+ named "LICENSE" in this directory.
+  
+
+ 
+ Thanks for using Imperius.
+
+                                          
+The Apache Imperius Project
+                                         
+<http://incubator.apache.org/Imperius/>
+

Propchange: incubator/imperius/trunk/imperius-cimsplextension/README.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/imperius/trunk/imperius-cimsplextension/build.properties
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-cimsplextension/build.properties?rev=631683&view=auto
==============================================================================
--- incubator/imperius/trunk/imperius-cimsplextension/build.properties (added)
+++ incubator/imperius/trunk/imperius-cimsplextension/build.properties Wed Feb 27 11:28:54 2008
@@ -0,0 +1,20 @@
+source.cimspl.jar = src/
+output.. = bin/
+bin.includes = META-INF/,\
+               cimspl.jar,\
+               plugin.properties,\
+               plugin.xml,\
+               bin/,\
+               cimsplprovider.jar,\
+               axis.jar,\
+               activation.jar,\
+               mail.jar,\
+               jaxrpc.jar,\
+               commons-logging-1.0.4.jar,\
+               commons-discovery-0.2.jar,\
+               build.properties,\
+               splcore.jar,\
+               saaj.jar,\
+               sblimCIMClient.jar,\
+               cimsplclientsideprovider.jar
+

Propchange: incubator/imperius/trunk/imperius-cimsplextension/build.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/imperius/trunk/imperius-cimsplextension/plugin.properties
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-cimsplextension/plugin.properties?rev=631683&view=auto
==============================================================================
--- incubator/imperius/trunk/imperius-cimsplextension/plugin.properties (added)
+++ incubator/imperius/trunk/imperius-cimsplextension/plugin.properties Wed Feb 27 11:28:54 2008
@@ -0,0 +1,13 @@
+#//(c) Copyright IBM Corp. 2007
+
+#/**
+# * @author Naidu Javvadi <njavvadi@in.ibm.com>
+# *
+# */
+
+pluginName = Policy Editor CIM Extension Plug-in
+providerName = IBM
+
+#Properties for SPL Editor
+STR_POLICY_CIM_SERVER_CONFIGURATION = CIM Server Configuration
+STR_EDIT_CIM_SERVER = Edit CIM Server Details
\ No newline at end of file

Propchange: incubator/imperius/trunk/imperius-cimsplextension/plugin.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/imperius/trunk/imperius-cimsplextension/plugin.xml
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-cimsplextension/plugin.xml?rev=631683&view=auto
==============================================================================
--- incubator/imperius/trunk/imperius-cimsplextension/plugin.xml (added)
+++ incubator/imperius/trunk/imperius-cimsplextension/plugin.xml Wed Feb 27 11:28:54 2008
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+
+<!-- (c) Copyright IBM Corp. 2007 -->
+
+<plugin>
+
+   <extension
+         point="org.apache.imperius.spl.editor.tool.binding">
+      <spl>
+         <binder name="CIM"
+               class="org.apache.imperius.cimspl.client.CIMPolicyClient">
+         </binder>
+      </spl>
+   </extension>
+
+<!-- CIM Server Preference 	
+   <extension point="org.eclipse.ui.preferencePages">
+      <page
+      		category="com.ibm.ac.spl.editor.tool.domainpreferences"
+            class="com.ibm.ac.cimspl.preferences.CIMPolicyServerPreferencePage"
+            id="com.ibm.ac.cimspl.preferences.cimserverpreferences"
+            name="%STR_POLICY_CIM_SERVER_CONFIGURATION">
+      </page>
+   </extension>
+-->   
+   
+<!-- Extension for properties pages      
+   <extension
+         point="org.eclipse.ui.propertyPages">
+         <page
+         	   category="policy.propertypage.category.id"
+               class="com.ibm.ac.cimspl.properties.CIMPolicyFilePropertyPage"
+           	   id="com.ibm.ac.cimspl.properties.cimPolicyFilePropertyPage"
+               nameFilter="*.spl"
+               name="%STR_EDIT_CIM_SERVER">
+         </page>
+   </extension>   	   
+ -->
+
+   <extension
+         point="org.eclipse.ui.propertyPages">
+ 
+	     <page
+	           id="org.apache.imperius.cimspl.properties.serverConfigPage"
+	           category="org.apache.imperius.spl.editor.tool.domainpreferences"
+	           class="org.apache.imperius.cimspl.properties.CIMPolicyFilePropertyPage"
+	           objectClass="org.eclipse.jdt.core.IJavaProject"
+	           name="%STR_EDIT_CIM_SERVER">
+	           <filter
+	                 name="nature"
+	                 value="org.apache.imperius.spl.editor.tool.splNature">
+	           </filter>
+	     </page>
+    </extension>
+ 
+</plugin>

Propchange: incubator/imperius/trunk/imperius-cimsplextension/plugin.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/imperius/trunk/imperius-cimsplextension/pom.xml
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-cimsplextension/pom.xml?rev=631683&view=auto
==============================================================================
--- incubator/imperius/trunk/imperius-cimsplextension/pom.xml (added)
+++ incubator/imperius/trunk/imperius-cimsplextension/pom.xml Wed Feb 27 11:28:54 2008
@@ -0,0 +1,283 @@
+<!--
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.  
+ */
+
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<groupId>imperius</groupId>
+	<artifactId>imperius-cimsplextension</artifactId>
+	<packaging>jar</packaging>
+	<version>1.0.0-SNAPSHOT</version>
+	<name>imperius-cimsplextension</name>
+	<dependencies>
+		<dependency>
+			<groupId>imperius</groupId>
+			<artifactId>imperius-splcore</artifactId>
+			<version>1.0.0-SNAPSHOT</version>
+	    	</dependency>
+		<dependency>
+			<groupId>imperius</groupId>
+			<artifactId>imperius-cimsplclientsideprovider</artifactId>
+			<version>1.0.0-SNAPSHOT</version>
+		</dependency>
+		<!--<dependency>
+			<groupId>imperius</groupId>
+			<artifactId>imperius-splsimulation</artifactId>
+			<version>1.0.0-SNAPSHOT</version>
+	    	</dependency>-->
+		<dependency>
+			<groupId>imperius</groupId>
+			<artifactId>imperius-spleditorcore</artifactId>
+			<version>1.0.0-SNAPSHOT</version>
+	    	</dependency>
+		
+		<dependency>
+			<groupId>org.eclipse.platform</groupId>
+			<artifactId>org.eclipse.platform</artifactId>
+			<version>[3.3.0,)</version>
+		</dependency>
+		<dependency>
+			<groupId>org.eclipse.core</groupId>
+			<artifactId>org.eclipse.core.runtime</artifactId>
+			<version>[3.3.100,)</version>
+		</dependency>
+		<dependency>
+			<groupId>org.eclipse.osgi</groupId>
+			<artifactId>org.eclipse.osgi</artifactId>
+			<version>[3.3.0,)</version>
+		</dependency>
+		<dependency>
+			<groupId>org.eclipse.equinox</groupId>
+			<artifactId>org.eclipse.equinox.common</artifactId>
+			<version>[3.3.0,)</version>
+		</dependency>
+		<dependency>
+			<groupId>org.eclipse.core</groupId>
+			<artifactId>org.eclipse.core.jobs</artifactId>
+			<version>[3.3.0,)</version>
+		</dependency>
+		<dependency>
+			<groupId>org.eclipse.core</groupId>
+			<artifactId>org.eclipse.core.runtime.compatibility.registry</artifactId>
+			<version>[3.2.100,)</version>
+		</dependency>
+		<dependency>
+			<groupId>org.eclipse.equinox</groupId>
+			<artifactId>org.eclipse.equinox.registry</artifactId>
+			<version>[3.3.0,)</version>
+		</dependency>
+		<dependency>
+			<groupId>org.eclipse.equinox</groupId>
+			<artifactId>org.eclipse.equinox.preferences</artifactId>
+			<version>[3.2.100,)</version>
+		</dependency>
+		<dependency>
+			<groupId>org.eclipse.core</groupId>
+			<artifactId>org.eclipse.core.contenttype</artifactId>
+			<version>[3.2.100,)</version>
+		</dependency>
+		<dependency>
+			<groupId>org.eclipse.equinox</groupId>
+			<artifactId>org.eclipse.equinox.app</artifactId>
+			<version>[1.0.0,)</version>
+		</dependency>
+		<dependency>
+			<groupId>org.eclipse.core</groupId>
+			<artifactId>org.eclipse.core.resources</artifactId>
+			<version>[3.3.0,)</version>
+		</dependency>
+		<dependency>
+			<groupId>org.eclipse.ui</groupId>
+			<artifactId>org.eclipse.ui</artifactId>
+			<version>[3.3.0,)</version>
+		</dependency>
+		<dependency>
+			<groupId>org.eclipse.swt</groupId>
+			<artifactId>org.eclipse.swt</artifactId>
+			<version>[3.3.0,)</version>
+		</dependency>
+		<dependency>
+			<groupId>org.eclipse.swt</groupId>
+			<artifactId>org.eclipse.swt.win32.win32.x86</artifactId>
+			<version>[3.3.0,)</version>
+		</dependency>
+		<dependency>
+			<groupId>org.eclipse.jface</groupId>
+			<artifactId>org.eclipse.jface</artifactId>
+			<version>[3.3.0,)</version>
+		</dependency>
+		<dependency>
+			<groupId>org.eclipse.core</groupId>
+			<artifactId>org.eclipse.core.commands</artifactId>
+			<version>[3.3.0,)</version>
+		</dependency>
+		<dependency>
+			<groupId>org.eclipse.ui</groupId>
+			<artifactId>org.eclipse.ui.workbench</artifactId>
+			<version>[3.3.0,)</version>
+		</dependency>
+		<dependency>
+			<groupId>org.eclipse.ui</groupId>
+			<artifactId>org.eclipse.ui.views</artifactId>
+			<version>[3.2.100,)</version>
+		</dependency>
+		<dependency>
+			<groupId>org.eclipse.jface</groupId>
+			<artifactId>org.eclipse.jface.text</artifactId>
+			<version>[3.3.0,)</version>
+		</dependency>
+		<dependency>
+			<groupId>org.eclipse.text</groupId>
+			<artifactId>org.eclipse.text</artifactId>
+			<version>[3.3.0,)</version>
+		</dependency>
+		<dependency>
+			<groupId>org.eclipse.debug</groupId>
+			<artifactId>org.eclipse.debug.core</artifactId>
+			<version>[3.3.0,)</version>
+		</dependency>
+		<dependency>
+			<groupId>org.eclipse.jdt</groupId>
+			<artifactId>org.eclipse.jdt.debug</artifactId>
+			<version>[3.3.0,)</version>
+		</dependency>
+		<dependency>
+			<groupId>org.eclipse.jdt</groupId>
+			<artifactId>org.eclipse.jdt.core</artifactId>
+			<version>[3.3.0,)</version>
+		</dependency>
+		<dependency>
+			<groupId>org.eclipse.jdt</groupId>
+			<artifactId>org.eclipse.jdt.compiler.apt</artifactId>
+			<version>[1.0.0,)</version>
+		</dependency>
+		<dependency>
+			<groupId>org.eclipse.jdt</groupId>
+			<artifactId>org.eclipse.jdt.compiler.tool</artifactId>
+			<version>[1.0.0,)</version>
+		</dependency>
+		<dependency>
+			<groupId>org.eclipse.jdt</groupId>
+			<artifactId>org.eclipse.jdt.ui</artifactId>
+			<version>[3.3.0,)</version>
+		</dependency>
+		<dependency>
+			<groupId>org.eclipse.ui</groupId>
+			<artifactId>org.eclipse.ui.ide</artifactId>
+			<version>[3.3.0,)</version>
+		</dependency>
+		<dependency>
+			<groupId>org.eclipse.ui</groupId>
+			<artifactId>org.eclipse.ui.editors</artifactId>
+			<version>[3.3.0,)</version>
+		</dependency>
+		<dependency>
+			<groupId>org.eclipse.core</groupId>
+			<artifactId>org.eclipse.core.filebuffers</artifactId>
+			<version>[3.3.0,)</version>
+		</dependency>
+		<dependency>
+			<groupId>org.eclipse.debug</groupId>
+			<artifactId>org.eclipse.debug.ui</artifactId>
+			<version>[3.3.0,)</version>
+		</dependency>
+		<dependency>
+			<groupId>org.eclipse.emf</groupId>
+			<artifactId>org.eclipse.emf.ecore</artifactId>
+			<version>[2.2.3,)</version>
+		</dependency>
+		<dependency>
+			<groupId>org.eclipse.emf</groupId>
+			<artifactId>org.eclipse.emf.common</artifactId>
+			<version>[2.2.2,)</version>
+		</dependency>
+		<dependency>
+			<groupId>org.eclipse.ui</groupId>
+			<artifactId>org.eclipse.ui.forms</artifactId>
+			<version>[3.3.0,)</version>
+		</dependency>
+		<dependency>
+			<groupId>org.eclipse.emf</groupId>
+			<artifactId>org.eclipse.emf.edit</artifactId>
+			<version>[2.2.2,)</version>
+		</dependency>
+		<dependency>
+			<groupId>org.eclipse.emf</groupId>
+			<artifactId>org.eclipse.emf.ecore.change</artifactId>
+			<version>[2.2.1,)</version>
+		</dependency>
+		<dependency>
+			<groupId>org.eclipse.emf</groupId>
+			<artifactId>org.eclipse.emf.edit.ui</artifactId>
+			<version>[2.2.3,)</version>
+		</dependency>
+		<dependency>
+			<groupId>org.eclipse.emf</groupId>
+			<artifactId>org.eclipse.emf.common.ui</artifactId>
+			<version>[2.2.1,)</version>
+		</dependency>
+		<dependency>
+			<groupId>org.eclipse.team</groupId>
+			<artifactId>org.eclipse.team.core</artifactId>
+			<version>[3.3.0,)</version>
+		</dependency>
+		<dependency>
+			<groupId>com.ibm.icu</groupId>
+			<artifactId>com.ibm.icu</artifactId>
+			<version>[3.6.1,)</version>
+		</dependency>
+		<dependency>
+			<groupId>org.eclipse.jdt</groupId>
+			<artifactId>org.eclipse.jdt.launching</artifactId>
+			<version>[3.3.0,)</version>
+		</dependency>
+	</dependencies>
+	<build>
+		<sourceDirectory>src</sourceDirectory>
+        <resources>
+            <resource>
+                <filtering>true</filtering>
+                <directory>${basedir}/src</directory>
+                <includes>
+                    <include>**/*.properties</include>
+                </includes>
+            </resource>
+            <resource>
+                <directory>${basedir}</directory>
+                <includes>
+                    <include>plugin.properties</include>
+                    <include>plugin.xml</include>
+                    <include>META-INF/MANIFEST.MF</include>
+                </includes>
+            </resource>
+        </resources>
+        <plugins>
+         <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-jar-plugin</artifactId>
+          <configuration>
+            <archive>
+              <manifestFile>META-INF/MANIFEST.MF</manifestFile>
+            </archive>
+          </configuration>
+        </plugin>
+      </plugins> 
+	</build>
+</project>
\ No newline at end of file

Propchange: incubator/imperius/trunk/imperius-cimsplextension/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/imperius/trunk/imperius-cimsplextension/src/org/apache/imperius/cimspl/client/CIMPolicyClient.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-cimsplextension/src/org/apache/imperius/cimspl/client/CIMPolicyClient.java?rev=631683&view=auto
==============================================================================
--- incubator/imperius/trunk/imperius-cimsplextension/src/org/apache/imperius/cimspl/client/CIMPolicyClient.java (added)
+++ incubator/imperius/trunk/imperius-cimsplextension/src/org/apache/imperius/cimspl/client/CIMPolicyClient.java Wed Feb 27 11:28:54 2008
@@ -0,0 +1,488 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.  
+ */
+
+/**
+ * @author Naidu Javvadi <njavvadi@in.ibm.com>
+ *
+ */
+
+package org.apache.imperius.cimspl.client;
+
+import java.io.BufferedReader;
+import java.io.InputStreamReader;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.ResourceBundle;
+import java.util.Vector;
+
+import org.apache.imperius.cimspl.extension.Activator;
+import org.apache.imperius.cimspl.nls.Messages;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.sblim.wbem.cim.CIMClass;
+import org.sblim.wbem.cim.CIMDataType;
+import org.sblim.wbem.cim.CIMException;
+import org.sblim.wbem.cim.CIMInstance;
+import org.sblim.wbem.cim.CIMMethod;
+import org.sblim.wbem.cim.CIMNameSpace;
+import org.sblim.wbem.cim.CIMObjectPath;
+import org.sblim.wbem.cim.CIMParameter;
+import org.sblim.wbem.cim.CIMProperty;
+import org.sblim.wbem.cim.CIMValue;
+import org.sblim.wbem.client.CIMClient;
+import org.sblim.wbem.client.PasswordCredential;
+import org.sblim.wbem.client.UserPrincipal;
+
+import org.apache.imperius.cimspl.client.CIMClientSideActuatorImpl;
+import org.apache.imperius.cimspl.client.CIMClientSideDataCollectorImpl;
+import org.apache.imperius.spl.editor.tool.PluginActivator;
+import org.apache.imperius.spl.editor.tool.internal.client.IPolicyClient;
+import org.apache.imperius.spl.editor.tool.internal.messages.PolicyMessages;
+import org.apache.imperius.spl.editor.tool.utils.AbstractClassDetails;
+import org.apache.imperius.spl.editor.tool.utils.ClassMethod;
+import org.apache.imperius.spl.editor.tool.utils.ClassProperty;
+import org.apache.imperius.spl.editor.tool.utils.MethodParameter;
+import org.apache.imperius.spl.editor.tool.utils.PolicyPluginLogUtil;
+import org.apache.imperius.spl.external.Actuator;
+import org.apache.imperius.spl.external.DataCollector;
+
+public class CIMPolicyClient implements IPolicyClient {
+	
+	public CIMPolicyClient() {
+		
+	}
+	
+	/**
+	 * 
+	 * @return
+	 */
+	public CIMClient getCIMClient() throws Exception {
+		CIMClient client = null;
+		try {
+			String url = "";
+			String namespace = "";
+			String username = "";
+			String password = "";
+			// check if any preferences
+			IPreferenceStore store = Activator.getDefault().getPreferenceStore();
+			if("".equals(store.getString(Messages.getString("CIM_SERVER_HOST_NAME")))) {
+				ResourceBundle bundle = Activator.getDefault().getResourceBundle();
+				url = "http://" + bundle.getString("cimserver.default.hostname") + ":" + bundle.getString("cimserver.default.port");
+				namespace = bundle.getString("cimserver.default.namespace");
+				username = bundle.getString("cimserver.default.username");
+				password = bundle.getString("cimserver.default.password");
+			} else {
+				url = "http://" + store.getString(Messages.getString("CIM_SERVER_HOST_NAME")) + ":" + store.getString(PolicyMessages.getString("CIM_SERVER_PORTNO"));
+				namespace = store.getString(Messages.getString("CIM_SERVER_NAMESPACE"));
+				username = store.getString(Messages.getString("CIM_SERVER_USERNAME"));
+				password = store.getString(Messages.getString("CIM_SERVER_PASSWORD"));
+			}
+		
+			client = getCIMClient(url, namespace, username, password);
+			
+			System.out.println("-client----------->"+client);
+			
+		} catch(Exception e) {
+			System.out.println("------------>"+e.getMessage());
+			throw new Exception("Error while connecting CIM Server");
+		}
+		return client;
+	}
+	
+	private CIMClient getCIMClient(String url, String namespace, String username, String password) {
+		CIMClient client = null;
+		try {
+		
+			// *****************************
+			// 1. Create user credentials
+			// *****************************
+			UserPrincipal userPr = new UserPrincipal(username);
+			char [] pwdCharArray = password.toCharArray();
+			PasswordCredential pwCred = new PasswordCredential(pwdCharArray);			
+	
+			// *****************************
+			// 2. Set NameSpace
+			// - URL is set like: http(s)://<IP>:Port
+			// - Namespace does not need to be specified in COPs if set in this constuctor
+			// - There is no server authentication being done. Thus: No need for a truststore
+			// *****************************			
+			CIMNameSpace ns = new CIMNameSpace(url,namespace);
+    
+			// *****************************
+			// 3. Create CIM Client
+			// *****************************		    				
+			client = new CIMClient(ns,userPr,pwCred);
+
+			System.out.println("got new cim client");
+		} catch(Exception e) {
+//			PolicyPluginLogUtil.logError("Error while connecting CIM Server", e);
+		}
+		return client;
+	}	
+	
+	/**
+	 * @param map object contains server connection details information
+	 */
+	public void testConnection(Map details) throws Exception {
+		String url = "http://" + details.get("hostname") + ":" + details.get("portno");
+		CIMClient client = null;
+		try {
+			String username = (String)details.get("username");
+			String password = (String)details.get("password");
+			String namespace = (String)details.get("namespace");
+			client = getCIMClient(url, namespace, username, password); 
+			CIMObjectPath co=new CIMObjectPath("CIM_ComputerSystem", (String)details.get("namespace"));
+			client.getClass(co, true);
+			MessageDialog.openInformation(PluginActivator.getActiveWorkbenchShell(), Messages.getString("CIM_CLIENT_CONNECTION_INFO_TITLE"), Messages.getString("CIM_CLIENT_CONNECTION_TEST_SUCCESS_STATUS"));
+		} catch(Exception e) {
+			PolicyPluginLogUtil.logError(e);
+			MessageDialog.openError(PluginActivator.getActiveWorkbenchShell(), Messages.getString("CIM_CLIENT_ERROR_TITLE"), e.getMessage());
+		} finally {
+			try {
+				if(client != null) {
+					client.close();
+				}
+			} catch (CIMException e) {
+				e.printStackTrace();
+			}
+		}
+	}
+	
+
+	/**
+	 * Gets all the policies from the server
+	 * @return a map with policy name as key and policy string as value
+	 */
+	public Map getPolicyFiles() throws Exception {
+		Map policyFilesMap = null;
+		CIMClient cimClient = null;
+		try {
+			policyFilesMap = new HashMap();
+			cimClient = getCIMClient();
+			if(cimClient == null) {
+				return null;
+			}
+			CIMObjectPath cimObjectPath = new CIMObjectPath("CIM_SPLPolicyRule");
+	    	CIMNameSpace clientNameSpace = cimClient.getNameSpace();
+	    	cimObjectPath.setNameSpace(clientNameSpace.getNameSpace());
+			Enumeration enumerator = cimClient.enumerateInstances(cimObjectPath, true, true, true, true, null);
+			if(enumerator != null) {
+				CIMInstance instanceObj = null; 
+				while(enumerator.hasMoreElements()) {
+					instanceObj = (CIMInstance) enumerator.nextElement();
+					String policyName = ((CIMProperty)instanceObj.getProperty("PolicyRuleName")).getValue().getValue() + ".spl";
+					String policyString = ((CIMProperty)instanceObj.getProperty("PolicyString")).getValue().getValue()+"";
+					policyFilesMap.put(policyName, policyString);
+				}
+			}
+		} catch(Exception e) {
+			PolicyPluginLogUtil.logError("Error while getting Policy Names", e);
+			throw e;
+		} finally {
+			try {
+				if(cimClient != null) {
+					cimClient.close();
+				}
+			} catch(Exception e) {
+				PolicyPluginLogUtil.logError(e);
+			}
+		}
+		return policyFilesMap;
+	}
+
+	/**
+	 * Deploys policy file to CIM server
+	 * @param policyFile
+	 */
+	public void doDeployPolicy(IFile policyFile) throws Exception {
+		// when user clicks on deploy check if any errors exist
+		CIMClient cimClient = null;
+		if(policyFile != null && policyFile instanceof IFile) {
+			try {
+				cimClient = getCIMClient();
+				if(cimClient == null) {
+					return;
+				}
+				String policyString = getPolicyString(policyFile);
+		    	String fileName = policyFile.getName();
+			    fileName=fileName.substring(0,fileName.indexOf("."));
+			    Vector kvp = new Vector ();
+			    CIMDataType strType = new CIMDataType(CIMDataType.STRING);
+			    CIMValue policyNameCimValue = new CIMValue (fileName,strType);
+			    CIMValue policyStringCimValue = new CIMValue(policyString,strType);
+			    kvp.addElement (new CIMProperty ("PolicyRuleName", policyNameCimValue));
+			    kvp.addElement (new CIMProperty ("PolicyString", policyStringCimValue));
+			    CIMObjectPath cop = new CIMObjectPath ("CIM_SPLPolicyRule", kvp);
+			    cop.setNameSpace (cimClient.getNameSpace().getNameSpace());
+			    CIMInstance ci = new CIMInstance (cop);
+			    ci.setObjectPath (cop);
+			    cimClient.createInstance(ci.getObjectPath(), ci);
+			    MessageDialog.openInformation(PluginActivator.getActiveWorkbenchShell(), PolicyMessages.getString("POLICY_DEPLOYMENT_STATUS"), PolicyMessages.getString("POLICY_DEPLOYMENT_STATUS_MSG"));
+			} catch(Exception e) {
+				PolicyPluginLogUtil.logError(e);
+				throw e;
+			} finally {
+				try {
+					if(cimClient != null) {
+						cimClient.close();
+					}
+				} catch(Exception e) {
+					PolicyPluginLogUtil.logError(e);
+				}
+			}		
+		}
+	}
+
+	/**
+	 * Runs policy file
+	 * @param policyFile
+	 */
+	public void doRunPolicy(IFile policyFile) throws Exception {
+		CIMClient cimClient = null;
+		if(policyFile != null && policyFile instanceof IFile) {
+			try {
+				cimClient = getCIMClient();
+				if(cimClient == null) {
+					return;
+				}
+		    	String policyName = policyFile.getName();
+		    	policyName = policyName.substring(0,policyName.indexOf("."));
+		    	
+			    CIMValue returnValue = null;
+				CIMObjectPath cimObjectPath = new CIMObjectPath("CIM_SPLPolicyRule");
+		    	CIMNameSpace clientNameSpace = cimClient.getNameSpace();
+		    	cimObjectPath.setNameSpace(clientNameSpace.getNameSpace());
+		    	cimObjectPath.setHost(clientNameSpace.getHost());
+		    	
+		    	CIMDataType strType = new CIMDataType(CIMDataType.STRING);
+				CIMValue policyNameCimValue = new CIMValue (policyName,strType);
+		    	
+		    	cimObjectPath.addKey("PolicyRuleName", policyNameCimValue);
+			    if(cimClient.getInstance(cimObjectPath, true, true, true, null) != null) {
+			    	returnValue = cimClient.invokeMethod(cimObjectPath, "evaluatePolicy", new Vector(), new Vector());
+			    	System.out.println("Evaluated Policy with result " + returnValue.toString());
+				    MessageDialog.openInformation(PluginActivator.getActiveWorkbenchShell(), PolicyMessages.getString("POLICY_RUN_STATUS"), "Return Code"+(returnValue==null?"-1":returnValue.getValue())+":"+PolicyMessages.getString("POLICY_RUN_STATUS_MSG"));
+			    } else {
+			    	System.out.println("Instance does not exist" + cimObjectPath);
+				    MessageDialog.openInformation(PluginActivator.getActiveWorkbenchShell(), PolicyMessages.getString("POLICY_RUN_STATUS"), "Instance does not exist"+cimObjectPath.toString());
+			    }
+			} catch (Exception e) {
+				PolicyPluginLogUtil.logError(e);
+				throw e;
+			} finally {
+				try {
+					if(cimClient != null) {
+						cimClient.close();
+					}
+				} catch(Exception e) {
+					PolicyPluginLogUtil.logError(e);
+				}
+			}		
+		}
+	}	
+
+	/**
+	 * 
+	 * @param policyFile
+	 * @return
+	 */
+	private String getPolicyString(IFile policyFile) {
+		StringBuffer policyString = new StringBuffer("");
+		try {
+			if(policyFile != null) {
+				BufferedReader bufferReader = new BufferedReader(new InputStreamReader(policyFile.getContents()));
+				String sLine = null;
+				while((sLine = bufferReader.readLine()) != null) {
+					policyString.append(sLine+"\n");
+				}
+			}
+		} catch(Exception e) {
+			PolicyPluginLogUtil.logError(e);
+		}
+		return policyString.toString();
+	}	
+
+
+	/**
+	 * 
+	 */
+	public DataCollector getDataCollector(Object constructorParams) {
+		DataCollector dc = null;
+		CIMClient cimClient = null;
+		try {
+			cimClient = getCIMClient();
+			if(cimClient == null) {
+				return null;
+			}
+			dc = new CIMClientSideDataCollectorImpl(cimClient);
+		} catch(Exception e) {
+			PolicyPluginLogUtil.logError(e);
+			//MessageDialog.openError(PluginActivator.getActiveWorkbenchShell(), Messages.getString("CIM_ERROR_TITLE"), e.getMessage());
+		} 
+		return dc;
+	}
+	
+	/**
+	 * 
+	 */
+	public Actuator getActuator(Object params) {
+		Actuator at = null;
+		CIMClient cimClient = null;
+		try {
+			cimClient = getCIMClient();
+			if(cimClient == null) {
+				return null;
+			}
+			at = new CIMClientSideActuatorImpl(cimClient);
+		} catch(Exception e) {
+			PolicyPluginLogUtil.logError(e);
+			//MessageDialog.openError(PluginActivator.getActiveWorkbenchShell(), Messages.getString("CIM_ERROR_TITLE"), e.getMessage());
+		} 
+		return at;
+	}	
+
+	/**
+	 * 
+	 */
+	public AbstractClassDetails fetchClassDetails(Object classObj) throws Exception {
+		CIMClient cimClient = null;
+		AbstractClassDetails classDetails = null;
+		try {
+			if(classObj instanceof String) {
+				String classname = (String)classObj; 
+				if(classname !=null && classname.length() > 0) {
+					cimClient = getCIMClient();
+					if(cimClient == null) {
+						return null;
+					}
+					CIMObjectPath cop = new CIMObjectPath(classname, cimClient.getNameSpace().getNameSpace());
+					CIMClass cimClass = cimClient.getClass(cop, false);
+					classDetails = new AbstractClassDetails();
+					
+					classDetails.setDomain("CIM");
+					classDetails.setClassname(classname);
+					classDetails.setProperties(getClassProperties(cimClass));
+					classDetails.setMethods(getClassMethods(cimClass));
+				}
+			}
+		} catch(Exception e) {
+			throw e;
+		} finally {
+			try {
+				if(cimClient != null) {
+					cimClient.close();
+				}
+			} catch (CIMException e) {
+				e.printStackTrace();
+			}
+		}
+		return classDetails;
+	}
+
+	/**
+	 * 
+	 * @param cimClass
+	 * @return
+	 */
+	private List getClassProperties(CIMClass cimClass) {
+		List propertiesList = new ArrayList();
+		try {
+			Iterator iter = cimClass.getProperties().iterator();
+			CIMProperty cimPropertyObj = null;
+			ClassProperty classProperty = null;
+			while (iter.hasNext()) {
+				cimPropertyObj = (CIMProperty)iter.next();
+				classProperty = new ClassProperty();
+				classProperty.setPropertyName(cimPropertyObj.getName());
+				propertiesList.add(classProperty);
+			}
+		} catch(Exception e) {
+			PolicyPluginLogUtil.logError("Error while getting Class Properties from CIM Server", e);
+		}
+		return propertiesList;
+	}
+
+	/**
+	 * 
+	 * @param cimClass
+	 * @return
+	 */
+	private List getClassMethods(CIMClass cimClass) {
+		List methodsList = new ArrayList();
+		try {
+			ClassMethod classMethod = null;
+			Vector methodsVect = cimClass.getMethods();
+			if(methodsVect != null && methodsVect.size() > 0) {
+				Iterator methodsIter = methodsVect.iterator();
+				CIMMethod cimMethod = null;
+				Vector methodsParamsVect = null;
+				while(methodsIter.hasNext()) {
+					cimMethod = (CIMMethod)methodsIter.next();
+					classMethod = new ClassMethod();
+					classMethod.setMethodName(cimMethod.getName());
+					MethodParameter mp = null;
+					methodsParamsVect = cimMethod.getParameters();
+					if(methodsParamsVect != null && methodsParamsVect.size() > 0) {
+						Iterator methodsParamIter = methodsParamsVect.iterator();
+						CIMParameter cimparameter = null;
+						while(methodsParamIter.hasNext()) {
+							cimparameter = (CIMParameter)methodsParamIter.next();
+							mp = new MethodParameter();
+							mp.setParamName(cimparameter.getName());
+							mp.setParamType(String.valueOf(cimparameter.getType()));
+							mp.setArray(cimparameter.getType().isArrayType());
+							mp.setReferenceClassName(cimparameter.getType().getRefClassName());
+							classMethod.addMethodParameter(mp);
+						}
+					}
+					methodsList.add(classMethod);
+				}
+			}
+		} catch(Exception e) {
+			PolicyPluginLogUtil.logError("Error while getting Class Methods from CIM Server", e);
+		}
+		return methodsList;		
+	}
+
+	/**
+	 * 
+	 */
+	public String[] customOperators() {
+		return null;
+	}
+
+	/**
+	 * 
+	 */
+	public String[] customActions() {
+		return null;
+	}
+
+	/**
+	 * 
+	 */
+	public String[] customKeywords() {
+		return null;
+	}
+}

Propchange: incubator/imperius/trunk/imperius-cimsplextension/src/org/apache/imperius/cimspl/client/CIMPolicyClient.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/imperius/trunk/imperius-cimsplextension/src/org/apache/imperius/cimspl/extension/Activator.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-cimsplextension/src/org/apache/imperius/cimspl/extension/Activator.java?rev=631683&view=auto
==============================================================================
--- incubator/imperius/trunk/imperius-cimsplextension/src/org/apache/imperius/cimspl/extension/Activator.java (added)
+++ incubator/imperius/trunk/imperius-cimsplextension/src/org/apache/imperius/cimspl/extension/Activator.java Wed Feb 27 11:28:54 2008
@@ -0,0 +1,142 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.  
+ */
+
+/**
+ * @author Naidu Javvadi <njavvadi@in.ibm.com>
+ *
+ */
+
+
+package org.apache.imperius.cimspl.extension;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+import org.apache.imperius.spl.editor.tool.PluginActivator;
+import org.apache.imperius.spl.editor.tool.utils.PolicyPluginLogUtil;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+	// The plug-in ID
+	public static final String PLUGIN_ID = "org.apache.imperius.cimspl.extension";
+
+	// The shared instance
+	private static Activator plugin;
+	
+	private ResourceBundle resourceBundle;
+	/**
+	 * The constructor
+	 */
+	public Activator() {
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
+	 */
+	public void start(BundleContext context) throws Exception {
+		super.start(context);
+		plugin = this;
+		try {
+			resourceBundle = ResourceBundle.getBundle("org.apache.imperius.cimspl.extension.pluginResources");
+		} catch (MissingResourceException me) {
+			resourceBundle = null;
+		} catch (Exception e) {
+			e.printStackTrace();
+		}		
+		System.out.println("Started here");
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
+	 */
+	public void stop(BundleContext context) throws Exception {
+		plugin = null;
+		super.stop(context);
+	}
+
+	/**
+	 * Returns the shared instance
+	 *
+	 * @return the shared instance
+	 */
+	public static Activator getDefault() {
+		return plugin;
+	}
+
+	/**
+	 * 
+	 * @return
+	 */
+	public static IWorkspace getWorkspace() {
+		return ResourcesPlugin.getWorkspace();
+	}
+
+	/**
+	 * 
+	 * @return
+	 */
+	public static IWorkbenchWindow getActiveWorkbenchWindow() {
+		return plugin.getWorkbench().getActiveWorkbenchWindow();
+	}
+
+	/**
+	 * 
+	 * @return
+	 */
+	public static Shell getActiveWorkbenchShell() {
+		IWorkbenchWindow window = PluginActivator.getActiveWorkbenchWindow();
+		return window == null ? null : window.getShell();
+	}
+
+	public ResourceBundle getResourceBundle() {
+		return resourceBundle;
+	}	
+	
+	/**
+	 * Function to get values from the resource bundle
+	 */
+	public String getMessage(String aKey) {
+		String value = null;
+		ResourceBundle bundle = PluginActivator.getDefault().getResourceBundle();
+		if (bundle != null) {
+			try {
+				value = bundle.getString(aKey);
+			} catch (MissingResourceException me) {
+				value = "!" + aKey + "!";
+				PolicyPluginLogUtil.logMessage(me.getMessage());
+			}
+		} else {
+			value = "!" + aKey + "!";
+		}
+		return value;
+	}
+
+}

Propchange: incubator/imperius/trunk/imperius-cimsplextension/src/org/apache/imperius/cimspl/extension/Activator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/imperius/trunk/imperius-cimsplextension/src/org/apache/imperius/cimspl/extension/pluginResources.properties
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-cimsplextension/src/org/apache/imperius/cimspl/extension/pluginResources.properties?rev=631683&view=auto
==============================================================================
--- incubator/imperius/trunk/imperius-cimsplextension/src/org/apache/imperius/cimspl/extension/pluginResources.properties (added)
+++ incubator/imperius/trunk/imperius-cimsplextension/src/org/apache/imperius/cimspl/extension/pluginResources.properties Wed Feb 27 11:28:54 2008
@@ -0,0 +1,31 @@
+#
+#/*
+ #* Licensed to the Apache Software Foundation (ASF) under one
+ #* or more contributor license agreements.  See the NOTICE file
+ #* distributed with this work for additional information
+ #* regarding copyright ownership.  The ASF licenses this file
+ #* to you under the Apache License, Version 2.0 (the
+ #* "License"); you may not use this file except in compliance
+ #* with the License.  You may obtain a copy of the License at
+ #* 
+ #*     http://www.apache.org/licenses/LICENSE-2.0
+ #* 
+ #* Unless required by applicable law or agreed to in writing,
+ #* software distributed under the License is distributed on an
+ #* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ #* KIND, either express or implied.  See the License for the
+ #* specific language governing permissions and limitations
+ #* under the License.  
+ #*/
+#/**
+# * @author Naidu Javvadi <njavvadi@in.ibm.com>
+# *
+# */
+
+# CIM SERVER CONFIG DETAILS
+cimserver.default.hostname = localhost
+cimserver.default.namespace = root/cimv2
+cimserver.default.port = 5988
+cimserver.default.listenerPortNo = 8189
+cimserver.default.username = a3
+cimserver.default.password = a3
\ No newline at end of file

Propchange: incubator/imperius/trunk/imperius-cimsplextension/src/org/apache/imperius/cimspl/extension/pluginResources.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/imperius/trunk/imperius-cimsplextension/src/org/apache/imperius/cimspl/nls/Messages.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-cimsplextension/src/org/apache/imperius/cimspl/nls/Messages.java?rev=631683&view=auto
==============================================================================
--- incubator/imperius/trunk/imperius-cimsplextension/src/org/apache/imperius/cimspl/nls/Messages.java (added)
+++ incubator/imperius/trunk/imperius-cimsplextension/src/org/apache/imperius/cimspl/nls/Messages.java Wed Feb 27 11:28:54 2008
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.  
+ */
+
+/**
+ * @author Naidu Javvadi <njavvadi@in.ibm.com>
+ *
+ */
+
+
+package org.apache.imperius.cimspl.nls;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+	private static final String MSG_BUNDLE_NAME = "org.apache.imperius.cimspl.nls.messages";
+	
+	private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(MSG_BUNDLE_NAME);
+
+	private Messages() {
+	}
+
+	public static String getString(String key) {
+		try {
+			return RESOURCE_BUNDLE.getString(key);
+		} catch(MissingResourceException me) {
+			return '!' + key + '!';
+		}
+	}
+}

Propchange: incubator/imperius/trunk/imperius-cimsplextension/src/org/apache/imperius/cimspl/nls/Messages.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/imperius/trunk/imperius-cimsplextension/src/org/apache/imperius/cimspl/nls/messages.properties
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-cimsplextension/src/org/apache/imperius/cimspl/nls/messages.properties?rev=631683&view=auto
==============================================================================
--- incubator/imperius/trunk/imperius-cimsplextension/src/org/apache/imperius/cimspl/nls/messages.properties (added)
+++ incubator/imperius/trunk/imperius-cimsplextension/src/org/apache/imperius/cimspl/nls/messages.properties Wed Feb 27 11:28:54 2008
@@ -0,0 +1,45 @@
+#
+#/*
+ #* Licensed to the Apache Software Foundation (ASF) under one
+ #* or more contributor license agreements.  See the NOTICE file
+ #* distributed with this work for additional information
+ #* regarding copyright ownership.  The ASF licenses this file
+ #* to you under the Apache License, Version 2.0 (the
+ #* "License"); you may not use this file except in compliance
+ #* with the License.  You may obtain a copy of the License at
+ #* 
+ #*     http://www.apache.org/licenses/LICENSE-2.0
+ #* 
+ #* Unless required by applicable law or agreed to in writing,
+ #* software distributed under the License is distributed on an
+ #* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ #* KIND, either express or implied.  See the License for the
+ #* specific language governing permissions and limitations
+ #* under the License.  
+ #*/
+#/**
+# * @author Naidu Javvadi <njavvadi@in.ibm.com>
+# *
+# */
+
+SERVER_LOCATION_GROUP_LABEL = Location
+SERVER_HOST_LABEL = Host:
+SERVER_PORT_LABEL = Port:
+SERVER_NAMESPACE_LABEL = Namespace:
+SERVER_USERNAME_LABEL = UserName:
+SERVER_PASSWORD_LABEL = Password:
+
+CIM_CLIENT_ERROR_TITLE = Connection Failure
+CIM_ERROR_TITLE = CIM error
+CIM_CLIENT_CONNECTION_INFO_TITLE = Connection test status
+CIM_CLIENT_CONNECTION_TEST_SUCCESS_STATUS = Connection test success
+
+# CIM Specific
+CIM_POLICYSERVER_PREFERENCE_LABEL = Set the CIM Server Details
+CIM_SERVER_HOST_NAME = CIM_SERVER_HOST_NAME
+CIM_SERVER_USERNAME = CIM_SERVER_USERNAME
+CIM_SERVER_PASSWORD = CIM_SERVER_PASSWORD
+CIM_SERVER_PORTNO = CIM_SERVER_PORTNO
+CIM_SERVER_NAMESPACE = CIM_SERVER_NAMESPACE
+
+TEST_CONNECTION_LABEL = Test Connection
\ No newline at end of file

Propchange: incubator/imperius/trunk/imperius-cimsplextension/src/org/apache/imperius/cimspl/nls/messages.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/imperius/trunk/imperius-cimsplextension/src/org/apache/imperius/cimspl/preferences/CIMPolicyServerPreferencePage.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-cimsplextension/src/org/apache/imperius/cimspl/preferences/CIMPolicyServerPreferencePage.java?rev=631683&view=auto
==============================================================================
--- incubator/imperius/trunk/imperius-cimsplextension/src/org/apache/imperius/cimspl/preferences/CIMPolicyServerPreferencePage.java (added)
+++ incubator/imperius/trunk/imperius-cimsplextension/src/org/apache/imperius/cimspl/preferences/CIMPolicyServerPreferencePage.java Wed Feb 27 11:28:54 2008
@@ -0,0 +1,327 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.  
+ */
+
+/**
+ * @author Naidu Javvadi <njavvadi@in.ibm.com>
+ *
+ */
+
+
+package org.apache.imperius.cimspl.preferences;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.ResourceBundle;
+
+import org.apache.imperius.cimspl.extension.Activator;
+import org.apache.imperius.cimspl.nls.Messages;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferencePage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+
+import org.apache.imperius.spl.editor.tool.internal.client.IPolicyClient;
+import org.apache.imperius.spl.editor.tool.internal.client.IPolicyClientFactory;
+import org.apache.imperius.spl.editor.tool.internal.client.PolicyClientFactoryImpl;
+
+import org.apache.imperius.spl.editor.tool.utils.PolicyPluginLogUtil;
+
+public class CIMPolicyServerPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
+
+	private Text _serverHost = null;
+	
+	private Text _namespace = null;
+	
+	private Text _serverPort = null;
+	
+	private Text _username = null;
+	
+	private Text _password = null;
+	
+	private static ResourceBundle bundle = Activator.getDefault().getResourceBundle();
+	
+	private static boolean fValidateFlag = true;
+	
+	public CIMPolicyServerPreferencePage() {
+
+	}
+
+	public void init(IWorkbench workbench) {
+		storeDefaultCIMServerDetails();
+	}
+	
+	public void storeDefaultCIMServerDetails() {
+		IPreferenceStore store = Activator.getDefault().getPreferenceStore();
+		if("".equals(store.getString(Messages.getString("CIM_SERVER_HOST_NAME")))) {
+			store.setDefault(Messages.getString("CIM_SERVER_HOST_NAME"), bundle.getString("cimserver.default.hostname"));
+			store.setDefault(Messages.getString("CIM_SERVER_USERNAME"), bundle.getString("cimserver.default.username"));
+			store.setDefault(Messages.getString("CIM_SERVER_PASSWORD"), bundle.getString("cimserver.default.password"));
+			store.setDefault(Messages.getString("CIM_SERVER_PORTNO"), bundle.getString("cimserver.default.port"));
+			store.setDefault(Messages.getString("CIM_SERVER_NAMESPACE"), bundle.getString("cimserver.default.namespace"));
+		}
+	}
+
+	protected Control createContents(Composite aParent) {
+		Composite composite = addGridLayout(new Composite(aParent, 0), 1);
+		Label note = new Label(composite, 0);
+		note.setText(Messages.getString("CIM_POLICYSERVER_PREFERENCE_LABEL"));
+		addServerLocation(composite);
+		addAuthenticationDetails(composite);
+		//addConnectionDetails(composite);
+		addConnectionButton(composite);
+		initializeControls();
+		return composite;
+	}
+
+	private void initializeControls() {
+		IPreferenceStore store = Activator.getDefault().getPreferenceStore();
+		_serverHost.setText(store.getString(Messages.getString("CIM_SERVER_HOST_NAME")));
+		_namespace.setText(store.getString(Messages.getString("CIM_SERVER_NAMESPACE")));
+		_serverPort.setText(store.getString(Messages.getString("CIM_SERVER_PORTNO")));
+		_username.setText(store.getString(Messages.getString("CIM_SERVER_USERNAME")));
+		_password.setText(store.getString(Messages.getString("CIM_SERVER_PASSWORD")));
+	}
+
+	private Composite addGridLayout(Composite composite, int noOfCols) {
+		GridLayout layout = new GridLayout();
+		layout.numColumns = noOfCols;
+		composite.setLayout(layout);
+		GridData data = new GridData();
+		data.widthHint = 400;
+		composite.setLayoutData(data);
+		return composite;
+	}
+
+	private void sourceContentChanged(Object srcObject, String labelName) {
+		if (srcObject instanceof Text) {
+			Text srcText = (Text) srcObject; 
+			validateText(srcText.getText(), labelName);
+		}
+	}
+	
+	private void validateText(String textValue, String labelName) {
+		if(textValue.length() == 0) {
+			updateStatus(labelName + " can not be blank");
+			fValidateFlag = false;
+			return;
+		}
+		if("Port No".equals(labelName)) {
+			if(!textValue.matches("[\\d]*")) {
+				updateStatus(labelName + " should not contain alphabets");
+				fValidateFlag = false;
+				return;
+			}
+		}
+		fValidateFlag = true;
+		updateStatus(null);
+	}
+	
+	private void updateStatus(String message) {
+		setErrorMessage(message);
+	}
+
+	private void addServerLocation(Composite aParent) {
+		Group locationGroup = (Group) addGridLayout(new Group(aParent, 16), 2);
+		locationGroup.setText(Messages.getString("SERVER_LOCATION_GROUP_LABEL"));
+		Label label = new Label(locationGroup, 0);
+		label.setText(Messages.getString("SERVER_HOST_LABEL"));
+		_serverHost = new Text(locationGroup, SWT.BORDER);
+		_serverHost.setLayoutData(getDefaultGridData());
+		_serverHost.addModifyListener(new ModifyListener() {
+			public void modifyText(ModifyEvent event) {
+				sourceContentChanged(event.getSource(),"Host");
+			}
+		});
+		
+		label = new Label(locationGroup, 0);
+		label.setText(Messages.getString("SERVER_PORT_LABEL"));
+		_serverPort = new Text(locationGroup, SWT.BORDER);
+		_serverPort.setLayoutData(getDefaultGridData());
+		_serverPort.addModifyListener(new ModifyListener() {
+			public void modifyText(ModifyEvent event) {
+				sourceContentChanged(event.getSource(),"Port No");
+			}
+		});		
+		
+		label = new Label(locationGroup, 0);
+		label.setText(Messages.getString("SERVER_NAMESPACE_LABEL"));
+		_namespace = new Text(locationGroup, SWT.BORDER);
+		_namespace.setLayoutData(getDefaultGridData());
+		_namespace.addModifyListener(new ModifyListener() {
+			public void modifyText(ModifyEvent event) {
+				sourceContentChanged(event.getSource(),"Namespace");
+			}
+		});
+	}
+
+	private void addAuthenticationDetails(Composite aParent) {
+		Group locationGroup = (Group) addGridLayout(new Group(aParent, 16), 2);
+		locationGroup.setText("Authentication");
+		Label label = new Label(locationGroup, 0);
+		label.setText(Messages.getString("SERVER_USERNAME_LABEL"));
+		_username = new Text(locationGroup, SWT.BORDER);
+		_username.setLayoutData(getDefaultGridData());
+//		_username.addModifyListener(new ModifyListener() {
+//			public void modifyText(ModifyEvent event) {
+//				sourceContentChanged(event.getSource(),"username");
+//			}
+//		});
+		label = new Label(locationGroup, 0);
+		label.setText(Messages.getString("SERVER_PASSWORD_LABEL"));
+		_password = new Text(locationGroup, SWT.BORDER);
+		_password.setLayoutData(getDefaultGridData());
+//		_password.addModifyListener(new ModifyListener() {
+//			public void modifyText(ModifyEvent event) {
+//				sourceContentChanged(event.getSource(),"password");
+//			}
+//		});		
+	}
+
+	private GridData getDefaultGridData() {
+		GridData gd = new GridData();
+		gd.horizontalAlignment = 768;
+		gd.widthHint = convertWidthInCharsToPixels(60);
+		return gd;
+	}
+
+	/**
+	 * 
+	 * @param aParent
+	 */
+//	private void addConnectionDetails(Composite aParent) {
+//		Group locationGroup = (Group) addGridLayout(new Group(aParent, 16), 2);
+//		locationGroup.setText("Connection");
+//		Label label = new Label(locationGroup, 0);
+//		label.setText("Port: ");
+//		_serverPort = new Text(locationGroup, SWT.BORDER);
+//		_serverPort.setLayoutData(getDefaultGridData());
+//		_serverPort.addModifyListener(new ModifyListener() {
+//			public void modifyText(ModifyEvent event) {
+//				sourceContentChanged(event.getSource(),"Port No");
+//			}
+//		});		
+//	}
+
+	private void addConnectionButton(Composite aParent) {
+		Composite container = addGridLayout(new Composite(aParent, 0), 2);
+		final Button checkButton = new Button(container, SWT.PUSH);
+		checkButton.setText(Messages.getString("TEST_CONNECTION_LABEL"));
+		checkButton.addSelectionListener(new SelectionAdapter() {
+			public void widgetSelected(SelectionEvent e) {
+				testConnection();
+			}
+		});
+	}
+	
+	private void testConnection() {
+		// connect to server and see
+		IPolicyClientFactory factory = new PolicyClientFactoryImpl();
+		IPolicyClient policyClient = null;
+		try {
+			Map connectionDetails = new HashMap();
+			if(_serverHost.getText() != null && _serverPort.getText() != null) {
+				connectionDetails.put("hostname", _serverHost.getText());
+				connectionDetails.put("portno", _serverPort.getText());
+				connectionDetails.put("namespace", _namespace.getText());
+				connectionDetails.put("username", _username.getText());
+				connectionDetails.put("password", _password.getText());
+				policyClient = factory.getClient("CIM");
+				if(policyClient != null) {
+					policyClient.testConnection(connectionDetails);
+				}
+			} else {
+				MessageDialog.openInformation(Activator.getActiveWorkbenchShell(), "Information", "Set all fields");
+			}
+		} catch (Exception _ex) {
+			if(_ex.getMessage().indexOf("was unable to instantiate class") != -1) {
+//				DomainConfigurationErrorWindow win = new DomainConfigurationErrorWindow(getShell(),DomainConfigurationErrorWindow.getConfigInstructions());
+//				win.setBlockOnOpen(true);
+//				win.open();
+			}
+			PolicyPluginLogUtil.logError(_ex);
+		} 
+	}
+
+	/**
+	 * 
+	 */
+	protected void performDefaults() {
+		super.performDefaults();
+		IPreferenceStore store = Activator.getDefault().getPreferenceStore();
+		_serverHost.setText(store.getDefaultString(Messages.getString("CIM_SERVER_HOST_NAME")));
+		_namespace.setText(store.getDefaultString(Messages.getString("CIM_SERVER_NAMESPACE")));
+		_serverPort.setText(store.getDefaultString(Messages.getString("CIM_SERVER_PORTNO")));
+		_username.setText(store.getDefaultString(Messages.getString("CIM_SERVER_USERNAME")));
+		_password.setText(store.getDefaultString(Messages.getString("CIM_SERVER_PASSWORD")));
+		setErrorMessage(null);
+    }
+
+	/**
+	 * 
+	 */
+	protected void performApply() {
+		IPreferenceStore store = Activator.getDefault().getPreferenceStore();
+		store.setValue(Messages.getString("CIM_SERVER_HOST_NAME"), _serverHost.getText());
+		store.setValue(Messages.getString("CIM_SERVER_NAMESPACE"), _namespace.getText());
+		store.setValue(Messages.getString("CIM_SERVER_PORTNO"), _serverPort.getText());
+		store.setValue(Messages.getString("CIM_SERVER_USERNAME"), _username.getText());
+		store.setValue(Messages.getString("CIM_SERVER_PASSWORD"), _password.getText());
+	}	
+
+	/**
+	 * 
+	 */
+	public boolean performOk() {
+		if(!fValidateFlag) {
+			return false;
+		}
+		performApply();
+		return true;
+	}
+
+	public Text get_serverHost() {
+		return _serverHost;
+	}
+
+	public Text get_serverPort() {
+		return _serverPort;
+	}
+
+	public Text get_username() {
+		return _username;
+	}
+
+	public Text get_password() {
+		return _password;
+	}
+}

Propchange: incubator/imperius/trunk/imperius-cimsplextension/src/org/apache/imperius/cimspl/preferences/CIMPolicyServerPreferencePage.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/imperius/trunk/imperius-cimsplextension/src/org/apache/imperius/cimspl/properties/CIMPolicyFilePropertyPage.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-cimsplextension/src/org/apache/imperius/cimspl/properties/CIMPolicyFilePropertyPage.java?rev=631683&view=auto
==============================================================================
--- incubator/imperius/trunk/imperius-cimsplextension/src/org/apache/imperius/cimspl/properties/CIMPolicyFilePropertyPage.java (added)
+++ incubator/imperius/trunk/imperius-cimsplextension/src/org/apache/imperius/cimspl/properties/CIMPolicyFilePropertyPage.java Wed Feb 27 11:28:54 2008
@@ -0,0 +1,300 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.  
+ */
+
+/**
+ * @author Naidu Javvadi <njavvadi@in.ibm.com>
+ *
+ */
+ 
+package org.apache.imperius.cimspl.properties;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.ResourceBundle;
+
+import org.apache.imperius.cimspl.extension.Activator;
+import org.apache.imperius.cimspl.nls.Messages;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.dialogs.PropertyPage;
+
+import org.apache.imperius.spl.editor.tool.internal.client.IPolicyClient;
+import org.apache.imperius.spl.editor.tool.internal.client.IPolicyClientFactory;
+import org.apache.imperius.spl.editor.tool.internal.client.PolicyClientFactoryImpl;
+import org.apache.imperius.spl.editor.tool.utils.PolicyPluginLogUtil;
+
+/**
+ * @author Administrator
+ *
+ */
+public class CIMPolicyFilePropertyPage extends PropertyPage {
+	
+	private Text _serverHost = null;
+	
+	private Text _namespace = null;
+	
+	private Text _serverPort = null;
+	
+	private Text _username = null;
+	
+	private Text _password = null;
+
+	private static ResourceBundle bundle = Activator.getDefault().getResourceBundle();
+	
+	private static boolean fValidateFlag = true;
+	
+	public CIMPolicyFilePropertyPage() {
+		storeDefaultCIMServerDetails();
+	}
+	
+	public void storeDefaultCIMServerDetails() {
+		IPreferenceStore store = Activator.getDefault().getPreferenceStore();
+		if("".equals(store.getString(Messages.getString("CIM_SERVER_HOST_NAME")))) {
+			store.setDefault(Messages.getString("CIM_SERVER_HOST_NAME"), bundle.getString("cimserver.default.hostname"));
+			store.setDefault(Messages.getString("CIM_SERVER_USERNAME"), bundle.getString("cimserver.default.username"));
+			store.setDefault(Messages.getString("CIM_SERVER_PASSWORD"), bundle.getString("cimserver.default.password"));
+			store.setDefault(Messages.getString("CIM_SERVER_PORTNO"), bundle.getString("cimserver.default.port"));
+			store.setDefault(Messages.getString("CIM_SERVER_NAMESPACE"), bundle.getString("cimserver.default.namespace"));
+		}
+	}
+
+	protected Control createContents(Composite aParent) {
+		Composite composite = addGridLayout(new Composite(aParent, 0), 1);
+		Label note = new Label(composite, 0);
+		note.setText(Messages.getString("CIM_POLICYSERVER_PREFERENCE_LABEL"));
+		addServerLocation(composite);
+		addAuthenticationDetails(composite);
+		//addConnectionDetails(composite);
+		addConnectionButton(composite);
+		initializeControls();
+		return composite;
+	}
+
+	private void initializeControls() {
+		IPreferenceStore store = Activator.getDefault().getPreferenceStore();
+		_serverHost.setText(store.getString(Messages.getString("CIM_SERVER_HOST_NAME")));
+		_namespace.setText(store.getString(Messages.getString("CIM_SERVER_NAMESPACE")));
+		_serverPort.setText(store.getString(Messages.getString("CIM_SERVER_PORTNO")));
+		_username.setText(store.getString(Messages.getString("CIM_SERVER_USERNAME")));
+		_password.setText(store.getString(Messages.getString("CIM_SERVER_PASSWORD")));
+	}
+
+	private Composite addGridLayout(Composite composite, int noOfCols) {
+		GridLayout layout = new GridLayout();
+		layout.numColumns = noOfCols;
+		composite.setLayout(layout);
+		GridData data = new GridData();
+		data.widthHint = 400;
+		composite.setLayoutData(data);
+		return composite;
+	}
+
+	private void sourceContentChanged(Object srcObject, String labelName) {
+		if (srcObject instanceof Text) {
+			Text srcText = (Text) srcObject; 
+			validateText(srcText.getText(), labelName);
+		}
+	}
+	
+	private void validateText(String textValue, String labelName) {
+		if(textValue.length() == 0) {
+			updateStatus(labelName + " can not be blank");
+			fValidateFlag = false;
+			return;
+		}
+		if("Port No".equals(labelName)) {
+			if(!textValue.matches("[\\d]*")) {
+				updateStatus(labelName + " should not contain alphabets");
+				fValidateFlag = false;
+				return;
+			}
+		}
+		fValidateFlag = true;
+		updateStatus(null);
+	}
+	
+	private void updateStatus(String message) {
+		setErrorMessage(message);
+	}
+
+	private void addServerLocation(Composite aParent) {
+		Group locationGroup = (Group) addGridLayout(new Group(aParent, 16), 2);
+		locationGroup.setText(Messages.getString("SERVER_LOCATION_GROUP_LABEL"));
+		Label label = new Label(locationGroup, 0);
+		label.setText(Messages.getString("SERVER_HOST_LABEL"));
+		_serverHost = new Text(locationGroup, SWT.BORDER);
+		_serverHost.setLayoutData(getDefaultGridData());
+		_serverHost.addModifyListener(new ModifyListener() {
+			public void modifyText(ModifyEvent event) {
+				sourceContentChanged(event.getSource(),"Host");
+			}
+		});
+		
+		label = new Label(locationGroup, 0);
+		label.setText(Messages.getString("SERVER_PORT_LABEL"));
+		_serverPort = new Text(locationGroup, SWT.BORDER);
+		_serverPort.setLayoutData(getDefaultGridData());
+		_serverPort.addModifyListener(new ModifyListener() {
+			public void modifyText(ModifyEvent event) {
+				sourceContentChanged(event.getSource(),"Port No");
+			}
+		});		
+		
+		label = new Label(locationGroup, 0);
+		label.setText(Messages.getString("SERVER_NAMESPACE_LABEL"));
+		_namespace = new Text(locationGroup, SWT.BORDER);
+		_namespace.setLayoutData(getDefaultGridData());
+		_namespace.addModifyListener(new ModifyListener() {
+			public void modifyText(ModifyEvent event) {
+				sourceContentChanged(event.getSource(),"Namespace");
+			}
+		});
+	}
+
+	private void addAuthenticationDetails(Composite aParent) {
+		Group locationGroup = (Group) addGridLayout(new Group(aParent, 16), 2);
+		locationGroup.setText("Authentication");
+		Label label = new Label(locationGroup, 0);
+		label.setText(Messages.getString("SERVER_USERNAME_LABEL"));
+		_username = new Text(locationGroup, SWT.BORDER);
+		_username.setLayoutData(getDefaultGridData());
+//		_username.addModifyListener(new ModifyListener() {
+//			public void modifyText(ModifyEvent event) {
+//				sourceContentChanged(event.getSource(),"username");
+//			}
+//		});
+		label = new Label(locationGroup, 0);
+		label.setText(Messages.getString("SERVER_PASSWORD_LABEL"));
+		_password = new Text(locationGroup, SWT.BORDER);
+		_password.setLayoutData(getDefaultGridData());
+//		_password.addModifyListener(new ModifyListener() {
+//			public void modifyText(ModifyEvent event) {
+//				sourceContentChanged(event.getSource(),"password");
+//			}
+//		});		
+	}
+
+	private GridData getDefaultGridData() {
+		GridData gd = new GridData();
+		gd.horizontalAlignment = 768;
+		gd.widthHint = convertWidthInCharsToPixels(60);
+		return gd;
+	}
+
+	/**
+	 * 
+	 * @param aParent
+	 */
+//	private void addConnectionDetails(Composite aParent) {
+//		Group locationGroup = (Group) addGridLayout(new Group(aParent, 16), 2);
+//		locationGroup.setText("Connection");
+//		Label label = new Label(locationGroup, 0);
+//		label.setText("Port: ");
+//		_serverPort = new Text(locationGroup, SWT.BORDER);
+//		_serverPort.setLayoutData(getDefaultGridData());
+//		_serverPort.addModifyListener(new ModifyListener() {
+//			public void modifyText(ModifyEvent event) {
+//				sourceContentChanged(event.getSource(),"Port No");
+//			}
+//		});		
+//	}
+	
+	private void addConnectionButton(Composite aParent) {
+		Composite container = addGridLayout(new Composite(aParent, 0), 2);
+		final Button checkButton = new Button(container, SWT.PUSH);
+		checkButton.setText(Messages.getString("TEST_CONNECTION_LABEL"));
+		checkButton.addSelectionListener(new SelectionAdapter() {
+			public void widgetSelected(SelectionEvent e) {
+				testConnection();
+			}
+		});
+	}
+	
+	private void testConnection() {
+		// connect to server and see
+		IPolicyClientFactory factory = new PolicyClientFactoryImpl();
+		IPolicyClient policyClient = null;
+		try {
+			Map connectionDetails = new HashMap();
+			if(_serverHost.getText() != null && _serverPort.getText() != null) {
+				connectionDetails.put("hostname", _serverHost.getText());
+				connectionDetails.put("portno", _serverPort.getText());
+				connectionDetails.put("namespace", _namespace.getText());
+				connectionDetails.put("username", _username.getText());
+				connectionDetails.put("password", _password.getText());
+				policyClient = factory.getClient("CIM");
+				policyClient.testConnection(connectionDetails);
+			} else {
+				MessageDialog.openInformation(Activator.getActiveWorkbenchShell(), "Information", "Set all fields");
+			}
+		} catch (Exception _ex) {
+			PolicyPluginLogUtil.logError(_ex);
+		} 
+	}
+
+	/**
+	 * 
+	 */
+	protected void performDefaults() {
+		super.performDefaults();
+		IPreferenceStore store = Activator.getDefault().getPreferenceStore();
+		_serverHost.setText(store.getDefaultString(Messages.getString("CIM_SERVER_HOST_NAME")));
+		_namespace.setText(store.getDefaultString(Messages.getString("CIM_SERVER_NAMESPACE")));
+		_serverPort.setText(store.getDefaultString(Messages.getString("CIM_SERVER_PORTNO")));
+		_username.setText(store.getDefaultString(Messages.getString("CIM_SERVER_USERNAME")));
+		_password.setText(store.getDefaultString(Messages.getString("CIM_SERVER_PASSWORD")));
+		setErrorMessage(null);
+    }
+
+	/**
+	 * 
+	 */
+	protected void performApply() {
+		IPreferenceStore store = Activator.getDefault().getPreferenceStore();
+		store.setValue(Messages.getString("CIM_SERVER_HOST_NAME"), _serverHost.getText());
+		store.setValue(Messages.getString("CIM_SERVER_NAMESPACE"), _namespace.getText());
+		store.setValue(Messages.getString("CIM_SERVER_PORTNO"), _serverPort.getText());
+		store.setValue(Messages.getString("CIM_SERVER_USERNAME"), _username.getText());
+		store.setValue(Messages.getString("CIM_SERVER_PASSWORD"), _password.getText());
+	}	
+
+	/**
+	 * 
+	 */
+	public boolean performOk() {
+		if(!fValidateFlag) {
+			return false;
+		}
+		performApply();
+		return true;
+	}
+}

Propchange: incubator/imperius/trunk/imperius-cimsplextension/src/org/apache/imperius/cimspl/properties/CIMPolicyFilePropertyPage.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message