Duplicity check during Site creation using siteService.hasSite(shortname)

cancel
Showing results for 
Search instead for 
Did you mean: 
vojtechm
Active Member

Duplicity check during Site creation using siteService.hasSite(shortname)

Hello,

as I understand - when I want to check duplicity during new site creation in Alfresco 5.1.1, I will use siteService.hasSite(shortname) which will go through all sites (even Private ones) and give me true/false result. This hasSite even checks sites in Trashcan where deleted sites with possible same shortname might be located.

BUT in my case siteService.hasSite returns "ok" result even if the site is already in trashcan and is letting me to create site with once used shortname of site in Trashcan which might lead to future issues for users using such "duplicated" site.

I've tried to locate hasSite in classes in alfresco-repository-5.1.1.jar file but I was not able to find particular source code to see what this is doing and why does it not check trashcan or what does this query looks like.

Have someone experienced same behavior or have ideas why it's not checking the trashcan? Could this be related to index settings for archive://SpacesStore ?

Thank you very much.

Best regards
Vojtech

5 Replies
romschn
Senior Member

Re: Duplicity check during Site creation using siteService.hasSite(shortname)

I did not get a chance to debug through the code.However, you should be able to take a look at the source code at https://svn.alfresco.com/repos/alfresco-open-mirror/alfresco/COMMUNITYTAGS/5.1.a/root/projects/repos... 

For other community versions, it can be traversed from https://svn.alfresco.com/repos/alfresco-open-mirror/alfresco/COMMUNITYTAGS

Hope this helps.

ddraper
Intermediate II

Re: Duplicity check during Site creation using siteService.hasSite(shortname)

As an FYI, you might be interested to know that this is a feature that is actually coming in 5.2... we've updated the site creation dialog to use a new Aikau version that performs dynamic checking to see whether or not the suggested site title and short name has already been used (and also checks private sites). 

vojtechm
Active Member

Re: Duplicity check during Site creation using siteService.hasSite(shortname)

That is great to know. Thanks!

afaust
Master

Re: Duplicity check during Site creation using siteService.hasSite(shortname)

You meant to say that feature is already here. 5.2 GA shipped - only Enterprise folks have to wait a bit longer...

ddraper
Intermediate II

Re: Duplicity check during Site creation using siteService.hasSite(shortname)

Yes, that is true Smiley Happy