<?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>Loftux AB &#187; Uncategorized</title>
	<atom:link href="http://loftux.com/category/uncategorized-en/feed/" rel="self" type="application/rss+xml" />
	<link>http://loftux.com</link>
	<description>Dokumenthantering och informationshantering med öppen källkod</description>
	<lastBuildDate>Fri, 04 May 2012 11:11:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Google Site News dashlet with Drag and drop configuration</title>
		<link>http://loftux.com/2011/03/07/google-site-news-dashlet-with-drag-and-drop-configuration/</link>
		<comments>http://loftux.com/2011/03/07/google-site-news-dashlet-with-drag-and-drop-configuration/#comments</comments>
		<pubDate>Mon, 07 Mar 2011 08:31:06 +0000</pubDate>
		<dc:creator>Peter Löfgren</dc:creator>
				<category><![CDATA[Uncategorized @en]]></category>
		<category><![CDATA[dashlet]]></category>
		<category><![CDATA[dnd]]></category>
		<category><![CDATA[extras]]></category>
		<category><![CDATA[share]]></category>

		<guid isPermaLink="false">http://loftux.se/?p=648</guid>
		<description><![CDATA[<p><a href="http://loftux.se/wp-content/uploads/2011/03/GoogleSiteNewsDashlet.png"></a>If you are looking for plugins to Alfresco Share, Will Abson (<a href="http://blogs.alfresco.com/wp/wabson/">personal blog</a>) has created an excellent collection of dashlets, themes and document actions available at<a href="http://code.google.com/p/share-extras/"> Share Extras</a>. To this collection I have contributed a dashlet, Google Site News, the first version created soon after the release of the initial release of [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://loftux.se/wp-content/uploads/2011/03/GoogleSiteNewsDashlet.png"><img src="http://loftux.se/wp-content/uploads/2011/03/GoogleSiteNewsDashlet-185x300.png" alt="" title="GoogleSiteNewsDashlet" width="185" height="300" class="alignleft size-medium wp-image-641" /></a>If you are looking for plugins to Alfresco Share, Will Abson (<a href="http://blogs.alfresco.com/wp/wabson/">personal blog</a>) has created an excellent collection of dashlets, themes and document actions available at<a href="http://code.google.com/p/share-extras/"> Share Extras</a>. To this collection I have contributed a dashlet, Google Site News, the first version created soon after the release of the initial release of Alfresco Share. It has been available as part of the Alfresco Developer Toolbox downloadable from the Alfresco web site.</p>
<p>The first version was not configurable, and only took the name from the site and showed you what had been indexed base on the site name. Hence the dashlet name, it is news about what is in the index about your site (again, based on the name, not the site content). That worked well as an example of how to create a dashlet, but to be really useful it needed a configuration option to allow for custom searches.</p>
<p><a href="http://loftux.se/wp-content/uploads/2011/03/ConfigureGoogleSiteNews.png"><img src="http://loftux.se/wp-content/uploads/2011/03/ConfigureGoogleSiteNews-300x177.png" alt="" title="ConfigureGoogleSiteNews" width="300" height="177" class="alignleft size-medium wp-image-638" /></a>The version that is available for download from the Share Extras website now has option to configure search terms (still uses the site name if you do not configure). You can use the search options you would user for a google search to get more accurate search results. You can also set the number of days back from today to be shown. With drag and drop you can configure what searches (tabs) and the order searchers should be displayed int the dashlet.</p>
<p><a href="http://code.google.com/p/share-extras/downloads/detail?name=google-site-news-dashlet-0.2.jar&#038;can=2&#038;q=">Download</a>. <a href="http://code.google.com/p/share-extras/wiki/GoogleSiteNewsDashlet">Instructions</a>.</p>
<p>Download the jar file, already compiled, just drop in bin (see <a href="http://code.google.com/p/share-extras/wiki/GoogleSiteNewsDashlet">instructions</a>) and try it out. Or download source to create your own version. You can contribute localizations (currently available in English and Swedish) if you like. Or maybe you have your own Share add-on that you would like to contribute to the Alfresco Community?</p>
]]></content:encoded>
			<wfw:commentRss>http://loftux.com/2011/03/07/google-site-news-dashlet-with-drag-and-drop-configuration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Touchpad client for Alfresco based on jQuery Mobile</title>
		<link>http://loftux.com/2011/01/27/touchpa-client-for-alfresco-based-on-jquery-mobile/</link>
		<comments>http://loftux.com/2011/01/27/touchpa-client-for-alfresco-based-on-jquery-mobile/#comments</comments>
		<pubDate>Thu, 27 Jan 2011 08:37:32 +0000</pubDate>
		<dc:creator>Peter Löfgren</dc:creator>
				<category><![CDATA[Uncategorized @en]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[share]]></category>
		<category><![CDATA[touchpad]]></category>

		<guid isPermaLink="false">http://loftux.se/?p=566</guid>
		<description><![CDATA[<p>As many others did this christmas I got myself an iPad. And what better use could have of your Touchpad than browse your document repository with it?<br /> Alfresco Share isn&#8217;t really Touchpad friendly, and the beta Mobile client Alfresco did hasn&#8217;t been updated for the latest versions. My guess is Alfresco will release something [...]]]></description>
			<content:encoded><![CDATA[<p>As many others did this christmas I got myself an iPad. And what better use could have of your Touchpad than browse your document repository with it?<br />
Alfresco Share isn&#8217;t really Touchpad friendly, and the beta Mobile client Alfresco did hasn&#8217;t been updated for the latest versions. My guess is Alfresco will release something more touchpad/mobile friendly, but why wait?</p>
<p>I wanted to create something web based, and found the <a href="http://jquerymobile.com/">jQuery Mobile</a> framework:</p>
<blockquote><p>A unified user interface system across all popular mobile device platforms, built on the rock-solid jQuery and jQuery UI foundation. Its lightweight code is built with progressive enhancement, and has a flexible, easily themeable design.</p></blockquote>
<p>It is still Alpha, but with this framework I could really quickly create a simple browser based client. And since jQuere Mobile tries to support as many plattforms as possible, it should work not only with iPad, but Android and Blackberry devices as well.</p>
<p><object width="595" height="360"><param name="movie" value="http://www.youtube.com/e/MY7WUTfnFSU"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/e/MY7WUTfnFSU" type="application/x-shockwave-flash" width="595" height="360" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>I did this within the existing Share client instead of creating a standalone, This so I could reuse what is already there, such as login and connectivity to repo. Current Share login dialog is not optimal with touch screens as it insist on recenter itself, but that could be fixed. I&#8217;ve reused some javascript code from Alfresco dashlets, and the old mobile client, and created some new code. I didn&#8217;t have to create any client side javascript code for now, as the client just support browsing Share Sites. That would probably change once you start adding more advanced stuff, but I&#8217;m really amazed what you get out of the box of jQuery Mobile.</p>
<p>There are some design decisions that could probably be changed. jQuery Mobile uses ajax based page loading with # in the url, <server>/basefolder/basepage.html#subfolder/subpagetoload.html. In this case it loads <server>/basefolder/subfolder/subpagetoload.html. I first wasn&#8217;t sure if this supported absolute paths and that it would work with Share pages, so I created on start page, <server>/share/page/lxmobile that is subpaged, <server>/share/page/lxmobile/{mpage}, with components instead to support relative paths. I ended up using absolute paths in links anyway to have it working safely, and would use stand alone pages if starting over again.</p>
<p>You can download and test this yourself. Source code is <a href='http://loftux.se/wp-content/uploads/2011/01/LoftuxMobile.zip'>attached (download here)</a> tested with Community 3.4.c, and to test this you can drop the lxmobile.jar in webapps/share/WEB-INF/lib and restart. The are many features of jQuery Mobile that could be useful, such as dialogs, buttons and forms, if it is to be taken to the next level of actual usability.</p>
]]></content:encoded>
			<wfw:commentRss>http://loftux.com/2011/01/27/touchpa-client-for-alfresco-based-on-jquery-mobile/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Previews of Outlook MSG files</title>
		<link>http://loftux.com/2010/12/16/previews-of-outlook-msg-files/</link>
		<comments>http://loftux.com/2010/12/16/previews-of-outlook-msg-files/#comments</comments>
		<pubDate>Thu, 16 Dec 2010 17:38:19 +0000</pubDate>
		<dc:creator>Peter Löfgren</dc:creator>
				<category><![CDATA[Uncategorized @en]]></category>
		<category><![CDATA[outlook]]></category>
		<category><![CDATA[Preview]]></category>
		<category><![CDATA[share]]></category>
		<category><![CDATA[Thumbnails]]></category>

		<guid isPermaLink="false">http://loftux.se/?p=551</guid>
		<description><![CDATA[<p>Here is a quick tip for getting previews if you store Microsoft Outlook msg format files in Alfresco Share. By default it creates no previews, but all it takes is a little configuration, supporting transformers are already in place.<br /> <br /> Create a file in tomcat/shared/classes/alfresco/extension and name it msg-preview-context.xml, with content</p> <p>It will [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a quick tip for getting previews if you store Microsoft Outlook msg format files in Alfresco Share. By default it creates no previews, but all it takes is a little configuration, supporting transformers are already in place.<br />
<span id="more-551"></span><br />
Create a file in tomcat/shared/classes/alfresco/extension and name it msg-preview-context.xml, with content</p>
<pre class="brush: xml; title: ; notranslate">&lt;?xml version='1.0' encoding='UTF-8'?&gt;
&lt;!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'&gt;
&lt;beans&gt;
   &lt;!-- This transformer allows for the webpreviewing of outlook msg files. --&gt;
   &lt;bean id=&quot;transformer.complex.Msg2swf&quot;
        class=&quot;org.alfresco.repo.content.transform.ComplexContentTransformer&quot;
        parent=&quot;baseContentTransformer&quot; &gt;
      &lt;property name=&quot;transformers&quot;&gt;
         &lt;list&gt;
            &lt;ref bean=&quot;transformer.OutlookMsg&quot; /&gt;
            &lt;ref bean=&quot;transformer.PdfBox.TextToPdf&quot; /&gt;
            &lt;ref bean=&quot;transformer.Pdf2swf&quot; /&gt;
         &lt;/list&gt;
      &lt;/property&gt;
      &lt;property name=&quot;intermediateMimetypes&quot;&gt;
         &lt;list&gt;
            &lt;value&gt;text/plain&lt;/value&gt;
            &lt;value&gt;application/pdf&lt;/value&gt;
         &lt;/list&gt;
      &lt;/property&gt;
   &lt;/bean&gt;
   &lt;!-- This transformer is to support thumbnail previews --&gt;
   &lt;bean id=&quot;transformer.complex.Msg2image&quot;
        class=&quot;org.alfresco.repo.content.transform.ComplexContentTransformer&quot;
        parent=&quot;baseContentTransformer&quot; &gt;
      &lt;property name=&quot;transformers&quot;&gt;
         &lt;list&gt;
            &lt;ref bean=&quot;transformer.OutlookMsg&quot; /&gt;
            &lt;ref bean=&quot;transformer.complex.Text.Image&quot; /&gt;
         &lt;/list&gt;
      &lt;/property&gt;
      &lt;property name=&quot;intermediateMimetypes&quot;&gt;
         &lt;list&gt;
            &lt;value&gt;text/plain&lt;/value&gt;
         &lt;/list&gt;
      &lt;/property&gt;
   &lt;/bean&gt;
   &lt;!-- This is only needed if you have trouble doing metadata extraction --&gt;
   &lt;bean id=&quot;extracter.Mail&quot; class=&quot;org.alfresco.repo.content.metadata.MailMetadataExtracter&quot; parent=&quot;baseMetadataExtracter&quot; &gt;
      &lt;property name=&quot;supportedDateFormats&quot;&gt;
         &lt;list&gt;
            &lt;value&gt;EEE, d MMM yyyy HH:mm:ss Z&lt;/value&gt;
            &lt;value&gt;EEE, d MMM yy HH:mm:ss Z&lt;/value&gt;
         &lt;/list&gt;
      &lt;/property&gt;
   &lt;/bean&gt;
&lt;/beans&gt;</pre>
<p>It will only create a preview based on the text format of the message, so unfortunately the html formatting (if present) will not be rendered.<br />
In the configuration file I also added support for creating thumbnails.<br />
I&#8217;ve added this as an enhancement request <a href="http://issues.alfresco.com/jira/browse/ALF-6200">ALF-6200</a> so if it is accepted the config to will become part of standard Alfresco.</p>
<p>Depending on your locale settings you may need to add support for additional date formats in order for metadata extraction to work for msg files. That is the last part in the configuration file and may not be needed for your installation. Extract metadata can be done using rules, see Alfresco Share help <a href="http://www.alfresco.com/help/34/community/sharehelp/">The Document Library page component/Working with folders/Using rules</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://loftux.com/2010/12/16/previews-of-outlook-msg-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Alfresco Cifs Desktop action to open Share</title>
		<link>http://loftux.com/2010/11/09/alfresco-cifs-desktop-action-to-open-share/</link>
		<comments>http://loftux.com/2010/11/09/alfresco-cifs-desktop-action-to-open-share/#comments</comments>
		<pubDate>Tue, 09 Nov 2010 07:17:53 +0000</pubDate>
		<dc:creator>Peter Löfgren</dc:creator>
				<category><![CDATA[Uncategorized @en]]></category>
		<category><![CDATA[cifs]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[share]]></category>

		<guid isPermaLink="false">http://loftux.se/?p=504</guid>
		<description><![CDATA[<p>In Alfresco you can make information available in many ways, one of them is CIFS, that is you map you content repository in Windows Explorer as if it is a standard file server. It is however a bit more than a file server, you have automatic versioning, rules on folders and much more. To ease [...]]]></description>
			<content:encoded><![CDATA[<p>In Alfresco you can make information available in many ways, one of them is CIFS, that is you map you content repository in Windows Explorer as if it is a standard file server. It is however a bit more than a file server, you have automatic versioning, rules on folders and much more. To ease the management of documents, the system administrator can make small virtual applications, <a href="http://wiki.alfresco.com/wiki/Desktop_Actions">desktop actions</a>, where to users can drag &#038; drop documents to trigger actions. Standard ones are CheckInOut to lock the document, and ShowDetails to open the web client.</p>
<p>ShowDetails is still linked to Alfresco Explorer, if users drag &#038; drop on the application it is Alfresco Explorer that&#8217;s being opened to show that file. But we would like it to be Alfresco Share that is opened. Share is at least my preferred choice of client. This is how you can do it.<br />
<span id="more-504"></span><br />
Once you performed the steps below you will have a new desktop action. When you double-click __ShowInformation.exe your web browser will open and show that folder listing in Share. If you drag &#038; drop a file onto the exe file, the browser will display document details (including the preview). The script is location aware, meaning it will show within a site context if it is part of a site, if not it will show in repository mode.</p>
<p>In folder tomcat/shared/classes/alfresco/extension create the folder structure /subsystems/fileServers/default/default.<br />
Note that it is NOT a typo, it should be two default in the path.<br />
In the &#8216;default&#8217; folder create the file, myfile-server-context.xml (can be any name ending in -context.xml) with content:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;!DOCTYPE beans PUBLIC &quot;-//SPRING/DTD BEAN//EN&quot;
    &quot;http://www.springframework.org/dtd/spring-beans.dtd&quot;&gt;
&lt;beans&gt;
   &lt;bean id=&quot;filesystemContexts&quot; class=&quot;org.springframework.beans.factory.config.ListFactoryBean&quot;&gt;
      &lt;property name=&quot;sourceList&quot;&gt;
         &lt;list&gt;
            &lt;!-- Alfresco repository access shared filesystem --&gt;
            &lt;bean class=&quot;org.alfresco.filesys.repo.ContentContext&quot;&gt;
               &lt;property name=&quot;sysAdminParams&quot;&gt;
                  &lt;ref bean=&quot;sysAdminParams&quot; /&gt;
               &lt;/property&gt;
               &lt;property name=&quot;deviceName&quot;&gt;
                  &lt;value&gt;${filesystem.name}&lt;/value&gt;
               &lt;/property&gt;
               &lt;property name=&quot;storeName&quot;&gt;
                  &lt;value&gt;${spaces.store}&lt;/value&gt;
               &lt;/property&gt;
               &lt;property name=&quot;rootPath&quot;&gt;
                  &lt;value&gt;/${spaces.company_home.childname}&lt;/value&gt;
               &lt;/property&gt;
               &lt;!-- Mark locked files as offline --&gt;
               &lt;property name=&quot;offlineFiles&quot;&gt;
                  &lt;value&gt;true&lt;/value&gt;
               &lt;/property&gt;
	        &lt;!-- Enable the quota manager --&gt;
	        &lt;property name=&quot;quotaManager&quot;&gt;
		   &lt;ref bean=&quot;filesystemQuotaManager&quot; /&gt;
	        &lt;/property&gt;

               &lt;property name=&quot;globalDesktopActionConfig&quot;&gt;
                  &lt;bean class=&quot;org.alfresco.filesys.config.GlobalDesktopActionConfigBean&quot;&gt;
                     &lt;property name=&quot;path&quot;&gt;
                        &lt;value&gt;alfresco/desktop/Alfresco.exe&lt;/value&gt;
                     &lt;/property&gt;
                  &lt;/bean&gt;
               &lt;/property&gt;
               &lt;property name=&quot;desktopActionList&quot;&gt;
                  &lt;list&gt;
                      &lt;bean class=&quot;org.alfresco.filesys.repo.desk.CheckInOutDesktopAction&quot;&gt;
                        &lt;property name=&quot;name&quot;&gt;
                           &lt;value&gt;CheckInOut&lt;/value&gt;
                        &lt;/property&gt;
                        &lt;property name=&quot;filename&quot;&gt;
                           &lt;value&gt;__CheckInOut.exe&lt;/value&gt;
                        &lt;/property&gt;
                     &lt;/bean&gt;
                      &lt;!-- This is the new config to support the custom action --&gt;
                     &lt;bean class=&quot;org.alfresco.filesys.repo.desk.JavaScriptDesktopAction&quot;&gt;
                        &lt;property name=&quot;name&quot;&gt;
                           &lt;value&gt;JavaScript&lt;/value&gt;
                        &lt;/property&gt;
                        &lt;property name=&quot;filename&quot;&gt;
                           &lt;value&gt;__ShowInformation.exe&lt;/value&gt;
                        &lt;/property&gt;
                        &lt;property name=&quot;scriptName&quot;&gt;
                           &lt;value&gt;alfresco/extension/desktopActionShowDetails.js&lt;/value&gt;
                        &lt;/property&gt;
                        &lt;property name=&quot;attributeList&quot;&gt;
                            &lt;!-- multiplePaths must be present to support allowNoParams --&gt;
                           &lt;value&gt;anyFiles, multiplePaths, allowNoParams&lt;/value&gt;
                        &lt;/property&gt;
                        &lt;property name=&quot;preprocess&quot;&gt;
                           &lt;value&gt;copyToTarget&lt;/value&gt;
                        &lt;/property&gt;
                     &lt;/bean&gt;
                  &lt;/list&gt;
               &lt;/property&gt;
            &lt;/bean&gt;
         &lt;/list&gt;
      &lt;/property&gt;
   &lt;/bean&gt;
&lt;/beans&gt;
</pre>
<p>Create the file desktopActionShowDetails.js in tomcat/shared/classes/alfresco/extension with content:</p>
<pre class="brush: jscript; title: ; notranslate">
/*
Alfresco Desktop Action to Open Share
Created by Peter Löfgren, Loftux AB, http://loftux.se
*/
function getSiteName(nodeRef){
	var sitename = &quot;&quot;;
	//First Check if we are in a site root folder.
	if(nodeRef.name==&quot;documentLibrary&quot;){
		sitename = nodeRef.parent.properties.name;
	}else{
		var parentNode = nodeRef.parent;
		while(parentNode!=null){
			if(parentNode.isContainer){
				if(parentNode.hasPermission(&quot;Read&quot;)){
					if(parentNode.properties.name==&quot;documentLibrary&quot;){
						sitename = parentNode.parent.properties.name;
						break;
					}
				}
			}
			parentNode = parentNode.parent;
		}
	}
	return sitename;
}

//Main action
function runAction()
{
	//Get the share url. Companhome object is not available to us, so we need to do a search
	var companyhome = search.findNode(&quot;path&quot;, ['workspace','SpacesStore','app:company_home']);
        //ShareUrl is a content object that needs to be created
	var shareurlsetting = companyhome.childByNamePath('/Data Dictionary/Loftux/ShareUrl');
        //Prior 3.4, use this variant
        //var companyhome = search.findNode(&quot;path&quot;, ['workspace','SpacesStore','/']);
	if(shareurlsetting!=null){
		var servercontext = shareurlsetting.properties[&quot;title&quot;];
	}else {
		var servercontext = &quot;http://localhost:8080/share&quot;
	}

	if(deskParams.numberOfTargetNodes()==0){
		//No parameters, do a folder listing
		var nodeRef = utils.getNodeFromString(deskParams.getFolderNode());
		var siteName = getSiteName(nodeRef);
		var displayPath = nodeRef.displayPath + &quot;/&quot;+nodeRef.name;

		if(siteName!=&quot;&quot;){
			var replace = &quot;Company Home/Sites/&quot;+siteName+&quot;/documentLibrary&quot;
			displayPath = displayPath.replace(replace,&quot;&quot;);
			displayPath = displayPath.replace(&quot;//&quot;,&quot;/&quot;);
			var urlStr = servercontext + &quot;/page/site/&quot;+siteName+&quot;/documentlibrary?path=&quot;+displayPath
		}else{
			//In this case, Share is set to display Repository from root
			//Company Home, if not remove that part as well.
			displayPath = displayPath.replace(&quot;Company Home&quot;,&quot;&quot;);
			//displayPath = displayPath.replace(&quot;Company Home/MyStartSpace&quot;,&quot;&quot;);
			displayPath = displayPath.replace(&quot;//&quot;,&quot;/&quot;);
			var urlStr = servercontext + &quot;/page/repository?path=&quot;+displayPath
		}
	}else{
		//Drag &amp; drop of a file, display details of that file
		var nodeRef = utils.getNodeFromString(deskParams.getTarget(0).getNode());
		var siteName = getSiteName(nodeRef);
		if(siteName!=&quot;&quot;){
			//File is in a site
			var urlStr = servercontext +&quot;/page/site/&quot;+siteName+&quot;/document-details?nodeRef=workspace://SpacesStore/&quot;+nodeRef.getId();
		}else{
			var urlStr = servercontext +&quot;/page/document-details?nodeRef=workspace://SpacesStore/&quot;+nodeRef.getId();
		}
	}
	return urlStr;
}

var response = &quot;7,&quot; + runAction();
response;
</pre>
<p>You must add a file inside Alfresco as a setting for what Share server url to use. As per the code above, create a new space in Data Dictionary with name Loftux, then create a file (can be without content) named ShareUrl. If you prefer other names, just change the code accordingly. In the title property, add the Share server url, i.e. http://myalfresco.com/share. This was the easiest way to create a dynamic configuration for the url and avoid hardcoding it. If you have another way of solving this, please add to <a href="http://forums.alfresco.com/en/viewtopic.php?f=48&#038;t=35690">this</a> discussion in Alfresco forum.</p>
<p>Root objects such as companyhome are not available to javascript when used in desktop action as they are to webscripts. I therefore had to do a search for company home. The syntax for the search changed slightly in 3.4 (as used above). If it is not working, try to use the commented version instead. In the javascript code you also have to change the root path if you have configured Share not to display Repository from the root path, see commented example.</p>
<p>I could not get ticket logins that is used for automatic login when the browser opens (as the standard ShowDetails does in Alfresco Explorer) to work for Alfresco Share. But at least we end up in the correct client application. And if you ever wondered why there are two underscore in the virtual application name, it is to make them appear on top in the file list. You can change this if you like. Or maybe add a second entry pointing to the same javascript file with <code>&lt;value&gt;ZZZ__ShowInformation.exe&lt;/value&gt;</code> to show last as well if you have long file listings.</p>
]]></content:encoded>
			<wfw:commentRss>http://loftux.com/2010/11/09/alfresco-cifs-desktop-action-to-open-share/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Preview of binary files in Alfresco</title>
		<link>http://loftux.com/2010/10/06/preview-of-binary-files-in-alfresco/</link>
		<comments>http://loftux.com/2010/10/06/preview-of-binary-files-in-alfresco/#comments</comments>
		<pubDate>Wed, 06 Oct 2010 19:22:21 +0000</pubDate>
		<dc:creator>Peter Löfgren</dc:creator>
				<category><![CDATA[Uncategorized @en]]></category>
		<category><![CDATA[Preview]]></category>
		<category><![CDATA[Thumbnails]]></category>
		<category><![CDATA[Transform]]></category>

		<guid isPermaLink="false">http://loftux.se/?p=490</guid>
		<description><![CDATA[<p>Alfresco today has built in support for rendering thumbnails and previews of many file formats. But if you upload Windows exe files or other binary files, you will not get any previews, or just see the cogwheel as thumbnail.<br /> Since you can extend the built in rendering engine in Alfresco, so why not do [...]]]></description>
			<content:encoded><![CDATA[<p>Alfresco today has built in support for rendering thumbnails and previews of many file formats. But if you upload Windows exe files or other binary files, you will not get any previews, or just see the cogwheel as thumbnail.<br />
Since you can extend the built in rendering engine in Alfresco, so why not do it for binary (application/octet-stream) files. They actually do contain some valuable information.</p>
<p>With the help of transformation you can get thumbnails that displays basic information about the file.<br />
<a href="http://loftux.se/wp-content/uploads/2010/10/binary_thumbnails.png"><img src="http://loftux.se/wp-content/uploads/2010/10/binary_thumbnails-177x300.png" alt="" title="binary_thumbnails" width="177" height="300" class="alignleft size-medium wp-image-482" /></a><br />
That information can easily be extracted with the help of &#8216;file&#8217;, and with Imagemagick an image is created for the thumbnail. Besides exe och dll files the script used in the transformation can detect text files, if you save files in Alfresco without file ending, Alfresco may be unable to detect the proper mime-type, and saves it as application/octet-stream. The script will take care of this, and you will still get a preview. There is also a transformation to text, and that means Lucene indexer will get something to index. Not much, but more than nothing.<br />
<a href="http://loftux.se/wp-content/uploads/2010/10/binary_preview.png"><img src="http://loftux.se/wp-content/uploads/2010/10/binary_preview-300x148.png" alt="" title="binary_preview" width="300" height="148" class="alignleft size-medium wp-image-481" /></a></p>
<p>I&#8217;ve used the tools hachoir-metadata, extract, txt2html and file to extract information. The transformation is done via a bash shell script.<br />
In ubuntu you can install the tools with</p>
<p><code>sudo apt-get install txt2html python-hachoir-metadata extract file</code></p>
<p>Download from <a href='http://loftux.se/wp-content/uploads/2010/10/binary_transform.zip'>Binary Transform config</a> zip file and extract it.</p>
<p>The content in bin you can put in i /opt/alfresco/bin.<br />
The content in extension you put in tomcat/shared/classes/alfresco/extension.</p>
<p>Then you will have to make sure that path and other stuff is correct. Note that this script and configuration is meant as an example of what you can do. Adjust to fit your own needs. I will not do a windows version. But as an end user you can of course use the resulting thumbnails and previews on you windows pc if your Alfresco admin runs Alfresco on a Linux/Unix server.</p>
]]></content:encoded>
			<wfw:commentRss>http://loftux.com/2010/10/06/preview-of-binary-files-in-alfresco/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Alfresco Nordic user group on Linkedin</title>
		<link>http://loftux.com/2010/04/20/alfresco-nordic-user-group-on-linkedin/</link>
		<comments>http://loftux.com/2010/04/20/alfresco-nordic-user-group-on-linkedin/#comments</comments>
		<pubDate>Tue, 20 Apr 2010 10:47:52 +0000</pubDate>
		<dc:creator>Peter Löfgren</dc:creator>
				<category><![CDATA[Uncategorized @en]]></category>
		<category><![CDATA[community]]></category>
		<category><![CDATA[users]]></category>

		<guid isPermaLink="false">http://loftux.se/?p=435</guid>
		<description><![CDATA[<p>The Alfresco Nordic user group has been created on <a href="http://www.linkedin.com/groups?gid=2973263">Linkedin</a>.<br /> There can you as a Nordic Alfresco user get in touch with other Alfresco users from the Nordic countries to exchange experiences and ideas.<br /> You have a great opportunity to influence how the group evolves, so join today to create an active [...]]]></description>
			<content:encoded><![CDATA[<p>The Alfresco Nordic user group has been created on <a href="http://www.linkedin.com/groups?gid=2973263">Linkedin</a>.<br />
There can you as a Nordic Alfresco user get in touch with other Alfresco users from the Nordic countries to exchange experiences and ideas.<br />
You have a great opportunity to influence how the group evolves, so join today to create an active forum.</p>
]]></content:encoded>
			<wfw:commentRss>http://loftux.com/2010/04/20/alfresco-nordic-user-group-on-linkedin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Set the document type on file upload</title>
		<link>http://loftux.com/2010/03/22/set-the-document-type-on-file-upload/</link>
		<comments>http://loftux.com/2010/03/22/set-the-document-type-on-file-upload/#comments</comments>
		<pubDate>Mon, 22 Mar 2010 10:11:42 +0000</pubDate>
		<dc:creator>Peter Löfgren</dc:creator>
				<category><![CDATA[Uncategorized @en]]></category>
		<category><![CDATA[metadata]]></category>
		<category><![CDATA[share]]></category>
		<category><![CDATA[upload]]></category>

		<guid isPermaLink="false">http://loftux.se/?p=339</guid>
		<description><![CDATA[<p>In Alfresco Share you may want to set the document type already on file upload. Else there will be a 2-step process by first uploading, and then select Change Type.<br /> This is possible, but requires a small code change. Most is already done by the Alfresco developers, so you should be able to quickly [...]]]></description>
			<content:encoded><![CDATA[<p>In Alfresco Share you may want to set the document type already on file upload. Else there will be a 2-step process by first uploading, and then select Change Type.<br />
This is possible, but requires a small code change. Most is already done by the Alfresco developers, so you should be able to quickly make the changes yourself.<br />
Find the file */site-webscripts/org/alfresco/components/upload/flash-upload.get.js. It is used both for flash and html upload, so your changes will work for both ways to upload files.<br />
In the file, extend the array with your custom types.</p>
<pre class="brush: jscript; title: ; notranslate">
/**
 * Custom content types
 */
function getContentTypes()
{
   // TODO: Data webscript call to return list of available types
   var contentTypes = [
   {
      id: &quot;cm:content&quot;,
      value: &quot;cm_content&quot;
   },
   {
      id: &quot;my:customtype&quot;,
      value: &quot;my_customtype&quot;
   }
   ];

   return contentTypes;
}

model.contentTypes = getContentTypes();
</pre>
<p>The TODO is Alfresco developers note, so we may get this as an actual config option in the future, bit for now this is how you need to do it.<br />
You also need to extend the file flash-upload.get.properties, in this case also html-upload.get.properties.<br />
Add the value for &#8220;value&#8221; in the javascript for each of you custom types.</p>
<pre class="brush: plain; title: ; notranslate">my_customtype=My Custom Type</pre>
<p>This works well, and you get to set the document type for each of the files individually. There is one bug I&#8217;ve noticed, and that is that you get prompted for document type when uploading a new version, but it actually doesn&#8217;t change the type.<br />
This is what it can look like.<br />
<a href="http://loftux.se/wp-content/uploads/2010/03/FileUpload.png"><img src="http://loftux.se/wp-content/uploads/2010/03/FileUpload-300x183.png" alt="" title="FileUpload" width="300" height="183" class="aligncenter size-medium wp-image-335" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://loftux.com/2010/03/22/set-the-document-type-on-file-upload/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Advanced search in Alfresco Share</title>
		<link>http://loftux.com/2010/02/25/advanced-search-in-alfresco-share/</link>
		<comments>http://loftux.com/2010/02/25/advanced-search-in-alfresco-share/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 14:20:23 +0000</pubDate>
		<dc:creator>Peter Löfgren</dc:creator>
				<category><![CDATA[Uncategorized @en]]></category>
		<category><![CDATA[search]]></category>
		<category><![CDATA[share]]></category>

		<guid isPermaLink="false">http://loftux.se/?p=275</guid>
		<description><![CDATA[<p>The current version of Alfesco Share lacks an advanced search for your custom metadata. It is not Alfresco and Lucene that doesn&#8217;t have this capability, what is missing is an implementation of advanced search. According to Alfresco <a href="http://wiki.alfresco.com/wiki/Roadmap">roadmap</a> we will have to wait until end of 2010 before we get this as a standard [...]]]></description>
			<content:encoded><![CDATA[<p>The current version of Alfesco Share lacks an advanced search for your custom metadata. It is not Alfresco and Lucene that doesn&#8217;t have this capability, what is missing is an implementation of advanced search. According to Alfresco <a href="http://wiki.alfresco.com/wiki/Roadmap">roadmap</a> we will have to wait until end of 2010 before we get this as a standard functionality, meantime we will have to solve this ourself, and this is an example of how.<br />
<span id="more-275"></span><br />
To create the actual search form is the easy part, harder is to create the hit list. So we start by finding out if there is a list we can reuse already available in Alfresco, for example the one in Document Library. I prefer that list to the one provided by quick search, as we can get directly to the menu options and start working with the document. </p>
<p>To the left in the Document Library page there are some Quick searches like &#8220;I&#8217;m Editing&#8221;. This implies that we should have a way of adding our own. And you can, Sebastian Wenzky has written a good <a href="http://portal.krypthonas.de/2009/08/04/alfresco-32-share-pimp-the-document-library-for-custom-document-types/">howto</a>. The key is the file filter.lib.js available in<br />
tomcat/webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary.<br />
Looking at that you can see that you actually can call the Document Library page with parameters, for example<br />
<a href="http://localhost:8080/share/page/site/alfresco/documentlibrary?filter=editingMe">http://localhost:8080/share/page/site/alfresco/documentlibrary?filter=editingMe</a> and end up directly on the built in searches.</p>
<p>So we now have to create our own filter for the switch statement in filter.lib.js so that we get an url like documentlibrary?filter=customQuery. But we also need a way to pass our search data, and luckily there is a parameter already defined that can be used for that purpose, filterData, that is passed all the way by share to filter.lib.js. Our search url will the be /documentlibrary?filter=customQuery&#038;filterData=/your search parameters/.</p>
<p>Her is some sample code to be added in filter.lib.js, part of it is reused from what is in filter.lib.js. You will have to adapt the code to fit you needs and custom metadata.</p>
<pre class="brush: jscript; collapse: true; light: false; title: ; toolbar: true; notranslate">
         case &quot;customQuery&quot;:
             filterQuery = &quot;+PATH:\&quot;&quot; + parsedArgs.rootNode.qnamePath + &quot;//*\&quot;&quot;;
             if(args.filterData.length&gt;0)
             {
            	 var strData=decodeURI(args.filterData);
            	 logger.log(strData);
            	 var queryArray=strData.split(&quot;|&quot;);
            	 for(var i=0;i&lt;queryArray.length;i++)
            	 {
            		var strQuery=queryArray[i];
            		var strQueryArray=strQuery.split(&quot;_&quot;);
            		logger.log(strQueryArray[0]);
            		logger.log(strQueryArray[1]);
            		switch (strQueryArray[0])
            		{
            		case &quot;ftx&quot;:
             			var ftterm=strQueryArray[1];
            			var ftquery=&quot; +(&quot;;

            		      var ftterms = ftterm.split(/\s/), i, j, t;

            		      for (i = 0, j = ftterms.length; i &lt; j; i++)
            		      {
            		         t = ftterms[i];
            		         // remove quotes - TODO: add support for quoted terms later
            		         t = t.replace(/\&quot;/g, &quot;&quot;);
            		         if (t.length !== 0)
            		         {
            		            switch (t.toLowerCase())
            		            {
            		               case &quot;and&quot;:
            		                  if (i &lt; j - 1 &amp;&amp; ftterms[i + 1].length !== 0)
            		                  {
            		                     ftquery += &quot;AND &quot;;
            		                  }
            		                  break;

            		               case &quot;or&quot;:
            		                  break;

            		               case &quot;not&quot;:
            		                  if (i &lt; j - 1 &amp;&amp; ftterms[i + 1].length !== 0)
            		                  {
            		                     ftquery += &quot;NOT &quot;;
            		                  }
            		                  break;

            		               default:
            		                  ftquery += &quot;TEXT:\&quot;&quot; + t + &quot;\&quot;&quot; + &quot; &quot;;
            		               		break;

            		            }
            		         }
            		      }
            		      filterQuery += ftquery+&quot;) &quot;;

            			break;
            		case &quot;docid&quot;:
            			filterQuery += &quot; +@sys\\:node-dbid:&quot;+strQueryArray[1];
            			break;
            		case &quot;contractid&quot;:
            			filterQuery += &quot; +@ltx\\:contractid:&quot;+strQueryArray[1];
            			break;
            		case &quot;doctype&quot;:
            			filterQuery += &quot; +TYPE:\&quot;{http://www.loftux.se/model}&quot;+strQueryArray[1]+&quot;\&quot;&quot;;
            			break;
            		case &quot;file&quot;:
            			//we need to search both with and without wildcards. Sometime there is a hit
            			//sometime not if we dont depending on search term. Makes results more predictable
            			filterQuery += &quot; +(@cm\\:name:&quot;+strQueryArray[1] + &quot; OR @cm\\:name:*&quot;+strQueryArray[1]+&quot;*)&quot; ;
            			break;
                    case &quot;tag&quot;:
                    	filterQuery += &quot; +PATH:\&quot;/cm:taggable/cm:&quot; + search.ISO9075Encode(strQueryArray[1].toLowerCase()) + &quot;/member\&quot;&quot;;
                        break;
                    case &quot;sort&quot;:

                    	if(strQueryArray[1]==&quot;editdesc&quot;)
                    	{
                    		filterParams.sort = [
                    		{
                    		column: &quot;@{http://www.alfresco.org/model/content/1.0}modified&quot;,
                    		ascending: false
                    		}];
                    	}
                    	if(strQueryArray[1]==&quot;editasc&quot;)
                    	{
                    		filterParams.sort = [
                    		{
                    		column: &quot;@{http://www.alfresco.org/model/content/1.0}modified&quot;,
                    		ascending: true
                    		}];
                    	}

                    	break;
            		}
            	 }

             }
             filterParams.query = filterQuery + filterQueryDefaults;
             filterParams.query += &quot; &quot; + (Filters.TYPE_MAP[&quot;documents&quot;]);
</pre>
<p>We now can call the Document Library page with (example)<br />
/documentlibrary?filter=customQuery&#038;filterData=ftx_test|doctype_contract|sort_editdesc.<br />
This is as you can tell not a generic solution, each parameter is built up from a field in your search form. The search above would do a fulltext search on &#8220;test&#8221; and a document of custom type contract, sorted descending on last edit date.</p>
<p>To display correctly in Share Document Library, we also have to add our customQuery to Share. Find the file<br />
site-webscripts/org/alfresco/components/documentlibrary/filter.get.config.xml and add a new filter filter.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;filters&gt;
   &lt;filter id=&quot;all&quot; label=&quot;link.all&quot; /&gt;
   &lt;filter id=&quot;editingMe&quot; label=&quot;link.editingMe&quot; /&gt;
   &lt;filter id=&quot;editingOthers&quot; label=&quot;link.editingOthers&quot; /&gt;
   &lt;filter id=&quot;recentlyModified&quot; label=&quot;link.recentlyModified&quot; /&gt;
   &lt;filter id=&quot;recentlyAdded&quot; label=&quot;link.recentlyAdded&quot; /&gt;
   &lt;filter id=&quot;favouriteDocuments&quot; label=&quot;link.favouriteDocuments&quot; /&gt;
   &lt;filter id=&quot;customQuery&quot; label=&quot;link.customQuery&quot; /&gt;
&lt;/filters&gt;
</pre>
<p>Our filter is to be called by a special search page, so we don&#8217;t want i clickable link to apper. We can do this simply by making the label above blank in the file filter.get.properties (found in the same folder as above)<br />
link.customQuery=<br />
Also in the file toolbar.get.properties we have to add some labels for the result list to appera nicely.<br />
description.customQuery=Custom Search<br />
description.customQuery.more=<br />
If you have added more lanugages to share, add the same lines for corresponding properties files.</p>
<p>Now you just have to create you search form. you can do that by adding a custom <a href="http://www.google.se/search?q=alfresco+creating+a+custom+dashlet">Dashlet</a>, or with <a href="http://wiki.alfresco.com/wiki/Share_Custom_Pages">a custom Share page</a>. I will not describe this in this post, I may make a follow up post for that.</p>
<p>Note that Alfresco is also adding similar functionality to Share for version 3.3. It will be for the Share quick search box, where you can add parameters to search specific metadata by writing for example description:important and get an url like /share/page/search?t=description:important. But to my understanding this will only be by using the quick search box, and therefor more for advanced users. But this is certainly an option to wait for this functionality, and instead create you custom search page to call this url.</p>
]]></content:encoded>
			<wfw:commentRss>http://loftux.com/2010/02/25/advanced-search-in-alfresco-share/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

