DocumentFactory map = DocumentUtil.createDocumentFactory(this.serviceManager, session);
// always check for authoring URL since the live document doesn't
// have to exist
URLInformation info = new URLInformation(webappUrl);
// Danger, Will Robinson! If area or pubId is null, webappUrl.substring()
// will be out of bounds, because null becomes "null" in string concatenation
String pubId = info.getPublicationId();
String area = info.getArea();
String prefix = "/" + ((pubId != null) ? pubId + "/" : "");
// String prefix = "/" + pubId + "/";
String prefixWithArea = prefix + ((area != null) ? area : "");
// String prefixWithArea = prefix + area;
String authoringUrl = prefix + Publication.AUTHORING_AREA