return SKIP_BODY;
}
// First time search resources
if (searchResult == null) {
SearchQuery q = new SearchQueryImpl(site);
if (includeTypes != null)
q.withTypes(includeTypes.toArray(new String[includeTypes.size()]));
if (excludeTypes != null)
q.withoutTypes(excludeTypes.toArray(new String[excludeTypes.size()]));
if (order != null)
q.sortByCreationDate(order);
if (resourceId != null) {
for (String id : resourceId)
q.withIdentifier(id);
} else {
if (resourceSubjects != null) {
for (String subject : resourceSubjects) {
q.withSubject(subject);
}
}
if (resourceSeries != null) {
for (String series : resourceSeries) {
q.withSeries(series);
}
}
if (creatorStartDate != null || creatorEndDate != null) {
if (creatorStartDate == null)
creatorStartDate = new Date(0);
if (creatorEndDate == null)
creatorEndDate = new Date();
q.withCreationDateBetween(creatorStartDate);
q.and(creatorEndDate);
}
}
q.withLimit(limit);
q.withOffset(offset);
try {
searchResult = repository.find(q);
} catch (ContentRepositoryException e) {
logger.error("Error searching for resources with given subjects.");