Skip to content
This repository has been archived by the owner on Sep 23, 2018. It is now read-only.

簡単リーダー:レポートの見た目が以前のものとは異なる #6

Open
chikoski opened this issue Aug 28, 2012 · 12 comments
Labels

Comments

@chikoski
Copy link
Owner

使用しているテンプレートが違うので、以前のものを取得して差し替えること。

@chikoski
Copy link
Owner Author

差し替えたところ、足りない変数があるためうまく動かない。
一つ一つつぶしていく必要がある。

@chikoski
Copy link
Owner Author

index.ftl が使う変数:

  • title:集計のタイトル
  • xlsFileName:集計されたExcelファイルの名前
  • csvFileName:集計されたCSVファイルの名前

@chikoski
Copy link
Owner Author

kantanreader/src/main/java/net/sqs2/omr/result/export/HTMLReportExportModule.java でindex.ftlは利用されている

@chikoski
Copy link
Owner Author

タイトルを埋め込む機能をspikeブランチに実装した。

@chikoski
Copy link
Owner Author

index.ftl は終了。

@chikoski
Copy link
Owner Author

textAreaIndex.ftl に取りかかる。
kantan_reader/src/main/java/net/sqs2/omr/result/export/TextAreaExporter.java で利用されている。

必要とされる変数は次の通り

  • title:タイトル
  • textareas:自由記述欄の集合

@chikoski
Copy link
Owner Author

textAreaIndex.ftl 終了。
次はchartIndex.ftl

@chikoski
Copy link
Owner Author

chartIndex.ftl
kantan_reader/src/main/java/net/sqs2/omr/result/export/ChartExportModule.java で利用されている。

必要とされている変数

  • title:タイトル
  • exportChartImageMode: boolean これによって出力されるチャートが切り替わる模様
  • path:?
  • master:FormMaster
  • numRows:?
  • charts:チャートの集合

@chikoski
Copy link
Owner Author

freemarker.core.InvalidReferenceException: Expression chart.getDefaultFormArea().getLabelArray is undefined on line 100, column 24 in chartIndex.ftl.
at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:124)
at freemarker.core.TemplateObject.invalidTypeException(TemplateObject.java:134)
at freemarker.core.MethodCall._getAsTemplateModel(MethodCall.java:114)
at freemarker.core.Expression.getAsTemplateModel(Expression.java:89)
at freemarker.core.DynamicKeyName._getAsTemplateModel(DynamicKeyName.java:74)
at freemarker.core.Expression.getAsTemplateModel(Expression.java:89)
at freemarker.core.Assignment.accept(Assignment.java:90)
at freemarker.core.Environment.visit(Environment.java:209)
at freemarker.core.MixedContent.accept(MixedContent.java:92)
at freemarker.core.Environment.visit(Environment.java:209)
at freemarker.core.IteratorBlock$Context.runLoop(IteratorBlock.java:179)
at freemarker.core.Environment.visit(Environment.java:416)
at freemarker.core.IteratorBlock.accept(IteratorBlock.java:102)
at freemarker.core.Environment.visit(Environment.java:209)
at freemarker.core.MixedContent.accept(MixedContent.java:92)
at freemarker.core.Environment.visit(Environment.java:209)
at freemarker.core.Environment.process(Environment.java:189)
at freemarker.template.Template.process(Template.java:237)
at net.sqs2.omr.result.export.ChartExportModule.writeChartIndexHTMLFile(ChartExportModule.java:151)
at net.sqs2.omr.result.export.HTMLReportExportModule.exportReportCore(HTMLReportExportModule.java:264)
at net.sqs2.omr.result.export.HTMLReportExportModule.exportReport(HTMLReportExportModule.java:232)
at net.sqs2.omr.result.export.HTMLReportExportModule.endSpreadSheet(HTMLReportExportModule.java:134)
at net.sqs2.omr.result.event.SpreadSheetExportEventProducer.endSpreadSheet(SpreadSheetExportEventProducer.java:271)
at net.sqs2.omr.result.event.SpreadSheetExportEventProducer.processSourceDirectory(SpreadSheetExportEventProducer.java:57)
at net.sqs2.omr.result.event.ExportEventProducer.processMaster(ExportEventProducer.java:77)
at net.sqs2.omr.result.event.ExportEventProducer.processSession(ExportEventProducer.java:60)
at net.sqs2.omr.result.event.ExportEventProducer.produceSessionEvents(ExportEventProducer.java:40)
at net.sqs2.omr.session.MarkReaderSession.exportSession(MarkReaderSession.java:243)
at net.sqs2.omr.task.consumer.AbstractTaskConsumer.run(AbstractTaskConsumer.java:27)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:206)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:680)

