Difference between revisions of "Artefact:Template/org/ooem/templates/wiml-1.0-ooem-alias-2.0"

From OOModels
Jump to navigationJump to search
Line 20: Line 20:
                         Map<String,String> conversion_arguments,
                         Map<String,String> conversion_arguments,
                         Map<String,String> request_arguments) ⊐…
                         Map<String,String> request_arguments) ⊐…
« boolean complete_xml = "true".equals(predefined_arguments.get("CompleteXMLDocument"));
  String xmlns = complete_xml ? " xmlns=\"http://xmlns.sphenon.com/org/ooem\"" : "";
  String indent = complete_xml ? "" : "  ";
»…
«if(complete_xml) {»…
  ⋮<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
«}»…
«¶(indent)»…
<Alias>
  <Name>◂conversion_arguments.get("page").replaceFirst("Artefact:Model/","").replace("/",".")▸</Name>
  ⋮« for (String key : page_properties.keySet()) { »…
  <AliasMapping Name="◂key▸" Type="◂page_properties.get(key)▸"/>
  ⋮« } »…


PP  ◂page_properties▸
◂conversion_arguments.get("page").replaceFirst(".*/","")▸
</OOMCode>
</OOMCode>

Revision as of 14:45, 26 November 2012

Classification
Type Type:org/oogenerator/Template/2.0
Domain Domain:it/development/formatting
Category Type:org/oomodels/wiki/Template
Maturity final
More
Download Code
Namespace (more)

OOEM main package

create new pages

Code[edit]


G-2.0-java_jppi-1.0 -*- coding: utf-8; -*-

import org.oomodels.wiml.*;
import java.util.Map;
import java.util.Vector;
▼
⊏ signature(String code, Map<String,String> page_properties,
                         Map<String,String> predefined_arguments,
                         Map<String,String> conversion_arguments,
                         Map<String,String> request_arguments) ⊐
« boolean complete_xml = "true".equals(predefined_arguments.get("CompleteXMLDocument"));
  String xmlns = complete_xml ? " xmlns=\"http://xmlns.sphenon.com/org/ooem\"" : "";
  String indent = complete_xml ? "" : "  ";
»
«if(complete_xml) {»
  ⋮<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
«}»
«¶(indent)»
<Alias>
  <Name>◂conversion_arguments.get("page").replaceFirst("Artefact:Model/","").replace("/",".")▸</Name>
  ⋮« for (String key : page_properties.keySet()) { »
  <AliasMapping Name="◂key▸" Type="◂page_properties.get(key)▸"/>
  ⋮« } »