Outils pour utilisateurs

Outils du site


exalead:consobox

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentesRévision précédente
Prochaine révision
Révision précédente
exalead:consobox [2021/02/11 20:39] – ↷ Page déplacée de windows:softs:exalead:consobox à exalead:consobox nicoantoexalead:consobox [2022/02/02 14:30] (Version actuelle) – nicoanto
Ligne 33: Ligne 33:
 {{::exalead_consobox_forceaggregation.png?600|}} {{::exalead_consobox_forceaggregation.png?600|}}
  
 +===== Groovy Examples =====
 +
 +==== Creation of Child Document ====
 +
 +<code>
 +process("hpc_co") {
 +    log.info("Processing " + it.getUri());
 +    String hpc_co_dc_type = it.metas.getValue("dc_type");
 +    log.info "******* hpc_co_dc_type: "+hpc_co_dc_type;
 +    String[] SDC_TYPE = it.directives.getValues("SDC:TYPE");
 +    log.info "SDC_TYPE:"+SDC_TYPE.length;
 +    String datamodel_class = it.directives.getValue("datamodel_class");
 +    log.info "datamodel_class:"+datamodel_class;
 +    child = createChildDocument(
 +        it, // root
 +        it.getUri()+'_cosnapshot_Test', // child URI
 +        "hpc_co" // type
 +    );
 +    child.directives.datamodel_class = it.directives.getValue("datamodel_class");
 +    child.withDirectives("SDC:TYPE", it.directives.getValues("SDC:TYPE"));
 +    child.metas.hierarchical_types = "hpc_co";
 +    child.metas.hierarchical_types+="co";
 +    child.metas.hierarchical_types+="change";
 +    child.metas.hierarchical_types+="document";
 +    child.metas.id = it.metas.getValue("id");
 +    child.metas.url = "eno:bo:" + it.metas.getValue("id") + "_cosnapshot_Test";
 +    child.metas.history_type = "cosnapshot";
 +    child.metas.parenttype = "Change";
 +    child.metas.type = "Change Order";
 +    child.metas.current = "In Work";
 +    child.metas.changes = "current";
 +    yield child;
 +    log.info "childcreated:"+child;
 +}
 +</code>
 +
 +===== Changement du type à la transformation =====
 +Pour faire cela, il faut :
 +  * Ajouter un processeur 'ConditionalTypeSetterTransformationProcessor' avant le processeur 'HierarchicalTypesSetter'
 +  * Et ajouter un processeur 'CreateMetasOrDirectivesTransformationProcessor' pour faire un override de la directive 'datamodel_class' 
exalead/consobox.1613075942.txt.gz · Dernière modification : (modification externe)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki