AnsweredAssumed Answered

Non-Admin users can not resolve/create sites

Question asked by ofrxnz on Sep 15, 2008
Latest reply on Oct 17, 2008 by monk
When i log in as a non-admin user, i receive the following error ( see below ) in the "getting started" widget under the "sites" section.  Also the "sites" proper widget does not render.  I believe they have the same cause.  I am using the windows full install of alfresco 3b.

The Web Script /share/service/components/dashlets/user-welcome has responded with a status of 500 - Internal Error.

500 Description:   An error inside the HTTP server which prevented it from fulfilling the request.

Message:   Failed to process template org/alfresco/components/dashlets/user-welcome.get.html.ftl
   
Exception:   freemarker.core.InvalidReferenceException - Expression sites is undefined on line 21, column 12 in org/alfresco/components/dashlets/user-welcome.get.html.ftl.
   
   freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:124)
   freemarker.core.TemplateObject.invalidTypeException(TemplateObject.java:134)
   freemarker.core.BuiltIn$sizeBI._getAsTemplateModel(BuiltIn.java:630)
   freemarker.core.Expression.getAsTemplateModel(Expression.java:89)
   freemarker.core.ComparisonExpression.isTrue(ComparisonExpression.java:111)
   freemarker.core.ConditionalBlock.accept(ConditionalBlock.java:77)
   freemarker.core.Environment.visit(Environment.java:208)
   freemarker.core.MixedContent.accept(MixedContent.java:92)
   freemarker.core.Environment.visit(Environment.java:208)
   freemarker.core.Environment.process(Environment.java:188)
   freemarker.template.Template.process(Template.java:237)
   org.alfresco.web.scripts.PresentationTemplateProcessor.process(PresentationTemplateProcessor.java:146)
   org.alfresco.web.scripts.AbstractWebScript.renderTemplate(AbstractWebScript.java:377)
   org.alfresco.web.scripts.DeclarativeWebScript.renderFormatTemplate(DeclarativeWebScript.java:280)
   org.alfresco.web.scripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:173)
   org.alfresco.web.scripts.PresentationContainer.executeScript(PresentationContainer.java:53)
   org.alfresco.web.scripts.LocalWebScriptRuntimeContainer.executeScript(LocalWebScriptRuntimeContainer.java:186)
   org.alfresco.web.scripts.AbstractRuntime.executeScript(AbstractRuntime.java:240)
   org.alfresco.web.scripts.AbstractRuntime.executeScript(AbstractRuntime.java:139)
   org.alfresco.web.scripts.WebScriptRenderer.execute(WebScriptRenderer.java:272)
   org.alfresco.web.site.RenderUtil.renderComponent(RenderUtil.java:465)
   org.alfresco.web.site.PresentationUtil.renderComponent(PresentationUtil.java:202)
   org.alfresco.web.site.taglib.ComponentTag.doStartTag(ComponentTag.java:107)
   org.alfresco.tools.TagUtil.execute(TagUtil.java:143)
   org.alfresco.tools.TagUtil.execute(TagUtil.java:79)
   org.alfresco.web.scripts.FreemarkerTagSupportDirective.executeTag(FreemarkerTagSupportDirective.java:95)
   org.alfresco.web.scripts.FreemarkerTagSupportDirective.executeTag(FreemarkerTagSupportDirective.java:73)
   org.alfresco.web.scripts.ComponentFreemarkerTagDirective.execute(ComponentFreemarkerTagDirective.java:118)
   freemarker.core.Environment.visit(Environment.java:261)
   freemarker.core.UnifiedCall.accept(UnifiedCall.java:126)
   freemarker.core.Environment.visit(Environment.java:208)
   freemarker.core.MixedContent.accept(MixedContent.java:92)
   freemarker.core.Environment.visit(Environment.java:208)
   freemarker.core.Environment.process(Environment.java:188)
   freemarker.template.Template.process(Template.java:237)
   org.alfresco.web.scripts.PresentationTemplateProcessor.process(PresentationTemplateProcessor.java:146)
   org.alfresco.web.scripts.FreemarkerRenderer.execute(FreemarkerRenderer.java:219)
   org.alfresco.web.site.RenderUtil.executeRenderer(RenderUtil.java:869)
   org.alfresco.web.site.RenderUtil.executeRenderer(RenderUtil.java:846)
   org.alfresco.web.site.RenderUtil.renderRegion(RenderUtil.java:376)
   org.alfresco.web.site.PresentationUtil.renderRegion(PresentationUtil.java:164)
   org.alfresco.web.site.taglib.RegionTag.doStartTag(RegionTag.java:113)
   org.alfresco.tools.TagUtil.execute(TagUtil.java:143)
   org.alfresco.tools.TagUtil.execute(TagUtil.java:79)
   org.alfresco.web.scripts.FreemarkerTagSupportDirective.executeTag(FreemarkerTagSupportDirective.java:95)
   org.alfresco.web.scripts.RegionFreemarkerTagDirective.execute(RegionFreemarkerTagDirective.java:128)
   freemarker.core.Environment.visit(Environment.java:261)
   freemarker.core.UnifiedCall.accept(UnifiedCall.java:126)
   freemarker.core.Environment.visit(Environment.java:208)
   freemarker.core.IteratorBlock$Context.runLoop(IteratorBlock.java:179)
   freemarker.core.Environment.visit(Environment.java:415)
   freemarker.core.IteratorBlock.accept(IteratorBlock.java:102)
   freemarker.core.Environment.visit(Environment.java:208)
   freemarker.core.MixedContent.accept(MixedContent.java:92)
   freemarker.core.Environment.visit(Environment.java:208)
   freemarker.core.IteratorBlock$Context.runLoop(IteratorBlock.java:179)
   freemarker.core.Environment.visit(Environment.java:415)
   freemarker.core.IteratorBlock.accept(IteratorBlock.java:102)
   freemarker.core.Environment.visit(Environment.java:208)
   freemarker.core.MixedContent.accept(MixedContent.java:92)
   freemarker.core.Environment.visit(Environment.java:208)
   freemarker.core.Macro$Context.runMacro(Macro.java:164)
   freemarker.core.Environment.visit(Environment.java:601)
   freemarker.core.UnifiedCall.accept(UnifiedCall.java:106)
   freemarker.core.Environment.visit(Environment.java:208)
   freemarker.core.IfBlock.accept(IfBlock.java:82)
   freemarker.core.Environment.visit(Environment.java:208)
   freemarker.core.Macro$Context.runMacro(Macro.java:164)
   freemarker.core.Environment.visit(Environment.java:601)
   freemarker.core.UnifiedCall.accept(UnifiedCall.java:106)
   freemarker.core.Environment.visit(Environment.java:208)
   freemarker.core.MixedContent.accept(MixedContent.java:92)
   freemarker.core.Environment.visit(Environment.java:208)
   freemarker.core.Environment.visit(Environment.java:393)
   freemarker.core.BodyInstruction.accept(BodyInstruction.java:93)
   freemarker.core.Environment.visit(Environment.java:208)
   freemarker.core.MixedContent.accept(MixedContent.java:92)
   freemarker.core.Environment.visit(Environment.java:208)
   freemarker.core.Macro$Context.runMacro(Macro.java:164)
   freemarker.core.Environment.visit(Environment.java:601)
   freemarker.core.UnifiedCall.accept(UnifiedCall.java:106)
   freemarker.core.Environment.visit(Environment.java:208)
   freemarker.core.MixedContent.accept(MixedContent.java:92)
   freemarker.core.Environment.visit(Environment.java:208)
   freemarker.core.Environment.process(Environment.java:188)
   freemarker.template.Template.process(Template.java:237)
   org.alfresco.web.scripts.PresentationTemplateProcessor.process(PresentationTemplateProcessor.java:146)
   org.alfresco.web.scripts.FreemarkerRenderer.execute(FreemarkerRenderer.java:219)
   org.alfresco.web.site.RenderUtil.renderTemplate(RenderUtil.java:268)
   org.alfresco.web.site.RenderUtil.renderPage(RenderUtil.java:172)
   org.alfresco.web.site.PresentationUtil.renderPage(PresentationUtil.java:88)
   org.alfresco.web.site.servlet.DispatcherServlet.dispatchPage(DispatcherServlet.java:455)
   org.alfresco.web.site.servlet.DispatcherServlet.dispatch(DispatcherServlet.java:356)
   org.alfresco.web.site.servlet.DispatcherServlet.service(DispatcherServlet.java:144)
   javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
   org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
   org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
   org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
   org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
   org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
   org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
   org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
   org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
   org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
   org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
   org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
   org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
   org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
   java.lang.Thread.run(Thread.java:619)
   
