cancel
Showing results for 
Search instead for 
Did you mean: 

Renaming Site url/shortname causes Authority Not Found error

cybertoast
Champ in-the-making
Champ in-the-making
When creating a site in /share and renaming it in /alfresco there's an inconsistency introduced in the site's group. For example, if a site is created in Share as SiteA, alfresco creates a user group called SiteA which has implicit site-manager roles. If the site is then renamed to SiteB from /alfresco's management interface, the group remains the same, but the site's URL changes. But when retrieving sites using the API call remote.call('api/sites'), I get the error:

org.alfresco.repo.security.authority.UnknownAuthorityException: 01010007 An authority was not found for GROUP_site_siteb_SiteManager

But I don't seem to have a way to rename the URL through /share API.

Steps to reproduce:
* Create a new Public site in /share - Title = Site A, URL = SiteA
* Go to /alfresco as admin (or site creator)
* Change the "Name" value of the site (Company Home -> Sites -> SiteA -> Modify) to SiteB
* Create a dashlet in /share that retrieves a list of all public sites:

result = remote.call('/api/sites?');
* Result will contain the exception message above.

Is there an API call to both rename a site's short-name and set the appropriate internal Groups? Or is there a way to rename the group in /alfresco so that I can avoid this problem? Or am I just going about this the wrong way?
19 REPLIES 19

cybertoast
Champ in-the-making
Champ in-the-making
The same error occurs if I rename the site using WebDAV as well.

mrogers
Star Contributor
Star Contributor
I don't think you should be able to change the "shortName".   If there's something attempting to do that then that is going to cause problems.

cybertoast
Champ in-the-making
Champ in-the-making
But the short-name is not just an internal representation of the site - it's actually visible to the outside world through the URL and through WebDAV. So if we have a project-name that changes (and we tie Sites to Projects) then we need to be able to rename the Site. This is a pretty common occurrence and I believe a standard workflow.

The "shortname" is allowed to be changed in WCM (/alfresco) so I would think that this is a permitted action for Share as well. What I don't understand is how the Group assigned to a site is hard-tied to a site's shortname and there's no way to change this.

From your response mrogers, it seems that this restriction on renaming URL/shortname/Name is by design. But could you please clarify what "If there's something attempting to do that then that is going to cause problems." means? Are there other features that expect the shortname/Group to be tied together?

mikeh
Star Contributor
Star Contributor
I'm guessing it's you who has just raised this in JIRA as a "critical" bug: http://issues.alfresco.com/jira/browse/ALFCOM-3800

I'll paste my response here:
Renaming a Site is -as you've discovered- unsupported currently. You can rename the Site's name and description through the Share UI, but not the URL.

More importantly, modifying ANY Site parameter via the Explorer ("/alfresco") web client is very risky and can cause all sorts of problems; which is why we present the yellow warning banner across that client when browsing within the Sites space or subspaces.

Having said that, you could probably programatically rename the existing Site groups if you did want to rename a Site's shortName, however we really wouldn't recommend this.

Whether you *should* be able to change a Site's url is debatable: all existing links to content within that site (whether on an external system or simply bookmarked by your users) will break. If you really must be able to change the URLs frequently, I'd suggest proxying Share's Tomcat server with an Apache server; that way you can introduce rewrite rules to modify the URL as you wish without having to worry about any other factors.

Thanks,
Mike

mrogers
Star Contributor
Star Contributor
Yes you are approaching it incorrectly - you should assume that the site's "short name" cannot be changed.

cybertoast
Champ in-the-making
Champ in-the-making
Thanks much. Just something I was not aware of and something I need to keep in mind when dealing with ongoing administration (particularly for WebDAV access).
Is there a webscript/api call to programmatically rename the existing Site groups?

mrogers
Star Contributor
Star Contributor
No.   That's one of the reasons you can't rename a site.   If you have renamed a site then I suggest you change it back.

cybertoast
Champ in-the-making
Champ in-the-making
Is there any way to have WebDAV use the Title instead of the shortname? Since both are "served" by Alfresco is this configurable?

andnyg
Champ in-the-making
Champ in-the-making
Of course it must be possible to change the short name of the site. There must be some kind of technical challenge that makes this hard to implement for the developers. Changing URLS is of course something you should avoid, but that must be up to the administrator of the site or server. Not very flexible otherwise.