Expression chart.getDefaultFormArea().getLabelArray is undefined on line 100, column 24 in chartIndex.ftl.
The problematic instruction:


==> assignment: labelLevel0=chart.getDefaultFormArea().getLabelArray()[0] [on line 100, column 1 in chartIndex.ftl]


Java backtrace for programmers:


freemarker.core.InvalidReferenceException: Expression chart.getDefaultFormArea().getLabelArray is undefined on line 100, column 24 in chartIndex.ftl.
at freemarker.core.TemplateObject.assertNonNull(TemplateObject.java:124)
at freemarker.core.TemplateObject.invalidTypeException(TemplateObject.java:134)
at freemarker.core.MethodCall._getAsTemplateModel(MethodCall.java:114)
at freemarker.core.Expression.getAsTemplateModel(Expression.java:89)
at freemarker.core.DynamicKeyName._getAsTemplateModel(DynamicKeyName.java:74)
at freemarker.core.Expression.getAsTemplateModel(Expression.java:89)
at freemarker.core.Assignment.accept(Assignment.java:90)
at freemarker.core.Environment.visit(Environment.java:209)
at freemarker.core.MixedContent.accept(MixedContent.java:92)
at freemarker.core.Environment.visit(Environment.java:209)
at freemarker.core.IteratorBlock$Context.runLoop(IteratorBlock.java:179)
at freemarker.core.Environment.visit(Environment.java:416)
at freemarker.core.IteratorBlock.accept(IteratorBlock.java:102)
at freemarker.core.Environment.visit(Environment.java:209)
at freemarker.core.MixedContent.accept(MixedContent.java:92)
at freemarker.core.Environment.visit(Environment.java:209)
at freemarker.core.Environment.process(Environment.java:189)
at freemarker.template.Template.process(Template.java:237)
at net.sqs2.omr.result.export.ChartExportModule.writeChartIndexHTMLFile(ChartExportModule.java:151)
at net.sqs2.omr.result.export.HTMLReportExportModule.exportReportCore(HTMLReportExportModule.java:264)
at net.sqs2.omr.result.export.HTMLReportExportModule.exportReport(HTMLReportExportModule.java:232)
at net.sqs2.omr.result.export.HTMLReportExportModule.endSpreadSheet(HTMLReportExportModule.java:134)
at net.sqs2.omr.result.event.SpreadSheetExportEventProducer.endSpreadSheet(SpreadSheetExportEventProducer.java:271)
at net.sqs2.omr.result.event.SpreadSheetExportEventProducer.processSourceDirectory(SpreadSheetExportEventProducer.java:57)
at net.sqs2.omr.result.event.ExportEventProducer.processMaster(ExportEventProducer.java:77)
at net.sqs2.omr.result.event.ExportEventProducer.processSession(ExportEventProducer.java:60)
at net.sqs2.omr.result.event.ExportEventProducer.produceSessionEvents(ExportEventProducer.java:40)
at net.sqs2.omr.session.MarkReaderSession.exportSession(MarkReaderSession.java:243)
at net.sqs2.omr.task.consumer.AbstractTaskConsumer.run(AbstractTaskConsumer.java:27)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:98)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:206)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:680)

@chikoski
Copy link
Owner Author

getLabelArray() でかえってくる配列の中身は

  • getLabel() の結果から、/以降を抜いたもの
  • getItemIndex() + 1
  • getHints()[1]

であることがわかったので、それらでテンプレートを置き換え。

@chikoski
Copy link
Owner Author

とおもったが、うまくなかったので、あわせて終了

@chikoski
Copy link
Owner Author

各ページに調査票のタイトルを埋め込む作業以外は終了

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant