<commit_before>package org.ossim.omar.raster

import org.ossim.omar.core.DateUtil

class RasterEntryExportController
{
  def exportService
  def rasterEntrySearchService
  def grailsApplication

  def index( )
  {
  }

  def export( )
  {
      def format = params.format
    def queryParams = new RasterEntryQuery()
    bindData( queryParams, params )

    queryParams.startDate = DateUtil.initializeDate( "startDate", params )
    queryParams.endDate = DateUtil.initializeDate( "endDate", params )

    def objects = rasterEntrySearchService.runQuery( queryParams, params )

//    def fields = ["id", "acquisitionDate", "groundGeom"] as String[]
//    def labels = ["id", "acquisition_date", "ground_geom"] as String[]<commit_msg>added exportGclProject closure<commit_after>package org.ossim.omar.raster

import org.ossim.omar.core.DateUtil

class RasterEntryExportController
{
  def exportService
  def rasterEntrySearchService
  def grailsApplication

  def index( )
  {
  }

  def exportGclProject( )
  {
      def fNames = params?.filenames?.split(",")
      def cNames = params?.classnames?.split(",")

      def (file, mimeType) = exportService.exportGcl(fNames, cNames)

      response.setHeader( "Content-disposition", "attachment; filename=${file.name}" );
      response.contentType = mimeType
      response.outputStream << file.newInputStream()
      response.outputStream.flush()
      file.delete();
  }

  def export( )
  {
      def format = params.format
    def queryParams = new RasterEntryQuery()
    bindData( queryParams, params )

    queryParams.startDate = DateUtil.initializeDate( "startDate", params )
    queryParams.endDate = DateUtil.initializeDate( "endDate", params )

    def objects = rasterEntrySearchService.runQuery( queryParams, params )

//    def fields = ["id", "acquisitionDate", "groundGeom"] as String[]
//    def labels = ["id", "acquisition_date", "ground_geom"] as String[]
{'fraction_non_alphanumeric': 0.11342351716961499, 'fraction_numerical': 0.0, 'mean_word_length': 3.9056122448979593, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '145746', 'n_tokens_mistral': 589, 'n_tokens_neox': 575, 'n_words': 130}