cancel
Showing results for 
Search instead for 
Did you mean: 

Alfresco 5 new site via API throws errors in Share

rshariff
Champ in-the-making
Champ in-the-making
I created a new site using the /alfresco/service/api/sites POST method.  The site gets created successfully, but when I go to the site in Share via the browser, I get an error page and the log shows:

Could not resolve view with name 'site/myshortname/dashboard' in servlet with name 'Spring Surf Dispatcher Servlet'

Note that if I force the URL to:

/share/page/site/myshortname/documentlibrary

then it does show me the documents page.  It's just the dashboard page that throws the error for sites created via the API.
3 REPLIES 3

mlagneaux
Champ on-the-rise
Champ on-the-rise
I think that sites.post webscript only creates the sites on an Alfresco Explorer point of view. That means that surf config (dashlets and components on the site dashboard) is not initialized.
I don't remember well but there's an Alfresco Share webscript to call to make that.

Try to search in the create site source code in Alfresco Share.

rshariff
Champ in-the-making
Champ in-the-making
Does that sound like a bug in the app that should be corrected or is that how it's supposed to work?  If we have an external app creating new sites based on an integration with another application, it needs to not only interface with the /alfresco/api URLs but also do stuff with webscripts on the share site?  As a temporary workaround we can certainly do that, but it would be kind of odd to have an API integration interact with a GUI component as well to do stuff.

rshariff
Champ in-the-making
Champ in-the-making
Looks like that's just how it works.  I came across this from 2 years ago…unfortunately you have to go through share to get share to figure out that a new site has been created that it needs to be able to display:

http://ecmstuff.blogspot.com/2012/03/creating-alfresco-share-sites-with.html