use of org.alfresco.rest.api.model.Network in project alfresco-remote-api by Alfresco.
the class NetworksImpl method getNetwork.
public PersonNetwork getNetwork(String personId, String networkId) {
// check that personId is the current user
personId = people.validatePerson(personId, true);
Network network = validateNetwork(networkId);
org.alfresco.repo.tenant.Network tenantNetwork = networksService.getNetwork(network.getId());
PersonNetwork personNetwork = getPersonNetwork(tenantNetwork);
return personNetwork;
}
use of org.alfresco.rest.api.model.Network in project alfresco-remote-api by Alfresco.
the class NetworksImpl method validateNetwork.
public Network validateNetwork(String networkId) {
org.alfresco.repo.tenant.Network network = networksService.getNetwork(networkId);
if (network == null) {
throw new EntityNotFoundException(networkId);
}
Network restNetwork = new NetworkImpl(network);
return restNetwork;
}
use of org.alfresco.rest.api.model.Network in project alfresco-remote-api by Alfresco.
the class NetworksImpl method getNetworks.
public CollectionWithPagingInfo<PersonNetwork> getNetworks(String personId, Paging paging) {
// check that personId is the current user
personId = people.validatePerson(personId, true);
PagingResults<org.alfresco.repo.tenant.Network> networks = networksService.getNetworks(Util.getPagingRequest(paging));
List<PersonNetwork> ret = new ArrayList<PersonNetwork>(networks.getPage().size());
for (org.alfresco.repo.tenant.Network network : networks.getPage()) {
PersonNetwork personNetwork = getPersonNetwork(network);
ret.add(personNetwork);
}
return CollectionWithPagingInfo.asPaged(paging, ret, networks.hasMoreItems(), networks.getTotalResultCount().getFirst());
}
use of org.alfresco.rest.api.model.Network in project alfresco-remote-api by Alfresco.
the class NetworksImpl method getPersonNetwork.
private PersonNetwork getPersonNetwork(org.alfresco.repo.tenant.Network network) {
Network restNetwork = new NetworkImpl(network);
PersonNetwork personNetwork = new PersonNetwork(network.getIsHomeNetwork(), restNetwork);
return personNetwork;
}
Aggregations