Strumenti Utente

Strumenti Sito


documentazione_3di_riservata:docway4:script_utili_4

Differenze

Queste sono le differenze tra la revisione selezionata e la versione attuale della pagina.

Link a questa pagina di confronto

Entrambe le parti precedenti la revisioneRevisione precedente
documentazione_3di_riservata:docway4:script_utili_4 [2017/09/13 10:17] ncandeloradocumentazione_3di_riservata:docway4:script_utili_4 [Data sconosciuta] (versione attuale) – eliminata - modifica esterna (Data sconosciuta) 127.0.0.1
Linea 1: Linea 1:
-====== sanitizerSogin ====== 
-Lo script è stato realizzato su richiesta del cliente Sogin per aggiungere su tutte le persone interne il diritto di visualizzazione completa sui repertori ET, DSITO, DSGA e il diritto di visualizzazione dei documenti riservati per gli archivi xdocwaydoc e xdocwaydoc-nucleco (codici diritto DW-DOC-RIS-24 e DW-DOCU-RIS-24). 
  
-<file lua sanitizerSogin.lua> 
-local dbg = require 'xw.dbg' ({active=false, key='acl'}) 
-local xw = require('extraway') 
-xw.addPackage("$.xwTools") ; 
- 
---[[- 
---]] 
-function sanitizeACL() 
- -- deactivate triggers 
- xw.triggersOff() ; 
- 
- local outputXML = xw.prepareRecord("<report></report>") ; 
- local outputMainNode = outputXML:selectFirstNode("/report") ; 
- local recordIsModified = false ; 
- 
- local targetRecordSet = xw.executeQuery('([UD,/xw/@UdType/]="persona_interna")') ; 
- if ( targetRecordSet:isValid() and 0 < #targetRecordSet ) then 
- local targetRecord = targetRecordSet:getFirst() ; 
- while ( targetRecord:isValid() ) do 
- recordIsModified = false ; 
- targetRecord_LockResult = targetRecord:lock() ; 
- if ( targetRecord_LockResult == true ) then 
- 
- local targetRecordRootNode = targetRecord:selectFirstNode("/persona_interna", nil) ; 
- 
- local DWETVCompRep = targetRecord:selectFirstNode("/persona_interna/personal_rights/right[@cod='DW-ET-V-CompRep']", nil) ; 
- if ( DWETVCompRep:isValid() ) then 
- if ( DWETVCompRep:getValue() == 'FALSE' ) then 
- DWETVCompRep:setValue('TRUE') ; 
- recordIsModified = true ; 
- end 
- end 
- 
- local DWDSITOVCompRep = targetRecord:selectFirstNode("/persona_interna/personal_rights/right[@cod='DW-DSITO-V-CompRep']", nil) ; 
- if ( DWDSITOVCompRep:isValid() ) then 
- if ( DWDSITOVCompRep:getValue() == 'FALSE' ) then 
- DWDSITOVCompRep:setValue('TRUE') ; 
- recordIsModified = true ; 
- end 
- end 
- 
- local DWDSGAVCompRep = targetRecord:selectFirstNode("/persona_interna/personal_rights/right[@cod='DW-DSGA-V-CompRep']", nil) ; 
- if ( DWDSGAVCompRep:isValid() ) then 
- if ( DWDSGAVCompRep:getValue() == 'FALSE' ) then 
- DWDSGAVCompRep:setValue('TRUE') ; 
- recordIsModified = true ; 
- end 
- end 
- 
- local DWDOCRIS24 = targetRecord:selectFirstNode("/persona_interna/personal_rights/right[@cod='DW-DOC-RIS-24']", nil) ; 
- if ( DWDOCRIS24:isValid() ) then 
- if ( DWDOCRIS24:getValue() == 'FALSE' ) then 
- DWDOCRIS24:setValue('TRUE') ; 
- recordIsModified = true ; 
- end 
- end 
- 
- local DWDOCURIS24 = targetRecord:selectFirstNode("/persona_interna/personal_rights/right[@cod='DW-DOCU-RIS-24']", nil) ; 
- if ( DWDOCURIS24:isValid() ) then 
- if ( DWDOCURIS24:getValue() == 'FALSE' ) then 
- DWDOCURIS24:setValue('TRUE') ; 
- recordIsModified = true ; 
- end 
- end 
- 
- if ( recordIsModified ) then 
- local outcome = targetRecord:save() ; 
- if ( outcome <= 0 ) then 
- targetRecord:unlock() ; 
- xw.log.msg('save error') ; 
- end 
- else 
- targetRecord:unlock() ; 
- end 
- else 
- xw.log.msg('lock error') ; 
- end 
- targetRecord = targetRecordSet:getNext() ; 
- end 
- 
- end 
- 
- -- activate triggers 
- xw.triggersOn() ; 
- 
- return 'true' ; 
-end 
- 
-sanitizer = { 
- sanitizeACL = sanitizeACL, 
- sanitizeACL_signature = { 
- outParms = {"result"} 
- } 
-} ; 
-</file> 
- 
-<wrap em>Per il suo utilizzo lo script va copiato nella directory /opt/3di.it/extraway/xwee/script</wrap> e va eseguito tramite il seguente xmlcommand: 
- 
-<code xml> 
-<?xml version="1.0" encoding="ISO-8859-1"?> 
-<cmd stored="$.sanitizerSogin.sanitizeACL"/> 
-</code> 
/data/attic/documentazione_3di_riservata/docway4/script_utili_4.1505290664.txt.gz · Ultima modifica: 2017/09/13 10:17 da ncandelora