/** * Converts a type container list. */ public static List<TypeDefinitionContainer> convertTypeContainerList(List<CmisTypeContainer> typeContainers) { if (typeContainers == null) { return null; } List<TypeDefinitionContainer> result = new ArrayList<TypeDefinitionContainer>(); for (CmisTypeContainer container : typeContainers) { TypeDefinitionContainerImpl newConatiner = new TypeDefinitionContainerImpl(); newConatiner.setTypeDefinition(convert(container.getType())); newConatiner.setChildren(convertTypeContainerList(container.getChildren())); convertExtension(container, newConatiner); result.add(newConatiner); } return result; }
@Override public List<TypeDefinitionContainer> getTypeDescendants(String repositoryId, String typeId, BigInteger depth, Boolean includePropertyDefinitions, ExtensionsData extension) { RepositoryServicePort port = portProvider.getRepositoryServicePort(getCmisVersion(repositoryId), "getTypeDescendants"); try { return convertTypeContainerList(port.getTypeDescendants(repositoryId, typeId, depth, includePropertyDefinitions, convert(extension))); } catch (CmisException e) { throw convertException(e); } catch (Exception e) { throw new CmisRuntimeException("Error: " + e.getMessage(), e); } finally { portProvider.endCall(port); } }
/** * Converts a type container list. */ public static void convertTypeContainerList(List<TypeDefinitionContainer> typeContainers, List<CmisTypeContainer> target) { if (typeContainers == null) { return; } for (TypeDefinitionContainer container : typeContainers) { CmisTypeContainer newConatiner = new CmisTypeContainer(); newConatiner.setType(convert(container.getTypeDefinition())); convertTypeContainerList(container.getChildren(), newConatiner.getChildren()); convertExtension(container, newConatiner); target.add(newConatiner); } }
@Override public List<CmisTypeContainer> getTypeDescendants(String repositoryId, String typeId, BigInteger depth, Boolean includePropertyDefinitions, CmisExtensionType extension) throws CmisException { CmisService service = null; try { service = getService(wsContext, repositoryId); if (stopBeforeService(service)) { return null; } List<TypeDefinitionContainer> serviceResult = service.getTypeDescendants(repositoryId, typeId, depth, includePropertyDefinitions, convert(extension)); if (stopAfterService(service)) { return null; } List<CmisTypeContainer> result = new ArrayList<CmisTypeContainer>(); convertTypeContainerList(serviceResult, result); return result; } catch (Exception e) { throw convertException(e); } finally { closeService(service); } }