Exception:   org.alfresco.web.scripts.WebScriptException - Failed to process template org/alfresco/components/dashlets/user-welcome.get.html.ftl
   
   org.alfresco.web.scripts.PresentationTemplateProcessor.process(PresentationTemplateProcessor.java:150)
   
Server:   Alfresco Labs v3.0.0 (b 1164) schema 131
Time:   Sep 15, 2008 2:15:03 PM
   
Diagnostics:   Inspect Web Script (org/alfresco/components/dashlets/user-welcome.get)

When i click on the diagnostic link this is what i get.


Web Script: org/alfresco/components/dashlets/user-welcome.get
Generated from /share/service/script/org/alfresco/components/dashlets/user-welcome.get on Sep 15, 2008 1:59:34 PM

Script Properties
Id:   org/alfresco/components/dashlets/user-welcome.get
Short Name:   Getting Started
Description:   Displays a welcome note to the user
Authentication:   none
Transaction:   none
Method:   GET
URL Template:   /components/dashlets/user-welcome
Format Style:   any
Default Format:   html
Negotiated Formats:   [undefined]
Implementation:   class org.alfresco.web.scripts.DeclarativeWebScript
Extensions:   [undefined]

Store: classpath:alfresco/site-webscripts

File: org/alfresco/components/dashlets/user-welcome.get.desc.xml

