use of org.alfresco.rm.rest.api.model.RMSite in project records-management by Alfresco.
the class RMSiteEntityResourceUnitTest method updateRMSiteGuid.
@Test
public void updateRMSiteGuid() throws Exception {
String siteId = RM_SITE_ID;
Params parameters = mock(Params.class);
RMSite site = new RMSite();
site.setTitle("New Title");
site.setDescription("New Description");
site.setGuid("newGUID");
try {
rmSiteEntityResource.update(siteId, site, parameters);
fail("Expected ecxeption as rm site guid cannot be changed.");
} catch (InvalidArgumentException ex) {
assertEquals("Site update does not support field: guid", ex.getMsgId());
}
verify(mockedRMSites, never()).updateRMSite(any(String.class), any(SiteUpdate.class), any(Parameters.class));
}
use of org.alfresco.rm.rest.api.model.RMSite in project records-management by Alfresco.
the class RMSiteEntityResourceUnitTest method updateRMSiteRole.
@Test
public void updateRMSiteRole() throws Exception {
String siteId = RM_SITE_ID;
Params parameters = mock(Params.class);
RMSite site = new RMSite();
site.setTitle("New Title");
site.setDescription("New Description");
site.setRole("newRole");
try {
rmSiteEntityResource.update(siteId, site, parameters);
fail("Expected ecxeption as rm site role cannot be changed.");
} catch (InvalidArgumentException ex) {
assertEquals("Site update does not support field: role", ex.getMsgId());
}
verify(mockedRMSites, never()).updateRMSite(any(String.class), any(SiteUpdate.class), any(Parameters.class));
}
use of org.alfresco.rm.rest.api.model.RMSite in project records-management by Alfresco.
the class RMSitesImpl method getRMSite.
@Override
public RMSite getRMSite(String siteId) {
Site site = getSite(siteId);
SiteInfo siteInfo = siteService.getSite(siteId);
RMSiteCompliance compliance = getCompliance(siteInfo);
return new RMSite(site, compliance);
}
use of org.alfresco.rm.rest.api.model.RMSite in project records-management by Alfresco.
the class RMSitesImpl method createRMSite.
@Override
public RMSite createRMSite(RMSite rmSite, Parameters parameters) {
RMSiteCompliance compliance = rmSite.getCompliance();
if (compliance == null) {
compliance = RMSiteCompliance.STANDARD;
}
Site site = createSite(rmSite, parameters);
return new RMSite(site, compliance);
}
use of org.alfresco.rm.rest.api.model.RMSite in project records-management by Alfresco.
the class RMSitesImpl method updateRMSite.
/**
* Updates the RM site
*/
public RMSite updateRMSite(String siteId, SiteUpdate update, Parameters parameters) {
Site updatedSite = updateSite(siteId, update, parameters);
SiteInfo siteInfo = siteService.getSite(siteId);
RMSiteCompliance compliance = getCompliance(siteInfo);
return new RMSite(updatedSite, compliance);
}
Aggregations