You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-dev@ws.apache.org by sa...@apache.org on 2006/03/13 05:50:54 UTC

svn commit: r385423 - in /webservices/commons/modules/policy: AUTHORS AUTHORS.txt LICENSE LICENSE.txt README README.txt RELEASE-NOTE RELEASE-NOTE.txt docs/ project.xml xdocs/ xdocs/index.xml xdocs/navigation.xml xdocs/userguide.xml

Author: sanka
Date: Sun Mar 12 20:50:50 2006
New Revision: 385423

URL: http://svn.apache.org/viewcvs?rev=385423&view=rev
Log:
building the site

Added:
    webservices/commons/modules/policy/AUTHORS.txt
      - copied unchanged from r385422, webservices/commons/modules/policy/AUTHORS
    webservices/commons/modules/policy/LICENSE.txt
      - copied unchanged from r384113, webservices/commons/modules/policy/LICENSE
    webservices/commons/modules/policy/README.txt
      - copied unchanged from r385422, webservices/commons/modules/policy/README
    webservices/commons/modules/policy/RELEASE-NOTE.txt
      - copied unchanged from r385422, webservices/commons/modules/policy/RELEASE-NOTE
    webservices/commons/modules/policy/xdocs/
    webservices/commons/modules/policy/xdocs/index.xml
    webservices/commons/modules/policy/xdocs/navigation.xml
    webservices/commons/modules/policy/xdocs/userguide.xml
Removed:
    webservices/commons/modules/policy/AUTHORS
    webservices/commons/modules/policy/LICENSE
    webservices/commons/modules/policy/README
    webservices/commons/modules/policy/RELEASE-NOTE
    webservices/commons/modules/policy/docs/
Modified:
    webservices/commons/modules/policy/project.xml

Modified: webservices/commons/modules/policy/project.xml
URL: http://svn.apache.org/viewcvs/webservices/commons/modules/policy/project.xml?rev=385423&r1=385422&r2=385423&view=diff
==============================================================================
--- webservices/commons/modules/policy/project.xml (original)
+++ webservices/commons/modules/policy/project.xml Sun Mar 12 20:50:50 2006
@@ -20,120 +20,154 @@
 
 <project>
   <!-- the version of maven's project object model -->
-
-  <pomVersion>3</pomVersion>
+	
+	<pomVersion>3</pomVersion>
   <!-- a unique name for this project -->
-
-  <name>Web Services Commons : WS-Policy implemenation</name>
-  <id>policy</id>
-  <groupId>ws-commons</groupId>
+	
+	<name>Web Services Commons : WS-Policy implemenation</name>
+	<id>policy</id>
+	<groupId>ws-commons</groupId>
   
   <!-- a short but descriptive name for the project -->
-
-  <name>WS-Policy Implementation</name>
+	
+	<name>WS-Policy Implementation</name>
   <!-- The version of the project under development, e.g.
        1.1, 1.2, 2.0-SNAPSHOT -->
-
-  <currentVersion>${policy.version}</currentVersion>
+	
+	<currentVersion>${policy.version}</currentVersion>
   <!-- details about the organization that 'owns' the project -->
-
-  <organization>
-    <name>Apache Software Foundation</name>
-    <url>http://www.apache.org/</url>
-  </organization>
+	
+	<organization>
+		<name>Apache Software Foundation</name>
+		<url>http://www.apache.org/</url>
+	</organization>
   <!-- the year the project started -->
-
-  <inceptionYear>2002</inceptionYear>
-  <package>org.apache.ws.policy</package>
+	
+	<inceptionYear>2002</inceptionYear>
+	<package>org.apache.ws.policy</package>
 
   <!-- any mailing lists for the project -->
-
-  <mailingLists/>
+	<mailingLists>
+		<mailingList>
+			<name>WS-Policy Developer List</name>
+			<subscribe>commons-dev-subscribe@ws.apache.org</subscribe>
+			<unsubscribe>commons-dev-unsubscribe@ws.apache.org</unsubscribe>
+			<archive href="http://mail-archives.apache.org/mod_mbox/ws-commons-dev/" />
+		</mailingList>
+	</mailingLists>
+	
   <!-- who the developers are for the project -->
