= TabularExporter
:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR  CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

SPI to provide file export to table views.

== API

[source,java]
.TabularExporter.java
----
interface TabularExporter {
  void export(TabularModel.TabularSheet tabularSheet, File exportFile)     // <.>
  CommonMimeType getMimeType()
  String getTitleLabel()     // <.>
  String getCssClass()     // <.>
  int orderOfAppearanceInUiDropdown()     // <.>
  boolean appliesTo(Class<?> elementType)     // <.>
  Blob exportToBlob(TabularModel.TabularSheet tabularSheet)     // <.>
}
----

<.> xref:#export_TabularModel_TabularSheet_File[export(TabularModel_TabularSheet, File)]
+
--
Implementing exporters need to write given tabular data from _org.apache.causeway.commons.tabular.TabularModel.TabularSheet_ into the _File exportFile_ , which is provided by the framework for the duration of a single request cycle.
--
<.> xref:#getTitleLabel_[getTitleLabel()]
<.> xref:#getCssClass_[getCssClass()]
<.> xref:#orderOfAppearanceInUiDropdown_[orderOfAppearanceInUiDropdown()]
+
--
An ordinal, that governs the order of appearance in the UI dropdown.
--
<.> xref:#appliesTo_Class[appliesTo(Class)]
+
--
Whether this exporter applies to given _elementType_ . If `false` , this exporter is not provided to end users.
--
<.> xref:#exportToBlob_TabularModel_TabularSheet[exportToBlob(TabularModel_TabularSheet)]
+
--
Writes given tabular data to a xref:refguide:applib:index/value/Blob.adoc[Blob] , using given sheet's name as blob name.
--

== Members

[#export_TabularModel_TabularSheet_File]
=== export(TabularModel_TabularSheet, File)

Implementing exporters need to write given tabular data from _org.apache.causeway.commons.tabular.TabularModel.TabularSheet_ into the _File exportFile_ , which is provided by the framework for the duration of a single request cycle.

[#getTitleLabel_]
=== getTitleLabel()

[#getCssClass_]
=== getCssClass()

[#orderOfAppearanceInUiDropdown_]
=== orderOfAppearanceInUiDropdown()

An ordinal, that governs the order of appearance in the UI dropdown.

* _1000..1999_ reserved for different table presentations
* _2000..2999_ reserved for different table exports

Lowest comes first.

[#appliesTo_Class]
=== appliesTo(Class)

Whether this exporter applies to given _elementType_ . If `false` , this exporter is not provided to end users.

[#exportToBlob_TabularModel_TabularSheet]
=== exportToBlob(TabularModel_TabularSheet)

Writes given tabular data to a xref:refguide:applib:index/value/Blob.adoc[Blob] , using given sheet's name as blob name.
