}
if (query != null) {
CoreQueryPageProviderDescriptor desc = new CoreQueryPageProviderDescriptor();
desc.setPattern(query);
return new PaginableDocumentModelListImpl(
(PageProvider<DocumentModel>) pps.getPageProvider("", desc,
null, sortInfos, targetPageSize, new Long(page),
props, parameters), documentLinkBuilder);
} else {
Object[] params = new Object[parameters != null ? parameters.length + 1
: 1];
if (parameters != null) {
System.arraycopy(parameters, 0, params, 0, parameters.length);
}
params[params.length - 1] = finalPath;
return new PaginableDocumentModelListImpl(
(PageProvider<DocumentModel>) pps.getPageProvider(
providerName, sortInfos, targetPageSize, new Long(
page), props, params), documentLinkBuilder);
}
}