<?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 Accessing WCM repository from JSP or JS scripts? in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/accessing-wcm-repository-from-jsp-or-js-scripts/m-p/155339#M109691</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi, I am developing a WCM site in Alfresco 2.1.2. It is apparently not possible to access the repository directly from JSP scripts, without writing custom Java code (e.g. the press releases class in the alfrescodemo project). So I am trying to use a Web Script (Javascript) instead to access the repository. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As I understand it, this method of using Web Scripts is also recommended in this thread &lt;/SPAN&gt;&lt;A href="http://forums.alfresco.com/viewtopic.php?f=29&amp;amp;t=12424&amp;amp;p=41109" rel="nofollow noopener noreferrer"&gt;http://forums.alfresco.com/viewtopic.php?f=29&amp;amp;t=12424&amp;amp;p=41109&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have used Web Scripts before to access the Alfresco repository; it works fine. However it is not working in this WCM context. Please advise what am I doing wrong here? I have a WCM Web project named "update". In the web client, it is listed in Company Home / Web Projects / update. There is a sub-folder named "articles". In Data Dictionary/Web Scripts I have put a test script to access the repository:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;article.get.desc.xml : &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&amp;lt;webscript&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;lt;shortname&amp;gt;SFI Update article (xml)&amp;lt;/shortname&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;lt;description&amp;gt;Fetch an article from the repository&amp;lt;/description&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;lt;url&amp;gt;/update/article?guest=true&amp;lt;/url&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;lt;authentication&amp;gt;guest&amp;lt;/authentication&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;lt;format default="xml"&amp;gt;&amp;lt;/format&amp;gt;&lt;BR /&gt;&amp;lt;/webscript&amp;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;/CODE&gt;&lt;/PRE&gt;&lt;SPAN&gt;article.get.js: &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt; var tArticlesSpace = companyhome.childByNamePath( "Web Projects/update/articles" );&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(tArticlesSpace == null)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; throw "not found: Web Projects/update/articles";&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&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;/CODE&gt;&lt;/PRE&gt;&lt;SPAN&gt;When I hit the web script in my browser &lt;/SPAN&gt;&lt;A href="http://myserver:8080/alfresco/service/update/article?guest=true" rel="nofollow noopener noreferrer"&gt;http://myserver:8080/alfresco/service/update/article?guest=true&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;I get a 500 error indicating that childByNamePath could not locate the space in the repository and returned null. Where are the repository spaces, then, for WCM Web Projects ? Should the guest access work as well?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 02 Jun 2008 22:30:00 GMT</pubDate>
    <dc:creator>alrice</dc:creator>
    <dc:date>2008-06-02T22:30:00Z</dc:date>
    <item>
      <title>Accessing WCM repository from JSP or JS scripts?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/accessing-wcm-repository-from-jsp-or-js-scripts/m-p/155339#M109691</link>
      <description>Hi, I am developing a WCM site in Alfresco 2.1.2. It is apparently not possible to access the repository directly from JSP scripts, without writing custom Java code (e.g. the press releases class in the alfrescodemo project). So I am trying to use a Web Script (Javascript) instead to access the repo</description>
      <pubDate>Mon, 02 Jun 2008 22:30:00 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/accessing-wcm-repository-from-jsp-or-js-scripts/m-p/155339#M109691</guid>
      <dc:creator>alrice</dc:creator>
      <dc:date>2008-06-02T22:30:00Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing WCM repository from JSP or JS scripts?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/accessing-wcm-repository-from-jsp-or-js-scripts/m-p/155340#M109692</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;OK progress!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;How to access the repo&amp;nbsp; from Freemarker and XSLT:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://wiki.alfresco.com/wiki/WCM_Forms_Rendering" rel="nofollow noopener noreferrer"&gt;http://wiki.alfresco.com/wiki/WCM_Forms_Rendering&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;How to access the repo from JSP **. Thanks to Scott Ashcraft for pointing to this resource:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://www.rivetlogic.com/content/view/34/59/" rel="nofollow noopener noreferrer"&gt;http://www.rivetlogic.com/content/view/34/59/&lt;/A&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;** by inlining Java function into the JSP . This is preferable to a pre-compiled Java bean class, as shown in the press releases demo, in my opinion.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jun 2008 15:42:01 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/accessing-wcm-repository-from-jsp-or-js-scripts/m-p/155340#M109692</guid>
      <dc:creator>alrice</dc:creator>
      <dc:date>2008-06-04T15:42:01Z</dc:date>
    </item>
    <item>
      <title>Re: Accessing WCM repository from JSP or JS scripts?</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/accessing-wcm-repository-from-jsp-or-js-scripts/m-p/155341#M109693</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;See also: &lt;/SPAN&gt;&lt;A href="http://wiki.alfresco.com/wiki/JavaScript_API#AVM_API" rel="nofollow noopener noreferrer"&gt;http://wiki.alfresco.com/wiki/JavaScript_API#AVM_API&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Jan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Jun 2008 16:40:33 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/accessing-wcm-repository-from-jsp-or-js-scripts/m-p/155341#M109693</guid>
      <dc:creator>janv</dc:creator>
      <dc:date>2008-06-04T16:40:33Z</dc:date>
    </item>
  </channel>
</rss>

