Skip to content

Commit

Permalink
WINDUP-505 - Added render_link directive to link between resources. I…
Browse files Browse the repository at this point in the history
…nline hinting also goes directly to inline.

  Added functionality to interlink resources in a more repeatable process.
  • Loading branch information
bradsdavis authored and lincolnthree committed May 29, 2015
1 parent 15de1b2 commit 4a07fea
Show file tree
Hide file tree
Showing 7 changed files with 415 additions and 81 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ dl:last-child {
margin-bottom:0;
}

a.windup-file-location {
display: block; position: relative; top: -40px; visibility: hidden;
}


.windup-bar {
Expand Down
13 changes: 12 additions & 1 deletion reporting/impl/src/main/resources/reports/templates/source.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,17 @@


<script type='text/javascript'>
$(window).on("hashchange", function () {
window.scrollTo(window.scrollX, window.scrollY - 100);
});
function offsetAnchor() {
if(location.hash.length !== 0) {
window.scrollTo(window.scrollX, window.scrollY - 100);
}
}
window.setTimeout(function() {
offsetAnchor();
}, 1);
$(document).ready(function(){
$('pre').snippet('${reportModel.sourceType}',{style:'ide-eclipse', showNum:true,boxFill:'#ffeeb9', box: '${reportModel.sourceBlock}' });
Expand All @@ -126,7 +137,7 @@
<#assign lineNumber = hintLine.lineNumber>
<#compress>
$("<a name='${hintLine.asVertex().getId()?c}'></a><#t>
$("<a name='${hintLine.asVertex().getId()?c}' class='windup-file-location'></a><#t>
<div class='inline-source-comment green'><#t>
<#if hintLine.hint?has_content>
<div class='inline-comment'><#t>
Expand Down
48 changes: 6 additions & 42 deletions rules-java-ee/addon/src/main/resources/reports/templates/ejb.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -3,43 +3,11 @@

<#assign applicationReportIndexModel = reportModel.applicationReportIndexModel>

<#macro fileSourceLink fileRef name>
<#if fileRef?has_content>
<#assign sourceReportModel = fileModelToSourceReport(fileRef)>

<#if sourceReportModel.reportFilename??>
<a href="${sourceReportModel.reportFilename}"> ${name!""} </a>
<#else>
${name!""}
</#if>
<#else>
${name!""}
</#if>
</#macro>

<#macro renderLinksToClass fqcn>
<#assign sourceFiles = findSourceFilesByClassName(fqcn)>
<#if sourceFiles?has_content>
<#list sourceFiles as sourceFile>
<#assign sourceReportModel = fileModelToSourceReport(sourceFile)>
<a href="${sourceReportModel.reportFilename}">
<#if sourceFile_index == 0>
${fqcn}
<#else>
(${sourceFile_index + 1})
</#if>
</a>
</#list>
<#else>
${fqcn!""}
</#if>
</#macro>

<#macro mdbRenderer mdb>
<tr>
<td><@fileSourceLink mdb.ejbDeploymentDescriptor!"" mdb.beanName!""/></td>
<td><@render_link model=mdb.ejbDeploymentDescriptor text=mdb.beanName /></td>
<td>
<@renderLinksToClass mdb.ejbClass.qualifiedName/>
<@render_link model=mdb.ejbClass/>
</td>
<td><#if mdb.destination??>${mdb.destination.jndiLocation}</#if></td>
</tr>
Expand All @@ -49,12 +17,10 @@
<#macro ejbRenderer ejb>
<tr>
<td>
<@fileSourceLink ejb.ejbDeploymentDescriptor!"" ejb.beanName!""/>
<@render_link model=ejb.ejbDeploymentDescriptor text=ejb.beanName/>
</td>
<td>
<#if ejb.ejbClass??>
<@renderLinksToClass ejb.ejbClass.qualifiedName/>
</#if>
<@render_link model=ejb.ejbClass/>
</td>
<td>
<#if ejb.jndiReference??>${ejb.jndiReference.jndiLocation}</#if>
Expand All @@ -65,12 +31,10 @@
<#macro entityRenderer ejb>
<tr>
<td>
<@fileSourceLink ejb.ejbDeploymentDescriptor!"" ejb.beanName!""/>
<@render_link model=ejb.ejbDeploymentDescriptor text=ejb.beanName />
</td>
<td>
<#if ejb.ejbClass??>
<@renderLinksToClass ejb.ejbClass.qualifiedName/>
</#if>
<@render_link model=ejb.ejbClass/>
</td>
<td>${ejb.tableName!""}</td>
<td>${ejb.persistenceType!""}</td>
Expand Down
24 changes: 3 additions & 21 deletions rules-java-ee/addon/src/main/resources/reports/templates/jbpm.ftl
Original file line number Diff line number Diff line change
@@ -1,23 +1,6 @@

<!DOCTYPE html>

<#macro renderLinksToClass fqcn>
<#assign sourceFiles = findSourceFilesByClassName(fqcn)>
<#if sourceFiles?has_content>
<#list sourceFiles as sourceFile>
<#assign sourceReportModel = fileModelToSourceReport(sourceFile)>
<a href="${sourceReportModel.reportFilename}">
<#if sourceFile_index == 0>
${fqcn}
<#else>
(${sourceFile_index + 1})
</#if>
</a>
</#list>
<#else>
${fqcn!""}
</#if>
</#macro>

<#assign applicationReportIndexModel = reportModel.applicationReportIndexModel>

Expand Down Expand Up @@ -69,7 +52,6 @@
<#if iterableHasContent(reportModel.relatedResources.processes)>
<#list reportModel.relatedResources.processes.list.iterator() as process>

<#assign sourceReportModel = fileModelToSourceReport(process)!>
<div class="row">
<div class="container-fluid theme-showcase" role="main">
<div class="panel panel-primary">
Expand All @@ -81,7 +63,7 @@
<div class="panel-body">
<dl class="dl-horizontal small">
<dt>Process</dt>
<dd><a href="${sourceReportModel.reportFilename}">${getPrettyPathForFile(process)}</a></dd>
<dd><@render_link model=process /></dd>

<#if process.processName??>
<dt>Name</dt>
Expand Down Expand Up @@ -126,7 +108,7 @@
</tr>
<#list process.actionHandlers.iterator() as actionHandler>
<tr>
<td><@renderLinksToClass actionHandler.qualifiedName/></td>
<td><@render_link model=actionHandler/></td>
</tr>
</#list>
</table>
Expand All @@ -139,7 +121,7 @@
</tr>
<#list process.decisionHandlers.iterator() as decisionHandler>
<tr>
<td><@renderLinksToClass decisionHandler.qualifiedName/></td>
<td><@render_link model=decisionHandler/></td>
</tr>
</#list>
</table>
Expand Down
Loading

0 comments on commit 4a07fea

Please sign in to comment.