05-03-2018 10:09 AM
Hi team,
I found a problem with the available templates for a new Workspace creation. The problem is if you delete several TemplateRoot (and create others TemplateRoot) in your Domain and it (or them) keeps in the trash (TAB) the query to select available templates has a problem. It does not filter deleted document and the line templates = documentManager.getChildren(tl.get(0).getRef(), targetTypeName); with tl.get(0) is not correct.
Regards, VS!
The source code still on master branch:
@Override
public DocumentModelList getTemplates(String targetTypeName) {
...
String query = "SELECT * FROM Document where ecm:primaryType = '%s' AND ecm:path STARTSWITH %s";
DocumentModelList tl = documentManager.query(String.format(query, TemplateRoot,
NXQL.escapeString(navigationContext.getCurrentDomainPath())));
if (tl.isEmpty()) {
templates = tl;
} else {
templates = documentManager.getChildren(tl.get(0).getRef(), targetTypeName);
List<DocumentModel> deleted = new ArrayList<>();
for (DocumentModel current : templates) {
if (current.isTrashed()) {
deleted.add(current);
}
}
templates.removeAll(deleted);
}
}
05-07-2018 10:26 AM
Thanks for the report, NXP-24971 will track this issue.
05-07-2018 10:26 AM
Thanks for the report, NXP-24971 will track this issue.
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.