cancel
Showing results for 
Search instead for 
Did you mean: 

Could not resolve view with name 'site/undefined/dashboard'

ddzingielewski
Champ in-the-making
Champ in-the-making
hi,
I am working with:
Alfresco Community v3.4.0
(c @build-number@) schema 4113
Spring Surf and Spring WebScripts - v1.0.0
(Release Candidate 2 739)

I have some errors when I'm am trying to add new space in Share. From main dashboard i click "Sites->Create Site", when I provide custom input fields and click "Ok" button I get error message:


description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: Could not resolve view with name 'site/undefined/dashboard' in servlet with name 'Spring Surf Dispatcher Servlet'
org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1042)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:798)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:716)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:647)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:552)
javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.alfresco.web.site.servlet.MTAuthenticationFilter.doFilter(MTAuthenticationFilter.java:74)
org.alfresco.web.site.servlet.SSOAuthenticationFilter.doFilter(SSOAuthenticationFilter.java:301)

note The full stack trace of the root cause is available in the Apache Tomcat/6.0.32 logs.

Suprisingly new site is created. It apears in dashlet "My Sites" and When i click on them the newly added site dashboard opens properly and i can edit and modify it. I suppose that there is some problem with returning id of the newly created site (just after clicking "Ok" button), it seems that server does not recognize id so it tries to load 'site/undefined/dashboard' but that site does not exists. When i turn the newly created site from "My Sites" dashlet in URL appears some id=CT13120110707PD between site and dashboard
(full URL:  http://localhost:8080/share/page/site/CT13120110707PD/dashboard)

What can be the reason of that kind of error ?
Where I can found code which is responsible for reloading to the newly created site ?

Thanks for any help
dd
2 REPLIES 2

jpotts
World-Class Innovator
World-Class Innovator
You said you are providing some custom input fields when you create a site. Are you not providing a site ID when you post that form? It sounds as if you aren't, but the site service is creating the site anyway, but the client-side JavaScript doesn't know where to redirect you to because it is using the site ID provided, not the site ID returned.

I'm guessing and trying to get you pointed in the right direction–I'm not certain this is exactly what's happening.

If it gives you some sense of hope, I created a custom site creation form for a client where the site ID was auto-generated instead of specified by the user and it ultimately worked out alright, so what you are doing should definitely be possible.

Jeff

ddzingielewski
Champ in-the-making
Champ in-the-making
thanks for Your answer,

I have found that I'm getting the correct site id. In a script /usr/local/tomcat/webapps/share/WEB-INF/classes/alfresco/site-webscripts/org/alfresco/module/create-site.post.json.js I have

 (…)  var repoResponse = scriptRemoteConnector.post("/api/sites", clientRequest, "application/json");
   if (repoResponse.status == 401)
   {
      status.setCode(repoResponse.status, "error.loggedOut");
      return;
   }
   else
   {
      var repoJSON = eval('(' + repoResponse + ')');
      // Check if we got a positive result
      if (repoJSON.shortName)
      {
         // Yes we did, now create the site in the webtier
         var tokens = new Array();
         tokens["siteid"] = repoJSON.shortName;
         tokens["siteCategory"] = _jsonOb.sitePreset;
          sitedata.newPreset(clientJSON.sitePreset, tokens);        

         model.success = true;        
         //set shortName to the model which is necessary to build redirection to URL of new space (create-site.js)
         model.newSiteURL = repoJSON.shortName;
      }
      else if (repoJSON.status.code)
      {
         status.setCode(repoJSON.status.code, repoJSON.message);
         return;
      }
   }
(…)

the repoJSON.shortName have the correct value of a siteid, but I'm not sure what is done after that script that finally it is missing. For example: who should read from the model object, what is executing after create-site.post.json.js ?