<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: java code to upload content with version aspects in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/java-code-to-upload-content-with-version-aspects/m-p/271418#M224548</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Really Thanx Jan Čustović.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;But still im not successful &lt;img id="smileysad" class="emoticon emoticon-smileysad" src="https://connect.hyland.com/i/smilies/16x16_smiley-sad.png" alt="Smiley Sad" title="Smiley Sad" /&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Donno which is the correct format or sequence. i am facing still problems(errors).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;can you please forward me the whole code if its available with you. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance to Mr.Jan Čustović&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Hcl Power&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 21 Dec 2010 08:54:12 GMT</pubDate>
    <dc:creator>hclpower</dc:creator>
    <dc:date>2010-12-21T08:54:12Z</dc:date>
    <item>
      <title>java code to upload content with version aspects</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/java-code-to-upload-content-with-version-aspects/m-p/271414#M224544</link>
      <description>Hi Everyone, Im new to Alfresco and I have been working on Alfresco Repository using java code(servlets) from few days.I guess this is the best free service provided by Alfresco to upload and download files or contents from and into the Repository.I need code based on java(servlets) to upload files</description>
      <pubDate>Mon, 20 Dec 2010 09:55:34 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/java-code-to-upload-content-with-version-aspects/m-p/271414#M224544</guid>
      <dc:creator>hclpower</dc:creator>
      <dc:date>2010-12-20T09:55:34Z</dc:date>
    </item>
    <item>
      <title>Re: java code to upload content with version aspects</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/java-code-to-upload-content-with-version-aspects/m-p/271415#M224545</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If you want to create a new document version here is the code you could use:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;Predicate itemsToCheckOut = new Predicate(new Reference[] { node.getReference() }, null, null);&lt;BR /&gt;CheckoutResult checkOutResult = getAuthoringService().checkout(itemsToCheckOut, null);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;Reference workingCopyReference = checkOutResult.getWorkingCopies()[0];&lt;BR /&gt;ContentFormat format = new ContentFormat(mimeType, "UTF-8");&lt;BR /&gt;getContentService().write(workingCopyReference, Constants.PROP_CONTENT, contentInBytes, format);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;Predicate predicate = new Predicate(new Reference[] { workingCopyReference }, null, null);&lt;BR /&gt;CheckinResult result = getAuthoringService().checkin(predicate, properties, false);&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;And if you want to create a new versionable document you must apply versionable aspect. Example:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;CMLCreate create = new CMLCreate("1", parent, null, Constants.ASSOC_CONTAINS, null, documentTypeQName, properties);&lt;BR /&gt;CML cml = new CML();&lt;BR /&gt;CMLAddAspect[] aspectArray = new CMLAddAspect[] {new CMLAddAspect(Constants.ASPECT_VERSIONABLE, new NamedValue[] { new NamedValue(PropertyNames.PROP_AUTO_VERSION_ON_UPDATE_PROPS, false, "true", null) }, null, "1");};&lt;BR /&gt;cml.setAddAspect(aspectArray);&lt;BR /&gt;cml.setCreate(new CMLCreate[] { create });&lt;BR /&gt;UpdateResult[] results = getRepositoryService().update(cml);&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Dec 2010 10:27:49 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/java-code-to-upload-content-with-version-aspects/m-p/271415#M224545</guid>
      <dc:creator>jcustovic</dc:creator>
      <dc:date>2010-12-20T10:27:49Z</dc:date>
    </item>
    <item>
      <title>Re: java code to upload content with version aspects</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/java-code-to-upload-content-with-version-aspects/m-p/271416#M224546</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Jan Čustović. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Here can you clarify what actually is PropertyNames in the below line&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;CMLAddAspect[] aspectArray = new CMLAddAspect[] {new CMLAddAspect(Constants.ASPECT_VERSIONABLE, new NamedValue[] { new NamedValue(PropertyNames.PROP_AUTO_VERSION_ON_UPDATE_PROPS, false, "true", null) }, null, "1")};&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;I am not able to get this. Please can you clarify.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;HCLPower&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Dec 2010 07:08:42 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/java-code-to-upload-content-with-version-aspects/m-p/271416#M224546</guid>
      <dc:creator>hclpower</dc:creator>
      <dc:date>2010-12-21T07:08:42Z</dc:date>
    </item>
    <item>
      <title>Re: java code to upload content with version aspects</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/java-code-to-upload-content-with-version-aspects/m-p/271417#M224547</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;That is my static class that holds some usual QNames. You can find this property ContentModel.PROP_AUTO_VERSION_PROPS or you can just put String representation "{&lt;/SPAN&gt;&lt;A href="http://www.alfresco.org/model/content/1.0}autoVersionOnUpdateProps" rel="nofollow noopener noreferrer"&gt;http://www.alfresco.org/model/content/1.0}autoVersionOnUpdateProps&lt;/A&gt;&lt;SPAN&gt;".&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Dec 2010 08:31:41 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/java-code-to-upload-content-with-version-aspects/m-p/271417#M224547</guid>
      <dc:creator>jcustovic</dc:creator>
      <dc:date>2010-12-21T08:31:41Z</dc:date>
    </item>
    <item>
      <title>Re: java code to upload content with version aspects</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/java-code-to-upload-content-with-version-aspects/m-p/271418#M224548</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Really Thanx Jan Čustović.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;But still im not successful &lt;img id="smileysad" class="emoticon emoticon-smileysad" src="https://connect.hyland.com/i/smilies/16x16_smiley-sad.png" alt="Smiley Sad" title="Smiley Sad" /&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Donno which is the correct format or sequence. i am facing still problems(errors).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;can you please forward me the whole code if its available with you. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance to Mr.Jan Čustović&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Hcl Power&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Dec 2010 08:54:12 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/java-code-to-upload-content-with-version-aspects/m-p/271418#M224548</guid>
      <dc:creator>hclpower</dc:creator>
      <dc:date>2010-12-21T08:54:12Z</dc:date>
    </item>
    <item>
      <title>Re: java code to upload content with version aspects</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/java-code-to-upload-content-with-version-aspects/m-p/271419#M224549</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;A href="http://svn.alfresco.com/repos/alfresco-open-mirror/alfresco/HEAD/root/projects/sdk/samples/WebServiceSamples/source/org/alfresco/sample/webservice/CheckOutCheckIn.java" rel="nofollow noopener noreferrer"&gt;http://svn.alfresco.com/repos/alfresco-open-mirror/alfresco/HEAD/root/projects/sdk/samples/WebServiceSamples/source/org/alfresco/sample/webservice/CheckOutCheckIn.java&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Dec 2010 09:44:28 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/java-code-to-upload-content-with-version-aspects/m-p/271419#M224549</guid>
      <dc:creator>jcustovic</dc:creator>
      <dc:date>2010-12-21T09:44:28Z</dc:date>
    </item>
    <item>
      <title>Re: java code to upload content with version aspects</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/java-code-to-upload-content-with-version-aspects/m-p/271420#M224550</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hmmm i tried this code, it needs 2 more classes&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;SampleBase.java&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ContentReadAndWrite.java&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;After this, the files are getting stored into the respository with time in MilliSeconds.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;This process is creating chaos that which is the latest file to be downloaded. So download problem arising.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am looking for a code which stores the file as for example say : example.txt&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;then it should be stored into repository when i again upload with modifications as :example1.0.txt and so on…(same file name but with version added to it)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;or atleast overwrite the file with necessary changes made into the repository, so that it can be downloaded easily.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;can you please help me out in this issue&lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://connect.hyland.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks and Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;HCL Power&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Dec 2010 10:11:17 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/java-code-to-upload-content-with-version-aspects/m-p/271420#M224550</guid>
      <dc:creator>hclpower</dc:creator>
      <dc:date>2010-12-21T10:11:17Z</dc:date>
    </item>
  </channel>
</rss>

