/** * Extracts document location from a Zope-like URL, eg: server/path_or_docId/view_id/tab_id . */ @Override public DocumentView getDocumentViewFromUrl(String url) { final Pattern pattern = Pattern.compile(getPrefix() + URL_PATTERN); Matcher m = pattern.matcher(url); if (m.matches()) { final String server = m.group(1); String path = m.group(2); if (path != null) { // add leading slash to make it absolute if it's not the root path = "/" + URIUtils.unquoteURIPathComponent(path); } final DocumentRef docRef = path != null ? new PathRef(path) : null; String viewId = m.group(3); int jsessionidIndex = viewId.indexOf(";jsessionid"); if (jsessionidIndex != -1) { viewId = viewId.substring(0, jsessionidIndex); } // get other parameters String query = m.group(4); Map<String, String> params = URIUtils.getRequestParameters(query); final DocumentLocation docLoc = new DocumentLocationImpl(server, docRef); return new DocumentViewImpl(docLoc, viewId, params); } return null; }