blob: b0759fcc7d2de3d586a06fcee6bf1e20bd38148d [file] [log] [blame]
[comment encoding = UTF-8 /]
[module generateHTMLContent('http://www.eclipse.org/intent/intentdocument/0.8','http://www.eclipse.org/intent/descriptionunit/0.8', 'http://www.eclipse.org/intent/modelingunit/0.8', 'http://www.eclipse.org/emf/2002/Ecore','http://www.eclipse.org/intent/markup/0.7', 'http://www.eclipse.org/intent/markup/generator/0.7')]
[import org::eclipse::mylyn::docs::intent::markup::gen::files::html/]
[import org::eclipse::mylyn::docs::intent::markup::gen::files::htmlGenDocument/]
[import org::eclipse::mylyn::docs::intent::exporter::main::generateToc/]
[import org::eclipse::mylyn::docs::intent::exporter::queries::documentQueries/]
[template public generateHTMLContentRoot(intentElement : IntentSection)]
<div id="content" [if not(shouldShowTableOfContents())]style="padding:0px 0px 0px 50px"[/if]>
[comment Do not display Intent document in TOC /]
[if intentElement.oclIsKindOf(IntentDocument)]
[for (subSection : IntentSection | intentElement.intentContent->filter(IntentSection))]
[generateHTMLContent(subSection, subSection.getIndex())/]
[/for]
[else]
[generateHTMLContent(intentElement, '')/]
[/if]
</div>
[/template]
[template public generateHTMLContentRoot(intentElement : IntentStructuredElement)]
[/template]
[template public generateHTMLContent(subSectionContainer : IntentSection, index : String) ]
<section id="[index/]">
[if (subSectionContainer.eContainer().oclIsTypeOf(IntentDocument)) or (index = '')]
<div class="page-header">
<h1>
[subSectionContainer.generateSubSectionTitle(false)/]
</h1>
</div>
[else]
<h[getHeaderSize(index)/]>[subSectionContainer.generateSubSectionTitle(false)/]</h[getHeaderSize(index)/]>
[/if]
</section>
[for (child : EObject | subSectionContainer.intentContent)]
[if child.oclIsTypeOf(IntentSection)]
[child.oclAsType(IntentSection).generateHTMLContent(child.oclAsType(IntentSection).getIndex())/]
[else]
[if child.oclIsTypeOf(ModelingUnit)]
[child.oclAsType(ModelingUnit).generateHTMLContent(index + '_' + child.oclAsType(ModelingUnit).getIndex())/]
[else ]
[child.generateHTMLContent()/]
[/if]
[/if]
[/for]
[/template]
[template public generateHTMLContent(descriptionUnit :DescriptionUnit )]
<p>
[descriptionUnit.instructions.generateHTMLContent()/]
</p>
[/template]
[template public generateHTMLContent(descriptionBloc : DescriptionBloc)]
[descriptionBloc.descriptionBloc.oclAsType(Container).content.toHTML()/]
[/template]
[template public generateHTMLContent(reference : IntentReferenceInstruction)]
[if (reference.referencedElement.oclIsUndefined()._not())]
[generateReference(reference.textToPrint, reference.referencedElement)/]
[else]
<b>UNRESOLVED LINK : [reference.intentHref/]</b>
[/if]
[/template]
[template public generateReference(textToPrint : String, referenced : IntentSection)]
See <a href="#[getIndex(referenced.oclAsType(IntentSection))/]">
[if (textToPrint.oclIsUndefined()._not() and textToPrint.trim().size() > 0)]
[textToPrint/]
[else]
[generateSubSectionTitle(referenced.oclAsType(IntentSection), true)/]
[/if]</a>
[/template]
[template public generateReference(textToPrint : String, referenced : EObject)]
<b>UNSUPPORTED LINK : [referenced.eClass().name/]</b>
[/template]
[template public generateHTMLContent(label : LabelDeclaration)]
<b>[label.labelValue/]</b>
[/template]
[template public generateHTMLContent(modelingUnit :ModelingUnit, index : String )]
[if (not(shouldDisplayExternalRefInline()))]
<div class="mu" id="index">
<ul>
[/if]
[modelingUnit.instructions.generateHTMLContent()->sep(lineSeparator())/]
[if (not(shouldDisplayExternalRefInline()))]
</ul>
</div>
[/if]
[/template]
[template public generateHTMLContent(instancation : InstanciationInstruction)]
<li class="jstree-open">
[instancation.getImageForValue()/]
<a href="#" rel="popover" title=""
[instancation.generatePopoverLinks()/]>
[if instancation.name->isEmpty()._not()]
[instancation.name/] -
[/if]
new [instancation.metaType.typeName/] [definitionInformation()/]
</a>
[if instancation.structuralFeatures->size() > 0]
<ul>
[instancation.structuralFeatures.generateHTMLContent()->sep(lineSeparator())/]
</ul>
[/if]
</li>
[/template]
[template public generateHTMLContent(contribution : ContributionInstruction)]
<li class="jstree-open">
[contribution.getImageForValue()/]
<a href="#"
rel="popover" title="Contribution to [contribution.contributionReference.intentHref/] [if contribution.contributionReference.referencedInstruction.oclIsInvalid()._not()](of type [contribution.contributionReference.referencedInstruction.oclAsType(InstanciationInstruction).metaType.typeName/])[/if]"
[contribution.contributionReference.referencedInstruction.oclAsType(InstanciationInstruction).generatePopoverLinks()/]
">
[contribution.contributionReference.intentHref/] [contributionInformation()/]
</a>
[if contribution.contributions->size() > 0]
<ul>
[contribution.contributions.generateHTMLContent()->sep(lineSeparator())/]
</ul>
[/if]
</li>
[/template]
[template public generateHTMLContent(externalContent : ExternalContentReference)]
[if shouldDisplayExternalRefInline()]
[if (externalContent.externalContent->size() >0)]
see <a href="[externalContent.uri.toString()/]"> <img src="[getQualifiedImageId(externalContent.externalContent)/]"/> [getName(externalContent)/]</a><br/>
[/if]
[else]
<li class="jstree-open">
[if (externalContent.externalContent->size() >0)]
<img src="[getQualifiedImageId(externalContent.externalContent)/]"/>
[/if]
[if externalContent.uri->isEmpty()._not()]
(<i>Reference to</i> <code style="color:blue; border:0px solid black;">[externalContent.uri.toString()/])</code>
[/if]
</li>
[/if]
[/template]
[template public generateHTMLContent(resourceDeclaration : ResourceDeclaration)]
<li class="jstree-open">
<img src="../icons/modelingunit_resource.gif"/>
<a href="#"
rel="popover" title="Resource [resourceDeclaration.name/]"
data-content="Some infos"
>
Resource [resourceDeclaration.name/]
</a>
[if resourceDeclaration.uri->isEmpty()._not()]
(URI :<code style="color:blue; border:0px solid black;">[resourceDeclaration.uri.toString()/])</code>
[/if]
[if resourceDeclaration.content->size() > 0]
<ul>
[for (reference : ModelingUnitInstructionReference | resourceDeclaration.content)]
<a href="#"
rel="popover" title="Reference to [reference.intentHref/] [if reference.referencedInstruction.oclAsType(InstanciationInstruction).metaType.oclIsInvalid()._not()](of type [reference.referencedInstruction.oclAsType(InstanciationInstruction).metaType.typeName/])[/if]"
[reference.referencedInstruction.oclAsType(InstanciationInstruction).generatePopoverLinks()/]
>[reference.intentHref/]</a>
[/for]
</ul>
[/if]
</li>
[/template]
[template public generateHTMLContent(structuralFeature : StructuralFeatureAffectation)]
<li class="jstree-open">
[comment icon/]
[if structuralFeature.values->size() >0]
[structuralFeature.values->first().getImageForValue()/]
[/if]
[comment left-hand link/]
<a href="#" style="color:black"
rel="popover" title="Feature [structuralFeature.name/] [if structuralFeature.metaType.typeName.oclIsInvalid()._not()](of type [structuralFeature.metaType.typeName/])[/if]"
data-content="Informations on [structuralFeature.name/]"
>
[structuralFeature.name/]
</a>
[comment single-valued/]
[if structuralFeature.values->size() = 1]
[if (structuralFeature.values->first().oclIsKindOf(NativeValue))]:
[else]
&larr;
[/if]
[structuralFeature.values->first().generateHTMLContent()/]
[else]
[comment multi-valued/]
&larr; <ul>
[for (value : AbstractValue | structuralFeature.values)]
<li>[value.getImageForValue()/] [value.generateHTMLContent()/]</li>
[/for]
</ul>
[/if]
[/template]
[template public generateHTMLContent(newValueInstruction : NewObjectValue)]
<a href="#"
rel="popover" title=""
[newValueInstruction.value.generatePopoverLinks()/]
>
[if newValueInstruction.value.name->isEmpty()._not()]
[newValueInstruction.value.name/] -
[/if]
new [newValueInstruction.value.metaType.typeName/] [definitionInformation()/]
</a>
[if newValueInstruction.value.structuralFeatures->size() > 0]
<ul>
[for (structuralFeature : StructuralFeatureAffectation | newValueInstruction.value.structuralFeatures->select(feature | feature.values->select(value | value.oclIsKindOf(NativeValue))->size() = feature.values->size()))]
[generateHTMLContent(structuralFeature)/]
[/for]
[for (structuralFeature : StructuralFeatureAffectation | newValueInstruction.value.structuralFeatures->select(feature | feature.values->select(value | value.oclIsKindOf(NativeValue))->size() <> feature.values->size()))]
[generateHTMLContent(structuralFeature)/]
[/for]
</ul>
[/if]
[/template]
[template public generateHTMLContent(valueInstruction : NativeValue)]
[if valueInstruction.value.replace('true','').replace('false','').size() < 3]
<b><code style="color:#660000; border:0px solid black;">[valueInstruction.value.toString().replace('"','').replace('"','')/]</code></b>
[else]
<code style="color:blue; border:0px solid black;">[valueInstruction.value/]</code>
[/if]
[/template]
[template public generateHTMLContent(reference : ReferenceValue)]
<a href="#"
rel="popover" title="Reference to [reference.instanciationReference.instanceName/] [if reference.instanciationReference.instanciation.metaType.oclIsInvalid()._not()](of type [reference.instanciationReference.instanciation.metaType.typeName/])[/if]"
[reference.instanciationReference.instanciation.generatePopoverLinks()/]
>[reference.instanciationReference.instanceName/]</a>
[/template]
[template public getImageForValue(valueInstruction : NativeValue)]
<img src="../icons/modelingunit_value.gif"/>
[/template]
[template public getImageForValue(valueInstruction : AbstractValue)]
<img src="../icons/modelingunit_affect.png"/>
[/template]
[template public getImageForValue(valueInstruction : ReferenceValue)]
[if valueInstruction.referenceType.oclIsUndefined()]
<img src="../icons/modelingunit_ref.png"/>
[else]
[let imagePath : String = valueInstruction.referenceType.getQualifiedImageId()]
[if imagePath.size() > 2]
<img src="[imagePath/]"/>
[else]
<img src="../icons/modelingunit_ref.png"/>
[/if]
[/let]
[/if]
[/template]
[template public getImageForValue(valueInstruction : NewObjectValue)]
[let imagePath : String = valueInstruction.value.metaType.resolvedType.getQualifiedImageId()]
[if imagePath.size() > 0]
<img src="[imagePath/]"/>
[else]
<img src="../icons/modelingunit_ref.png"/>
[/if]
[/let]
[/template]
[template public getImageForValue(insanciationInstruction : InstanciationInstruction)]
[let imagePath : String = insanciationInstruction.metaType.resolvedType.getQualifiedImageId()]
[if imagePath.size() > 0]
<img src="[imagePath/]"/>
[else]
<img src="../icons/modelingunit_new_element.png"/>
[/if]
[/let]
[/template]
[template public getImageForValue(contributionInstruction : ContributionInstruction)]
[let imagePath : String = contributionInstruction.contributionReference.referencedInstruction.oclAsType(InstanciationInstruction).metaType.resolvedType.getQualifiedImageId()]
[if imagePath.size() > 0]
<img src="[imagePath/]"/>
[else]
<img src="../icons/modelingunit_contribution.png"/>
[/if]
[/let]
[/template]
[template public generateHTMLContent(defaultInstruction : UnitInstruction)]
<b>UNKNOWN : [defaultInstruction.eClass().name/]</b>
[/template]
[template public generateHTMLContent(instancation : EObject)]
[/template]
[template public generatePopoverLinks(instruction : InstanciationInstruction)]
data-content="<h4> Definition </h4>
[let containingSection : IntentSection = instruction.getContainingSection()]
<ul><li><a href='#[containingSection.getIndex()/]' >[containingSection.generateSubSectionTitle(true)/]</a></li></ul>
[/let]
[let contributions : OrderedSet(ContributionInstruction) = instruction.getAllContributions()]
[if contributions->size()>0]
<h4> Other contributions </h4>
<ul>
[/if]
[for (contribution : ContributionInstruction | contributions)]
[let containingSection : IntentSection = contribution.getContainingSection()]
<li><a href='#[containingSection.getIndex()/]' >[containingSection.generateSubSectionTitle(true)/]</a></li>
[/let]
[/for]
[if contributions->size()>0]
</ul>
[/if]
[/let]
"
[/template]
[template public contributionInformation()]
(Contribution)
[/template]
[template public definitionInformation()]
(Definition)
[/template]