<?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>Michał Wróbel&#039;s blog</title>
	<atom:link href="http://blog.mwrobel.eu/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.mwrobel.eu</link>
	<description>OPAKOWANIE ZASTĘPCZE / UNDER CONSTRUCTION</description>
	<lastBuildDate>Wed, 07 Sep 2011 11:36:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
		<item>
		<title>How to configure Eclipse to debug Alfresco java webscript code</title>
		<link>http://blog.mwrobel.eu/plhow-configure-eclipse-debug-alfresco-java-webscript-codeenhow-configure-eclipse-debug-alfresco-java-webscript-code/</link>
		<comments>http://blog.mwrobel.eu/plhow-configure-eclipse-debug-alfresco-java-webscript-codeenhow-configure-eclipse-debug-alfresco-java-webscript-code/#comments</comments>
		<pubDate>Wed, 07 Sep 2011 11:36:58 +0000</pubDate>
		<dc:creator>michal.wrobel</dc:creator>
				<category><![CDATA[Alfresco]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Programming environments]]></category>
		<category><![CDATA[Tomcat]]></category>
		<category><![CDATA[alfresco]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[remote]]></category>
		<category><![CDATA[tomcat]]></category>

		<guid isPermaLink="false">http://blog.mwrobel.eu/?p=264</guid>
		<description><![CDATA[How to configure Eclipse to debug Alfresco java webscript code NOTE: It is assumed, that Eclipse environment has been configured to work with Alfresco SDK. If it&#8217;s not true the configuration process has been described here: http://wiki.alfresco.com/wiki/Alfresco_SDK_3.4#Set_Eclipse_Compiler_Compliance_Level_to_6.0. 1. Select: Run menu -> Debug configurations&#8230; 2. Create new configuration for &#8216;Remote Java Application&#8217; 3. In &#8216;Project&#8217; [...]]]></description>
			<content:encoded><![CDATA[<p>How to configure Eclipse to debug Alfresco java webscript code</p>
<p>NOTE: It is assumed, that Eclipse environment has been configured to work with Alfresco SDK. If it&#8217;s not true the configuration process has been described here: http://wiki.alfresco.com/wiki/Alfresco_SDK_3.4#Set_Eclipse_Compiler_Compliance_Level_to_6.0.</p>
<p>1. Select: Run menu -> Debug configurations&#8230;<br />
2. Create new configuration for &#8216;Remote Java Application&#8217;<br />
3. In &#8216;Project&#8217; field select &#8216;home&#8217; project (presumably your webscript project), which you want to debug (but it is also possible to debug code from Alfresco core outside selected project)<br />
4. In &#8216;Connection properties&#8217; set Tomcat server IP address and debug port you defined earlier.</p>
<p>NOTE: It&#8217;s advised against to use &#8216;localhost&#8217; instead of IP address on Windows because of hosts file issues.</p>
<p>5. Click Apply, Debug<br />
6. If everything went correct you shouldn&#8217;t get any message.<br />
7. Switch to debug perspective<br />
8. You should see something like this:<br />
<div id="attachment_268" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.mwrobel.eu/wp-content/uploads/2011/08/debug_good.jpg"><img src="http://blog.mwrobel.eu/wp-content/uploads/2011/08/debug_good-300x93.jpg" alt="Proper screen from eclipse debug perspective" title="debug_good" width="300" height="93" class="size-medium wp-image-268" /></a><p class="wp-caption-text">Proper screen from eclipse debug perspective</p></div><br />
In case of debug session disconnection (eg. Tomcat restart) you may reconnect to it using Relaunch option:<br />
<div id="attachment_269" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.mwrobel.eu/wp-content/uploads/2011/08/debug_disconnected.jpg"><img src="http://blog.mwrobel.eu/wp-content/uploads/2011/08/debug_disconnected-300x243.jpg" alt="Reconnecting to debugger" title="debug_disconnected" width="300" height="243" class="size-medium wp-image-269" /></a><p class="wp-caption-text">Reconnecting to debugger</p></div><br />
9. Now you can normally set breakpoints and trace code execution of your webscript or other Alfresco SDK projects. A good test is setting a breakpoint in <strong>org.alfresco.web.bean.LoginBean</strong> at line<br />
<strong>&#8220;FacesContext context = FacesContext.getCurrentInstance();&#8221;</strong> &#8211; breakpoint should be caught at Alfresco Explorer login attemp.</p>
<p>NOTE: You may get following error message: <em>&#8220;Unable to install breakpoint in org.evolpe.webscripts.XMLwebs due to missing line number attributes. Modify compiler options to generate line number attributes.<br />
Reason:<br />
Absent Line Number Information&#8221;</em><br />
<div id="attachment_270" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.mwrobel.eu/wp-content/uploads/2011/09/missing_line_info.jpg"><img src="http://blog.mwrobel.eu/wp-content/uploads/2011/09/missing_line_info-300x124.jpg" alt="Missing line info window" title="missing_line_info" width="300" height="124" class="size-medium wp-image-270" /></a><p class="wp-caption-text">Missing line info window</p></div></p>
<p>CAUSE&#038;SOLUTION: To debug your own webscripts or other code it&#8217;s essential to enable code line number information in the compiler. If you use ant, set <strong>debug=&#8221;true&#8217;</strong> parameter in<strong> javac task</strong>.</p>
<p><strong>How to configure tomcat to debug instance of Alfresco on Windows and Linux will be described soon in my next articles.;)</strong><em></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mwrobel.eu/plhow-configure-eclipse-debug-alfresco-java-webscript-codeenhow-configure-eclipse-debug-alfresco-java-webscript-code/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to perform form field validation in Alfresco Share?</title>
		<link>http://blog.mwrobel.eu/field-validation-alfresco-share-form/</link>
		<comments>http://blog.mwrobel.eu/field-validation-alfresco-share-form/#comments</comments>
		<pubDate>Thu, 28 Jul 2011 11:57:04 +0000</pubDate>
		<dc:creator>michal.wrobel</dc:creator>
				<category><![CDATA[Alfresco]]></category>
		<category><![CDATA[Tomcat]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[share]]></category>
		<category><![CDATA[validation]]></category>

		<guid isPermaLink="false">http://blog.mwrobel.eu/?p=242</guid>
		<description><![CDATA[It&#8217;s possible to implement your own field validation function in Alfresco Share in JS by overwriting Share mandatory constraint which uses Alfresco.forms.validation.mandatory located in /opt/alfresco-3.4.d/tomcat/webapps/share/js/forms-runtime.js The default configuration can be suppressed the way described here:http://wiki.alfresco.com/wiki/Forms#constraint-handlers validation-handler parameter is the name of your own JS function. Here you can find description of validation function parameters http://wiki.alfresco.com/wiki/Forms_Developer_Guide#Validation_Handlers In [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s possible to implement your own field validation function in Alfresco Share in JS by overwriting Share mandatory constraint which uses<br />
<em><strong>Alfresco.forms.validation.mandatory</strong></em> located in <em><strong>/opt/alfresco-</strong></em><em><strong>3.4.d/tomcat/webapps/share/js/forms-runtime.js</strong></em><br />
The default configuration can be suppressed the way described here:<a title="http://wiki.alfresco.com/wiki/Forms#constraint-handlers" href="http://wiki.alfresco.com/wiki/Forms#constraint-handlers">http://wiki.alfresco.com/wiki/Forms#constraint-handlers</a><br />
<strong>validation-handler</strong> parameter is the name of your own JS function.<br />
Here you can find description of validation function parameters <a title="http://wiki.alfresco.com/wiki/Forms_Developer_Guide#Validation_Handlers" href="http://wiki.alfresco.com/wiki/Forms_Developer_Guide#Validation_Handlers">http://wiki.alfresco.com/wiki/Forms_Developer_Guide#Validation_Handlers</a></p>
<p>In the current version of Alfresco (3.4d) the validation &#8216;fails silently&#8217; which means you can&#8217;t dynamically display error message. When validation fails it&#8217;s not possible to submit the form. There are foundations for enhancement of this mechanism so it&#8217;s quite possible the &#8216;full&#8217; validation will be available in near future.<br />
You can <a href="http://blog.mwrobel.eu/wp-content/uploads/2011/07/share-form-validation-example.zip"><br />
</a></p>
<h3><a href="http://blog.mwrobel.eu/wp-content/uploads/2011/07/share-form-validation-example.zip">download full eclipse ant project for my example here</a></h3>
<p><a href="http://blog.mwrobel.eu/wp-content/uploads/2011/07/share-form-validation-example.zip"> </a></p>
<p><a href="http://blog.mwrobel.eu/wp-content/uploads/2011/07/share-form-validation-example.zip"></a>. I will provide<br />
instructions for manual installation as well.<br />
<strong>Ant installation</strong><br />
<strong>1.</strong> Set paths to tomcat directory in build.properties<br />
TOMCAT_HOME=/opt/alfresco-3.4.d/tomcatAPP_TOMCAT_HOME=/opt/alfresco-3.4.d/tomcat<br />
<strong>2.</strong> Just run &#8216;ant&#8217; in project directory.</p>
<p><strong>So, let&#8217;s start the core of this tutorial.</strong><br />
<strong>1. </strong>I implemented my own simple data model for this example. As it is not complicated, nor directly connected with validation its self I just attach needed files with my project.If you&#8217;re not familiar with defining data models you can read about it for instance, here<br />
tutorial:<a title="http://www.tribloom.com/blogs/michael/2011/04/18/alfresco-repository-webscript/" href="http://www.tribloom.com/blogs/michael/2011/04/18/alfresco-repository-webscript/">http://www.tribloom.com/blogs/michael/2011/04/18/alfresco-repository-webscript/</a></p>
<p><a title="http://www.tribloom.com/blogs/michael/2011/04/18/alfresco-repository-webscript/" href="http://www.tribloom.com/blogs/michael/2011/04/18/alfresco-repository-webscript/"></a>detailed documentation: <a title="http://wiki.alfresco.com/wiki/Data_Dictionary_Guide#The_Data_Dictionary" href="http://wiki.alfresco.com/wiki/Data_Dictionary_Guide#The_Data_Dictionary">http://wiki.alfresco.com/wiki/Data_Dictionary_Guide#The_Data_Dictionary</a><br />
<strong>validationModel.xml </strong>goes to<strong> /opt/alfresco-3.4.d/tomcat/webapps/alfresco/WEB-</strong><strong>INF/classes/alfresco/extension/model</strong><br />
<strong>validation-model-context.xml</strong> goes to <strong>/opt/alfresco-</strong><strong>3.4.d/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/extension/</strong></p>
<p>2.<strong> share-config-validation-custom.xml</strong> goes to<strong> /opt/alfresco-3.4.d/tomcat/webapps/share/WEB-INF/classes/alfresco/web-extension</strong><br />
This file contains definition of create and edit forms for the new data type.<br />
Piece of code concerning validation:</p>
<p><span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; font-size: 12px; line-height: 18px; white-space: pre;"><br />
</span></p>
<pre class="brush: xml; gutter: true">&lt;field id="ex:gross" label-id="example.price.gross" mandatory="true"
	help-id="example.price.gross.help"&gt;
	&lt;constraint-handlers&gt;
		&lt;!-- validation-handler param: js function name --&gt;
		&lt;constraint type="MANDATORY"
			validation-handler="Alfresco.forms.validation.exampleGrossValidation"
			event="keyup" /&gt;
	&lt;/constraint-handlers&gt;
&lt;/field&gt;</pre>
<p>&nbsp;</p>
<p><strong>Alfresco.forms.validation.exampleGrossValidation </strong>is the name of js validation<br />
function.<br />
3.<strong> exampleFormValidation.js </strong>and <strong>exampleFormValidation-min.js</strong> go to<strong>/opt/alfresco-3.4.d/tomcat/webapps/share/components/form</strong></p>
<pre>
<pre class="brush: javascript; gutter: true">Alfresco.forms.validation.exampleGrossValidation = function exampleGrossValidation(field, args,
  event, form, silent, message) {
 

  var valid = true;

  valid = YAHOO.lang.trim(field.value).length !== 0;  // check if field is not empty

// referencing to form fields is possible by following convention:
// field object passed to function representing validated field has an object form representing the whole form
// field object names are created by concating 'prop_'+{namespace from data model}_+{property name from data model}
  var net = field.form.prop_ex_net.value;
  var gross = field.form.prop_ex_gross.value;
  var rate = field.form.prop_ex_rate.value;

  var check = ((rate/100) + 1) * net;

  if((Math.abs(gross - check)) &gt; 0.01)  // check if gross has a valid value with given precision
{
valid = false;
}

  return valid;
};
</pre>
<p>&nbsp;</pre>
<p>4. <strong>exampleValidation_pl_PL.properties (</strong>labels for forms) goes to<strong>/opt/alfresco-3.4.d/tomcat/webapps/share/WEB-INF/classes/alfresco/messages</strong></p>
<p><strong> </strong><br />
<strong>You have to modify following files:</strong></p>
<p><strong> </strong><br />
1. <strong>slingshot-application-context.xml </strong>at<strong> /opt/alfresco-3.4.d/tomcat/webapps/share/WEB-INF/classes/alfresco/</strong><br />
Paths to share-config-validation-custom.xml and exampleValidation_pl_PL.properties go there<br />
At xPath &#8216;/beans/bean/constructor-arg/list&#8217; add:</p>
<p>&lt;value&gt;classpath:alfresco/web-extension/share-config-validation-custom.xml&lt;/value&gt;<br />
At xPath &#8216;/beans/bean/property/list&#8217; add:</p>
<p>&lt;value&gt;alfresco.messages.exampleValidation&lt;/value&gt;</p>
<p>2. <strong>form.get.head.ftl</strong> &#8211; link to .js fileat <strong>/opt/alfresco-3.4.d/tomcat/webapps/share/WEB-INF/classes/alfresco/site-webscripts/org/alfresco/components/form</strong><br />
Add: &lt;@script type=&#8221;text/javascript&#8221; src=&#8221;${page.url.context}/res/components/form/exampleFormValidation.js&#8221;&gt;&lt;/@script&gt;</p>
<p>3. <strong>toolbar.get.config.xml </strong>- In this file we can add a new option in menu &#8216;Create content&#8217; in Alfresco Share Site.<br />
at <strong>/opt/alfresco-3.4.d/tomcat/webapps/share/WEB-INF/classes/alfresco/site-webscripts/org/alfresco/components/documentlibrary/</strong><br />
add :<br />
&lt;content mimetype=&#8221;text/xml&#8221; icon=&#8221;xml&#8221; label=&#8221;example.price.menu&#8221; itemid=&#8221;ex:price&#8221;/&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mwrobel.eu/field-validation-alfresco-share-form/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Alfresco document preview doesn&#8217;t work for MS Office files (.doc, .docx, .ppt .pptx etc) although it works  for pdf files. I get &#8220;This document can&#8217;t be previewed.&#8221; message.</title>
		<link>http://blog.mwrobel.eu/alfresco-preview-office-doc-docx-ppt-pptx-doesnt-work/</link>
		<comments>http://blog.mwrobel.eu/alfresco-preview-office-doc-docx-ppt-pptx-doesnt-work/#comments</comments>
		<pubDate>Wed, 08 Jun 2011 12:55:14 +0000</pubDate>
		<dc:creator>michal.wrobel</dc:creator>
				<category><![CDATA[Alfresco]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[alfresco]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://blog.mwrobel.eu/?p=239</guid>
		<description><![CDATA[For reasons which are not obvious for me the installation and starting of alfrescoOpenOffice service doesn&#8217;t always work properly during automated Alfresco install/start script execution. If you have the same problem here is the solution for windows environment. 1. Start &#8211; &#62; run  - &#62; services.msc Check if alfrescoOpenOffice service is listed. If not go [...]]]></description>
			<content:encoded><![CDATA[<p>For reasons which are not obvious for me the installation and starting of alfrescoOpenOffice service doesn&#8217;t<br />
always work properly during automated Alfresco install/start script execution. If you have the same problem<br />
here is the solution for windows environment.<br />
1. Start &#8211; &gt; run  - &gt; <strong>services.msc</strong> Check if <strong>alfrescoOpenOffice service</strong> is listed. If not go to {alfresco install dir}\openoffice\scriptsand execute &#8220;<strong>openoffice_serviceinstall INSTALL</strong>&#8221; with administrative privileges.</p>
<p>2. Every time after starting alfresco by {alfresco install dir}\<strong>servicerun STAR</strong>T execute also{alfresco install dir}\openoffice\scripts\<strong>openoffice_servicerun START</strong>.</p>
<p>3. If you&#8217;re not happy with auto starting openoffice service with Windows change alfrescoOpenOffice execution<br />
type to &#8220;Manual&#8221;.</p>
<p>4. MS Office documents preview in Alfresco should be working just fine now <img src='http://blog.mwrobel.eu/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mwrobel.eu/alfresco-preview-office-doc-docx-ppt-pptx-doesnt-work/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>I get &#8220;Unable to locate the Javac Compiler&#8221; when trying to build using IAM Maven Eclipse plugin.</title>
		<link>http://blog.mwrobel.eu/unable-to-locate-the-javac-compiler-error-using-iam-maven-eclipse-plugin/</link>
		<comments>http://blog.mwrobel.eu/unable-to-locate-the-javac-compiler-error-using-iam-maven-eclipse-plugin/#comments</comments>
		<pubDate>Wed, 25 May 2011 14:47:23 +0000</pubDate>
		<dc:creator>michal.wrobel</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Maven]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Programming environments]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[IAM]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[maven]]></category>

		<guid isPermaLink="false">http://blog.mwrobel.eu/?p=232</guid>
		<description><![CDATA[Problem: When trying to build maven project using IAM under Eclipse I get an error like this: &#34;Unable to locate the Javac Compiler in:C:\\Program Files\\Java\\jre6\..\\lib\\tools.jar Please ensure you are using JDK 1.4 or above and not a JRE (the com.sun.tools.javac.Main class is required). In most cases you can change the location of your Java installation [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Problem: </strong><br />
When trying to build maven project using IAM under Eclipse I get an error like this:</p>
<pre class="brush: xml; title: ; wrap-lines: true;">

&quot;Unable to locate the Javac Compiler in:C:\\Program
Files\\Java\\jre6\..\\lib\\tools.jar
Please ensure you are using JDK 1.4 or above and
not a JRE (the com.sun.tools.javac.Main class is required).
In most cases you can change the location of your Java
installation by setting the JAVA_HOME environment variable&quot;
</pre>
<p>,nevertheless I have proper installation of newest Java JDK and JAVA_HOME is properly set.<br />
The problem never occured before.</p>
<p><strong>Solution:</strong></p>
<p>I know two possible causes of that problem:</p>
<p>1. Eclipse uses its own JRE to start, and IAM does the same. You&#8217;ve recently installed a new maven plugin and it requires JDK.<br />
You can force Eclipse to start using directly given Java VM by starting it that way from command line:</p>
<p><strong>&#8220;X:\\path\to\\eclipse\\eclipse.exe -vm JAVA_JDK_PATH&#8221;</strong></p>
<p>2. There also cases when IAM brokes up without apparent cause, and that happend to me.<br />
The reason may be IAM itself.<br />
Try standard tricks checklist from my another post here:<br />
<a title="Problems using Eclipse IAM and Maven" href="http://blog.mwrobel.eu/eclipse-iam-maven-problems/" target="_blank">Problems using Eclipse IAM and Maven</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mwrobel.eu/unable-to-locate-the-javac-compiler-error-using-iam-maven-eclipse-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I get &#8220;The processing instruction target matching &#8220;[xX][mM][lL]&#8221; is not allowed.&#8221; error during start of Alfresco.</title>
		<link>http://blog.mwrobel.eu/processing-instruction-target-notallowed-error-start-alfrescoeni-processing-instruction-target-matching-xxmmll-allowed-error-start-alfresco/</link>
		<comments>http://blog.mwrobel.eu/processing-instruction-target-notallowed-error-start-alfrescoeni-processing-instruction-target-matching-xxmmll-allowed-error-start-alfresco/#comments</comments>
		<pubDate>Wed, 11 May 2011 14:12:00 +0000</pubDate>
		<dc:creator>michal.wrobel</dc:creator>
				<category><![CDATA[Alfresco]]></category>
		<category><![CDATA[alfresco]]></category>

		<guid isPermaLink="false">http://blog.mwrobel.eu/?p=218</guid>
		<description><![CDATA[If you just defined a new content type in Alfresco the cause may be empty characters at the beginning of the model context file, nevertheless it&#8217;s grammatically correct the parser can&#8217;t get through. Eg. it may result in a stack trace similiar to: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from URL location [classpath:alfresco/application-context.xml] Offending resource: [...]]]></description>
			<content:encoded><![CDATA[<p>If you just defined a new content type in Alfresco the cause may be empty characters at the beginning of the model context file, nevertheless it&#8217;s grammatically correct the parser can&#8217;t get through.</p>
<p>Eg. it may result in a stack trace similiar to:</p>
<pre class="brush: xml; title: ; wrap-lines: true;">

org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem:
Failed to import bean definitions from URL location [classpath:alfresco/application-context.xml]
Offending resource: ServletContext resource [/WEB-INF/web-application-context.xml];
nested exception is org.springframework.beans.factory.parsing.BeanDefinitionParsingException:
 Configuration problem: Failed to import bean definitions from URL location
 [classpath*:alfresco/extension/*-context.xml]Offending resource: class path resource
[alfresco/application-context.xml]; nested exception is
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException:
Line 1 in XML document from file [D:\\xxxxxx-model-context.xml] is invalid;
nested exception is org.xml.sax.SAXParseException:
The processing instruction target matching &quot;[xX][mM][lL]&quot; is not allowed.
at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68)
....
</pre>
<p>Also watch out for the <strong>empty characters at the end of file paths</strong> in configuration xmls cause problems, alfresco can&#8217;t find these files.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mwrobel.eu/processing-instruction-target-notallowed-error-start-alfrescoeni-processing-instruction-target-matching-xxmmll-allowed-error-start-alfresco/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tomcat uses wrong path although CATALINA_HOME and CATALINA_BASE have correct values.</title>
		<link>http://blog.mwrobel.eu/tomcat-uses-wrong-path-catalina_home-catalina-base-correc/</link>
		<comments>http://blog.mwrobel.eu/tomcat-uses-wrong-path-catalina_home-catalina-base-correc/#comments</comments>
		<pubDate>Tue, 26 Apr 2011 15:04:06 +0000</pubDate>
		<dc:creator>michal.wrobel</dc:creator>
				<category><![CDATA[Alfresco]]></category>
		<category><![CDATA[Tomcat]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[alfresco]]></category>
		<category><![CDATA[tomcat]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://blog.mwrobel.eu/?p=212</guid>
		<description><![CDATA[The cause of the problem may be that your web application uses tomcat6.exe instead of catalina.bat to start up.  From my observations it seems tomcat6.exe as opposed to catalina.bat uses environment variables only for the 1st run to copy CATALINA_HOME and CATALINA_BASE values to Windows Registry. Thereafter these parameters start to live on their own;) [...]]]></description>
			<content:encoded><![CDATA[<p>The cause of the problem may be that your web application uses<strong> tomcat6.exe </strong>instead of <strong>catalina.bat</strong> to start up.  From my observations it seems tomcat6.exe as opposed to catalina.bat uses environment variables only for the 1st run to copy <strong>CATALINA_HOME</strong> and<strong> CATALINA_BASE </strong>values to Windows Registry. Thereafter these parameters start to live on their own;) I had one instance of Tomcat for my Openbravo developer stack and the other for Alfresco. Tomcat6.exe used old values regardless of completly separate instalation of Alfresco dev stack.<br />
You can edit these and other variables directly via Windows Registry editor, the path is:</p>
<p><strong>HKLM/SOFTWARE/Apache Software Foundation/&#8230;..</strong></p>
<p><strong> </strong>or more conveniently you can use tomcat6w.exe GUI:</p>
<p><strong>tomcat6w //ES//&lt;serviceName&gt; (eg. tomcat6w //ES//alfrescoTomcat)</strong></p>
<p><strong> </strong>calls a neat window where you can edit variables you need to run your web app properly.</p>
<p>there&#8217;s also <strong>//MS//</strong> parameter which will call a simple application monitoring given service:</p>
<p><strong>tomcat6w //MS//&lt;serviceName&gt;</strong></p>
<p>If you want to read more about <strong>running Tomcat as Windows service with tomcat6.exe</strong> go to <a title="an article from Apache Tomcat documentation" href="http://tomcat.apache.org/tomcat-6.0-doc/windows-service-howto.html#Tomcat6_service_application">an article from Apache Tomcat documentation.</a></p>
<p>Hope this helps someone:)</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mwrobel.eu/tomcat-uses-wrong-path-catalina_home-catalina-base-correc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Alfresco repository full text search example using CMIS webservices</title>
		<link>http://blog.mwrobel.eu/alfresco-repository-full-text-search-cmis-webservices/</link>
		<comments>http://blog.mwrobel.eu/alfresco-repository-full-text-search-cmis-webservices/#comments</comments>
		<pubDate>Tue, 19 Apr 2011 14:52:48 +0000</pubDate>
		<dc:creator>michal.wrobel</dc:creator>
				<category><![CDATA[Alfresco]]></category>
		<category><![CDATA[alfresco]]></category>
		<category><![CDATA[CMIS]]></category>
		<category><![CDATA[CMIS-SQL]]></category>
		<category><![CDATA[ECM]]></category>
		<category><![CDATA[FTS]]></category>
		<category><![CDATA[webservices]]></category>

		<guid isPermaLink="false">http://blog.mwrobel.eu/?p=202</guid>
		<description><![CDATA[It&#8217;s easily achieavable to perform a full text search on common format documents (like .doc, .pdf) stored in Alfresco repository. What&#8217;s more it&#8217;s also possible to get relevance of documents found against desired keywords. A short example: POST &#60;host&#62;/alfresco/service/cmis/queries Content-Type:application/cmisquery+xml Http basic auth required! &#60;cmis:query xmlns:cmis=&#34;http://docs.oasis-open.org/ns/cmis/core/200908/&#34;&#62; 1. &#60;cmis:statement&#62;SELECT cmis:name, SCORE() FROM cmis:document WHERE CONTAINS('niceWord')&#60;/cmis:statement&#62; &#60;cmis:searchAllVersions&#62;true&#60;/cmis:searchAllVersions&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s easily achieavable to perform a <strong>full text search</strong> on common format documents (<strong>like .doc, .pdf</strong>) stored in Alfresco repository. What&#8217;s more it&#8217;s also possible to get relevance of documents found against desired keywords.</p>
<p>A short example:</p>
<pre class="brush: xml; title: ;">
POST &lt;host&gt;/alfresco/service/cmis/queries
Content-Type:application/cmisquery+xml
Http basic auth required!
&lt;cmis:query xmlns:cmis=&quot;http://docs.oasis-open.org/ns/cmis/core/200908/&quot;&gt;
1.	&lt;cmis:statement&gt;SELECT cmis:name, SCORE() FROM cmis:document WHERE CONTAINS('niceWord')&lt;/cmis:statement&gt;
	&lt;cmis:searchAllVersions&gt;true&lt;/cmis:searchAllVersions&gt;
        &lt;cmis:includeAllowableActions&gt;false&lt;/cmis:includeAllowableActions&gt;
        &lt;cmis:includeRelationships&gt;none&lt;/cmis:includeRelationships&gt;
        &lt;cmis:renditionFilter&gt;*&lt;/cmis:renditionFilter&gt;
2.     	&lt;cmis:maxItems&gt;50&lt;/cmis:maxItems&gt;
3.     	&lt;cmis:skipCount&gt;0&lt;/cmis:skipCount&gt;
&lt;/cmis:query&gt;
</pre>
<p>A few important details:</p>
<p><strong>1.</strong> SCORE() returns relevance of document found against expression passed to CONTAINS() function. In Alfresco you can use powerful FTS language as CONTAINS() parameter but it means losing compliance with CMIS-SQL standard.</p>
<ul>
<li>Info about FTS is delivered here: <a title="http://wiki.alfresco.com/wiki/Full_Text_Search_Query_Syntax" href="http://wiki.alfresco.com/wiki/Full_Text_Search_Query_Syntax">http://wiki.alfresco.com/wiki/Full_Text_Search_Query_Syntax</a>,</li>
<li>and standard CMIS-SQL CONTAINS() syntax is desribed here:  <a title="http://wiki.alfresco.com/wiki/CMIS_Query_Language#text_search_predicate" href="http://wiki.alfresco.com/wiki/CMIS_Query_Language#text_search_predicate">http://wiki.alfresco.com/wiki/CMIS_Query_Language#text_search_predicate</a></li>
</ul>
<p><strong>2. , 3.</strong> Paging effect. It&#8217;s recommend to always use paging because Alfresco doesn&#8217;t guarantee that it will return all entries if there is a lot of them.</p>
<p>And that&#8217;s all, you will receive a neat list of entries meeting your requirements.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mwrobel.eu/alfresco-repository-full-text-search-cmis-webservices/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to upload a new file to Alfresco using web services?</title>
		<link>http://blog.mwrobel.eu/uploading-big-file-alfresco-web-services/</link>
		<comments>http://blog.mwrobel.eu/uploading-big-file-alfresco-web-services/#comments</comments>
		<pubDate>Mon, 18 Apr 2011 15:20:18 +0000</pubDate>
		<dc:creator>michal.wrobel</dc:creator>
				<category><![CDATA[Alfresco]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[alfresco]]></category>
		<category><![CDATA[CMIS]]></category>
		<category><![CDATA[ECM]]></category>
		<category><![CDATA[webservices]]></category>

		<guid isPermaLink="false">http://blog.mwrobel.eu/?p=182</guid>
		<description><![CDATA[Uploading a big binary file to alfresco repository using CMIS web services and UploadContentServlet]]></description>
			<content:encoded><![CDATA[<div>
<div style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #ffffff; font: normal normal normal 13px/19px Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; font-family: 'Times New Roman'; line-height: normal; font-size: medium; padding: 0.6em; margin: 0px;">
<div style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #ffffff; font: normal normal normal 13px/19px Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; background-position: initial initial; background-repeat: initial initial; padding: 0.6em; margin: 0px;">
<p>There are some examples how to upload a file to alfresco using <strong>UploadContentServlet</strong> but they all show how to code it directly in Java. Documentation and forum lacks an example showing how to upload a large file using Alfresco web services. After a bit of struggle I figured it out.</p>
<p>Quick and dirty recipe:</p>
<ol>
<li><strong>Perform      ticket authorization</strong></li>
</ol>
<pre class="brush: xml; title: ;">
POST /alfresco/service/api/login
{
&quot;username&quot; : &quot;admin&quot;,
&quot;password&quot; : &quot;admin&quot;
}
</pre>
<p>You&#8217;ll get response with ticket in it.</p>
<ol>
<li><strong>Create a new document using CMIS services</strong></li>
</ol>
<pre class="brush: xml; title: ;">POST /alfresco/service/cmis/i/176c5f4d-db63-49ec-9886-c19d6d9eefce/children
Content-Type:application/atom+xml;type=entry

&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;entry xmlns=&quot;http://www.w3.org/2005/Atom&quot;
xmlns:cmisra=&quot;http://docs.oasis-open.org/ns/cmis/restatom/200908/&quot;
xmlns:cmis=&quot;http://docs.oasis-open.org/ns/cmis/core/200908/&quot;&gt;
&lt;title&gt;important document&lt;/title&gt;
&lt;summary&gt;VERY important document&lt;/summary&gt;
&lt;content type=&quot;text/plain&quot;&gt;
MS4gR2l0YSAKIDIuIEthcm1heW9nYSBieSBWaXZla2FuYW5k
&lt;/content&gt;
&lt;cmisra:object&gt;
&lt;cmis:properties&gt;
&lt;cmis:propertyId propertyDefinitionId=&quot;cmis:objectTypeId&quot;&gt;&lt;cmis:value&gt;cmis:document&lt;/cmis:value&gt;&lt;/cmis:propertyId&gt;
&lt;/cmis:properties&gt;
&lt;/cmisra:object&gt;
&lt;/entry&gt;</pre>
<p><strong>/i/176c5f4d-db63-49ec-9886-c19d6d9eefce denotes folder to create document within.</strong></p>
<p>It is also possible to refer to directories in more natural way &#8211; using names.</p>
<p>More info provided here:  <a href="http://wiki.alfresco.com/wiki/CMIS_Web_Scripts_Reference#Create_.2F_Move_a_Folder_or_Document_.28createDocument.2C_createFolder.2C_createPolicy.2C_moveObject.29">http://wiki.alfresco.com/wiki/CMIS_Web_Scripts_Reference#Create_.2F_Move_a_Folder_or_Document_.28createDocument.2C_createFolder.2C_createPolicy.2C_moveObject.29</a>You will get quite big chunk of xml with a lot info about newly uploaded document, among these informations you&#8217;ll find ID of the document.</p>
<p>3.  <strong>Overwrite the new document with your big file</strong></p>
<pre class="brush: xml; title: ; wrap-lines: true;">PUT /alfresco/upload/workspace/SpacesStore/85c43689-4a38-4a0a-8e58-e24333ffec14/test.pdf?ticket=TICKET_fc7af4c45f138ad366dd5905aaf7a4ab8b9da268</pre>
<p><strong>Send file as body of request.</strong></p>
<p>More info about <strong>UploadContentServlet : </strong><a title="http://wiki.alfresco.com/wiki/URL_Addressability#UploadContentServlet" href="http://wiki.alfresco.com/wiki/URL_Addressability#UploadContentServlet" target="_blank">http://wiki.alfresco.com/wiki/URL_Addressability#UploadContentServlet</a></p>
<p><strong>And that&#8217;s all, your file is ready in Alfresco repository!</strong></p>
</div>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.mwrobel.eu/uploading-big-file-alfresco-web-services/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>I get NoClassDefFound for ContextLoaderListener class using Spring and Eclipse IAM Maven plugin</title>
		<link>http://blog.mwrobel.eu/noclassdeffound-contextloaderlistener-class-spring-eclipse-iam-maven-plugin/</link>
		<comments>http://blog.mwrobel.eu/noclassdeffound-contextloaderlistener-class-spring-eclipse-iam-maven-plugin/#comments</comments>
		<pubDate>Mon, 28 Mar 2011 12:34:58 +0000</pubDate>
		<dc:creator>michal.wrobel</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Maven]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Programming environments]]></category>
		<category><![CDATA[Tomcat]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[IAM]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[maven]]></category>
		<category><![CDATA[NoClassDefFoundError]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[tomcat]]></category>

		<guid isPermaLink="false">http://blog.mwrobel.eu/?p=178</guid>
		<description><![CDATA[I get NoClassDefFound for ContextLoaderListener class using Spring and Eclipse IAM Maven plugin. A few simple solutions.]]></description>
			<content:encoded><![CDATA[<p>My most common headache during my last Spring project was:</p>
<pre class="brush: java; title: ;">

java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
</pre>
<p>during start of Tomcat.</p>
<p>Every source pointed to problems with <strong>spring.jar</strong>, so I suspected having some version conflict between my Spring libraries (eg. I used also Spring-WS in an old version). But that wasn&#8217;t real cause and I&#8217;d wasted a lot of time. The real problem was <strong>faulty Eclipse IAM plugin</strong>.</p>
<p>Try out some tricks I&#8217;ve described in my another article : <a title="Problems using Eclipse IAM and Maven" href="http://blog.mwrobel.eu/eclipse-iam-maven-problems/" target="_self"><strong>Problems using Eclipse IAM and Maven</strong></a></p>
<p>They really may help you.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mwrobel.eu/noclassdeffound-contextloaderlistener-class-spring-eclipse-iam-maven-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Problems using Eclipse IAM and Maven</title>
		<link>http://blog.mwrobel.eu/eclipse-iam-maven-problems/</link>
		<comments>http://blog.mwrobel.eu/eclipse-iam-maven-problems/#comments</comments>
		<pubDate>Mon, 28 Mar 2011 11:02:44 +0000</pubDate>
		<dc:creator>michal.wrobel</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Maven]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Programming environments]]></category>
		<category><![CDATA[Tomcat]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[IAM]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[maven]]></category>
		<category><![CDATA[NoClassDefFoundError]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[tomcat]]></category>

		<guid isPermaLink="false">http://blog.mwrobel.eu/?p=169</guid>
		<description><![CDATA[Problems using Eclipse IAM and Maven. NoClassDefFound error.]]></description>
			<content:encoded><![CDATA[<p>During my last project I was involved, I used Eclipse IAM plugin for integration with Maven. It caused many problems, mainly Class not found exceptions and issues with Tomcat server.</p>
<p>Generally I perceived that Eclipse IAM tends to lose jars from pom.xml, what leads to unexpected, bizarre time wasting NoClassDefFoundError.</p>
<p>Unfortunately I hadn&#8217;t been sucessful in finding causes of my problems but I&#8217;d like to share with you my standard &#8216;IAM problems checklist&#8217; <img src='http://blog.mwrobel.eu/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>If you have any problems try this (in specified order) :</p>
<ol>
<li>Use refresh, then fetch source jars option from maven menu.</li>
<li>Try cleaning maven libraries, then do &#8217;1.&#8217;</li>
<li>After doing &#8217;2.&#8217;, remove your app from Tomcat, clean server, then deploy again.</li>
<li>Try removing whole server, then add it again.</li>
<li>REMOVE AND REGENERATE WHOLE WORKSPACE</li>
</ol>
<p>Any step mentioned above is not a joke. I had really to &#8216;reset&#8217; workspace a few times to make things work again.. First three steps helped me in 80% cases.</p>
<p>I hope my tips will save your time.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.mwrobel.eu/eclipse-iam-maven-problems/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

