AnsweredAssumed Answered

Duplicate Folder Path (allowed) breaks Web Services methods

Question asked by igor1234 on Jan 28, 2009
Latest reply on Jan 30, 2009 by igor1234
Hi.
I'm evaluating Alfresco Enterprise 3.0 SP1 and Web Services specifically.
I've been using basic functionality (save folder, delete folder, copy folder, save content) following available examples.

The issue I have noticed, and was able to reproduce, related to some of the most basic functionality - Create new Folder (space) - using webservice.

There are two names attributed to a space (folder):
1. Display Name - shown in Web Client and passed with 'CMLCreate' - 'NamedValue' model objects.
2. Name used in a folder(space) path - 'childName' attribute of  'ParentReference' model object.

When I create folder with existing 'Display Name' I get
"Duplicate child name not allowed:"
error (which is good!).

But when I create folder(space) with existing path-name (but different 'Display Name') it is allowed to go through (no errors) !!!

After that,  these duplicated folders displayed  normally in Web Client by their 'Display Name' but from WebService point of view, data became corrupted. Any method call involving Reference to this duplicated path,
something like:
WebServiceFactory.getRepositoryService().get(new Predicate(new Reference[]{reference}, STORE, null) );
generated this error:

AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.generalException
faultSubcode:
faultString:
faultActor:
faultNode:
faultDetail:
   {http://www.alfresco.org/ws/service/repository/1.0}RepositoryFault:<ns1:errorCode>0</ns1:errorCode><ns1:message>java.lang.IllegalStateException: Failed to resolve to a single NodeRef with parameters (store=workspace:SpacesStore uuid=null path=/app:company_home/cm:AdPortal2/cm:test_Duplicate), found 2 nodes.</ns1:message>
   {http://xml.apache.org/axis/}exceptionName:org.alfresco.repo.webservice.repository.RepositoryFault
   {http://xml.apache.org/axis/}stackTrace:
   at org.alfresco.repo.webservice.repository.RepositoryWebService.get(RepositoryWebService.java:482)

In fact I'm getting the same error for all other WebServices method-calls that take 'Reference' object as input (I could not delete it for example).

To aggravate that, I've got several 'Fantom' folders created that do not show in Web Client but still recorded somewhere in Alfresco DB tables and when I try to reuse their names (in a folder-path) I get above error. For this second problem I suspect 'shallow copy' issue (described in another thread: http://forums.alfresco.com/en/viewtopic.php?f=27&t=13160) occurring  during  copping (moving) folder(s) with subfolder(s) in WebClient (this is obviously for another topic).

Thanks,
Igor

Outcomes