org.archive.crawler.restlet.Beans.ftl Maven / Gradle / Ivy
The newest version!
Crawl beans in ${model.crawlJobShortName}
Crawl beans in built job ${model.crawlJobShortName}
Enter a bean path of the form beanName, beanName.property, beanName.property[indexOrKey], etc.
<#if model.beanPath?? && (model.beanPath?length >0)>
Bean path ${model.beanPath}
<#if model.problem??>
problem: ${model.problem}
<#elseif model.editable>
${model.beanPath} =
<@beanTemplate bean=model.bean /> edit
<#else>
<@beanTemplate bean=model.bean />
#if>
#if>
All named crawl beans
<#list model.allNamedCrawlBeans as bean>
<@beanListItem bean=bean />
#list>
<#macro beanListItem bean>
<#-- have to use .get("class") instead of .class due to freemarker conflict with method getClass()-->
${bean.name} ${bean.get("class")}
<#list bean.children as child>
<@beanListItem bean=child />
#list>
#macro>
<#macro beanTemplate bean>
<#if bean.field?? && (bean.field?length>0)>
<#if bean.field?contains("#") || !bean.url??>${bean.field}<#else>${bean.field}#if>:
#if>
<#if bean.propValuePreviouslyDescribed??>
↑
<#elseif !bean.propValue?? && !bean.properties?? && !bean.get("class")??>
<#if bean.key?? && bean.field??>
${bean.key}
<#else>
null
#if>
<#elseif bean.propValue?? && !bean.propValue?is_collection>
<#if bean.get("class")?? && bean.get("class")?contains("String")>
"${bean.propValue}"
<#elseif bean.propValue?is_number>
${bean.propValue?c}
<#else>
${bean.propValue?string}
#if>
#if>
<#if (!bean.propValue?? && !bean.properties?? && bean.get("class")??) || bean.properties?? || (bean.propValue?? && bean.propValue?is_collection)>
#if>
#macro>