protected void checkRepositoryId(String repositoryId) { if (!connector.getRepositoryId().equals(repositoryId)) { throw new CmisObjectNotFoundException("Unknown repository '" + repositoryId + "'!"); } }
protected void checkRepositoryId(String repositoryId) { if (!connector.getRepositoryId().equals(repositoryId)) { throw new CmisObjectNotFoundException("Unknown repository '" + repositoryId + "'!"); } }
@Override public RepositoryInfo getRepositoryInfo(String repositoryId, ExtensionsData extension) { if (!fRepInfo.getId().equals(repositoryId)) { throw new CmisObjectNotFoundException( "A repository with repository id '" + repositoryId + "' does not exist!"); } return fRepInfo; }
/** * @return this instance as a <code>RegistryFolder</code> * @throws CmisConstraintException if <code>this.isFolder() == false</code> */ public RegistryFolder asFolder() { if (isFolder()) { return (RegistryFolder) this; } else { throw new CmisObjectNotFoundException("Not a folder: " + this); } }
@Override public void deleteType(String repositoryId, String typeId, ExtensionsData extension) { Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put(Constants.PARAM_ID, typeId); String link = loadTemplateLink(repositoryId, Constants.TEMPLATE_TYPE_BY_ID, parameters); if (link == null) { throw new CmisObjectNotFoundException("Unknown repository!"); } delete(new UrlBuilder(link)); } }
@Override public void deleteType(String repositoryId, String typeId, ExtensionsData extension) { Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put(Constants.PARAM_ID, typeId); String link = loadTemplateLink(repositoryId, Constants.TEMPLATE_TYPE_BY_ID, parameters); if (link == null) { throw new CmisObjectNotFoundException("Unknown repository!"); } delete(new UrlBuilder(link)); } }
@Override public void applyPolicy(String repositoryId, String policyId, String objectId, ExtensionsData extension) { checkRepositoryId(repositoryId); // what kind of object is it? CMISNodeInfo info = getOrCreateNodeInfo(objectId, "Object"); TypeDefinitionWrapper type = info.getType(); if (type == null) { throw new CmisObjectNotFoundException("No corresponding type found! Not a CMIS object?"); } connector.applyPolicies(info.getNodeRef(), type, Collections.singletonList(policyId)); }
@Override public void removePolicy(String repositoryId, String policyId, String objectId, ExtensionsData extension) { checkRepositoryId(repositoryId); // what kind of object is it? CMISNodeInfo info = getOrCreateNodeInfo(objectId, "Object"); TypeDefinitionWrapper type = info.getType(); if (type == null) { throw new CmisObjectNotFoundException("No corresponding type found! Not a CMIS object?"); } throw new CmisConstraintException("Object is not policy controllable!"); }
@Override public TypeDefinition getTypeDefinition(String repositoryId, String typeId, ExtensionsData extension) { checkRepositoryId(repositoryId); // find the type TypeDefinitionWrapper tdw = connector.getOpenCMISDictionaryService().findType(typeId); if (tdw == null) { throw new CmisObjectNotFoundException("Type '" + typeId + "' is unknown!"); } // return type definition return tdw.getTypeDefinition(true); }
public RegistryPrivateWorkingCopy getPwc() { Resource node = getNode(); if (isCheckedOut(node)) { return new RegistryPrivateWorkingCopy(getRepository(), node, typeManager, pathManager); } else { throw new CmisObjectNotFoundException("Not checked out document has no private working copy"); } }
protected UrlBuilder getObjectUrl(String repositoryId, String objectId, String selector) { UrlBuilder result = getRepositoryUrlCache().getObjectUrl(repositoryId, objectId, selector); if (result == null) { getRepositoriesInternal(repositoryId); result = getRepositoryUrlCache().getObjectUrl(repositoryId, objectId, selector); } if (result == null) { throw new CmisObjectNotFoundException("Unknown repository!"); } return result; }
protected UrlBuilder getObjectUrl(String repositoryId, String objectId) { UrlBuilder result = getRepositoryUrlCache().getObjectUrl(repositoryId, objectId); if (result == null) { getRepositoriesInternal(repositoryId); result = getRepositoryUrlCache().getObjectUrl(repositoryId, objectId); } if (result == null) { throw new CmisObjectNotFoundException("Unknown repository!"); } return result; }
protected UrlBuilder getPathUrl(String repositoryId, String path, String selector) { UrlBuilder result = getRepositoryUrlCache().getPathUrl(repositoryId, path, selector); if (result == null) { getRepositoriesInternal(repositoryId); result = getRepositoryUrlCache().getPathUrl(repositoryId, path, selector); } if (result == null) { throw new CmisObjectNotFoundException("Unknown repository!"); } return result; }
protected UrlBuilder getObjectUrl(String repositoryId, String objectId, String selector) { UrlBuilder result = getRepositoryUrlCache().getObjectUrl(repositoryId, objectId, selector); if (result == null) { getRepositoriesInternal(repositoryId); result = getRepositoryUrlCache().getObjectUrl(repositoryId, objectId, selector); } if (result == null) { throw new CmisObjectNotFoundException("Unknown repository!"); } return result; }
protected UrlBuilder getPathUrl(String repositoryId, String path, String selector) { UrlBuilder result = getRepositoryUrlCache().getPathUrl(repositoryId, path, selector); if (result == null) { getRepositoriesInternal(repositoryId); result = getRepositoryUrlCache().getPathUrl(repositoryId, path, selector); } if (result == null) { throw new CmisObjectNotFoundException("Unknown repository!"); } return result; }
protected UrlBuilder getRepositoryUrl(String repositoryId, String selector) { UrlBuilder result = getRepositoryUrlCache().getRepositoryUrl(repositoryId, selector); if (result == null) { getRepositoriesInternal(repositoryId); result = getRepositoryUrlCache().getRepositoryUrl(repositoryId, selector); } if (result == null) { throw new CmisObjectNotFoundException("Unknown repository!"); } return result; }
protected UrlBuilder getRepositoryUrl(String repositoryId) { UrlBuilder result = getRepositoryUrlCache().getRepositoryUrl(repositoryId); if (result == null) { getRepositoriesInternal(repositoryId); result = getRepositoryUrlCache().getRepositoryUrl(repositoryId); } if (result == null) { throw new CmisObjectNotFoundException("Unknown repository!"); } return result; }
protected UrlBuilder getRepositoryUrl(String repositoryId, String selector) { UrlBuilder result = getRepositoryUrlCache().getRepositoryUrl(repositoryId, selector); if (result == null) { getRepositoriesInternal(repositoryId); result = getRepositoryUrlCache().getRepositoryUrl(repositoryId, selector); } if (result == null) { throw new CmisObjectNotFoundException("Unknown repository!"); } return result; }
protected UrlBuilder getRepositoryUrl(String repositoryId) { UrlBuilder result = getRepositoryUrlCache().getRepositoryUrl(repositoryId); if (result == null) { getRepositoriesInternal(repositoryId); result = getRepositoryUrlCache().getRepositoryUrl(repositoryId); } if (result == null) { throw new CmisObjectNotFoundException("Unknown repository!"); } return result; }
protected UrlBuilder getObjectUrl(String repositoryId, String objectId) { UrlBuilder result = getRepositoryUrlCache().getObjectUrl(repositoryId, objectId); if (result == null) { getRepositoriesInternal(repositoryId); result = getRepositoryUrlCache().getObjectUrl(repositoryId, objectId); } if (result == null) { throw new CmisObjectNotFoundException("Unknown repository!"); } return result; }