<?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>Sceneric Thinking &#187; Architecture</title>
	<atom:link href="http://www.sceneric.com/blogs/?feed=rss2&#038;cat=10" rel="self" type="application/rss+xml" />
	<link>http://www.sceneric.com/blogs</link>
	<description>thoughts on technology and industry</description>
	<lastBuildDate>Thu, 28 Jun 2012 14:12:11 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Integrate Axis into Magnolia</title>
		<link>http://www.sceneric.com/blogs/?p=28</link>
		<comments>http://www.sceneric.com/blogs/?p=28#comments</comments>
		<pubDate>Thu, 05 Feb 2009 22:38:19 +0000</pubDate>
		<dc:creator>jimherbert</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Content Management]]></category>
		<category><![CDATA[Enterprise Integration]]></category>
		<category><![CDATA[JSR170]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Magnolia]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Package Implementation]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web 2.0]]></category>
		<category><![CDATA[Integration]]></category>

		<guid isPermaLink="false">http://www.sceneric.com/blogs/?p=28</guid>
		<description><![CDATA[A few months ago we created a proof of concept to access the Magnolia JCR container using Webservices so that a PHP based site we were building could access new items within an Enterprise Class CMS.  It turned out to be remarkably easy:
To integrate Axis 1.4 into Magnolia:

Download the Axis distribution
Copy the jars into the [...]]]></description>
			<content:encoded><![CDATA[<p>A few months ago we created a proof of concept to access the Magnolia JCR container using Webservices so that a PHP based site we were building could access new items within an Enterprise Class CMS.  It turned out to be remarkably easy:</p>
<p>To integrate Axis 1.4 into Magnolia:</p>
<ol>
<li>Download the Axis distribution</li>
<li>Copy the jars into the magnoliaAuthor and magnoliaPublic WEB-INF/lib directories</li>
<li>Copy the servlet declarations from the axis web.xml into the magnolia web.xml in both auth and pub</li>
<li>Open AdminCentral and browse to Configuration</li>
<li>Open server/filters/servlets and copy log4j node, rename to AxisServlet</li>
<li>Open AxisServlet/mappings/&#8211;magnolia-pages&#8211;/patten and change to /services/*</li>
<li>Change AxisServlet/servletClass to org.apache.axis.transport.http.AxisServlet</li>
<li>Change AxisServlet/servletName to AxisServet (to match the web.xml servletname)</li>
</ol>
<p>If you now deploy a class through jws or wsdl methods (by coping the classes, wsdl and .wsdd files) into Magnolia you will be able to access it through &lt;host&gt;/&lt;maginstance&gt;/services/ServiceName?wsdl</p>
<p>You might want to bypass Magnolia security during development, to do that:</p>
<ol>
<li>Open AdminCentral and browse to Configuration</li>
<li>Open server/filters/uriSecurity/bypasses</li>
<li>Create a new content node &#8220;services&#8221;</li>
<li>Create 2 new data nodes; &#8220;services/class&#8221; with data info.magnolia.voting.voters.URIStartsWithVoter and &#8220;services/pattern&#8221; with data /services</li>
</ol>
<p>For our demo, we simply queried the API for a &#8220;text&#8221; content node based on a path that was passed into the method:<br />
<code><br />
public String getContent (String name) throws Exception {<br />
String returnContent = new String();<br />
returnContent="";<br />
try {<br />
//get the current context<br />
Context context = MgnlContext.getSystemContext();<br />
//get a hierarchy manager and lookup the content node<br />
HierarchyManager mgr = context.getHierarchyManager(ContentRepository.WEBSITE);<br />
Content uriContent = mgr.getContent(name);<br />
if(uriContent==null){<br />
//oops<br />
returnContent+=" content is null";<br />
} else {<br />
//get the data collection and return the text node<br />
for(Iterator i = uriContent.getNodeDataCollection().iterator(); i.hasNext();) {<br />
NodeData nodeData = (NodeData) i.next();<br />
String nodeName = nodeData.getName();<br />
if (nodeName.equals("text")) {<br />
returnContent=nodeData.getString();<br />
}<br />
}<br />
}<br />
} catch (RepositoryException e) {<br />
throw new Exception(e.getMessage());<br />
}<br />
return returnContent;<br />
}<br />
</code><br />
Axis presents this with the following WSDL:</p>
<pre id="line1"><span class="pi">&lt;?xml version="1.0" encoding="UTF-8"?&gt;</span>
&lt;<span class="start-tag">wsdl:definitions</span><span class="attribute-name"> targetNamespace</span>=<span class="attribute-value">"http://test.sceneric.com" </span><span class="attribute-name">xmlns:apachesoap</span>=<span class="attribute-value">"http://xml.apache.org/xml-soap" </span><span class="attribute-name">xmlns:impl</span>=<span class="attribute-value">"http://test.sceneric.com" </span><span class="attribute-name">xmlns:intf</span>=<span class="attribute-value">"http://test.sceneric.com" </span><span class="attribute-name">xmlns:wsdl</span>=<span class="attribute-value">"http://schemas.xmlsoap.org/wsdl/" </span><span class="attribute-name">xmlns:wsdlsoap</span>=<span class="attribute-value">"http://schemas.xmlsoap.org/wsdl/soap/" </span><span class="attribute-name">xmlns:xsd</span>=<span class="attribute-value">"http://www.w3.org/2001/XMLSchema"</span>&gt;
<span class="comment">&lt;!--WSDL created by Apache Axis version: 1.4
Built on Apr 22, 2006 (06:55:48 PDT)--&gt;</span>
 &lt;<span class="start-tag">wsdl:types</span>&gt;
  &lt;<span class="start-tag">schema</span><span class="attribute-name"> elementFormDefault</span>=<span class="attribute-value">"qualified" </span><span class="attribute-name">targetNamespace</span>=<span class="attribute-value">"http://test.sceneric.com" </span><span class="attribute-name">xmlns</span>=<span class="attribute-value">"http://www.w3.org/2001/XMLSchema"</span>&gt;
   &lt;<span class="start-tag">element</span><span class="attribute-name"> name</span>=<span class="attribute-value">"getContent"</span>&gt;
    &lt;<span class="start-tag">complexType</span>&gt;
     &lt;<span class="start-tag">sequence</span>&gt;
      &lt;<span class="start-tag">element</span><span class="attribute-name"> name</span>=<span class="attribute-value">"name" </span><span class="attribute-name">type</span>=<span class="attribute-value">"xsd:string"</span><span class="attribute-name">/</span>&gt;
     &lt;/<span class="end-tag">sequence</span>&gt;</pre>
<pre id="line12">    &lt;/<span class="end-tag">complexType</span>&gt;
   &lt;/<span class="end-tag">element</span>&gt;
   &lt;<span class="start-tag">element</span><span class="attribute-name"> name</span>=<span class="attribute-value">"getContentResponse"</span>&gt;
    &lt;<span class="start-tag">complexType</span>&gt;
     &lt;<span class="start-tag">sequence</span>&gt;
      &lt;<span class="start-tag">element</span><span class="attribute-name"> name</span>=<span class="attribute-value">"getContentReturn" </span><span class="attribute-name">type</span>=<span class="attribute-value">"xsd:string"</span><span class="attribute-name">/</span>&gt;
     &lt;/<span class="end-tag">sequence</span>&gt;
    &lt;/<span class="end-tag">complexType</span>&gt;
   &lt;/<span class="end-tag">element</span>&gt;</pre>
<pre id="line21">  &lt;/<span class="end-tag">schema</span>&gt;
 &lt;/<span class="end-tag">wsdl:types</span>&gt;

   &lt;<span class="start-tag">wsdl:message</span><span class="attribute-name"> name</span>=<span class="attribute-value">"getContentResponse"</span>&gt;

      &lt;<span class="start-tag">wsdl:part</span><span class="attribute-name"> element</span>=<span class="attribute-value">"impl:getContentResponse" </span><span class="attribute-name">name</span>=<span class="attribute-value">"parameters"</span><span class="attribute-name">/</span>&gt;

   &lt;/<span class="end-tag">wsdl:message</span>&gt;

   &lt;<span class="start-tag">wsdl:message</span><span class="attribute-name"> name</span>=<span class="attribute-value">"getContentRequest"</span>&gt;</pre>
<pre id="line32">      &lt;<span class="start-tag">wsdl:part</span><span class="attribute-name"> element</span>=<span class="attribute-value">"impl:getContent" </span><span class="attribute-name">name</span>=<span class="attribute-value">"parameters"</span><span class="attribute-name">/</span>&gt;

   &lt;/<span class="end-tag">wsdl:message</span>&gt;

   &lt;<span class="start-tag">wsdl:portType</span><span class="attribute-name"> name</span>=<span class="attribute-value">"TestWebService"</span>&gt;

      &lt;<span class="start-tag">wsdl:operation</span><span class="attribute-name"> name</span>=<span class="attribute-value">"getContent"</span>&gt;

         &lt;<span class="start-tag">wsdl:input</span><span class="attribute-name"> message</span>=<span class="attribute-value">"impl:getContentRequest" </span><span class="attribute-name">name</span>=<span class="attribute-value">"getContentRequest"</span><span class="attribute-name">/</span>&gt;

         &lt;<span class="start-tag">wsdl:output</span><span class="attribute-name"> message</span>=<span class="attribute-value">"impl:getContentResponse" </span><span class="attribute-name">name</span>=<span class="attribute-value">"getContentResponse"</span><span class="attribute-name">/</span>&gt;</pre>
<pre id="line43">      &lt;/<span class="end-tag">wsdl:operation</span>&gt;

   &lt;/<span class="end-tag">wsdl:portType</span>&gt;

   &lt;<span class="start-tag">wsdl:binding</span><span class="attribute-name"> name</span>=<span class="attribute-value">"TestWebServiceSoapBinding" </span><span class="attribute-name">type</span>=<span class="attribute-value">"impl:TestWebService"</span>&gt;

      &lt;<span class="start-tag">wsdlsoap:binding</span><span class="attribute-name"> style</span>=<span class="attribute-value">"document" </span><span class="attribute-name">transport</span>=<span class="attribute-value">"http://schemas.xmlsoap.org/soap/http"</span><span class="attribute-name">/</span>&gt;

      &lt;<span class="start-tag">wsdl:operation</span><span class="attribute-name"> name</span>=<span class="attribute-value">"getContent"</span>&gt;

         &lt;<span class="start-tag">wsdlsoap:operation</span><span class="attribute-name"> soapAction</span>=<span class="attribute-value">""</span><span class="attribute-name">/</span>&gt;</pre>
<pre id="line55">         &lt;<span class="start-tag">wsdl:input</span><span class="attribute-name"> name</span>=<span class="attribute-value">"getContentRequest"</span>&gt;

            &lt;<span class="start-tag">wsdlsoap:body</span><span class="attribute-name"> use</span>=<span class="attribute-value">"literal"</span><span class="attribute-name">/</span>&gt;

         &lt;/<span class="end-tag">wsdl:input</span>&gt;

         &lt;<span class="start-tag">wsdl:output</span><span class="attribute-name"> name</span>=<span class="attribute-value">"getContentResponse"</span>&gt;

            &lt;<span class="start-tag">wsdlsoap:body</span><span class="attribute-name"> use</span>=<span class="attribute-value">"literal"</span><span class="attribute-name">/</span>&gt;

         &lt;/<span class="end-tag">wsdl:output</span>&gt;</pre>
<pre id="line67">      &lt;/<span class="end-tag">wsdl:operation</span>&gt;

   &lt;/<span class="end-tag">wsdl:binding</span>&gt;

   &lt;<span class="start-tag">wsdl:service</span><span class="attribute-name"> name</span>=<span class="attribute-value">"TestWebServiceService"</span>&gt;

      &lt;<span class="start-tag">wsdl:port</span><span class="attribute-name"> binding</span>=<span class="attribute-value">"impl:TestWebServiceSoapBinding" </span><span class="attribute-name">name</span>=<span class="attribute-value">"TestWebService"</span>&gt;

         &lt;<span class="start-tag">wsdlsoap:address</span><span class="attribute-name"> location</span>=<span class="attribute-value">"http://localhost:8800/magnoliaAuthor/services/TestWebService"</span><span class="attribute-name">/</span>&gt;

      &lt;/<span class="end-tag">wsdl:port</span>&gt;</pre>
<pre id="line79">   &lt;/<span class="end-tag">wsdl:service</span>&gt;

&lt;/<span class="end-tag">wsdl:definitions</span>&gt;</pre>
<p>and an example of this in action is:</p>
<pre id="line1"><span class="pi">&lt;?xml version="1.0" encoding="UTF-8"?&gt;</span>
&lt;soapenv:Envelope&gt;
−
&lt;soapenv:Body&gt;
−
&lt;getContentResponse&gt;
−
&lt;ns1:getContentReturn&gt;
&lt;p&gt;yadda yadda yadda&lt;/p&gt;
&lt;/ns1:getContentReturn&gt;
&lt;/getContentResponse&gt;
&lt;/soapenv:Body&gt;
&lt;/soapenv:Envelope&gt;</pre>
<p>Of course, a twist to this approach would be to wrap the JSP rendering with Axis to take advantage of the tag libraries. We tested this with PHP 5&#8217;s SOAP Client and successfully read data from Magnolia.  In a production environment we would obviously use XPath or the Query Builder in order to search the repository, and return more complex results.</p>
<p>You can see a video demonstration of this here: <a href="http://bit.ly/uPreky">http://bit.ly/uPreky</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sceneric.com/blogs/?feed=rss2&amp;p=28</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java optimisation</title>
		<link>http://www.sceneric.com/blogs/?p=17</link>
		<comments>http://www.sceneric.com/blogs/?p=17#comments</comments>
		<pubDate>Tue, 13 Jan 2009 23:34:01 +0000</pubDate>
		<dc:creator>jimherbert</dc:creator>
				<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Hosting]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Retail]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[best practice]]></category>
		<category><![CDATA[clustering]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[heap]]></category>
		<category><![CDATA[JVM]]></category>
		<category><![CDATA[optimisation]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[stability]]></category>

		<guid isPermaLink="false">http://www.sceneric.com/blogs/?p=17</guid>
		<description><![CDATA[One of the things that is a constant surprise is finding clients with slow Java systems that spend a tonne of cash on new hardware but don&#8217;t configure their systems to make full use of it.  A classic problem is leaving the application server settings as per first install, with very low JVM heap size [...]]]></description>
			<content:encoded><![CDATA[<p>One of the things that is a constant surprise is finding clients with slow Java systems that spend a tonne of cash on new hardware but don&#8217;t configure their systems to make full use of it.  A classic problem is leaving the application server settings as per first install, with very low JVM heap size and a poor garbage collector, another problem being running only one instance of a JVM, a situation where you may have a new server with 4GB of RAM and a quad-core CPU but running the software in only 512MB RAM with threading likely to be tied to a single core.</p>
<p>Sceneric consultants are experts at optimising our clients platforms to ensure the hardware is properly utilised.  Our consultants have deployed applications on clustered IBM Websphere, Weblogic, Oracle iAS and JBoss servers, and have created Coldfusion Enterprise clusters on JRun 4.0 leading to significant performance and stability gains.</p>
<p>The key thing to remember is that Java runs within a virtual machine which has limits ordinarily significantly smaller than the avialable hardware.   Without explicit tuning expertise applied, the applications running within the virutal machine will not be performing to their optimum potential.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sceneric.com/blogs/?feed=rss2&amp;p=17</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
