Difference between revisions of "Artefact:Template/org/ooem/templates/bundleentries-1.0-ooem-2.0"
From OOModels
< Artefact:Template | org | ooem | templates
Jump to navigationJump to search
AndreasLeue (talk | contribs) (→Code) |
AndreasLeue (talk | contribs) |
||
(14 intermediate revisions by the same user not shown) | |||
Line 16: | Line 16: | ||
import java.util.Map; | import java.util.Map; | ||
▼… | ▼… | ||
⊏ signature(String xml_code, Map<String,String> predefined_arguments, | ⊏ signature(String xml_code, Map<String,String> page_properties, | ||
Map<String,String> predefined_arguments, | |||
Map<String,String> conversion_arguments, | Map<String,String> conversion_arguments, | ||
Map<String,String> request_arguments) ⊐… | Map<String,String> request_arguments) ⊐… | ||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | <?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
<Package xmlns="http://xmlns.sphenon.com/org/ooem"> | <Package xmlns="http://xmlns.sphenon.com/org/ooem" OID="root"> | ||
<Name> | <Name>root</Name> | ||
<Project OPTIONALPARAMETER="project" NULL="true"/> | |||
« | « | ||
try { | try { | ||
Line 29: | Line 30: | ||
⋮«∀(entries){»… | ⋮«∀(entries){»… | ||
⋮« | ⋮« | ||
String pagename = ((String[])(⊙))[0]; | |||
OOMResource oomr = oomp.getResource("raw--wiml-1.0-ooem-class-2.0-fragment"); | OOMPage oomp = new OOMPage(pagename, null); | ||
String data; | |||
if (pagename.matches("Artefact:Model/.*")) { | |||
OOMResource oomr = oomp.getResource("raw--wiml-1.0-ooem-class-2.0-fragment"); | |||
data = oomr.getData(); | |||
} else if (pagename.matches("Artefact:Aggregate/.*")) { | |||
OOMResource oomr = oomp.getResource("raw--wiml-1.0-ooem-aggregate-2.0-fragment"); | |||
data = oomr.getData(); | |||
} else { | |||
data = "<!-- " + pagename + " -->"; | |||
} | |||
»… | »… | ||
◂data▸ | ◂data▸ |
Latest revision as of 11:08, 20 March 2013
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_jpp-1.0 -*- coding: utf-8; -*- ▼… import org.oomodels.*; import java.util.Vector; import java.util.Map; ▼… ⊏ signature(String xml_code, Map<String,String> page_properties, Map<String,String> predefined_arguments, Map<String,String> conversion_arguments, Map<String,String> request_arguments) ⊐… <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <Package xmlns="http://xmlns.sphenon.com/org/ooem" OID="root"> <Name>root</Name> <Project OPTIONALPARAMETER="project" NULL="true"/> « try { Vector<String[]> entries = XMLBundleEntriesReader.getEntries(xml_code.toString()); »… ⋮«∀(entries){»… ⋮« String pagename = ((String[])(⊙))[0]; OOMPage oomp = new OOMPage(pagename, null); String data; if (pagename.matches("Artefact:Model/.*")) { OOMResource oomr = oomp.getResource("raw--wiml-1.0-ooem-class-2.0-fragment"); data = oomr.getData(); } else if (pagename.matches("Artefact:Aggregate/.*")) { OOMResource oomr = oomp.getResource("raw--wiml-1.0-ooem-aggregate-2.0-fragment"); data = oomr.getData(); } else { data = "<!-- " + pagename + " -->"; } »… ◂data▸ ⋮«}/∀»… </Package> « } catch (Throwable t) { org.oomodels.OOMStatusCode osc = new org.oomodels.OOMStatusCode(204); //osc.setCause(t); throw osc; } »…