HI
I am working on an Iview, that would be used to rename folders.Basically the user would enter the scope, old name and new name.The Iview is required to search through all the folders within the scope and rename the ones with the old name with the new name.
I am using the following piece of code to search for the folders.
IGenericQueryFactory queryFactory = null;
try {
queryFactory = GenericQueryFactory.getInstance();
}catch (ResourceException e3) {
e3.printStackTrace();
}
IQueryBuilder queryBldr = queryFactory.getQueryBuilder();
IPropertyName ipn = PropertyName.createDisplayname();
IQueryExpression queryExpr =queryBldr.like(ipn, myBean.getCurrentName());
IGenericQuery query = null;
try {
query = queryFactory.toGenericQuery(queryExpr);
} catch (NotSupportedException e4) {
e4.printStackTrace();
}
try {
IResourceList result = query.execute(scopeResource, Integer.MAX_VALUE,Integer.MAX_VALUE,false);
IResourceListIterator resultIter = result.listIterator();
while(resultIter.hasNext()){
response.write("<br>" + resultIter.next().getRID());
}
} catch (AccessDeniedException e5) {
e5.printStackTrace();
}
However, the problem is this works fine if the displayName property is set for the folders.
For most of the folders, the displayName is not set in which case they do not appear in the results.
Can somebody suggest a solution?
Thanks
Alkesh