use of org.apache.jackrabbit.webdav.version.LabelInfo in project jackrabbit by apache.
the class RepositoryServiceImpl method removeVersionLabel.
@Override
public void removeVersionLabel(SessionInfo sessionInfo, NodeId versionHistoryId, NodeId versionId, Name label) throws RepositoryException {
HttpLabel request = null;
try {
String uri = getItemUri(versionId, sessionInfo);
String strLabel = getNamePathResolver(sessionInfo).getJCRName(label);
request = new HttpLabel(uri, new LabelInfo(strLabel, LabelInfo.TYPE_REMOVE));
initMethod(request, sessionInfo, !isUnLockMethod(request));
HttpResponse response = executeRequest(sessionInfo, request);
request.checkSuccess(response);
} catch (IOException e) {
throw new RepositoryException(e);
} catch (DavException ex) {
throw ExceptionConverter.generate(ex);
} finally {
request.releaseConnection();
}
}
use of org.apache.jackrabbit.webdav.version.LabelInfo in project jackrabbit by apache.
the class RepositoryServiceImpl method addVersionLabel.
@Override
public void addVersionLabel(SessionInfo sessionInfo, NodeId versionHistoryId, NodeId versionId, Name label, boolean moveLabel) throws RepositoryException {
HttpLabel request = null;
try {
String uri = getItemUri(versionId, sessionInfo);
String strLabel = getNamePathResolver(sessionInfo).getJCRName(label);
request = new HttpLabel(uri, new LabelInfo(strLabel, moveLabel ? LabelInfo.TYPE_SET : LabelInfo.TYPE_ADD));
initMethod(request, sessionInfo, !isUnLockMethod(request));
HttpResponse response = executeRequest(sessionInfo, request);
request.checkSuccess(response);
} catch (IOException e) {
throw new RepositoryException(e);
} catch (DavException ex) {
throw ExceptionConverter.generate(ex);
} finally {
request.releaseConnection();
}
}
use of org.apache.jackrabbit.webdav.version.LabelInfo in project jackrabbit by apache.
the class WebdavRequestImpl method getLabelInfo.
/**
* @see org.apache.jackrabbit.webdav.version.DeltaVServletRequest#getLabelInfo()
*/
public LabelInfo getLabelInfo() throws DavException {
LabelInfo lInfo = null;
Document requestDocument = getRequestDocument();
if (requestDocument != null) {
Element root = requestDocument.getDocumentElement();
int depth = getDepth(DEPTH_0);
lInfo = new LabelInfo(root, depth);
}
return lInfo;
}
Aggregations