<?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: Site not works, when it's created through web scripts in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/site-not-works-when-it-s-created-through-web-scripts/m-p/219603#M172733</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;the problem in your case is that in order for Share to actually use the site you have created requires that your web script at creates the view/component description files for the site dashboard as well. These files consitute the Object Model for the sites dashboard and dashlets, as well as the definition, which pages are available within the site.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please take a look at the Share web script in "share/WEB-INF/classes/alfresco/site-webscripts/org/alfresco/modules/create-site.post.json.js". Tis web script calls the create command as yours does, and then calls sitedata.newPreset() to create the SURF descriptor XML files using the preset definition found in "share/WEB-INF/classes/alfresco/site-data/presets/presets.xml". You have to either duplicate this approach in your own web script (if it runs within a SURF platform and has access to the same presets as your Share) or have your script create the files directly (either via Repository web script at URL "/avmstore/{method}/s/{store}/w/{webapp}/{path}" or SURF web script within Share at URL "/api/surf/object/{type}?id={id?}")&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Sep 2010 12:45:18 GMT</pubDate>
    <dc:creator>afaust</dc:creator>
    <dc:date>2010-09-12T12:45:18Z</dc:date>
    <item>
      <title>Site not works, when it's created through web scripts</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/site-not-works-when-it-s-created-through-web-scripts/m-p/219602#M172732</link>
      <description>Hi all,I am currently using the latest version available on the site(3.3g).I am creating a site through web scripts.URL "http://localhost:8080/alfresco/service/api/sites?alf_ticket=" + authTicket";These are parametersJSONObject site = new JSONObject();site.put("shortName", sitename);site.put("sitePr</description>
      <pubDate>Fri, 10 Sep 2010 14:06:45 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/site-not-works-when-it-s-created-through-web-scripts/m-p/219602#M172732</guid>
      <dc:creator>kalyan</dc:creator>
      <dc:date>2010-09-10T14:06:45Z</dc:date>
    </item>
    <item>
      <title>Re: Site not works, when it's created through web scripts</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/site-not-works-when-it-s-created-through-web-scripts/m-p/219603#M172733</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;the problem in your case is that in order for Share to actually use the site you have created requires that your web script at creates the view/component description files for the site dashboard as well. These files consitute the Object Model for the sites dashboard and dashlets, as well as the definition, which pages are available within the site.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please take a look at the Share web script in "share/WEB-INF/classes/alfresco/site-webscripts/org/alfresco/modules/create-site.post.json.js". Tis web script calls the create command as yours does, and then calls sitedata.newPreset() to create the SURF descriptor XML files using the preset definition found in "share/WEB-INF/classes/alfresco/site-data/presets/presets.xml". You have to either duplicate this approach in your own web script (if it runs within a SURF platform and has access to the same presets as your Share) or have your script create the files directly (either via Repository web script at URL "/avmstore/{method}/s/{store}/w/{webapp}/{path}" or SURF web script within Share at URL "/api/surf/object/{type}?id={id?}")&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Sep 2010 12:45:18 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/site-not-works-when-it-s-created-through-web-scripts/m-p/219603#M172733</guid>
      <dc:creator>afaust</dc:creator>
      <dc:date>2010-09-12T12:45:18Z</dc:date>
    </item>
    <item>
      <title>Re: Site not works, when it's created through web scripts</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/site-not-works-when-it-s-created-through-web-scripts/m-p/219604#M172734</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi AFaust,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you please give sample code or steps to follow?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I did not understand this part.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;'You have to either duplicate this approach in your own web script (if it runs within a SURF platform and has access to the same presets as your Share) or have your script create the files directly (either via Repository web script at URL "/avmstore/{method}/s/{store}/w/{webapp}/{path}" or SURF web script within Share at URL "/api/surf/object/{type}?id={id?}")'&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Sans&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Nov 2010 17:29:22 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/site-not-works-when-it-s-created-through-web-scripts/m-p/219604#M172734</guid>
      <dc:creator>sans</dc:creator>
      <dc:date>2010-11-30T17:29:22Z</dc:date>
    </item>
    <item>
      <title>Re: Site not works, when it's created through web scripts</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/site-not-works-when-it-s-created-through-web-scripts/m-p/219605#M172735</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hey Sans,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;look at the file /webapps/alfresco/WEB-INF/classes/alfresco/templates/webscripts/org/alfresco/repository/site/sites.post.json.js&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There all the way on the bottom you see a funcion call like follows:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt; // Create the site &lt;BR /&gt; var site = siteService.createSite(sitePreset, shortName, title, description, visibility);&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;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;This is server site JS. You can also use this code in any of your WebScripts that you write on the Alfresco side. This would be Alfresco 3.4.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Another very helpful thing is the Sites JS API:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://wiki.alfresco.com/wiki/3.4_JavaScript_Services_API#Site_service" rel="nofollow noopener noreferrer"&gt;http://wiki.alfresco.com/wiki/3.4_JavaScript_Services_API#Site_service&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Dec 2010 08:03:10 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/site-not-works-when-it-s-created-through-web-scripts/m-p/219605#M172735</guid>
      <dc:creator>tb13</dc:creator>
      <dc:date>2010-12-02T08:03:10Z</dc:date>
    </item>
    <item>
      <title>Re: Site not works, when it's created through web scripts</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/site-not-works-when-it-s-created-through-web-scripts/m-p/219606#M172736</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi, I have a similar problem.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm creating site programicly through java webscript. In my java webscript I construct json object and then call create-siteCustom.post.json.js script (with only one modification of create-site.post.json.js - adding alf_ticket when calling api/sites).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I test create-siteCustom through poster in mozilla firefox it works perfectly, i can access newly created site and after restart of tomcat everything is fine.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But when I call create-siteCustom through java webscript, site creates normally and I can access it, BUT after tomcat/alfressco restart I see created site but when I access it I get following error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;HTTP Status 500 -&lt;BR /&gt;&lt;BR /&gt;type Exception report&lt;BR /&gt;&lt;BR /&gt;message&lt;BR /&gt;&lt;BR /&gt;description The server encountered an internal error () that prevented it from fulfilling this request.&lt;BR /&gt;&lt;BR /&gt;exception&lt;BR /&gt;&lt;BR /&gt;javax.servlet.ServletException: Could not resolve view with name 'site/test15/dashboard' in servlet with name 'Spring Surf Dispatcher Servlet'&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1042)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:798)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:716)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:647)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:552)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;javax.servlet.http.HttpServlet.service(HttpServlet.java:617)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;javax.servlet.http.HttpServlet.service(HttpServlet.java:717)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;org.alfresco.web.site.servlet.MTAuthenticationFilter.doFilter(MTAuthenticationFilter.java:67)&lt;BR /&gt;&lt;BR /&gt;note The full stack trace of the root cause is available in the Apache Tomcat/6.0.26 logs.&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;/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;Can anyone help please,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Tnx&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Dec 2010 10:37:56 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/site-not-works-when-it-s-created-through-web-scripts/m-p/219606#M172736</guid>
      <dc:creator>jelena</dc:creator>
      <dc:date>2010-12-02T10:37:56Z</dc:date>
    </item>
    <item>
      <title>Re: Site not works, when it's created through web scripts</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/site-not-works-when-it-s-created-through-web-scripts/m-p/219607#M172737</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi jelena,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;But when I call create-siteCustom through java webscript, site creates normally and I can access it, BUT after tomcat/alfressco restart I see created site but when I access it I get following error:&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;I am also facing similar problem.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Did you find the solution? I will let you know if I find anything on this.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Sans!!!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Jan 2011 12:52:20 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/site-not-works-when-it-s-created-through-web-scripts/m-p/219607#M172737</guid>
      <dc:creator>sans</dc:creator>
      <dc:date>2011-01-07T12:52:20Z</dc:date>
    </item>
    <item>
      <title>Re: Site not works, when it's created through web scripts</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/site-not-works-when-it-s-created-through-web-scripts/m-p/219608#M172738</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I had this same problem but recently found the solution.&amp;nbsp; Posted here.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://forums.alfresco.com/en/viewtopic.php?f=48&amp;amp;t=46259&amp;amp;p=138469#p138469" rel="nofollow noopener noreferrer"&gt;https://forums.alfresco.com/en/viewtopic.php?f=48&amp;amp;t=46259&amp;amp;p=138469#p138469&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 12 Oct 2012 20:01:38 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/site-not-works-when-it-s-created-through-web-scripts/m-p/219608#M172738</guid>
      <dc:creator>joemc3</dc:creator>
      <dc:date>2012-10-12T20:01:38Z</dc:date>
    </item>
  </channel>
</rss>

