cancel
Showing results for 
Search instead for 
Did you mean: 

[SOLVED] HOW TO - Delete badly named sites?

nenad982
Champ on-the-rise
Champ on-the-rise
Hi all,

I have some bad data in repository (some share sites with url names that contains invalid characters) so now I am not able to delete those using UI. Is there way to delete or mark as deleted those nodes directly in database?

Thanks…
4 REPLIES 4

mrogers
Star Contributor
Star Contributor
No.    You to delete the site through the Sites API.

nenad982
Champ on-the-rise
Champ on-the-rise
Hi mrogers,

thanks for your answer. But I can not do it using Sites API. For example my client has sites with invalid characters and because of it alfresco is not able to delete those ("a-z, A-Z, 0-9 and -" are valid characters for site URL name). So is there any other way to delete bad data from repository, if it is not possible using db?

Thanks…

mrogers
Star Contributor
Star Contributor
Yes - you can do it directly in the database.   But its high risk and be aware that you are bypassing business logic.    Test it first!

Also be aware that you need to delete the contents of the site as well as the site itself.

You can delete it through the java API.   You just need to suspend the policy that prevents deletion of a site.  Look at the SiteServiceImpl to see how the site service does it.

nenad982
Champ on-the-rise
Champ on-the-rise
Hi mrogers,

you are right. I am able to delete wrongly named sites using Java API (SiteService#deleteSite()). In that method, aspect that marks node as undeletable had been removed before site has been deleted. It was not possible to delete those sites from UI because this method in SiteService is not invoked at all because execution of the code was stopped with exception somewhere before in JavaScript.

Once again thanks a lot…