<?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: Integrity error handling in web scripts in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/integrity-error-handling-in-web-scripts/m-p/231158#M184288</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Can you please provide some example for the transaction and attempt to commit step?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;Quoting from memory, it should be something like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;UserTransaction tx = transactionService.getUserTransaction(false);&lt;BR /&gt;tx.begin();&lt;BR /&gt;&lt;BR /&gt;// do something&lt;BR /&gt;&lt;BR /&gt;try {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; tx.commit();&lt;BR /&gt;} catch (RollbackException re) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; // something bad has happened and the transaction has been rolled back&lt;BR /&gt;&amp;nbsp;&amp;nbsp; // notify the client&lt;BR /&gt;}&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;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope that helps,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Sylvain.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 30 Apr 2010 07:26:30 GMT</pubDate>
    <dc:creator>schambon</dc:creator>
    <dc:date>2010-04-30T07:26:30Z</dc:date>
    <item>
      <title>Integrity error handling in web scripts</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/integrity-error-handling-in-web-scripts/m-p/231155#M184285</link>
      <description>Hi all,Suppose that you have a custom model that defines an integrity constraint (eg you're testing that a file name fits the file name regexp). Suppose that you write a data web script (which takes json as input and outputs json as well) that lets you create nodes of your custom type. Now suppose t</description>
      <pubDate>Fri, 14 Aug 2009 14:01:49 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/integrity-error-handling-in-web-scripts/m-p/231155#M184285</guid>
      <dc:creator>schambon</dc:creator>
      <dc:date>2009-08-14T14:01:49Z</dc:date>
    </item>
    <item>
      <title>Re: Integrity error handling in web scripts</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/integrity-error-handling-in-web-scripts/m-p/231156#M184286</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Integrity checks are performed when a transaction commits. To trigger these checks from within a webscript, you have to:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1. Ensure that the webscript itself is not a transaction (you can configure this in your desc.xml)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2. Create a Java-backed webscript&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;3. In your webscript, create a new transaction and attempt to commit it&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;4. Now, you can catch the error and process accordingly, possibly using your own custom 5xx error codes &amp;amp; ftl's&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Gluck,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Rogier&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Sep 2009 06:40:01 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/integrity-error-handling-in-web-scripts/m-p/231156#M184286</guid>
      <dc:creator>rogier_oudshoor</dc:creator>
      <dc:date>2009-09-15T06:40:01Z</dc:date>
    </item>
    <item>
      <title>Re: Integrity error handling in web scripts</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/integrity-error-handling-in-web-scripts/m-p/231157#M184287</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Integrity checks are performed when a transaction commits. To trigger these checks from within a webscript, you have to:&lt;BR /&gt;1. Ensure that the webscript itself is not a transaction (you can configure this in your desc.xml)&lt;BR /&gt;2. Create a Java-backed webscript&lt;BR /&gt;3. In your webscript, create a new transaction and attempt to commit it&lt;BR /&gt;4. Now, you can catch the error and process accordingly, possibly using your own custom 5xx error codes &amp;amp; ftl's&lt;BR /&gt;&lt;BR /&gt;Gluck,&lt;BR /&gt;&lt;BR /&gt;Rogier&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you please provide some example for the transaction and attempt to commit step?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Apr 2010 21:43:39 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/integrity-error-handling-in-web-scripts/m-p/231157#M184287</guid>
      <dc:creator>hyperation</dc:creator>
      <dc:date>2010-04-29T21:43:39Z</dc:date>
    </item>
    <item>
      <title>Re: Integrity error handling in web scripts</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/integrity-error-handling-in-web-scripts/m-p/231158#M184288</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Can you please provide some example for the transaction and attempt to commit step?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;Quoting from memory, it should be something like:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;UserTransaction tx = transactionService.getUserTransaction(false);&lt;BR /&gt;tx.begin();&lt;BR /&gt;&lt;BR /&gt;// do something&lt;BR /&gt;&lt;BR /&gt;try {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; tx.commit();&lt;BR /&gt;} catch (RollbackException re) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; // something bad has happened and the transaction has been rolled back&lt;BR /&gt;&amp;nbsp;&amp;nbsp; // notify the client&lt;BR /&gt;}&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;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;Hope that helps,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Sylvain.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Apr 2010 07:26:30 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/integrity-error-handling-in-web-scripts/m-p/231158#M184288</guid>
      <dc:creator>schambon</dc:creator>
      <dc:date>2010-04-30T07:26:30Z</dc:date>
    </item>
    <item>
      <title>Re: Integrity error handling in web scripts</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/integrity-error-handling-in-web-scripts/m-p/231159#M184289</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks schambon, it works!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&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;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 May 2010 20:53:03 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/integrity-error-handling-in-web-scripts/m-p/231159#M184289</guid>
      <dc:creator>hyperation</dc:creator>
      <dc:date>2010-05-03T20:53:03Z</dc:date>
    </item>
  </channel>
</rss>

