<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Wazi &#187; Features</title>
	<atom:link href="http://olex.openlogic.com/wazi/category/features/feed/" rel="self" type="application/rss+xml" />
	<link>http://olex.openlogic.com/wazi</link>
	<description>Thinking OPEN</description>
	<lastBuildDate>Fri, 19 Mar 2010 03:29:34 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Securing SSL/TLS with Secure Renegotiation</title>
		<link>http://olex.openlogic.com/wazi/2010/ssl-tls-secure-renegotiation/</link>
		<comments>http://olex.openlogic.com/wazi/2010/ssl-tls-secure-renegotiation/#comments</comments>
		<pubDate>Fri, 05 Mar 2010 21:55:48 +0000</pubDate>
		<dc:creator>Joe Backo</dc:creator>
				<category><![CDATA[Features]]></category>
		<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[openssl]]></category>

		<guid isPermaLink="false">http://olex.openlogic.com/wazi/?p=52319</guid>
		<description><![CDATA[A recently-exposed a flaw in the current standard for the SSL/TLS protocol allows "man-in-the-middle" attacks, but fortunately there's an interim fix included in OpenSSL release 0.9.8l.  This article describes the solution and provides links to additional resources.]]></description>
			<content:encoded><![CDATA[<p>In November of this year an energetic software engineer exposed a flaw in the current standard for the SSL/TLS protocol.  This flaw impacted all implementations of SSL/TLS.  Since SSL/TLS is used throughout the web in everything from electronic commerce to online banking, recent reports of the flaw have prompted questions about a patch or fix in popular SSL/TLS implementations such as <a href="https://olex.openlogic.com/packages/openssl">OpenSSL</a>. The vulnerability works in such a way as to allow what is known as a &#8220;man-in-the-middle&#8221; attack to be conducted with the possibility of exposing account information including passwords. As one can imagine, this sort of security exploit and its potential ramifications has a far-reaching impact &ndash; particularly on enterprises that use open source software in production systems.</p>
<p>An interim fix has been posted that takes the drastic step of simply shutting off all SSL/TLS renegotiation.  This bulk approach is not ideal for many enterprises, as it removes a feature that is often required to use their sites effectively.  The code for this interim fix is included in OpenSSL release 0.9.8l.  The more effective fix, and one that was recently approved by the IETF Security Working Group, is included in OpenSSL 0.9.8m, released on February 25th, 2010. The fix changes OpenSSL&#8217;s default behavior to use secure renegotiation unless overridden.  Previous versions of OpenSSL used the opposite default, requiring secure negotiation to be turned on manually. This change should address the problem for the majority of OpenSSL users. However, by changing the default behavior, users of OpenSSL who had already been using more complex negotiation schemes may need to update their settings.</p>
<p>A future version (2.2.15) of the <a href="https://olex.openlogic.com/packages/apache">Apache Httpd web server</a> will incorporate flags that can be used to tune the SSL/TLS renegotiation feature. This code has not been released at this time.</p>
<h3>Additional Resources</h3>
<p>More specific information and code can be obtained through the resources listed below.</p>
<ul>
<li><a href="https://olex.openlogic.com/packages/openssl">https://olex.openlogic.com/packages/openssl</a></li>
<li><a href="http://www.openssl.org/" target="_blank">http://www.openssl.org/</a></li>
<li><a href="http://www.ietf.org/mail-archive/web/tls/current/msg05563.html" target="_blank">http://www.ietf.org/mail-archive/web/tls/current/msg05563.html</a></li>
<li><a href="http://www.phonefactor.com/sslgap/ssl-tls-authentication-patches" target="_blank">http://www.phonefactor.com/sslgap/ssl-tls-authentication-patches</a></li>
<li><a href="http://www.computer.org/portal/web/computingnow/0110/whatsnew/internetcomputing" target="_blank">http://www.computer.org/portal/web/computingnow/0110/whatsnew/internetcomputing</a></li>
<li><a href="http://extendedsubset.com" target="_blank">http://extendedsubset.com/</a></li>
<li><a href="http://blogs.sun.com/security/entry/vulnerability_in_tls_protocol_during" target="_blank">http://blogs.sun.com/security/entry/vulnerability_in_tls_protocol_during</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://olex.openlogic.com/wazi/2010/ssl-tls-secure-renegotiation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting Started with Java EE 6</title>
		<link>http://olex.openlogic.com/wazi/2010/get-started-with-jee6/</link>
		<comments>http://olex.openlogic.com/wazi/2010/get-started-with-jee6/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 20:04:54 +0000</pubDate>
		<dc:creator>Mert</dc:creator>
				<category><![CDATA[Features]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[glassfish]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[jsf]]></category>
		<category><![CDATA[Maven]]></category>
		<category><![CDATA[NetBeans]]></category>
		<category><![CDATA[YUI]]></category>

		<guid isPermaLink="false">http://olex.openlogic.com/wazi/?p=49634</guid>
		<description><![CDATA[Java EE 6 is hot, new, and pretty darn cool. In this tutorial we’ll update you on the world of Java EE 6 with the help of a Twitter-like demo application that contains JSF 2.0, PrimeFaces, CDI and Weld as well as Hibernate Validator frameworks.]]></description>
			<content:encoded><![CDATA[<p>In this tutorial we&#8217;ll update you on the world of Java EE 6 with the help of a Twitter-like demo application we&#8217;ve code-named <a title="wallfriend code.google" href="http://code.google.com/p/wallfriend/" target="_blank">wallfriend</a>. The demo application contains <a href="https://olex.openlogic.com/packages/jsf" target="_blank">JSF</a> 2.0, PrimeFaces, CDI and Weld as well as Hibernate Validator frameworks.</p>
<h3>Before You Start</h3>
<p>Our tutorial assumes that you&#8217;re familiar with the following technologies:</p>
<ul>
<li>JavaServer Faces (JSF) and Facelets</li>
<li>Dependency Injection Mechanism</li>
<li>Bean Validation</li>
</ul>
<p>You&#8217;ll also need to install the following applications in order to build the demo application from scratch, or to run it on your local machine:</p>
<ul>
<li>Java 6 (Java SDK 1.6) or greater</li>
<li><a href="https://olex.openlogic.com/packages/netbeans" target="_blank">NetBeans</a> 6.8 bundled with <a href="https://olex.openlogic.com/packages/glassfish" target="_blank">GlassFish</a> 3</li>
<li><a href="https://olex.openlogic.com/packages/maven" target="_blank">Maven</a>, preferably the latest version 2.2.1 (Netbeans ships with Maven 3.0-SNAPSHOT, so that can also be used)</li>
</ul>
<h3>Meat &amp; Potatoes</h3>
<h4>What&#8217;s New with Java EE 6?</h4>
<p><a title="JSR-316" href="http://jcp.org/en/jsr/detail?id=316" target="_blank">Java EE 6</a> specification was finalized in December of 2009, bringing new and updated features to the world of enterprise application development. It introduces the <em>profile approach</em>, meant to focus both developers and applications on particular parts of the Java EE 6 platform. The first profile defined by the expert group is the Java EE 6 web profile, which attempts to specify the minimal configuration targeted for the development of typical web applications. Here are the elements of the web profile, with a few that we&#8217;ve chosen to explain in detail.</p>
<ol>
<li>Servlet 3.0<br />
In web frameworks, servlets are used as an entry point to handle all incoming requests, so it could be said that they are the core elements of web-based applications. The new 3.0 version (specification <a title="JSR 315" href="http://jcp.org/en/jsr/detail?id=315" target="_blank">JSR-315</a>) offers innovative features like ease of development with annotations (@Servlet, @ServletFilter, @ServletContextListener) and annotations for restful services like @GET, @POST and more. It also offers pluggability and extensibility. The main aim here is to attain zero-configuration when working with other frameworks and libraries. Toward this end, a  new xml tag definition called &lt;web-fragment&gt; can be used to apply this feature. The web fragments, which are to be stored inside the jars of their respective libraries, will be merged by the container &#8212; so there&#8217;s no need for the developer to set up any configurations on the web descriptor file. Speaking of pluggability and extensibility, Servlet 3.0 also has a new application programming interface (API) which can be used to add servlets and filters with coding.</li>
<li>JavaServer Pages (JSP) 2.2</li>
<li>ExpressionLanguage (EL) 2.2</li>
<li>Debugging Support for Other Languages (JSR-45) 1.0</li>
<li>Standard Tag Library for JavaServer Pages (JSTL) 1.2</li>
<li>JavaServer Faces (JSF) 2.0<br />
Ever since  the release of JSF&#8217;s 1.X version, its aim was to be <em>the</em> go-to framework for building user interfaces and web applications. As it gained popularity with many application developers around the world, there was a growing awareness of terrific features like componenting, validation, navigation, i18n and others. However, as with so many wonderful things, flaws and disadvantages became more evident over time &#8212; like how complicated it could be to accomplish even a simple task such as creating your own custom JSF component. JSF version 2.0 aims to remedy these flaws by simplifying and easing development and introducing new features, like built-in Ajax support, which will make standard some of what have until now been third party solutions. Here&#8217;s a quick summary of the improvements that are part of JSF 2.0.</p>
<ul>
<li>Composite components<br />
Implementing custom JSF components in 1.x is a real burden. You have to implement a UI component and Tag class, with the option of a Renderer for the markup, and then configure all these within faces-config and tld files. JSF 2.0 simplifies the procedure with the composite component approach introduced in Facelets.</li>
<li>Native Ajax Support<br />
JSF 2.0 provides built-in support for Ajax with its API and infrastructure.  A good example of the useful new components is f:ajax.</li>
<li>State Saving<br />
Since JSF 2.0 aims to handle requests partially with classes like PartialViewContext and PartialStateHolder (among others), it also attempts to make use of a partial mechanism to handle state saving. This has been implemented before, by Apache Trinidad, but PartialStateHolder and StateHelper classes provide a more elegant solution. The goal is to have a lightweight version of the saved state going back and forth in response to requests.</li>
<li>Scopes<br />
In addition to the request, session and application scopes, 2.0 also introduces view and flash scopes. View-scoped beans have a life span that is longer than a request, but shorter than session-scoped beans. Flash scopes are like the view scopes that will live on a specified view, including the redirects, and will be removed if you’re moving another view.</li>
<li>Navigation<br />
In JSF 1.x every navigation rule should be added to faces-config.xml. With version 2.0 implicit navigation can also be used, as in whether or not an outcome corresponds to a view I.D. It&#8217;s also possible to perform conditional navigations on a navigation-case. The new tag &lt;if&gt; can be used in faces-config, with an el snippet for conditional navigation. Version 2.0 also makes it easy to retrieve view parameters and assign them to a given property, which in turn makes handling the parameters for GET requests easy. Two new components (h:link and h:button) also support the integration of view parameters. The key benefit of using these components will be bookmarkable URLs.</li>
<li>Configuration with Annotations<br />
With JSF 2.0 you can annotate your managed beans with the new @ManagedBean annotation, and you can specify the scope for your beans with @RequestScoped, @SessionScoped, @ViewScoped, @NoneScoped and more. Instead of those, we&#8217;ve chosen to use  CDI and Weld annotations.</li>
</ul>
</li>
<li>Common Annotations for Java Platform (JSR-250) 1.1</li>
<li>Enterprise JavaBeans (EJB) 3.1 Lite</li>
<li>Java Transaction API (JTA) 1.1</li>
<li>Java Persistence API (JPA) 2.0<br />
In our opinion, the  main highlights of this release are the API for criteria queries and the support for validation. There are also some fancy new features like extended map support and ordered list mappings.</li>
</ol>
<h4>Java EE 6 Containers</h4>
<p>There are currently two application servers that are compatible with the implementation of Java EE 6: <a title="GlassFish v3 Java EE 6 Certified App Server" href="http://www.sun.com/software/products/glassfishv3" target="_blank">GlassFish Enterprise Server v3</a> and <a title="TMAX JEUS 7 Java EE 6 Certified App Server" href="http://www.tmax.co.kr/tmax_en/jeus" target="_blank">TMAX JEUS 7</a>. We’ve chosen to stick with GlassFish v3.</p>
<h4>So &#8211; What&#8217;s Up with PrimeFaces?</h4>
<p>PrimeFaces is an open source JSF component suite that bundles over 70 components with built-in Ajax support. It’s based on the <a href="https://olex.openlogic.com/packages/yui" target="_blank">YUI</a> and <a href="https://olex.openlogic.com/packages/jquery" target="_blank">jQuery</a> javascripting libraries. It has a simple, lightweight design that is fully compatible with other JSF component libraries. PrimeFaces also supports Ajax Push with a Comet framework, and it has a mobile UI kit known as TouchFaces. Currently, PrimeFaces supports JSF 2.0 with its 2.0.0.RC and 2.0.0-SNAPSHOT releases.</p>
<p>The ability of Java EE 6 to merge web.xml fragments that originate from third-party frameworks makes it unnecessary (in the context of Java EE 6) to do servlet and mapping configurations for PrimeFaces. Primefaces ships with its own web-fragment.xml.</p>
<p>For more information, visit <a title="PrimeFaces - JSF Component Library" href="http://www.primefaces.org" target="_blank">www.primefaces.org</a>.</p>
<h4>Contexts and Dependency Injection (CDI)</h4>
<p>As stated in Java Specification Request <a title="JSR 299" href="//jcp.org/en/jsr/summary?id=299" target="_blank">JSR-299</a>, the purpose of this specification is to unify the JSF-managed bean component model with the EJB component model, resulting in a significantly simplified programming model for web-based applications. CDI also makes it possible for JEE elements to interact with each other using the observer pattern, making it a lot easier to work with enterprise beans and transactional support, among other things.</p>
<h4>Dependency Injection For Java</h4>
<p><a title="JSR-330" href="http://jcp.org/en/jsr/summary?id=330" target="_blank">JSR 330</a> is also a part of Java EE 6, offering a set of standard annotations that can be used for dependency injection. In our demo application we&#8217;ll use some of these annotations, such as @Named, @Inject, @Qualifier and others.</p>
<h4>WELD</h4>
<p>Weld is the reference implementation of JSR-299, which is abbreviated as CDI.  Weld provides a complete SPI, allowing Java EE containers to use Weld as their built-in CDI implementation. GlassFish 3 (which  we’ll use in our demo) ships with Weld.</p>
<h4>Bean Validation and Hibernate Validator</h4>
<p>The Bean Validation, <a title="JSR-303" href="http://jcp.org/en/jsr/detail?id=303" target="_blank">JSR 303</a>, defines a metadata model and an API for JavaBean validation. The Hibernate Validator is the reference implementation for this specification request. Hibernate Validator&#8217;s latest version adds some nice features &#8212; things like validation grouping, native integration with JPA v.2 and JSF v.2, an extended annotation set and more.</p>
<h4>WallFriend, The Demo APP</h4>
<p>Let’s start by creating the project. We’ll do it using the Maven archetype command. It has an interactive mode, so see below for the user input data (in bold).</p>
<blockquote>
<pre><strong>mvn archetype:generate -DarchetypeCatalog=http://anonsvn.jboss.org
   /repos/weld/archetypes/tags/1.0.0-BETA1</strong></pre>
</blockquote>
<blockquote>
<pre>DEV$ mvn archetype:generate -DarchetypeCatalog=http://anonsvn.jboss.org
   /repos/weld/archetypes/tags/1.0.0-BETA1
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'archetype'.
[INFO] ------------------------------------------------------------------
[INFO] Building Maven Default Project
[INFO]    task-segment: [archetype:generate] (aggregator-style)
[INFO] ------------------------------------------------------------------
[INFO] Preparing archetype:generate
[INFO] No goals needed for project - skipping
[INFO] Setting property: classpath.resource.loader.class =&gt;
'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'.
[INFO] Setting property: velocimacro.messages.on =&gt; 'false'.
[INFO] Setting property: resource.loader =&gt; 'classpath'.
[INFO] Setting property: resource.manager.logwhenfound =&gt; 'false'.
[INFO] [archetype:generate]
[INFO] Generating project in Interactive mode
[INFO] No archetype defined. Using maven-archetype-quickstart
(org.apache.maven.archetypes:maven-archetype-quickstart:1.0)
Choose archetype:
1: remote -&gt; weld-jsf-servlet-minimal (Weld archetype for creating an
application using JSF 2.0 and CDI 1.0 for Servlet Containers
(Tomcat 6 / Jetty 6))
2: remote -&gt; weld-jsf-jee-minimal (Weld archetype for creating a minimal
Java EE 6 application using JSF 2.0, CDI 1.0 and EJB 3.1 (persistence unit
not included))
3: remote -&gt; weld-jsf-jee (Weld archetype for creating a Java EE 6
application using JSF 2.0, CDI 1.0, EJB 3.1 and JPA 2.0 (persistence
unit included))
Choose a number:  (1/2/3): 2

Here enter 2, for weld-jsf-jee-minimal. And then specify the
groupId-artifactId-packaging for the project.

Define value for groupId: : <strong>com.openlogic.wazi</strong>
Define value for artifactId: : <strong>wallfriend</strong>
Define value for package: : <strong>war</strong>
Confirm properties configuration:
version: 1.0.0-SNAPSHOT
groupId: com.openlogic.wazi
artifactId: wallfriend
package: war
 Y: : <strong>Y</strong>
[INFO] -------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] -------------------------------------------------------------------
[INFO] Total time: 19 seconds
[INFO] Finished at: Tue Jan 12 21:58:35 EET 2010 [INFO]
Final Memory: 12M/79M [INFO]
-------------------------------------------------------------------</pre>
</blockquote>
<p>Since this is an archetype project, we can immediately run it from the command line with Maven on an embedded GlassFish:</p>
<blockquote>
<pre>DEV$ <strong>mvn package embedded-glassfish:run</strong>
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'embedded-glassfish'.
[INFO] org.apache.maven.plugins: checking for updates from glassfish
[INFO] org.codehaus.mojo: checking for updates from glassfish
[INFO] -------------------------------------------------------------------
[INFO] Building wallfriend
[INFO]    task-segment: [package, embedded-glassfish:run]
[INFO] -------------------------------------------------------------------
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] Compiling 1 source file to /DEV/wallfriend/target/classes
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:testCompile]
[INFO] Compiling 1 source file to /DEV/wallfriend/target/test-classes
[INFO] [surefire:test]
[INFO] Surefire report directory: /DEV/wallfriend/target/surefire-reports

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running TestSuite
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.369 sec

Results :

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0

[INFO] [war:war]
[INFO] Packaging webapp
[INFO] Assembling webapp[wallfriend] in [/DEV/wallfriend/target/wallfriend]
[INFO] Processing war project
[INFO] Webapp assembled in[162 msecs]
[INFO] Building war: /DEV/wallfriend/target/wallfriend.war
[INFO] [embedded-glassfish:run]
[WARNING] Attempting to build MavenProject instance for Artifact
(org.codehaus.mojo:jboss-maven-plugin:3.0) of type: maven-plugin;
constructing POM artifact instead.
Downloading: http://repository.jboss.org/maven2/org/codehaus/mojo
/jboss-maven-plugin/3.0/jboss-maven-plugin-3.0.pom
Downloading: http://repo1.maven.org/maven2/org/codehaus/mojo
/jboss-maven-plugin/3.0/jboss-maven-plugin-3.0.pom
[WARNING] Attempting to build MavenProject instance for Artifact
(org.apache.maven.plugins:maven-eclipse-plugin:3.0)  of type:
maven-plugin; constructing POM artifact instead.
Downloading: http://repository.jboss.org/maven2/org/apache/maven
/plugins/maven-eclipse-plugin/3.0/maven-eclipse-plugin-3.0.pom
Downloading: http://repo1.maven.org/maven2/org/apache/maven
/plugins/maven-eclipse-plugin/3.0/maven-eclipse-plugin-3.0.pom
Jan 13, 2010 10:36:39 PM com.sun.enterprise.v3.server.AppServerStartup run
INFO: GlassFish v3 (74.2) startup time : Embedded(1228ms)
startup services(1317ms) total(2545ms)
Jan 13, 2010 10:36:39 PM com.sun.enterprise.transaction
.JavaEETransactionManagerSimplified initDelegates
INFO: Using com.sun.enterprise.transaction.jts
.JavaEETransactionManagerJTSDelegate as the delegate
Jan 13, 2010 10:36:40 PM org.glassfish.admin.mbeanserver
.JMXStartupService$JMXConnectorsStarterThread run
INFO: JMXStartupService: JMXConnector system is disabled, skipping.
Jan 13, 2010 10:36:40 PM AppServerStartup run
INFO: [Thread[GlassFish Kernel Main Thread,5,main]] started
Jan 13, 2010 10:36:40 PM org.hibernate.validator.util.Version
INFO: Hibernate Validator null
Jan 13, 2010 10:36:40 PM org.hibernate.validator.engine.resolver
.DefaultTraversableResolver detectJPA
INFO: Instantiated an instance of org.hibernate.validator.engine.resolver
.JPATraversableResolver.
Jan 13, 2010 10:36:41 PM com.sun.enterprise.v3.services.impl
.GrizzlyProxy$2$1 onReady
INFO: Grizzly Framework 1.9.18-k started in: 434ms listening on port 7070
Jan 13, 2010 10:36:58 PM com.sun.common.util.logging
.LoggingConfigImpl openPropFile
INFO: Cannot read logging.properties file.
Jan 13, 2010 10:36:58 PM com.sun.enterprise.web.WebContainer
createHttpListener
INFO: Created HTTP listener embedded-listener on port 7070
Jan 13, 2010 10:36:58 PM com.sun.enterprise.web.WebContainer
configureHttpServiceProperties
WARNING: pewebcontainer.invalid_http_service_property
Jan 13, 2010 10:36:59 PM com.sun.enterprise.web.WebContainer createHosts
INFO: Created virtual server server
Jan 13, 2010 10:36:59 PM com.sun.enterprise.web.WebContainer
loadSystemDefaultWebModules
INFO: Virtual server server loaded system default web module
^[[BJan 13, 2010 10:37:08 PM com.sun.enterprise.security.SecurityLifecycle
INFO: security.secmgroff
Jan 13, 2010 10:37:09 PM com.sun.enterprise.security.ssl.SSLUtils
checkCertificateDates
SEVERE: java_security.expired_certificate
Jan 13, 2010 10:37:09 PM com.sun.enterprise.security.SecurityLifecycle
onInitialization
INFO: Security startup service called
Jan 13, 2010 10:37:09 PM com.sun.enterprise.security.PolicyLoader
loadPolicy
INFO: policy.loading
Jan 13, 2010 10:37:09 PM com.sun.enterprise.security.auth.realm.Realm
doInstantiate
INFO: Realm admin-realm of classtype com.sun.enterprise.security.auth
.realm.file.FileRealm successfully created.
Jan 13, 2010 10:37:09 PM com.sun.enterprise.security.auth.realm.Realm
doInstantiate
INFO: Realm file of classtype com.sun.enterprise.security.auth.realm.file
.FileRealm successfully created.
Jan 13, 2010 10:37:09 PM com.sun.enterprise.security.auth.realm.Realm
doInstantiate
INFO: Realm certificate of classtype com.sun.enterprise.security.auth
.realm.certificate.CertificateRealm successfully created.
Jan 13, 2010 10:37:09 PM com.sun.enterprise.security.SecurityLifecycle
onInitialization
INFO: Security service(s) started successfully....
classLoader = WebappClassLoader (delegate=true; repositories=WEB-INF/classes/)
SharedSecrets.getJavaNetAccess()=java.net.URLClassLoader$7@2d205042
Jan 13, 2010 10:37:09 PM org.jboss.weld.bootstrap.WeldBootstrap
INFO: WELD-000900 SNAPSHOT
Jan 13, 2010 10:37:09 PM org.hibernate.validator.engine.resolver
.DefaultTraversableResolver detectJPA
INFO: Instantiated an instance of org.hibernate.validator.engine
.resolver.JPATraversableResolver.
nullID: /DEV/wallfriend/gfembed6764346819525137279tmp/applications
/wallfriend/ CLASSES: [class war.HelloWorld]

Jan 13, 2010 10:37:10 PM com.sun.faces.config.ConfigureListener
contextInitialized
INFO: Initializing Mojarra 2.0.2 (FCS b10) for context '/wallfriend'
Jan 13, 2010 10:37:14 PM com.sun.enterprise.web.WebApplication start
INFO: Loading application wallfriend at /wallfriend
Hit ENTER to redeploy, X to exit</pre>
</blockquote>
<p>Once you see the line <em>Hit ENTER to redeploy, X to exit, </em>make a request for <a title="wallfriend" href="http://localhost:7070/wallfriend" target="_blank">http://localhost:7070/wallfriend</a> on your browser. You should get a first look at the archetype application like the one below:</p>
<p><img src="http://wallfriend.googlecode.com/svn/trunk/images/wallfriend_firstlook.jpg" alt="WallFriend - FirstLook" width="600" height="400" /></p>
<p>Now, let’s open the project inside NetBeans 6.8. Open NetBeans and click <em>File</em> &gt;<em> New Project</em> and then select <em>Maven</em> / <em>Maven Project with Existing POM</em> from the resulting wizard. This should put the Open Project menu on your screen. Select wallfriend from here and you should see the project in the projects tab:</p>
<p><img src="http://wallfriend.googlecode.com/svn/trunk/images/wallfriend_netbeans.jpg" alt="WallFriend - NetBeans" /></p>
<p>To run wallfriend inside NetBeans 6.8, you need to make sure that you have Java 1.6 defined as a Java platform, and be sure that wallfriend is also using it. Also, from the Tools &gt; Servers menu, you need to define the Java 1.6 executable for your GlassFish. Netbeans also comes with a Maven 3.0-SNAPSHOT version. So, if you want to use your own external Maven, you must declare it to the IDE from <em>Preferences</em> &gt; <em>Miscellaneous</em> &gt; <em>Maven</em>. After configuring it all, just make a request for <a title="wallfriend" href="http://localhost:8080/wallfriend" target="_blank">http://localhost:8080/wallfriend</a> on your browser. You should see the very same page as you did when you ran the project with the embedded GlassFish.</p>
<h4>Adding PrimeFaces to the Project</h4>
<p>In order to use the JSF components of PrimeFaces, we first have to add the repo and dependency definitions to the pom.xml of the project. Go ahead and open Project Files &gt; pom.xml in NetBeans and add the following snippets, respectively:</p>
<blockquote>
<pre>&lt;repository&gt;
    &lt;id&gt;prime-repo&lt;/id&gt;
    &lt;name&gt;Prime Technology Maven Repository&lt;/name&gt;
    &lt;url&gt;http://repository.prime.com.tr&lt;/url&gt;
    &lt;layout&gt;default&lt;/layout&gt;
&lt;/repository&gt;

&lt;dependency&gt;
    &lt;groupId&gt;org.primefaces&lt;/groupId&gt;
    &lt;artifactId&gt;primefaces&lt;/artifactId&gt;
    &lt;version&gt;2.0.0-SNAPSHOT&lt;/version&gt;
&lt;/dependency&gt;</pre>
</blockquote>
<p>Now namespace can be added inside the xhtml’s files for PrimeFaces, xmlns:p=&#8221;http://primefaces.prime.com.tr/ui&#8221;. As mentioned above, there is no configuration needed in web.xml since PrimeFaces ships with its own web fragment.</p>
<p><strong>Wallfriend – The Implementation</strong></p>
<p>As we said before, <a title="wallfriend code.google" href="http://code.google.com/p/wallfriend/" target="_blank">wallfriend</a> is a simple write-to-wall application with a basic domain, managed beans, and some xhtml pages. You can check out the source from the Google Code project at <a title="wallfriend source" href="http://wallfriend.googlecode.com/svn/trunk/wallfriend" target="_blank">http://wallfriend.googlecode.com/svn/trunk/wallfriend</a>. A <em>follow the wall</em> mechanism as well as a <em>restful expose of the wall</em> will be added to the project in the near future.</p>
<p>Since the application was not created from scratch, we have some clean-up to do on the archetype-created application. Go ahead and delete the following folders, because they won’t be used:</p>
<ul>
<li>Web Pages/WEB-INF/templates</li>
<li>Web Pages/resources</li>
<li>Source Packages / war</li>
<li>Test packages / war</li>
</ul>
<p>Now let’s go through the parts of the project: <strong>The Model</strong>, <strong>The Managed Beans</strong>, and <strong>The Views</strong>.</p>
<p><strong>The Model</strong></p>
<p>For the domain, we have 3 classes: Wall, Brick and WallFriendContext. Wall and Brick are for defining a master-detail relationship between the posts and the wall. WallFriendContext is the application-scoped bean for storing created walls. It&#8217;s marked with the javax.enterprise.context.ApplicationScoped bean.</p>
<p><span style="text-decoration: underline">Wall.java</span></p>
<blockquote>
<pre>package com.openlogic.wazi.beans;

import java.util.LinkedList;
import java.util.List;

public class Wall {

    String wallName;

    List bricks = new LinkedList();

    public Wall(String wallName) {
        this.wallName = wallName;
    }

    public void addBrick(String graffiti) {
        bricks.add(0, new Brick(graffiti));
    }

    public String getWallName() {
        return wallName;
    }

    public List getBricks() {
        return bricks;
    }
}</pre>
</blockquote>
<p><span style="text-decoration: underline">Brick.java</span></p>
<blockquote>
<pre>package com.openlogic.wazi.beans;

import java.util.Date;

public class Brick {

    private String graffiti;
    private Date publishDate;

    public Brick(String graffiti) {
        this.graffiti = graffiti;
        this.publishDate = new Date();
    }

    public void init() {
    }

    public String getGraffiti() {
        return graffiti;
    }

    public void setGraffiti(String graffiti) {
        this.graffiti = graffiti;
    }

    public Date getPublishDate() {
        return publishDate;
    }

    public void setPublishDate(Date publishDate) {
        this.publishDate = publishDate;
    }
}</pre>
</blockquote>
<p><span style="text-decoration: underline">WallFriendContext.java</span></p>
<blockquote>
<pre>package com.openlogic.wazi.beans;

import java.util.HashMap;
import java.util.Map;
import javax.enterprise.context.ApplicationScoped;

@ApplicationScoped
public class WallFriendContext {

    private Map walls = new HashMap();

    public void addWall(Wall wall) {
        walls.put(wall.getWallName(), wall);
    }

    public Map getWalls() {
        return walls;
    }
}</pre>
</blockquote>
<p><strong>The Managed Beans (a.k.a. Contextual Beans)</strong></p>
<p>The managed bean classes are defined by the CDI and implemented by Weld, which ships with the GlassFish server. CDI also needs an empty beans.xml file under the WEB-INF folder, since we’re going to use annotations to define our beans. That&#8217;s right &#8212; that means they can also be configured with good old fashioned XML.</p>
<p><em>LoginView</em> is the managed bean of choice for handling wall management and creation/accessing. The annotation javax.enterprise.inject.Model identifies the LoginView as a bean of the model layer, as stated in the MVC  pattern. We use javax.inject.Inject to identify injectable constructors, while methods and fields. org.hibernate.validator.constraints.NotEmpty is a validator annotation that specifies that the field wallName cannot be empty.</p>
<blockquote>
<pre>package com.openlogic.wazi.view;

import com.openlogic.wazi.beans.Wall;
import com.openlogic.wazi.beans.WallFriendContext;
import javax.enterprise.inject.Model;
import javax.faces.context.FacesContext;
import javax.inject.Inject;
import org.hibernate.validator.constraints.NotEmpty;

@Model
public class LoginView {

    @Inject
    private WallFriendContext wallFriendContext;

    @NotEmpty(message="Wall Name cannot be empty")
    private String wallName;

    public String doLogin() {
        Wall wall;
        if (wallFriendContext.getWalls().containsKey(wallName)) {
            wall = wallFriendContext.getWalls().get(wallName);
        }
        else {
            wall = new Wall(wallName);
            wallFriendContext.addWall(wall);
        }
        FacesContext.getCurrentInstance().getExternalContext()
.getRequestMap().put("wall", wall);

        return "myWall";
    }

    public String getWallName() {
        return wallName;
    }

    public void setWallName(String wallName) {
        this.wallName = wallName;
    }
}</pre>
</blockquote>
<p>MyWallView is the managed bean for handling the paint-a-graffiti on the wall action. The annotation javax.inject.Named, used here, allows you to access the bean using the bean name, with the first letter in lowercase. We use javax.annotation.PostConstruct to mark a method to be invoked after the Dependency Injection is done.</p>
<blockquote>
<pre>package com.openlogic.wazi.view;

import com.openlogic.wazi.beans.Wall;
import java.io.Serializable;
import javax.annotation.PostConstruct;
import javax.enterprise.context.SessionScoped;
import javax.faces.context.FacesContext;
import javax.inject.Named;
import org.hibernate.validator.constraints.NotEmpty;

@Named
@SessionScoped
public class MyWallView implements Serializable {

    private Wall wall;

    @PostConstruct
    public void init() {
        wall = (Wall) FacesContext.getCurrentInstance()
                  .getExternalContext().getRequestMap().get("wall");
    }

    @NotEmpty(message="Graffiti cannot be empty")
    private String graffiti;

    public String paint() {
        wall.addBrick(graffiti);
        graffiti = "";

        return null;
    }

    public Wall getWall() {
        return wall;
    }

    public void setWall(Wall wall) {
        this.wall = wall;
    }

    public String getGraffiti() {
        return graffiti;
    }

    public void setGraffiti(String graffiti) {
        this.graffiti = graffiti;
    }
}</pre>
</blockquote>
<p><strong>The Pages</strong></p>
<p>Facelets, JSF 2.0, and PrimeFaces projects are used for the development of views. JSF tags are also commonly used. One different component could be p:growl, which is for viewing the FacesMessages in a Mac-like growl. Also, there is no defined navigation-rule in the faces-config.xml file for navigating from login.xhtml to myWall.xhtml. This is with the implicit navigation mechanism that comes  with JSF 2.0. The return string of LoginView#doLogin() method matches the name of the myWall.xhtml view.</p>
<blockquote>
<pre>&lt;html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
     xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.prime.com.tr/ui"&gt;
      &lt;h:head&gt;
          &lt;title&gt;WallFriend - Java EE 6 Starter Application&lt;/title&gt;
      &lt;/h:head&gt;
      &lt;h:body&gt;
          &lt;h:form&gt;
              &lt;p:growl showDetail="true" /&gt;
              &lt;p:panel header="Access to your wall" style="width:400px"&gt;
                  &lt;h:outputLabel value="Wall Name : " for="wallname" /&gt;
                  &lt;h:inputText id="wallname" value="#{loginView.wallName}" /&gt;
                  &lt;h:commandButton value="Paint it Now, Paint it Black"
                      action="#{loginView.doLogin}" /&gt;
              &lt;/p:panel&gt;
          &lt;/h:form&gt;
      &lt;/h:body&gt;
&lt;/html&gt;</pre>
</blockquote>
<p>myWall.xhtml page renders the wall posts for a wall, and the user can also write up to the wall.</p>
<blockquote>
<pre> &lt;html xmlns="http://www.w3.org/1999/xhtml"
       xmlns:h="http://java.sun.com/jsf/html"
       xmlns:f="http://java.sun.com/jsf/core"
       xmlns:ui="http://java.sun.com/jsf/facelets"
       xmlns:p="http://primefaces.prime.com.tr/ui"&gt;
       &lt;h:head&gt;
          &lt;title&gt;WallFriend - Java EE 6 Starter Application&lt;/title&gt;
       &lt;/h:head&gt;
       &lt;h:body&gt;
          &lt;h:form&gt;
             &lt;p:growl showDetail="true" /&gt;
                &lt;p:panel header="#{myWallView.wall.wallName}'s WALL"
                    style="width:600px"&gt;
                   &lt;h:panelGrid columns="1"&gt;
                   &lt;h:panelGroup&gt;
                      &lt;h:inputTextarea value="#{myWallView.graffiti}"
                             cols="50" rows="3" /&gt;
                      &lt;h:commandButton value="Paint"
                             action="#{myWallView.paint}" /&gt;
                   &lt;/h:panelGroup&gt;
                   &lt;p:dataTable value="#{myWallView.wall.bricks}"
                            var="brick"&gt;
                      &lt;p:column&gt;
                        #{brick.graffiti}
                        &lt;br/&gt;
                        &lt;h:outputText value="#{brick.publishDate}"&gt;
                           &lt;f:convertDateTime dateStyle="default"
                              type="both" pattern="dd.MM.yyyy HH:mm:ss" /&gt;
                        &lt;/h:outputText&gt;
                     &lt;/p:column&gt;
                  &lt;/p:dataTable&gt;
               &lt;/h:panelGrid&gt;
            &lt;/p:panel&gt;
         &lt;/h:form&gt;
      &lt;/h:body&gt;
&lt;/html&gt;</pre>
</blockquote>
<h3>Finishing Up</h3>
<p>Java EE 6 is hot, new, and pretty darn cool. In our opinion, as users begin to employ it for upcoming projects, the number of blogposts, samples, and other resources will eventually increase. And with its adoption by the Java Community, we&#8217;ll for sure see more Java EE 6-compliant application servers around. Java EE 6 really eases development with its “standardized” features, and the zero-configuration approach apparent in every part of the implementation is really nice, lending an out-of-the-box feeling that&#8217;s similar to the .NET environment.  It&#8217;s not just another java framework!</p>
]]></content:encoded>
			<wfw:commentRss>http://olex.openlogic.com/wazi/2010/get-started-with-jee6/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Best Practices for Creating an Open Source Policy</title>
		<link>http://olex.openlogic.com/wazi/2009/create-open-source-policy/</link>
		<comments>http://olex.openlogic.com/wazi/2009/create-open-source-policy/#comments</comments>
		<pubDate>Wed, 25 Feb 2009 23:17:05 +0000</pubDate>
		<dc:creator>Stormy Peters</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[Features]]></category>

		<guid isPermaLink="false">http://olex.openlogic.com/wazi/?p=2288</guid>
		<description><![CDATA[Need to create an open source policy but unsure of how to get started?  You're not alone, so we compiled this handy guide chock full of best practices for open source software policy writing. Learn how to get started, what to include, and who to invite to the policy writing party.  Trust us, we've done this before.]]></description>
			<content:encoded><![CDATA[<p>Most companies using open source software know they need an open source policy policy. However, when it comes to creating a policy companies often don&#8217;t know where to start and spend months debating policy details and researching options.  This guide is intended to help you write an open source software policy. But perhaps more important, it will also help you figure out who to include in the policy creation process so that your company is likely to agree upon and use the open source software policy once it&#8217;s been written.</p>
<h3>Why do you need an open source software policy?</h3>
<p>At first many companies question the need for an open source software policy—primarily because they think it will be too difficult to create. Policy creation does require a lot of work and cooperation, but by following this guide you should be able to create and roll out an open source software policy in less than a month.</p>
<p>Some of the main benefits to having an open source software policy include:</p>
<ul>
<li><strong>Ensuring the company is in agreement about how to use open source software.</strong> Companies often start drafting an open source policy when somebody in management realizes they don&#8217;t know how much their IT department or software products depend on open source software. A clearly-stated policy can help ensure that everyone in the company is on board with your open source strategy and that employees feel like they&#8217;re empowered to use open source software where appropriate.</li>
<li><strong>Maximizing the benefit of open source software.</strong> By creating a policy, you will put processes in place that will enable employees to use open source software effectively as well as share knowledge and workload between teams. For example, three different teams won&#8217;t independently figure out how to get support for the same project, and different employees won&#8217;t independently evaluate the same upgrade. Having an open source software policy and sharing information across the enterprise will enable your company to maximize the benefits of the open source software it uses.</li>
<li><strong>Minimizing the legal, technical, and business risks of using open source software.</strong> Executive management and attorneys are often very concerned about being sued for using open source software, getting caught without sufficient technical support, or receiving bad publicity related to how open source software is used. An open source software policy can not only minimize those risks but also show concerned employees how the company is addressing those needs.</li>
</ul>
<h3>The process of writing an open source policy</h3>
<p>The key to writing an open source software policy is just to get started! Companies typically either write, approve, and adopt an open source software policy within a month, or else they spend months working on a policy and yet fail to gain company-wide approval on the finished product. By following these steps you can ensure your company has an approved and adopted policy within a few weeks:</p>
<ul>
<li>Identify key stakeholders</li>
<li>Get stakeholders to buy into the concept of a policy</li>
<li>Figure out your company&#8217;s strategy</li>
<li>Create the first draft of the policy</li>
<li>Get widespread review and acceptance, starting with your stakeholders</li>
<li>Repeat last two steps as necessary</li>
</ul>
<h3>Stakeholders</h3>
<p>Your first step—the one important to making sure that your policy is adopted—is to identify the stakeholders in your policy. There are several types, ranging from those who care desperately because you might change their ability to do their job (like developers) to those who care desperately because they think a bad policy might get them fired (like CIOs and those who report to them.) Be sure to include people who you think will disagree with your policy—better to address their disagreements upfront than to have them fight the policy because they don&#8217;t like one part of it.</p>
<p>While you&#8217;ll have to use whatever strategies work best in your organization, getting all of the stakeholders involved as soon as possible will help your policy get widely adopted more quickly. The more your stakeholders feel like it&#8217;s their policy, the better. The best case scenario is if they can say they reviewed it and feel comfortable with you (or whoever is writing the policy) taking care of the details.</p>
<p>As you put together your list of stakeholders you should consider:</p>
<ul>
<li>Developers—the people who will have to follow the policy</li>
<li>IT staff, as they probably download and use open source software</li>
<li>Managers of teams that use open source software</li>
<li>Attorneys</li>
<li>CIO and staff</li>
<li>Technical architects; many companies have architectural committees, and they should be involved</li>
</ul>
<p>You&#8217;ll probably have two groups of stakeholders: the key stakeholders who will need to approve the policy, and the people who will be affected by the policy.</p>
<h3>Strategy</h3>
<p>An open source software policy is meant to help your company&#8217;s strategy—both its general strategy and its open source strategy.</p>
<p>For example, you might see open source software as a way to reduce your IT costs. In this case your strategy should not be to &#8220;use as much open source software as possible,&#8221; but rather to &#8220;reduce IT costs by using open source software.&#8221; This will enable all of your employees to make the right decision when it comes to choosing between open source and proprietary solutions. The policy will then help your company reduce IT costs—not just by encouraging the use of open source software that has no licensing fees associated with it, but by also leveraging the preexisting open source knowledge of your IT staff.</p>
<p>On the other hand, you might want to build an online community around your company&#8217;s product. In this case your strategy might be to use open source software in order to encourage outside developers to help build out features that enable your community to grow. Your interest is in the community, not in making money through software sales, so you might even want to open source your own software and grow a community around it.</p>
<p>Identifying your open source strategy upfront will not only help you figure out your policy, but it will also help you explain to others why it&#8217;s the right policy for your company.</p>
<p>Here&#8217;s an example of what an open source strategy statement might look like:</p>
<p><img src="http://olex.openlogic.com/wazi/wp-content/uploads/2009/02/oss_policy_strategy.png" alt="" /></p>
<h3>Background Statement</h3>
<p>Many open source software policies start by talking about the problem they&#8217;re trying to solve. Whether or not you need this section probably depends on your company. You may need this section if:</p>
<ul>
<li> Management doesn&#8217;t know how much open source software the company uses or depends on.</li>
<li>There are widely varying opinions on how much open source software is used.</li>
<li>There&#8217;s an open source software rule or policy that conflicts with reality (e.g., &#8220;No open source allowed,&#8221; but your IT infrastructure is built upon open source software).</li>
<li>There are big disagreements on how the company should use open source software.</li>
</ul>
<p>If you decide you need a background statement, make it brief. Some key things to include in the background statement (if you know them) are:</p>
<ul>
<li>How much open source software the company currently uses.</li>
<li>How much open source software has or will save you—not just monetary savings, but also consider reductions in development time, consulting time, learning curves, and so on.</li>
<li>Any risks to be aware of—for example, your 24&#215;7 website depends on an open source software package for which there is currently no defined support process.</li>
</ul>
<p>A background statement in an open source policy might look like this:</p>
<p><img src="http://olex.openlogic.com/wazi/wp-content/uploads/2009/02/oss_policy_background_statement.png" alt="" /></p>
<h3>Scope</h3>
<p>Your company may have many policies, and it may be obvious who they cover. However, with open source software policies it is often necessary to define not only who is covered but what is covered.</p>
<h4>Who&#8217;s Covered</h4>
<p>Most companies with an open source software policy adopt the policy company-wide. However, for many organizations it makes more sense to have a very brief company policy that simply states the strategy and provides some general guidelines for how to use open source software. Then, each division is allowed to elaborate and expand on the policy to meet its needs.  In other cases, a particular division creates a policy and later tries to get the company as a whole to adopt it.</p>
<p>Don&#8217;t forget to specify subsidiaries and agents in this definition. You might want to consult with an attorney about whether giving open source software to the company&#8217;s agents or subsidiaries is considered distribution, as distribution triggers clauses in some open source software licenses.</p>
<p>Also, you might want to specify whether or not the open source software policy applies to everyone or just to employees in certain jobs or roles. For example, you may not care how your IT staff uses open source software in the internal IT environment, but you want to ensure that all software developers working on applications that are distributed to others are aware of the open source software policy.</p>
<p>Whatever you decide, make sure it&#8217;s clearly stated and that you have the right people review and approve the policy.  The example below illustrates one approach to defining who&#8217;s covered by a policy:</p>
<p><img src="http://olex.openlogic.com/wazi/wp-content/uploads/2009/02/oss_policy_whos_covered.png" alt="" /></p>
<h4>What&#8217;s Covered</h4>
<p>There&#8217;s a lot of misunderstanding and disagreement about what exactly qualifies as &#8220;open source software.&#8221; One common misconception is that <em>freeware</em>, <em>free to use</em>, and <em>free for personal use only</em> licenses are open source software licenses.</p>
<p>Companies typically decide that any software released under a license approved by the <a href="http://opensource.org" target="_blank">Open Source Initiative (OSI)</a> is considered open source software.</p>
<p>You need to define what is covered and what is not covered by your company&#8217;s open source software policy. Many companies have different standards for open source software used in IT, development, and production environments.</p>
<p>You&#8217;ll also need to think about what qualifies as open source software and what usage cases need to be covered.</p>
<ul>
<li>Does the policy apply to using software inside the company?</li>
<li>Does it apply to shipping software?</li>
<li>To freeware? People often assume anything that doesn&#8217;t cost money is open source software—that&#8217;s not true, and you need to explicitly include or exclude that type of software.</li>
</ul>
<p>An open source policy might address the issue of what qualifies as open source with language like this:</p>
<p><img src="http://olex.openlogic.com/wazi/wp-content/uploads/2009/02/oss_policy_whats_covered.png" alt="" /></p>
<h3>Ownership</h3>
<p>Your open source software policy will be a living document. As business conditions change, your company becomes more comfortable using open source software, and new open source software packages and licenses become available, you&#8217;ll want to adapt the policy to the new situations. In addition, an individual or team needs to be available to answer questions, provide training, and approve any exceptions.</p>
<p>Although an individual usually writes the open source software policy, a committee or open source review board should own the policy. A review board is most effective when it represents the main divisions in the company. If every group feels like they&#8217;re adequately represented, you&#8217;ll get better buy-in and compliance later on.</p>
<h4>When to Make Exceptions and Who&#8217;s Allowed to Make Them</h4>
<p>Only a couple of people should be allowed to make exceptions to the open source software policy: the owners of the policy, and the business group or manager who&#8217;s allowed to decide that the business benefit outweighs the risk of breaking from the policy.</p>
<h3>Approval Process</h3>
<p>While it&#8217;s easier create an open source software policy before establishing an approval process, in reality the opposite usually occurs. Someone is responsible for making open source decisions, and he or she ends up pulling together a group of people to create an informal approval process.  Once established, even informal approval processes can become quite elaborate and efficient.</p>
<p>If you don&#8217;t have an approval process, you&#8217;ll want to sent one up. If you have one, you&#8217;ll need to review it with your open source policy in mind.</p>
<h4>Who&#8217;s Part of the Open Source Review Process?</h4>
<p>You may want to establish a cross-divisional open source review board. This is usually the same team that owns the open source software policy. It should definitely include an attorney or work closely with one.</p>
<p>You&#8217;ll also want the review board to include any teams that will use approved open source software, as it&#8217;s important that they agree with the policy as well as the process. They can give you feedback to make sure the process integrates smoothly with their work flow so that reviews happen quickly and issues are resolved smoothly.</p>
<h4>What Information Should Be Reviewed?</h4>
<p>Decide what information should be included in the review process. At a minimum you&#8217;ll want each open source usage request to include:</p>
<ol>
<li>Name of the employee submitting the request.</li>
<li>Name and version number of the requested open source software package.</li>
<li>Source of the software (website from which it was downloaded).</li>
<li>List of the licenses associated with the software and any bundled components.</li>
<li>Business reason for the request.</li>
<li>Platform on which the software will be installed.</li>
<li>Plan for integrating the open source software into other software currently being used or produced.</li>
<li>Whether or not there are plans to modify the source code (Y/N). If yes, explain the reason for modification.</li>
<li>Whether or not there are plans to distribute the open source software, either modified or not (Y/N). If yes, explain the reason for distribution.</li>
<li>Plan for supporting the software, monitoring for security updates, and performing upgrades.</li>
</ol>
<p>Next, decide on the process for reviewing requests. You&#8217;ll probably save a lot of unnecessary reviews by asking local management and attorneys to review requests before they&#8217;re escalated to the corporate open source review board.</p>
<p>Best practices for open source approval processes include:</p>
<ul>
<li>Ensure quick turn-around on all requests. If the approval process takes weeks, developers will skip it because they need to download open source software and get their job done. Your approval process should take one or two weeks at most.</li>
<li>Ensure all review board members are committed to the process. You should be prepared to replace people as the original members move onto other interests or discover they don&#8217;t have enough time anymore.</li>
<li>Have a really good &#8220;pre-approved open source list&#8221;. You can pre-approved by license, package name, and/or usage models.</li>
<li>Get lots of attorneys involved. While there may be an attorney on the review board, it will help if you have attorneys close to the team involved. They will best be able to understand how the open source software will be used, and they can help field questions. Educate these attorneys over time.</li>
<li>Create an exception process, but do your best to set it up in a way that minimizes the use of exceptions.</li>
<li>Make public within your organization all open source requests as well as the review board results. If people can see what has been requested and why certain packages were approved or denied they can tailor their requests appropriately, saving you a lot of time.</li>
<li>Define some standard business reasons for your organization. Depending on your open source strategy these could vary from &#8220;saving time by using existing technology&#8221; to &#8220;saving money by eliminating licensing fees&#8221; to &#8220;getting buy-in from technical adopters by enabling them to see how product is developed.&#8221;</li>
</ul>
<h4>Audits</h4>
<p>Although your policy can require all open source software be reviewed and approved through a defined process, it&#8217;s impossible to enforce by brute force—open source software can easily and freely be downloaded from the Internet. In order to make sure your approval process is effective and that employees are following it, you&#8217;ll need to define an audit process.</p>
<p>The flowchart below illustrates a typical open source audit process:</p>
<p><img src="http://olex.openlogic.com/wazi/wp-content/uploads/2009/02/oss_policy_osrb_process.png" alt="" /></p>
<h3>Sourcing</h3>
<p>Your policy should explicitly state the websites and methods through which employees are allowed to obtain open source software (sourcing) and how to decide whether a particular open source package is the right piece of software for the job (selection). Who can download software? Where can they go to download it? Do they need permission before downloading? Before using? Before distributing?</p>
<p>Many companies allow developers to download software and try it before going through the approval process. Attorneys are often uncomfortable with this because employees can use the software before the license is reviewed. However, businesses typically balance this concern with the fact that the risk is relatively small while the developer is just evaluating the software.</p>
<p>Most companies end up adopting a free-for-all open source download and maintenance program—every team that needs an open source software package is permitted to download it and figure out their own support options. This is highly inefficient and often leads to the situation where a company is using many different versions of the same software package as well as duplicating evaluation and upgrade processes every time a new version is released.</p>
<p>Other companies have adopted the idea of an open source repository in which approved open source packages are stored. Employees who need to use open source software are required to download it from the repository instead of the Internet. While an excellent idea, this approach often leads to failure because it&#8217;s difficult for a single company that&#8217;s not in the open source software business to create and maintain a comprehensive open source repository. The repository often ends up outdated and missing many useful open source software packages. If you go with this approach, you&#8217;ll need a very good process for handling requests to add new open source packages or versions to the repository. Alternatively, you can use an open source repository provided by a third-party, like <a href="https://olex.openlogic.com" target="_blank">OpenLogic Exchange (OLEX)</a> from OpenLogic.</p>
<p>A policy that defines how and where employees can obtain open source software might look like this:</p>
<p><img src="http://olex.openlogic.com/wazi/wp-content/uploads/2009/02/oss_policy_sourcing1.png" alt="" /></p>
<p>Alternatively, your policy can allow employees to make a judgment call when it comes to sourcing:</p>
<p><img src="http://olex.openlogic.com/wazi/wp-content/uploads/2009/02/oss_policy_sourcing2.png" alt="" /></p>
<p>Note that while many attorneys recommend that no software be downloaded until the license is reviewed and approved, this is rarely followed. Your policy needs to take into account the legal risk of downloading software for testing or trial purposes before attorneys have a chance to review it. Adding a clause like this can help mitigate the risk:</p>
<p><img src="http://olex.openlogic.com/wazi/wp-content/uploads/2009/02/oss_policy_sourcing3.png" alt="" /></p>
<h3>Selection</h3>
<p>Selection is the process of deciding whether or not a particular software package meets your needs and quality standards. In addition to any testing and standards processes already have in place, you might want to consider additional aspects for reviewing open source software such as:</p>
<ul>
<li>Support: There are options for <a href="http://www.openlogic.com/products/open-source-support.php">support for open source software</a>, but which options are available and which you should choose may vary from package to package.</li>
<li>Community: Is there an active open source community for the package? Are bugs fixed quickly?</li>
<li>Quality: Is the software package reliable?  How does it compare to similar open source packages?</li>
</ul>
<p>For a list of other factors to consider around open source package selection, see the <a href="http://www.openlogic.com/downloads/whitepapers.php" target="_blank">OpenLogic Certification Process white paper</a>.</p>
<p>A policy might approach the issue of open source selection with language like this:</p>
<p><img src="http://olex.openlogic.com/wazi/wp-content/uploads/2009/02/oss_policy_selection1.png" alt="" /></p>
<p>Your policy may also outline what to do in case an open source project &#8220;ends&#8221; or forks. For example, the policy might define a timeframe in which the team has to find a different open source package to replace the original package:</p>
<p><img src="http://olex.openlogic.com/wazi/wp-content/uploads/2009/02/oss_policy_selection2.png" alt="" /></p>
<h3>Mergers and Acquisitions</h3>
<p>Don&#8217;t forget to include a section in your policy about mergers and acquisitions. Enterprises often fail to investigate open source usage or policy until after a target company has been acquired. It makes much more sense to check beforehand. You&#8217;ll need to make sure your company&#8217;s mergers and acquisitions team is aware of the internal open source policy as well as the need to investigate open source policy and usage at target companies prior to completing any acquisitions. Open source tools such as <a href="http://fossology.org" target="_blank">FOSSology</a>, <a href="http://www.openlogic.com/products/scanners.php#oss-discovery" target="_blank">OSS Discovery</a>, and <a href="http://www.openlogic.com/products/scanners.php#oss-deep-discovery" target="_blank">OSS Deep Discovery</a> can be run to identify the open source software deployed within a target organization.</p>
<p>A policy might approach the issue of mergers and acquisitions with language like this:</p>
<p><img src="http://olex.openlogic.com/wazi/wp-content/uploads/2009/02/oss_policy_mergers.png" alt="" /></p>
<h3>Support</h3>
<p>Technical support in the open source world has a bad reputation. While many people think there&#8217;s no support available for open source software, the real problem is that there are too many choices for open source software support—and few of them resemble what people are used to in the proprietary world.</p>
<p>Options vary from do-it-yourself (by following mailing lists and even fixing critical bugs yourself) to paying a third party for a complete support and maintenance contract. The table below shows some of the common options:</p>
<table class="help_table" border="0">
<tbody>
<tr>
<th>Type</th>
<td width="135"><strong>Mailing List</strong></td>
<td width="135"><strong>Internal</strong></td>
<td width="135"><strong>Commercial</strong></td>
</tr>
<tr>
<th>Contact Methods</th>
<td>Online only</td>
<td>Varies</td>
<td>Online and phone</td>
</tr>
<tr>
<th>Resources</th>
<td>Other users &amp; project developers</td>
<td>Your internal staff</td>
<td>Experts – committers and contributors</td>
</tr>
<tr>
<th>SLAs (Speed of Response)</th>
<td>None – could be 5 minutes to never</td>
<td>Maybe</td>
<td>Yes</td>
</tr>
<tr valign="top">
<th>Changes Accepted Into the Source Code</th>
<td>Sometimes</td>
<td>Depends – must be submitted and accepted</td>
<td>Typically yes</td>
</tr>
<tr>
<th>Cost</th>
<td>Free</td>
<td>Depends</td>
<td>Varies &#8211; per project, per server, per incident,<br />
flat fee, etc.</td>
</tr>
</tbody>
</table>
<p>An open source policy might address the issue of technical support with language like this:</p>
<p><img src="http://olex.openlogic.com/wazi/wp-content/uploads/2009/02/oss_policy_support.png" alt="" /></p>
<h3>Maintenance</h3>
<p>Once the decision to use open source has been made, the process of downloading it and getting it to work is often challenging and satisfying. However, it can be frustrating to track the project for security updates, solve problems, and figure out when to upgrade to a new version.</p>
<p>Your open source policy should provide guidance on maintenance concerns by addressing the following issues:</p>
<ul>
<li>Security updates: Who&#8217;s going to be responsible for staying abreast of security updates? This often requires subscribing to a mailing list.</li>
<li>New versions: Who&#8217;s going to figure out when you should upgrade to a new version? Deciding when to upgrade can be hard because open source software projects release new versions often. While some projects are very good about specifying what&#8217;s new, what&#8217;s changed, and what&#8217;s gone, others are not. Someone will have to evaluate each release and decide whether or not to upgrade. In addition, you&#8217;ll need a process to ensure that only one or two versions (or as few as possible) are deployed within the company. In particular, you&#8217;ll want to ensure the company doesn&#8217;t fall too far behind the latest version available from the open source project, as communities rarely support previous versions for long.</li>
<li>Bugs: When a bug is discovered, what&#8217;s the process for reporting it to the open source project? Your policy should also specify when and how employees can fix bugs and submit bug fixes to open source projects. (You may want to provide some training about how best to create and provide patches, as it&#8217;s in your best interest to make sure patches are accepted upstream.)</li>
</ul>
<p>The maintenance section of your open source policy should specify whether or not company employees can modify open source software. While you&#8217;ll probably want to encourage people to not modify open source software (unless they are planning on fixing a bug or adding a new feature to contribute upstream), it&#8217;s likely that some packages will require modifications to work in your environment or process. Your policy should specify when that&#8217;s allowed and how changes are documented for maintenance.</p>
<p>An open source policy might address the issue of ongoing maintenance with language like this:</p>
<p><img src="http://olex.openlogic.com/wazi/wp-content/uploads/2009/02/oss_policy_maintenance.png" alt="" /></p>
<h3>Contributions</h3>
<p>Your open source policy should include a clear statement about whether or not employees can contribute code changes to open source software projects. There are several situations in which you&#8217;ll probably will want employees to contribute.  For example, if an employee fixes a bug, you&#8217;ll want him or her to contribute the patch to the project so that you don&#8217;t have to maintain a unique patch through every version upgrade.  In addition, by contributing code your company might gain credibility within the open source community.  If your company actively contributes to a project, the community will be be more likely to recognize employees and quickly respond to their emails when issues arise.</p>
<p>Situations to consider when thinking about whether employees can contribute code changes to open source software projects include:</p>
<ul>
<li>Can employees post questions and answers on mailing lists? While many companies are afraid of what employees may accidentally reveal on mailing lists, it&#8217;s best to give them the proper training on confidentiality and then let them work on mailing lists.  Not only will they build credibility for themselves and the company, but it&#8217;s often one of the best ways to get help with a problem.  Disallowing employee contributions on mailing lists will impede employees&#8217; ability to use and support open source software solutions.</li>
<li>Can employees post bug reports to the bug tracking system?  Unless there are very good business reasons not to, you should allow employees to post bug reports in order to ensure they can be fixed in a timely manner that will work for the company.</li>
<li>Can employees fix bugs and submit their patches?  Employees often need to fix simple bugs in order to get things up and running.  When they do, it&#8217;s in the company&#8217;s best interest to ensure the bug is fixed in a general way that&#8217;s acceptable to the project so it can be submitted upstream. This will simplify support over the long term and help build credibility for the company.</li>
<li>Can employees contribute features to an open source project?  Can they become project contributors?</li>
<li>Can employees work on open source software projects in their free time?  On the same project(s) they work on in the office?  On unrelated projects?  How do you decide if a project is unrelated to the company&#8217;s business?</li>
</ul>
<p>An open source policy might address the issue of open source contributions with language like this:</p>
<p><img src="http://olex.openlogic.com/wazi/wp-content/uploads/2009/02/oss_policy_contributions.png" alt="" /></p>
<p>Some open source policies state that employees can only interact with open source communities using personal email addresses, not company email addresses.  Note that if you include this rule in your open source policy, your company will never develop any credibility with the community.</p>
<h3>Communication</h3>
<p>Although many companies try to hide that fact that they use open source software, it rarely remains a secret—especially for organizations that decide to provide their own support using internal resources. It&#8217;s best to establish a policy for how employees should communicate with open source communities and other interested parties, even if you intend to limit communication about open source usage as much as possible.</p>
<p>Your open source policy should provide guidance on communication by addressing the following issues:</p>
<ul>
<li>How can employees communicate with open source software projects? (For more on this topic, see the Maintenance section above.)</li>
<li>How can employees communicate about open source usage at conferences? Employees will likely want to attend open source software conferences, which provide an excellent opportunity to meet open source project maintainers. If employees can talk about which open source packages they&#8217;re using and even present case studies, it will help them meet the right people and gain credibility for your company. The open source software community likes hearing about how their products are being used.</li>
<li>How can employees communicate about open source usage in documentation? If you ship products that contain open source software, you may have to display the open source software licenses in the product documentation (depending on the licenses). You might also want to say something to end users about what you&#8217;re using and why, depending on the type of end users. For example, if you sell TVs that use open source software you may need to display one or more licenses in order to comply with them, but you probably don&#8217;t need to spend a lot of time talking about the software installed on the TV. If, on the other hand, you distribute a toolkit for software developers, you&#8217;ll probably want to allow more space in your documentation for discussion about the open source software you&#8217;re using and why it&#8217;s part of the toolkit.</li>
</ul>
<h3>Summary</h3>
<p>Be sure to remain positive in the summary of your open source policy—after all, you want your employees to <em>want to follow</em> the policy—while also clearly stating when and how open source software usage triggers review.  For example, the summary section of a corporate open source policy might look like this:</p>
<p><img src="http://olex.openlogic.com/wazi/wp-content/uploads/2009/02/oss_policy_summary.png" alt="" /></p>
]]></content:encoded>
			<wfw:commentRss>http://olex.openlogic.com/wazi/2009/create-open-source-policy/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
