use of org.apache.jackrabbit.webdav.client.methods.HttpProppatch in project jackrabbit by apache.
the class RepositoryServiceImpl method internalSetNamespaces.
/**
*
* @param sessionInfo
* @param namespaces
* @throws NamespaceException
* @throws UnsupportedRepositoryOperationException
* @throws AccessDeniedException
* @throws RepositoryException
*/
private void internalSetNamespaces(SessionInfo sessionInfo, Map<String, String> namespaces) throws RepositoryException {
DavPropertySet setProperties = new DavPropertySet();
setProperties.add(createNamespaceProperty(namespaces));
HttpProppatch request = null;
try {
String uri = uriResolver.getWorkspaceUri(sessionInfo.getWorkspaceName());
request = new HttpProppatch(uri, setProperties, new DavPropertyNameSet());
initMethod(request, sessionInfo, true);
HttpResponse response = executeRequest(sessionInfo, request);
request.checkSuccess(response);
} catch (IOException e) {
throw new RepositoryException(e);
} catch (DavException e) {
throw ExceptionConverter.generate(e);
} finally {
if (request != null) {
request.releaseConnection();
}
}
}
use of org.apache.jackrabbit.webdav.client.methods.HttpProppatch in project jackrabbit by apache.
the class RepositoryServiceImpl method registerNodeTypes.
@Override
public void registerNodeTypes(SessionInfo sessionInfo, QNodeTypeDefinition[] nodeTypeDefinitions, boolean allowUpdate) throws RepositoryException {
HttpProppatch request = null;
try {
DavPropertySet setProperties = new DavPropertySet();
setProperties.add(createRegisterNodeTypesProperty(sessionInfo, nodeTypeDefinitions, allowUpdate));
String uri = uriResolver.getWorkspaceUri(sessionInfo.getWorkspaceName());
request = new HttpProppatch(uri, setProperties, new DavPropertyNameSet());
initMethod(request, sessionInfo, true);
HttpResponse response = executeRequest(sessionInfo, request);
request.checkSuccess(response);
} catch (IOException e) {
throw new RepositoryException(e);
} catch (DavException e) {
throw ExceptionConverter.generate(e);
} finally {
if (request != null) {
request.releaseConnection();
}
}
}
use of org.apache.jackrabbit.webdav.client.methods.HttpProppatch in project jackrabbit by apache.
the class RepositoryServiceImpl method resolveMergeConflict.
@Override
public void resolveMergeConflict(SessionInfo sessionInfo, NodeId nodeId, NodeId[] mergeFailedIds, NodeId[] predecessorIds) throws RepositoryException {
HttpProppatch request = null;
try {
List<HrefProperty> changeList = new ArrayList<HrefProperty>();
String[] mergeFailedHref = new String[mergeFailedIds.length];
for (int i = 0; i < mergeFailedIds.length; i++) {
mergeFailedHref[i] = getItemUri(mergeFailedIds[i], sessionInfo);
}
changeList.add(new HrefProperty(VersionControlledResource.AUTO_MERGE_SET, mergeFailedHref, false));
if (predecessorIds != null && predecessorIds.length > 0) {
String[] pdcHrefs = new String[predecessorIds.length];
for (int i = 0; i < predecessorIds.length; i++) {
pdcHrefs[i] = getItemUri(predecessorIds[i], sessionInfo);
}
changeList.add(new HrefProperty(VersionControlledResource.PREDECESSOR_SET, pdcHrefs, false));
}
request = new HttpProppatch(getItemUri(nodeId, sessionInfo), changeList);
initMethod(request, sessionInfo, !isUnLockMethod(request));
HttpResponse response = executeRequest(sessionInfo, request);
request.checkSuccess(response);
} catch (IOException e) {
throw new RepositoryException(e);
} catch (DavException e) {
throw ExceptionConverter.generate(e);
} finally {
if (request != null) {
request.releaseConnection();
}
}
}
use of org.apache.jackrabbit.webdav.client.methods.HttpProppatch in project jackrabbit by apache.
the class RepositoryServiceImpl method unregisterNodeTypes.
@Override
public void unregisterNodeTypes(SessionInfo sessionInfo, Name[] nodeTypeNames) throws RepositoryException {
HttpProppatch request = null;
try {
DavPropertySet setProperties = new DavPropertySet();
setProperties.add(createUnRegisterNodeTypesProperty(sessionInfo, nodeTypeNames));
String uri = uriResolver.getWorkspaceUri(sessionInfo.getWorkspaceName());
request = new HttpProppatch(uri, setProperties, new DavPropertyNameSet());
initMethod(request, sessionInfo, true);
HttpResponse response = executeRequest(sessionInfo, request);
request.checkSuccess(response);
} catch (IOException e) {
throw new RepositoryException(e);
} catch (DavException e) {
throw ExceptionConverter.generate(e);
} finally {
if (request != null) {
request.releaseConnection();
}
}
}
Aggregations