<?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; upload</title>
	<atom:link href="http://loftux.com/tag/upload/feed/" rel="self" type="application/rss+xml" />
	<link>http://loftux.com</link>
	<description>Dokumenthantering och informationshantering med öppen källkod</description>
	<lastBuildDate>Wed, 11 Jan 2012 12:04:40 +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>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>
	</channel>
</rss>