<webscript>
   <shortname>Getting Started</shortname>
   <description>Displays a welcome note to the user</description>
   <family>user-dashlet</family>
   <url>/components/dashlets/user-welcome</url>
</webscript>

File: org/alfresco/components/dashlets/user-welcome.get.head.ftl

<!– User Welcome Assets –>
<link rel="stylesheet" type="text/css" href="${page.url.context}/components/dashlets/user-welcome.css"/>
<script type="text/javascript" src="${page.url.context}/components/dashlets/user-welcome.js"></script>
<link rel="stylesheet" type="text/css" href="${page.url.context}/modules/create-site.css"/>
<script type="text/javascript" src="${page.url.context}/modules/create-site.js"></script>

File: org/alfresco/components/dashlets/user-welcome.get.html.ftl

<script type="text/javascript">//<![CDATA[
new Alfresco.UserWelcome("${args.htmlid}");
//]]></script>
<div class="dashlet user-welcome">
   <div class="title">${msg("header.userWelcome")}</div>
   <div class="body">
      <div class="detail-list-item">
         <h4>${msg("header.userDashboard")}</h4>
         <div>${msg("text.userDashboard")}</div>
      </div>
      <div class="detail-list-item">
         <h4>${msg("header.customiseDashboard")}</h4>
         <div>${msg("text.customiseDashboard")}</div>
         <div><a href="${url.context}/page/customise-user-dashboard">${msg("link.customiseDashboard")}</a></div>
      </div>
      <div class="detail-list-item">
         <h4>${msg("header.userProfile")}</h4>
         <div>${msg("text.userProfile")}</div>
         <div><a href="${url.context}/page/user/${user.name?url}/profile">${msg("link.userProfile")}</a></div>
      </div>
      <#if sites?size &gt; 0>
         <div class="detail-list-item">
            <h4>${msg("header.mySites")}</h4>
            <div>${msg("text.mySites")}</div>
         <#list sites as site>
            <div class="site"><a href="${url.context}/page/site/${site.shortName}/dashboard">${site.title}</a></div>
         </#list>
         </div>
      </#if>
      <div class="detail-list-item last">
         <h4>${msg("header.createSite")}</h4>
         <div>${msg("text.createSite")}</div>
         <div><a id="${args.htmlid}-createSite-button" href="#">${msg("link.createSite")}</a></div>
      </div>
   </div>
</div>

File: org/alfresco/components/dashlets/user-welcome.get.js

function sortByTitle(site1, site2)
{
   return (site1.title > site2.title) ? 1 : (site1.title < site2.title) ? -1 : 0;
}

function main()
{
   // Call the repo for sites the user is a member of
   var result = remote.call("/api/people/" + user.name + "/sites");
   if (result.status == 200)
   {
      // Create javascript objects from the server response
      var sites = eval('(' + result + ')');
      if(sites.length > 2)
      {
         sites = sites.slice(sites.length - 3);
      }

      // Sort the sites by title
      sites.sort(sortByTitle);
     
      // Prepare the model for the template
      model.sites = sites;
   }
}

main();

File: org/alfresco/components/dashlets/user-welcome.get.properties

header.userWelcome=Getting Started

header.userDashboard=Welcome to your Dashboard
text.userDashboard=Your dashboard gives you a rolled-up view of what is going on in all the sites of which you are a member.

header.customiseDashboard=Customize Your Dashboard
text.customiseDashboard=To add/remove dashlets and change the layout of this page click, Customize Dashboard.
link.customiseDashboard=Customize Dashboard

header.userProfile=Your Profile
text.userProfile=You can change your password and enter information about yourself and company on your profile page.
link.userProfile=Your Profile

header.mySites=My Sites
text.mySites=Why not visit one of your sites?

header.createSite=Create a site
text.createSite=Why not create a site and start collaborating with others?
link.createSite=Create Site

button.remove=Thanks, now remove this

Store: classpath:alfresco/webscripts

[No implementation files]


any help would be greatly appreciated.

Thanks,

Adam

Outcomes