function getNodeByPath($Store, $path, $node = null)
{
$bits = split('/', $path);
if ($node == null) {
$node = $Store->getCompanyHome();
}
/* @var $node Node */
foreach ($bits as $bit) {
// Skip up until we have the parts after the company home
if (empty($bit) || $bit == 'Company Home') {
continue;
}
// Get the node for the current bit. If the current
// "bit" doesn't exist, then
$children = $node->getChildren();
foreach ($children as $child) {
$childNode = $child->getChild();
if ($childNode->cm_name == $bit) {
$node = $childNode;
// Cheat and skip to the next 'bit' to scan
continue 2;
}
}
$node = null;
break;
}
return $node;
}
Me he dado cuenta que sólo me devuelve en la lista los primeros 1000 nodos de una carpeta (en la que tenemos unos 2500).
Fetched next set of results:
Total results count: 1212
Batch size: 1000
New Position: 1000
String sQuery = "TYPE:\"" + Constants.TYPE_CONTENT + "\"";
// Establece el tamaño del batch en la cabecera de la query…
int batchSize = 10;
QueryConfiguration queryCfg = new QueryConfiguration();
queryCfg.setFetchSize(batchSize);
RepositoryServiceSoapBindingStub repositoryService = WebServiceFactory.getRepositoryService();
repositoryService.setHeader(new RepositoryServiceLocator().getServiceName().getNamespaceURI(), "QueryHeader", queryCfg);
// Obtenemos los primeros resultados
QueryResult result = repositoryService.query(STORE, getQuery(sQuery), true);
//Procesamos el primer lote de resultados de la query
String querySession = result.getQuerySession();
while (querySession != null) {
// Accedemos al siguiente lote de resultados
result = repositoryService.fetchMore(querySession);
// Procesamos los siguientes resultados de la query
querySession = result.getQuerySession();
}
Content from pre 2016 and from language groups that have been closed.
Content is read-only.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.