<?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 How to get current site details in alfresco repository in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/how-to-get-current-site-details-in-alfresco-repository/m-p/78865#M24614</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;In datalist(custom), I am submitting a form (creating '&lt;STRONG&gt;&lt;EM&gt;NewItem' )&amp;nbsp;&lt;/EM&gt;&lt;/STRONG&gt;and validating that it should not allow saving duplicate based on a property(e.g BatchName).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I know that it's handled by&amp;nbsp;&lt;A class="link-titled" href="http://localhost:8080/share/proxy/alfresco/api/type/&amp;lt;type&amp;gt;/formprocessor" title="http://localhost:8080/share/proxy/alfresco/api/type/&amp;lt;type&amp;gt;/formprocessor" rel="nofollow noopener noreferrer"&gt;http://localhost:8080/share/proxy/alfresco/api/type/&lt;STRONG&gt;&lt;EM style="color: #3d3d3d;"&gt;my&lt;img id="smileytongue" class="emoticon emoticon-smileytongue" src="https://connect.hyland.com/i/smilies/16x16_smiley-tongue.png" alt="Smiley Tongue" title="Smiley Tongue" /&gt;rop&lt;/EM&gt;&lt;/STRONG&gt;/formprocessor&lt;/A&gt;. That's why I am overriding &lt;STRONG&gt;form.post.json.js&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In&amp;nbsp;&lt;STRONG&gt;&lt;STRONG&gt;form.post.json.js,&amp;nbsp;&lt;/STRONG&gt;&lt;/STRONG&gt;based on&amp;nbsp;itemId I am doing validation.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;if(itemId == "my&lt;img id="smileytongue" class="emoticon emoticon-smileytongue" src="https://connect.hyland.com/i/smilies/16x16_smiley-tongue.png" alt="Smiley Tongue" title="Smiley Tongue" /&gt;rop"){&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; var luceneQuery = "PATH:\"/app:company_home/st:sites/cm:"+siteId+"//*\" AND TYPE:\"my&lt;img id="smileytongue" class="emoticon emoticon-smileytongue" src="https://connect.hyland.com/i/smilies/16x16_smiley-tongue.png" alt="Smiley Tongue" title="Smiley Tongue" /&gt;rop\" AND @my\\:batchName:\""+selectedValue+"\"";&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;var result = search.luceneSearch(luceneQuery);&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; logger.system.out("@ luceneQuery : " + luceneQuery);&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; logger.system.out("@ Result length: " + result.length);&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; if(result.length &amp;gt;0){&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; status.setCode(409, "already exist..");&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; return;&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; }&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; }&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt; persistedObject = formService.saveForm(itemKind, itemId, repoFormData);&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;But my prob is that I am not able to get the site value here. and I want to check duplicate in the current site.&amp;nbsp;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;Anyway so that I can get the site here ???&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;&lt;EM&gt;'NewItem' of toolbar.js &lt;/EM&gt;&lt;/STRONG&gt;&lt;EM&gt;and&lt;/EM&gt;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;SPAN style="text-decoration: underline;"&gt; toolBar.get.html.ftl&amp;nbsp;&lt;/SPAN&gt;the method is already overwritten in another datalist.&amp;nbsp; Hope I cannot override toolbar&amp;nbsp;multiple times.&amp;nbsp;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 21 Sep 2018 08:04:41 GMT</pubDate>
    <dc:creator>ratik_singhal</dc:creator>
    <dc:date>2018-09-21T08:04:41Z</dc:date>
    <item>
      <title>How to get current site details in alfresco repository</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-get-current-site-details-in-alfresco-repository/m-p/78865#M24614</link>
      <description>Hello,&amp;nbsp;In datalist(custom), I am submitting a form (creating 'NewItem' )&amp;nbsp;and validating that it should not allow saving duplicate based on a property(e.g BatchName).I know that it's handled by&amp;nbsp;http://localhost:8080/share/proxy/alfresco/api/type/my&lt;IMG id="smileytongue" class="emoticon emoticon-smileytongue" src="https://migration33.stage.lithium.com/i/smilies/16x16_smiley-tongue.png" alt="Smiley Tongue" title="Smiley Tongue" /&gt;rop/formprocessor. That's why I am overriding form.</description>
      <pubDate>Fri, 21 Sep 2018 08:04:41 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-get-current-site-details-in-alfresco-repository/m-p/78865#M24614</guid>
      <dc:creator>ratik_singhal</dc:creator>
      <dc:date>2018-09-21T08:04:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to get current site details in alfresco repository</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-get-current-site-details-in-alfresco-repository/m-p/78866#M24615</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I cannot answer your question directly because it has been too long since I fooled with form processors. If you had a node ref you could ask the site service which site it belongs to, but I don't think you have a node ref.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But in thinking about your problem, I wonder if it would make more sense from a dev perspective and an end-user perspective to do the check on the Share tier or even from the client-side. You could easily write your own web script that would check for the existence of that value in a give site and you could invoke that from either a Share tier web script or from client-side JavaScript (like in a custom form control, for example).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That would allow you to reject the save much earlier. Just a thought.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jeff&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Sep 2018 03:40:49 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-get-current-site-details-in-alfresco-repository/m-p/78866#M24615</guid>
      <dc:creator>jpotts</dc:creator>
      <dc:date>2018-09-25T03:40:49Z</dc:date>
    </item>
  </channel>
</rss>

