ilscipio/scipio-erp

View on GitHub
framework/webtools/widget/DocScreens.xml

Summary

Maintainability
Test Coverage
<!--
This file is subject to the terms and conditions defined in the
files 'LICENSE' and 'NOTICE', which are part of this source
code package.
-->

<screens xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-screen.xsd">

    <!-- SCIPIO: Documentation screens -->

    <!-- Developer Documentation screens -->
    
    <screen name="DeveloperDocIndex">
        <section>
            <actions>
                <set field="titleProperty" value="WebtoolsDeveloperDocumentation"/>
                <set field="activeSubMenu" from-field="activeSubMenu" default-value="DeveloperDoc"/>
                <set field="activeSubMenuItem" from-field="activeSubMenuItem" default-value="DeveloperDocIndex"/>
                
                <set field="tmplApiBaseWebappUri" value="/docs/templating/ftl/lib"/>
                <set field="tmplApiMasterWebappUri" value="${tmplApiBaseWebappUri}/standard/htmlTemplate"/>
            </actions>
            <widgets>
                <decorator-screen name="CommonDocumentationDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <platform-specific>
                            <html><html-template><![CDATA[
                                <#assign scpErpRelDesc = getPropertyValue('scipiometainfo', 'scipio.release.desc')!"Scipio ERP">
                                <p><em><#-- Version: --><a href="https://www.scipioerp.com/community/developer/" target="_blank">${scpErpRelDesc}
                                    ${getPropertyValue('scipiometainfo', 'scipio.release.version')!"v?"} 
                                    (${getPropertyValue('scipiometainfo', 'scipio.release.branch')!("branch ?")})</a>, 
                                    <a href="https://freemarker.apache.org/docs/" target="_blank">Freemarker ${.version!}</a></em></p>
                                    
                                <#-- TODO: Localize? -->
                                <p>This is the local instance hosted version of ${scpErpRelDesc} developer documentation and resources.
                                  It focuses on providing developer information most closely matching your current version in use,
                                  and when possible on the portions of documentation most benefitting from interaction and dynamic
                                  rendering, or yet those requiring manual examination of source files.</p>
                                  
                                <p>NOTE: For a more comprehensive introduction and documentation, including architectural overview, please visit the 
                                  <a href="http://www.scipioerp.com/community/developer/" target="_blank">Scipio ERP website 
                                    at http://www.scipioerp.com/community/developer/</a></p>
                                
                              <@section title=getLabel('ContentContents', 'ContentUiLabels')>
                                <ol>
                                  <li>
                                    <@heading><a href="<@appUrl uri=tmplApiMasterWebappUri escapeAs='html'/>">
                                      ${getLabel('WebtoolsTemplateApiDocsTitle')}</a></@heading> - current, automatically generated from your local instance source files.
                                    <br/><small>Alternatively, the Scipio website provides a periodically updated version at 
                                        <a href="http://www.scipioerp.com/community/developer/freemarker-macros/" target="_blank">http://www.scipioerp.com/community/developer/freemarker-macros/</a>.</small>  
                                    <br/><small>The Toolkit Freemarker source files - fully documented - can be consulted directly under the 
                                        <code>/framework/common/webcommon/includes/scipio/lib/</code> folder from the root of your local copy.</small>
                                  </li>
                                  
                                  <li>
                                    <#-- TODO: web-presentable version of the *.xsd files... (XSLT for *.xsd -> *.html maybe?) -->
                                    <@heading>Screen and Menu Widget Reference</@heading> - is provided as annotations in <code>*.xsd</code> XML Schema definition files 
                                    under <code>/framework/widget/dtd/</code>, primarily: <code>widget-screen.xsd</code>, <code>widget-common.xsd</code> and
                                    <code>widget-menu.xsd</code>. These are greatly enhanced and re-documented for Scipio.
                                    <br/><small>To use these and other widget XML schema definition files (*.xsd) in your development environment for autocompletion and validation,
                                        import the file named ".xmlcatalog.xml" from the Scipio project root as XML Catalog file/project type using import dialog.
                                        Note this also includes the definition files for all other Scipio/ofbiz XML resources such as entity models, service definitions, etc.</small>
                                  </li>
                                </ol>
                              </@section>
                            ]]></html-template></html>
                        </platform-specific>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>
    

    <!-- Templating API page rendering screen (builds multiple pages) -->
    <screen name="TemplateApiDocPage">
        <section>
            <actions>
                <!-- switchable docPurpose in session -->
                <set field="curDocPurpose" from-field="parameters.docPurpose" default-value="${groovy: request.getSession().getAttribute('docPurposeSaved')}"/><!--  -->
                <set field="dummy" value="${groovy: if (context.curDocPurpose) request.getSession().setAttribute('docPurposeSaved', curDocPurpose); return '';}"/>
            
                <!-- Parse *.ftl API files under component://common/webcommon/includes/scipio/lib/ into a data model -->
                <set field="fdtwArgs" type="NewMap"/>
                <set field="fdtwArgs.doCompile" type="Boolean" value="true"/>
                <set field="fdtwArgs.docPurpose" from-field="curDocPurpose" />
                <set field="fdtwArgs.targetLibPath" value="${groovy: request.getAttribute('scipioTmplApiTargetLibPath')}"/><!-- set by templateApiDocPage.jsp -->
                <set field="fdtwArgs.targetLibName" value=""/>
                <set field="fdtwArgs.reloadDataModel" type="Boolean" from-field="parameters.reloadDataModel" />
                <script location="component://common/webcommon/includes/scipio/doc/WEB-INF/actions/ftlDocTemplateAdmin.groovy"/>
                
                <set field="title" value="${docLibTitleMap[targetLibName]}"/>
                <set field="subtitle" value="${docContext.pageTitle}"/>
                
                <set field="activeSubMenu" from-field="activeSubMenu" default-value="TemplateApiDoc"/>
                <set field="activeSubMenuItem" from-field="activeSubMenuItem" default-value="${targetLibShortName}"/>
                
                <set field="basePageIntraWebappUri" value="/docs/templating/ftl/lib"/>
                <set field="basePageInterWebappUri" value="${groovy: request.getContextPath() + basePageIntraWebappUri}"/>
                <set field="currPageIntraWebappUri" value="${basePageIntraWebappUri}/${targetLibPath}"/>
                
                <!-- TODO? the logic and decorators for this toggle work, but themes don't seem to respect context.widePage anymore
                <script location="component://webtools/webapp/webtools/WEB-INF/actions/doc/SetDocWidePage.groovy"/>-->
                
                <!-- allow public access -->
                <set field="commonWebtoolsAppBasePermCond" type="Boolean" value="true"/>
            </actions>
            <widgets>
                <decorator-screen name="CommonDocumentationDecorator" location="${parameters.mainDecoratorLocation}">
                    <decorator-section name="body">
                        <!--<container>
                            <include-menu name="TemplateApiDocSubTabBar" location="component://webtools/widget/Menus.xml"/>
                        </container>-->
                        <section>
                            <actions>
                                <!-- dumps the docContext we made into main context but with special freemarker object wrapping (do this as late as possible) -->
                                <set field="fdtwArgs" type="NewMap"/>
                                <set field="fdtwArgs.doPrepFtlCtx" type="Boolean" value="true"/>
                                <script location="component://common/webcommon/includes/scipio/doc/WEB-INF/actions/ftlDocTemplateAdmin.groovy"/>
                            </actions>
                            <widgets>
                                <platform-specific><html><html-template location="component://common/webcommon/includes/scipio/doc/ftlDocTemplateAdmin.ftl"/></html></platform-specific>
                            </widgets>
                        </section>
                    </decorator-section>
                </decorator-screen>
            </widgets>
        </section>
    </screen>

</screens>