<?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: How to get the noderef of the sites using sitename? in Alfresco Forum</title>
    <link>https://connect.hyland.com/t5/alfresco-forum/how-to-get-the-noderef-of-the-sites-using-sitename/m-p/89901#M26885</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;You can use the 'SiteService' (Java API) to get noderef and other detalis of site by site's&amp;nbsp;&lt;SPAN style="color: #353833; background-color: #ffffff;"&gt;shortName as below:&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;SiteInfo site = serviceRegistry.getSiteService().getSite("test");&lt;BR /&gt; NodeRef siteNode = site.getNodeRef();&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;This &lt;A href="https://dev.alfresco.com/resource/docs/java/org/alfresco/service/cmr/site/SiteService.html" rel="nofollow noopener noreferrer"&gt;Link&lt;/A&gt; provides more information to you about siteServices.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As well as you can use Javascript API for getting noderef of site&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;var site = siteService.getSite("jncasr");&lt;BR /&gt;var siteNodeRef = site.getNode().getNodeRef();&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vidhi&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.contcentric.com/" rel="nofollow noopener noreferrer"&gt;ContCentric&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 30 Jul 2019 04:51:59 GMT</pubDate>
    <dc:creator>vidhipanchal</dc:creator>
    <dc:date>2019-07-30T04:51:59Z</dc:date>
    <item>
      <title>How to get the noderef of the sites using sitename?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-get-the-noderef-of-the-sites-using-sitename/m-p/89900#M26884</link>
      <description>Is there any web url for this?</description>
      <pubDate>Tue, 30 Jul 2019 03:52:16 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-get-the-noderef-of-the-sites-using-sitename/m-p/89900#M26884</guid>
      <dc:creator>madhu_sudireddy</dc:creator>
      <dc:date>2019-07-30T03:52:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the noderef of the sites using sitename?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-get-the-noderef-of-the-sites-using-sitename/m-p/89901#M26885</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;You can use the 'SiteService' (Java API) to get noderef and other detalis of site by site's&amp;nbsp;&lt;SPAN style="color: #353833; background-color: #ffffff;"&gt;shortName as below:&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;SiteInfo site = serviceRegistry.getSiteService().getSite("test");&lt;BR /&gt; NodeRef siteNode = site.getNodeRef();&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;This &lt;A href="https://dev.alfresco.com/resource/docs/java/org/alfresco/service/cmr/site/SiteService.html" rel="nofollow noopener noreferrer"&gt;Link&lt;/A&gt; provides more information to you about siteServices.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As well as you can use Javascript API for getting noderef of site&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;var site = siteService.getSite("jncasr");&lt;BR /&gt;var siteNodeRef = site.getNode().getNodeRef();&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vidhi&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.contcentric.com/" rel="nofollow noopener noreferrer"&gt;ContCentric&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jul 2019 04:51:59 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-get-the-noderef-of-the-sites-using-sitename/m-p/89901#M26885</guid>
      <dc:creator>vidhipanchal</dc:creator>
      <dc:date>2019-07-30T04:51:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the noderef of the sites using sitename?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-get-the-noderef-of-the-sites-using-sitename/m-p/89902#M26886</link>
      <description>&lt;P&gt;&lt;SPAN&gt;serviceRegistry does not have "getSiteService()" methode.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;can you please let me know exact way ?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jul 2020 03:40:22 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-get-the-noderef-of-the-sites-using-sitename/m-p/89902#M26886</guid>
      <dc:creator>atultalhar</dc:creator>
      <dc:date>2020-07-29T03:40:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the noderef of the sites using sitename?</title>
      <link>https://connect.hyland.com/t5/alfresco-forum/how-to-get-the-noderef-of-the-sites-using-sitename/m-p/89903#M26887</link>
      <description>&lt;P&gt;ServiceRegistery does have proxy for SiteService.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/Alfresco/alfresco-repository/blob/master/src/main/java/org/alfresco/service/ServiceRegistry.java#L411" target="_blank" rel="noopener nofollow noreferrer"&gt;https://github.com/Alfresco/alfresco-repository/blob/master/src/main/java/org/alfresco/service/ServiceRegistry.java#L411&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Which version of ACS you are on?&lt;/P&gt;
&lt;P&gt;You have option to inject siteService via spring bean as well. Example of a bean def:&lt;/P&gt;
&lt;PRE&gt;&amp;lt;bean id="example.action" class="com.example.TestAction" parent="action-executer"&amp;gt;
   &amp;lt;constructor-arg ref="SiteService" /&amp;gt; &amp;lt;!-- proxy SiteService --&amp;gt;
&amp;lt;/bean&amp;gt;&lt;BR /&gt;&lt;BR /&gt;or&lt;BR /&gt;&lt;BR /&gt;&amp;lt;bean id="example.action" class="com.example.TestAction" parent="action-executer"&amp;gt; &lt;BR /&gt;  &amp;lt;constructor-arg ref="siteService" /&amp;gt; &lt;BR /&gt;&amp;lt;/bean&amp;gt;

or

&amp;lt;bean id="example.action" class="com.example.TestAction" parent="action-executer"&amp;gt;
   &amp;lt;property name="siteService" ref="SiteService" /&amp;gt; &amp;lt;!-- proxy SiteService --&amp;gt;
&amp;lt;/bean&amp;gt;&lt;BR /&gt;&lt;BR /&gt;or&lt;BR /&gt;&lt;BR /&gt;&amp;lt;bean id="example.action" class="com.example.TestAction" parent="action-executer"&amp;gt; &lt;BR /&gt;    &amp;lt;property name="siteService" ref="siteService" /&amp;gt; &lt;BR /&gt;&amp;lt;/bean&amp;gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 29 Jul 2020 07:57:59 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-forum/how-to-get-the-noderef-of-the-sites-using-sitename/m-p/89903#M26887</guid>
      <dc:creator>abhinavmishra14</dc:creator>
      <dc:date>2020-07-29T07:57:59Z</dc:date>
    </item>
  </channel>
</rss>

