Skip to content

Commit

Permalink
Modificate property documentale Contratti
Browse files Browse the repository at this point in the history
  • Loading branch information
rosangela.pucciarelli committed Mar 1, 2017
1 parent 1fcae56 commit dccc524
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 10 deletions.
Expand Up @@ -513,11 +513,17 @@ public ItemIterable<CmisObject> getChildren(Folder folder){
public void addConsumerToEveryone(CmisObject cmisObject) throws ApplicationException{
addAcl(getSiglaBindingSession(), cmisObject.getProperty(ALFCMIS_NODEREF).getValueAsString(), Collections.singletonMap("GROUP_EVERYONE", ACLType.Consumer));
}

public void removeConsumerToEveryone(CmisObject cmisObject) throws ApplicationException{
removeAcl(getSiglaBindingSession(), cmisObject.getProperty(ALFCMIS_NODEREF).getValueAsString(), Collections.singletonMap("GROUP_EVERYONE", ACLType.Consumer));
}

// per gestire gruppi diversi es. CONTRATTI
public void addConsumer(CmisObject cmisObject,String group ) throws ApplicationException{
addAcl(getSiglaBindingSession(), cmisObject.getProperty(ALFCMIS_NODEREF).getValueAsString(), Collections.singletonMap(group, ACLType.Consumer));
}
public void removeConsumer(CmisObject cmisObject,String group ) throws ApplicationException{
removeAcl(getSiglaBindingSession(), cmisObject.getProperty(ALFCMIS_NODEREF).getValueAsString(), Collections.singletonMap(group, ACLType.Consumer));
}
public void copyNode(Document source, Folder target){
source.addToFolder(target, true);
}
Expand Down
Expand Up @@ -364,9 +364,10 @@ public void pubblicaContratto(ActionContext context) throws it.cnr.jada.action.B
ContrattoComponentSession comp = (ContrattoComponentSession)createComponentSession();
comp.modificaConBulk(context.getUserContext(), contratto);
if (folder != null){
contrattoService.updateProperties(contratto, folder);
contrattoService.updateProperties(contratto, folder);
contrattoService.addAspect(folder, "P:sigla_contratti_aspect:stato_definitivo");
contrattoService.addConsumerToEveryone(folder);
contrattoService.addConsumer(folder,"GROUP_CONTRATTI");
contrattoService.setInheritedPermission(contrattoService.getCMISPathFolderContratto(contratto), Boolean.FALSE);
}
edit(context,contratto);
}catch(it.cnr.jada.comp.ComponentException ex){
Expand Down
Expand Up @@ -94,8 +94,7 @@ public void unpublishContratto(ActionContext context) throws it.cnr.jada.action.
ContrattoComponentSession comp = (ContrattoComponentSession)createComponentSession();
comp.modificaConBulk(context.getUserContext(), contratto);
if (node != null){
contrattoService.removeAspect(node, "P:sigla_contratti_aspect:stato_definitivo");
contrattoService.removeConsumerToEveryone(node);
contrattoService.removeConsumer(node,"GROUP_CONTRATTI");
}
edit(context,contratto);
}catch(it.cnr.jada.comp.ComponentException ex){
Expand Down
Expand Up @@ -1186,11 +1186,10 @@ public ContrattoBulk salvaDefinitivo(UserContext userContext, ContrattoBulk cont
Folder node = contrattoService.getFolderContratto(contrattoDefinitivo);
if (node != null){
contrattoService.addAspect(node, "P:sigla_contratti_aspect:stato_definitivo");
if (contrattoDefinitivo.isPassivo() || contrattoDefinitivo.isAttivo_e_Passivo())
if(pubblica)
contrattoService.addConsumerToEveryone(node);
else
if (contrattoDefinitivo.isPassivo() || contrattoDefinitivo.isAttivo_e_Passivo()){
contrattoService.addConsumer(node,"GROUP_CONTRATTI");
contrattoService.setInheritedPermission(contrattoService.getCMISPathFolderContratto(contrattoDefinitivo), Boolean.FALSE);
}
}
}
return contrattoDefinitivo;
Expand Down

0 comments on commit dccc524

Please sign in to comment.