This commit is contained in:
Lucio Lelii 2019-01-09 16:38:53 +00:00
parent 3ee7c2e52f
commit d7448eb8f1
1 changed files with 13 additions and 3 deletions

View File

@ -149,12 +149,22 @@ public class ItemsManager {
try{
ses = repository.getRepository().login(CredentialHandler.getAdminCredentials(context));
authChecker.checkReadAuthorizationControl(ses, id);
//NOT using the internal pattern matching of jcr because of title for shared folder
NodeIterator it = ses.getNodeByIdentifier(id).getNodes();
while (it.hasNext()) {
Node child= it.nextNode();
Item item = node2Item.getItem(child, excludes);
if (item.getName().equalsIgnoreCase(name) || item.getTitle().equalsIgnoreCase(name))
toReturn.add(item);
String nodeName = child.getName();
if (!child.hasProperty(NodeProperty.TITLE.toString())) continue;
String title = child.getProperty(NodeProperty.TITLE.toString()).getString();
String cleanedName = name;
if (name.startsWith("*")) cleanedName = name.substring(1);
if (name.endsWith("*")) cleanedName = name.substring(0, name.length()-1);
if ((name.startsWith("*") && (nodeName.endsWith(cleanedName) || title.endsWith(cleanedName))) || (name.endsWith("*") && (nodeName.startsWith(cleanedName) || title.startsWith(cleanedName)))
|| (nodeName.equals(cleanedName) || title.equals(cleanedName)))
toReturn.add(node2Item.getItem(child, excludes));
}
}catch(RepositoryException re){