use of org.bedework.calfacade.exc.CalFacadeAccessException in project bw-calendar-engine by Bedework.
the class ProcessorBase method indexCollection.
protected void indexCollection(final CalSvcI svci, final String path) throws CalFacadeException {
if (skipThis(path)) {
if (debug) {
debug("Skipping " + path);
}
return;
}
if (debug) {
debug("indexCollection(" + path + ")");
}
status.currentStatus = "indexCollection(" + path + ")";
status.stats.inc(IndexedType.collections);
try {
BwCalendar col = null;
try {
col = svci.getCalendarsHandler().get(path);
} catch (final CalFacadeAccessException cfe) {
error("No access to " + path);
}
if ((col == null) || !hasAccess(col)) {
if (debug) {
debug("path " + path + " not found");
}
return;
}
final BwIndexer indexer = svci.getIndexer(principal, indexRootPath);
indexer.indexEntity(col);
// close();
final BwCalendar.CollectionInfo ci = col.getCollectionInfo();
if (!ci.childrenAllowed) {
return;
}
Refs refs = null;
for (; ; ) {
refs = getChildCollections(path, refs);
if (refs == null) {
break;
}
for (final String cpath : refs.refs) {
indexCollection(svci, cpath);
}
}
if (!ci.onlyCalEntities || !ci.indexable) {
return;
}
refs = null;
for (; ; ) {
refs = getChildEntities(path, refs);
if (refs == null) {
break;
}
final EntityProcessor ep = new EntityProcessor(status, name + ":Entity", adminAccount, principal, entityDelay, path, refs.refs, indexRootPath);
final IndexerThread eit = getEntityThread(ep);
eit.start();
}
} catch (final Throwable t) {
error(t);
}
}
use of org.bedework.calfacade.exc.CalFacadeAccessException in project bw-calendar-engine by Bedework.
the class ProcessDelete method deleteEvent.
private boolean deleteEvent() throws Throwable {
final String path = wordOrQuotedVal();
if (path == null) {
error("Expected a path");
return false;
}
final String name = wordOrQuotedVal();
if (name == null) {
error("Expected a name");
return false;
}
try {
open();
final EventInfo ei = getEvent(path, name);
if (ei == null) {
return false;
}
getSvci().getEventsHandler().delete(ei, false);
return true;
} catch (final CalFacadeAccessException cae) {
pstate.addError("No access to event " + path + "/" + name);
return false;
} finally {
close();
}
}
use of org.bedework.calfacade.exc.CalFacadeAccessException in project bw-calendar-engine by Bedework.
the class ProcessDelete method deleteCollection.
private boolean deleteCollection() throws Throwable {
BwCalendar cal = null;
try {
open();
cal = getCal();
if (cal == null) {
return false;
}
final boolean emptyIt = "recursive".equals(word());
getSvci().getCalendarsHandler().delete(cal, emptyIt, false);
return true;
} catch (final CalFacadeAccessException cae) {
pstate.addError("No access to collection " + cal.getPath());
return false;
} finally {
close();
}
}
use of org.bedework.calfacade.exc.CalFacadeAccessException in project bw-calendar-engine by Bedework.
the class ProcessReindex method indexCollection.
protected int indexCollection(final String path, final BwIndexer indexer) throws CalFacadeException {
int reindexed = 0;
try {
BwCalendar col = null;
try {
col = getSvci().getCalendarsHandler().get(path);
} catch (final CalFacadeAccessException cfe) {
error("No access to " + path);
}
if (col == null) {
if (debug) {
debug("path " + path + " not found");
}
return 0;
}
indexer.indexEntity(col);
// close();
reindexed++;
final BwCalendar.CollectionInfo ci = col.getCollectionInfo();
if (!ci.childrenAllowed) {
return reindexed;
}
Refs refs = null;
for (; ; ) {
refs = getChildCollections(path, refs);
if (refs == null) {
break;
}
for (final String cpath : refs.refs) {
reindexed += indexCollection(cpath, indexer);
}
}
} catch (final Throwable t) {
error(t);
}
return reindexed;
}
Aggregations