-
-  <developers/>
+	
+	<developers>
+		<developer>
+			<name>Sanjiva Weerawarana</name>
+			<id>sanjiva</id>
+			<email>sanjiva@opensource.lk</email>
+		</developer>
+		<developer>
+			<name>Davanum Srinivas</name>
+			<id>dims</id>
+			<email>dims@yahoo.com</email>
+		</developer>
+		<developer>
+			<name>Dittmann, Werner</name>
+			<id>werner</id>
+			<email></email>
+		</developer>
+	</developers>
   <!-- jar files the project is dependent on -->
-
-    <dependencies>
-        <dependency>
-            <groupId>ws-commons</groupId>
-            <artifactId>axiom</artifactId>
-            <version>${axiom.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>${stax.impl.groupid}</groupId>
-            <artifactId>${stax.impl.artifactid}</artifactId>
-            <version>${stax.impl.version}</version>
-            <properties>
-                <module>true</module>
-            </properties>
-        </dependency>
-        <dependency>
-            <groupId>stax</groupId>
-            <artifactId>stax-api</artifactId>
-            <version>${stax.api.version}</version>
-            <properties>
-                <module>true</module>
-            </properties>
-        </dependency>
-        <dependency>
-            <groupId>commons-logging</groupId>
-            <artifactId>commons-logging</artifactId>
-            <version>${commons.logging.version}</version>
-            <properties>
-                <module>true</module>
-            </properties>
-        </dependency>
-    </dependencies>
+	
+	<licenses>
+		<license>
+			<name>The Apache Software License, Version 2.0</name>
+			<url>http://www.apache.org/licenses/LICENSE-2.0</url>
+			<distribution>repo</distribution>
+		
+		</license>
+	</licenses>
+
+	
+	
+	<dependencies>
+		<dependency>
+			<groupId>ws-commons</groupId>
+			<artifactId>axiom</artifactId>
+			<version>${axiom.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>${stax.impl.groupid}</groupId>
+			<artifactId>${stax.impl.artifactid}</artifactId>
+			<version>${stax.impl.version}</version>
+			<properties>
+				<module>true</module>
+			</properties>
+		</dependency>
+		<dependency>
+			<groupId>stax</groupId>
+			<artifactId>stax-api</artifactId>
+			<version>${stax.api.version}</version>
+			<properties>
+				<module>true</module>
+			</properties>
+		</dependency>
+		<dependency>
+			<groupId>commons-logging</groupId>
+			<artifactId>commons-logging</artifactId>
+			<version>${commons.logging.version}</version>
+			<properties>
+				<module>true</module>
+			</properties>
+		</dependency>
+	</dependencies>
   <!-- build information for the project -->
-
-    <build>
-        <nagEmailAddress>commons-dev@ws.apache.org</nagEmailAddress>
-        <sourceDirectory>src</sourceDirectory>
-        <unitTestSourceDirectory>test</unitTestSourceDirectory>
-
-        <unitTest>
-            <excludes>
-                <exclude>**/PolicyTestCase.java</exclude>
-            </excludes>
-            <includes>
-                <include>**/*Test*.java</include>
-            </includes>
-
-            <resources>
-                <resource>
-                    <directory>${basedir}/test-resources</directory>
-                </resource>
-                <resource>
-                    <directory>conf</directory>
-                    <includes>
-                        <include>**/*.properties</include>
-                    </includes>
-                </resource>
-                <resource>
-                    <directory>src</directory>
-                    <includes>
-                        <include>**/*.properties</include>
-                        <include>**/*.xml</include>
-                    </includes>
-                </resource>
-            </resources>
-        </unitTest>
-
-        <resources>
-            <resource>
-                <directory>conf</directory>
-                <includes>
-                    <include>**/*.properties</include>
-                </includes>
-            </resource>
-            <resource>
-                <directory>src</directory>
-                <includes>
-                    <include>**/*.properties</include>
-                    <include>**/*.xml</include>
-                </includes>
-            </resource>
-        </resources>
-    </build>
+	
+	<build>
+		<nagEmailAddress>commons-dev@ws.apache.org</nagEmailAddress>
+		<sourceDirectory>src</sourceDirectory>
+		<unitTestSourceDirectory>test</unitTestSourceDirectory>
+		
+		<unitTest>
+			<excludes>
+				<exclude>**/PolicyTestCase.java</exclude>
+			</excludes>
+			<includes>
+				<include>**/*Test*.java</include>
+			</includes>
+			
+			<resources>
+				<resource>
+					<directory>${basedir}/test-resources</directory>
+				</resource>
+				<resource>
+					<directory>conf</directory>
+					<includes>
+						<include>**/*.properties</include>
+					</includes>
+				</resource>
+				<resource>
+					<directory>src</directory>
+					<includes>
+						<include>**/*.properties</include>
+						<include>**/*.xml</include>
+					</includes>
+				</resource>
+			</resources>
+		</unitTest>
+		
+		<resources>
+			<resource>
+				<directory>conf</directory>
+				<includes>
+					<include>**/*.properties</include>
+				</includes>
+			</resource>
+			<resource>
+				<directory>src</directory>
+				<includes>
+					<include>**/*.properties</include>
+					<include>**/*.xml</include>
+				</includes>
+			</resource>
+		</resources>
+	</build>
 </project>

Added: webservices/commons/modules/policy/xdocs/index.xml
URL: http://svn.apache.org/viewcvs/webservices/commons/modules/policy/xdocs/index.xml?rev=385423&view=auto
==============================================================================
--- webservices/commons/modules/policy/xdocs/index.xml (added)
+++ webservices/commons/modules/policy/xdocs/index.xml Sun Mar 12 20:50:50 2006
@@ -0,0 +1,123 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<document>
+	<properties>
+		<title>Welcome to WS Policy</title>
+	</properties>
+	
+	<head>
+		<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
+		<meta content="text/html; charset=iso-8859-1" />
+		<meta name="generator" content="amaya 9.2.1, see http://www.w3.org/Amaya/" />
+	</head>
+	
+	<body>
+	
+	<section>
+
+	<h1>Welcome to Apache Web Services (WS) Policy</h1>
+
+<h4>- Version 0.90 Release</h4>
+
+<h2>Introduction</h2>
+
+<p>WS-Commons/Policy provides an implementation of WS-Policy specification.
+It provides a convenient model to process any policy information at runtime.
+In other words, it allows you to convert any policy to an object (which is
+its runtime representation) and play with it as you like. You could normalize
+it and then print it if you want to convert your original policy into a
+standard format. Else you could merge or intersect that policy object with
+another policy object and print it to see how the merge / or intersect looks
+like.</p>
+
+<p><strong>WS-Policy specification</strong> define <a
+href="#operations">policy operations</a> to manipulate policies.
+WS-Commons/Policy framework support all these operations which are extremely
+useful when trying to do complex policy manipulations</p>
+
+<h3>What is WS-Policy?</h3>
+
+<p>A <strong>WS-policy</strong> is a set of requirements that have to be met
+in order to consume a web service.</p>
+
+<p>A requirement can be domain specific. For instance, if your policy demands
+that you need security token type, then its a primitive requirement.
+<strong>PrimtiveAssertion</strong> class represents such requirements in
+<strong>Commons/Policy framework</strong>.</p>
+
+<p>Another requirement would be to meet several assertions in a certain way.
+For instance, an assertion would require all its child assertions be met
+while another assertion may require exactly one of its child assertions be
+met. Such assertions are known as <strong>CompositeAssertions</strong>. If
+assertion implements CompositeAssertion marker-interface, it's an indication
+that this assertion is of CompositeAssertion type. For instance
+AndCompositeAssertion, XorCompositeAssertion and Policy are of
+CompositeAssertion type.</p>
+
+<p>If you consider the <strong>AndCompositeAssertion</strong> it requires all
+its child terms be met. If its <strong>XorCompositeAssertion</strong> type,
+it requires that exactly one of its child terms be met. Both Policy and
+AndCompositeAssertion requires same behavior except that in
+<strong>Policy</strong>, policy object is the outer most element.</p>
+<a name="operations"></a>
+<h3>Policy Operations</h3>
+
+<p>The object model in WS-Commons/Policy becomes very handy when it comes to
+<strong>policy operation</strong>s. For instance you could invoke normalize()
+method on a policy object which will return a new policy object which has the
+same implication, but in a standard format.</p>
+
+<p>If you merge a policy object with another policy object it will return a
+new policy object which represents the merged policies of those two objects.
+If you could satisfy any policy alternative available in the resultant
+object, it is guaranteed that at least one policy alternative of both policy
+objects could be met.</p>
+
+<p>One interesting application of policies would be to identify which policy
+alternatives that both parties can agree upon. The simple solution is to
+intersect the two policy objects and get the resultant policy object. It
+would contain all possible policy alternatives that both parties agree
+upon.</p>
+
+<p>Commons/Policy framework is now reaching its maturity. It is used in other
+web services projects like Axis2, Sandehsa2 and WSS4J to process any policy
+information they require. Recently it passed all the WS Policy Interop Round1
+which is aimed to test the correctness of object model. And it seems safe to
+say that bright future is ahead.</p>
+
+<p>You can learn how to use Apache WS-Policy by checking out our <a href="userguide.html" target="_blank">User's Guide</a>
+</p>
+
+<h2>Key Features</h2>
+<ol>
+  <li>Fully compliant with latest WS-Policy Specification</li>
+  <li>Passes WS-Policy Interop ROUND1 Test Suite</li>
+</ol>
+
+<h2>Resources</h2>
+<ul>
+  <li><a
+    href="https://svn.apache.org/repos/asf/webservices/commons/modules/policy/" target="_blank">ws-commons/policy</a></li>
+  <li><a href="http://specs.xmlsoap.org/ws/2004/09/policy/ws-policy.pdf" target="_blank">Web
+    Services Policy Framework (WS-Policy)</a></li>
+  <li>Samaranayake, Sanka. January 2006. <a
+    href="http://www.wso2.net/2006/01/web_services_policy_why_what_how" target="_blank">Web
+    services Policy - Why, What &amp; How.</a></li>
+</ul>
+<!--Remove when docs are published on site-->
+<a name="mailing"></a>
+<h2>Mailing List</h2>
+
+<p>Developer List- <a
+href="mailto:commons-dev-subscribe@ws.apache.org?subject=subscribe">Subscribe</a>
+| <a
+href="mailto:commons-dev-unsubscribe@ws.apache.org?subject=unsubscribe">Unsubscribe</a></p>
+
+<p>Once subscribed to the developer mailing list you can send your feedback
+to : <a href="mailto:commons-dev@ws.apache.org?subject=[WS-Policy]">commons-dev@ws.apache.org</a>
+(Prefix the subject with [Policy])</p>
+	
+	</section>
+	
+	</body>
+</document>

Added: webservices/commons/modules/policy/xdocs/navigation.xml
URL: http://svn.apache.org/viewcvs/webservices/commons/modules/policy/xdocs/navigation.xml?rev=385423&view=auto
==============================================================================
--- webservices/commons/modules/policy/xdocs/navigation.xml (added)
+++ webservices/commons/modules/policy/xdocs/navigation.xml Sun Mar 12 20:50:50 2006
@@ -0,0 +1,21 @@
+<project name="WS-Policy">
+	<title>Web Services Commons : WS-Policy implemenation</title>
+	<body>
+		<menu name="WS-Policy">
+			<item name="Home" href="index.html"/>
+			<item nane="Downloads">
+				<item name="Releases" href="download.cgi"/>
+				<item name="Source Code" href="http://svn.apache.org/repos/asf/webservices/commons/modules/policy"/>
+			</item>
+			<item>
+				<item name="User Guide" href="userGuide.html"/>
+				<item name="Javadocs" href="apidocs/index.html"/>
+			</item>
+			<item name="Project Information">
+				<item name="Mailing Lists"/>
+				<item name="Project Team"/>
+			</item>
+		</menu>
+	</body>
+	
+</project>

Added: webservices/commons/modules/policy/xdocs/userguide.xml
URL: http://svn.apache.org/viewcvs/webservices/commons/modules/policy/xdocs/userguide.xml?rev=385423&view=auto
==============================================================================
--- webservices/commons/modules/policy/xdocs/userguide.xml (added)
+++ webservices/commons/modules/policy/xdocs/userguide.xml Sun Mar 12 20:50:50 2006
@@ -0,0 +1,203 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+
+<document>
+	<properties>
+		<title>WS Policy User's Guide</title>
+	</properties>
+	
+	<head>
+		<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
+		<meta name="generator" content="amaya 9.2.1, see http://www.w3.org/Amaya/"/>
+	</head>
+	
+	<body>
+		<section>
+			
+			<h1>Apache Web Services Policy User's Guide:</h1>
+			
+			<h4>- Version 0.90 Release</h4>
+			
+			<p>This document will instruct you how to use WS-Policy model, taking you
+step by step through the process using a simple sample.</p>
+			
+			<p>Send your feedback to: <a
+						href="mailto:commons-dev@ws.apache.org">commons-dev@ws.apache.org</a> (Prefix
+the subject with [Policy])</p>
+			<p>To subscribe to developer mailing list see <a href="index.html#mailing">here</a>
+			</p>
+			
+			<h2>Content</h2>
+			<ol>
+				<li>
+					<a href="#create">Create a policy object</a>
+					<ul>
+						<li>
+							<a href="#policydoc">Create a policy object by reading a policy document</a>
+							<ul>
+								<li>
+									<a href="#policyreader">How to create a PolicyReader</a>
+								</li>
+								<li>
+									<a href="#feedpolicydoc">Feed the policy document to PolicyReader as an
+            inputStream</a>
+								</li>
+							</ul>
+						</li>
+						<li>
+							<a href="#program">Create a policy object programmatically.</a>
+						</li>
+					</ul>
+				</li>
+				<li>
+					<a href="#write">Write a policy object</a>
+				</li>
+				<li>
+					<a href="#normalize">Normalization</a>
+				</li>
+				<li>
+					<a href="#merge">Merge policy objects</a>
+				</li>
+				<li>
+					<a href="#intersect">Intersect policy objects</a>
+				</li>
+			</ol>
+			<a name="create"></a>
+			<h2>Create a policy object</h2>
+			
+			<p>You can create a policy obejct using one of the following two methods</p>
+			<ol>
+				<li>
+					<a href="#policydoc">Create a policy object by redaing a policy document</a>
+				</li>
+				<li>
+					<a href="#program">Create a policy object programmatically</a>
+				</li>
+			</ol>
+			<a name="policydoc"></a>
+			<h3>Create a policy object by reading a policy document</h3>
+			
+			<p>The following steps need to be taken to create a policy object from a
+policy document</p>
+			<ol>
+				<li>
+					<a href="#policyreader">Create a PolicyReader</a> - This is the class that creates a policy object
+    using an InputStream.</li>
+				<li>
+					<a href="#feedpolicydoc">Feed the policy document to PolicyReader as an InputStream</a>-This will
+    return a policy object</li>
+			</ol>
+			<a name="policyreader"></a>
+			<h4>1. How to create a PolicyReader</h4>
+			
+			<p>PolicyReader is the class that creates a policy object using an
+InputStream.</p>
+			<source>
+				<pre>PolicyReader reader =
+PolicyFactory.getPolicyReader(PolicyFactory.OM_POLICY_READER);
+
+// or
+
+PolicyReader reader =
+PolicyFactory.getPolicyReader(PolicyFactory.DOM_POLICY_READER);</pre>
+			</source>
+			<a name="feedpolicydoc"></a>
+			<h4>2. Feed the policy document to PolicyReader as an InputStream.</h4>
+			
+			<p>This step will return a policy object.</p>
+			<source>
+				<pre>String pathToPolicyFile = " /home/ ../Policy1.xml";
+
+FileInputStream fis = new FileInputStream(pathToPolicyFile);
+
+Policy policy = reader.readPolicy(fis);</pre>
+			</source>
+			<a name="program"></a>
+			<h3>Create a policy object programmatically.</h3>
+			<a name="policy"></a>
+			<p>Lets consider the sample policy below.</p>
+			<source>
+				<pre>&lt;wsp:Policy&gt;
+   &lt;wsp:ExactlyOne&gt; // Corresponds to XorCompositeAssertion
+   &lt;wsp:All&gt; // Corresponds to AndCompositeAssertion
+     &lt;ns1:TestAssertion&gt;
+     TestAssertion1
+     &lt;/ns:TestAssertion&gt;
+   &lt;/wsp:All&gt;
+   &lt;/wsp:ExactlyOne&gt;
+&lt;/wsp:Policy&gt;</pre>
+			</source>
+			<p>Now lets create programmatically the policy object which represents the
+above policy</p>
+			<source>
+				<pre>Policy p = new Policy(); // will give you the following element
+
+&lt;wsp:Policy&gt; &lt;/wsp:Policy&gt;
+
+XorCompositeAssertion x1 = new XorCompositeAssertion();
+p.addTerm(x1); //will give you XorCompositeAssertion as seen below
+
+&lt;wsp:Policy&gt;
+&lt;wsp:ExactlyOne&gt;....&lt;/wsp:ExactlyOne&gt;
+&lt;/wsp:Policy&gt;
+
+AndCompositeAssertion a1 = new AndCompositeAssertion();
+x1.addTerm(a1);// will give you AndCompositeAssertion as seen below
+
+&lt;wsp:Policy&gt;
+&lt;wsp:ExactlyOne&gt;
+&lt;wsp:All&gt;...&lt;/wsp:All&gt;
+&lt;/wsp:ExactlyOne&gt;
+&lt;/wsp:Policy&gt;
+
+QName name = new QName("Test", "http://tests.org/tests", "ns1");
+PrimitiveAssertion prim1 = new PrimitiveAssertion(name);
+prim1.setStrValue("MyTestAssertion");
+a1.addTerm(prim1); //will give you the <a href="#policy">complete policy</a>
+				</pre>
+			</source>
+			<a name="write"></a>
+			<h2>Write a policy object</h2>
+			<p>The following code will achieve this task</p>
+			<source>
+				<pre>String pathToOutFile = "/home/... /Policy2.xml";
+
+FileOutputStream fos = new FileOutputStream(pathToOutFile);
+
+PolicyWriter writer =
+PolicyFactory.getPolicyWriter(PolicyFactory.StAX_POLICY_WRITER);
+
+writer.writePolicy(policy, fos );</pre>
+			</source>
+			<a name="normalize"></a>
+			<h2>Normalization</h2>
+			<p>The following code will achieve policy normalization</p>
+			<source>
+				<pre>Policy policy1 = reader.readPolicy(...);
+
+Policy normalized = (Policy) policy1.normalize();</pre>
+			</source>
+			<a name="merge"></a>
+			<h2>Merge policy objects</h2>
+			<p>The following code will merge two policy objects</p>
+			<source>
+				<pre>Policy policy1 = reader.readPolicy(...);
+
+Policy policy2 = reader.readPolicy(...);
+
+Policy merged = (Policy) policy1.merge(policy2);</pre>
+			</source>
+			<a name="intersect"></a>
+			<h2>Intersect policy objects</h2>
+			<p>The following code will intersect two policy objects</p>
+			<source>
+				<pre>Policy policy1 = reader.readPolicy(..)
+
+Policy policy2 = reader.readPolicy(..)
+
+Policy intersected = (Policy) policy1.intersect(policy2);</pre>
+			</source>
+		</section>
+	
+	</body>
+
+</document>