Árvore de páginas

Versões comparadas

Chave

  • Esta linha foi adicionada.
  • Esta linha foi removida.
  • A formatação mudou.

...


Bloco de código
themeRDark
titleexemploprograma.p
USING com.totvs.framework.sec.ProtectedData.

FIND FIRST tabela_negocio EXCLUSIVE-LOCK:
ASSIGN tabela_negocio.nom_cliente    = ProtectedData:DefaultAnonymousCharacter
       tabela_negocio.cod_rg         = ProtectedData:DefaultAnonymousNumber
       tabela_negocio.dat_nascimento = ProtectedData:DefaultAnonymousDate.

...

Exemplo de programa
Bloco de código
themeRDark
titleexemploprograma.p
collapsetrue
USING Progress.Json.ObjectModel.*.
USING com.totvs.framework.sec.ProtectedData.

DEFINE VARIABLE jObjRequest  AS JsonObject NO-UNDO.
DEFINE VARIABLE jArrRequest  AS JsonArray  NO-UNDO.
DEFINE VARIABLE jArrResponse AS JsonArray  NO-UNDO.

jArrRequest = NEW JsonArray().

jObjRequest = NEW JsonObject().
jObjRequest:ADD("databaseName","emsfnd").
jArrRequest:ADD(jObjRequest).

jObjRequest = NEW JsonObject().
jObjRequest:ADD("databaseName","emsfnd2").
jArrRequest:ADD(jObjRequest).

jArrResponse = ProtectedData:getAnonymizableFieldsByDatabase(jArrRequest).

jArrResponse:WriteFile("c:\temp\resultado.json", TRUE).

...

Exemplo de programa
Bloco de código
themeRDark
titleprograma_de_negocio.p
collapsetrue
USING Progress.Json.ObjectModel.*.
USING com.totvs.framework.sec.ProtectedData.

DEFINE VARIABLE jObjRequest  AS JsonObject NO-UNDO.
DEFINE VARIABLE jArrRequest  AS JsonArray  NO-UNDO.
DEFINE VARIABLE jArrResponse AS JsonArray  NO-UNDO.

jArrRequest = NEW JsonArray().

jObjRequest = NEW JsonObject().
jObjRequest:ADD("databaseName","emsfnd").
jObjRequest:ADD("tableName","usuar_mestre").
jArrRequest:ADD(jObjRequest).

jObjRequest = NEW JsonObject().
jObjRequest:ADD("databaseName","emsfnd").
jObjRequest:ADD("tableName","video").
jArrRequest:ADD(jObjRequest).

jObjRequest = NEW JsonObject().
jObjRequest:ADD("databaseName","emsfnd").
jObjRequest:ADD("tableName","imagens").
jArrRequest:ADD(jObjRequest).

jArrResponse = ProtectedData:getAnonymizableFieldsByTable(jArrRequest).

jArrResponse:WriteFile("c:\temp\resultado.json", TRUE).

...

Exemplo de programa
Bloco de código
themeRDark
titleprograma_de_negocio.p
collapsetrue
USING Progress.Json.ObjectModel.*.
USING com.totvs.framework.sec.ProtectedData.

DEFINE VARIABLE jArrRequest  AS JsonArray  NO-UNDO.
DEFINE VARIABLE jArrResponse AS JsonArray  NO-UNDO.

jArrRequest = NEW JsonArray().
jArrRequest:ADD("bas_prog_dtsul").
jArrRequest:ADD("bas_som").
jArrRequest:ADD("sec000aa").
jArrRequest:ADD("bas_procedimento").

jArrResponse = ProtectedData:getAnonymizableFieldsByRoutine(jArrRequest).

jArrResponse:WriteFile("c:\temp\resultado.json", TRUE).

...

Exemplo de programa
Bloco de código
themeRDark
titleprograma_de_negocio.p
collapsetrue
USING Progress.Json.ObjectModel.*.
USING com.totvs.framework.sec.ProtectedData.

DEFINE VARIABLE jObjRequest  AS JsonObject NO-UNDO.
DEFINE VARIABLE jObjResponse AS JsonObject NO-UNDO.

DO ON ERROR UNDO, LEAVE:
    jObjRequest = NEW JsonObject().
    jObjRequest:ADD("databaseName","emsfnd").
    jObjRequest:ADD("tableName","usuar_mestre").
    jObjRequest:ADD("fieldName","nom_usuario").
    jObjResponse = ProtectedData:isFieldAnonymizable(jObjRequest).
    
    MESSAGE STRING(jObjResponse:GetJsonText())
        VIEW-AS ALERT-BOX INFORMATION BUTTONS OK.

    CATCH customError AS fwk.utils.CustomError:
        MESSAGE STRING(customError:arryaOfErrors:getJsonText())
            VIEW-AS ALERT-BOX INFO BUTTONS OK.
    END CATCH.
END.

DO ON ERROR UNDO, LEAVE:
    jObjRequest = NEW JsonObject().
    jObjRequest:ADD("databaseName","emsfnd").
    jObjRequest:ADD("tableName","agenda_rpw3").
    jObjRequest:ADD("fieldName","cdn_trans_edi2").
    jObjResponse = ProtectedData:isFieldAnonymizable(jObjRequest).
    
    MESSAGE STRING(jObjResponse:GetJsonText())
        VIEW-AS ALERT-BOX INFORMATION BUTTONS OK.
    
    CATCH customError AS fwk.utils.CustomError:
        MESSAGE STRING(customError:arryaOfErrors:getJsonText())
            VIEW-AS ALERT-BOX INFO BUTTONS OK.
    END CATCH.
END.

...