freemarker-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Dekany <ddek...@freemail.hu>
Subject Re: Sample screens for the format box
Date Thu, 10 Mar 2016 18:02:15 GMT
Tuesday, March 8, 2016, 10:32:31 PM, Pradeep Murugesan wrote:

> Hi Daniel,
>
> Sorry for the delay.
>
> Attached is the WIP for the current task.

Looks fine, however, it would be better if we can fit "output format"
there. "o/p" is not obvious for everyone.

> I have the following questions.
>
> 1.  I now receive the customization params like o/p format ,
> timezone to server. Now how can I process the same to the FM
> Template Java API ?  I could see there are some setters for all the 3,
>  template.setTimeZone(),
>  template.setOutputEncoding(),

You will need the outputFormat, not the outputEncoding.

>  template.setLocale().
>
>  Shall I use the same.

It will be quite much trickier as the outputFormat influences the
parsing, so it can't be changed after the Template object was
constructed, yet we have ad-hoc per-template settings here. So you
have to follow an unusual procedure here. Create a
TemplateConfiguration object, associate it with the singleton
Configuration object with setParentConfiguration, then set the desired
parameters (including the output format). Then pass the
TemplateConfiguration object to the Template constructor. Finally,
call TemplateConfiguration.apply(Template) to finish the setup of the
Template.

> 2. The new jar, FreeMarker 2.3.24-rc01-incubating is not in the
> maven central I believe,

Right, only stable releases go there.

> For now I am using it as a local jar in lib
> folder under the project then added the following in the dependecies.
>          compile files('lib/freemarker-2.3.24-rc01-incubating.jar')
>
>    I tried to add the apache staging repo but not able to do it. Is this local jar fine
?

Add a profile like this to the ~/.m2/settings.xml and it should work:

    <profile>
      <id>apache-staging-repo</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <repositories>
        <repository>
          <id>apache-staging-repository</id>
          <url>https://repository.apache.org/content/repositories/staging/</url>
        </repository>
      </repositories>
    </profile>

> 3. What should the timezone and the locale select box options ? or
> should it be left as free text with some prefilled content ?

In principle those should be combo boxes (things where you can type to
filter the list, but can only select things that are in the list). I
believe Java has some API-s to query the available locales and time
zones. But for the first iteration it's sufficient to have a fixed
list that you assemble, from some of the most common values.

> Pradeep.
>
> ________________________________________
> From: Daniel Dekany <ddekany@freemail.hu>
> Sent: Tuesday, February 9, 2016 3:53 AM
> To: Pradeep Murugesan
> Cc: dev@freemarker.incubator.apache.org
> Subject: Re: Sample screens for the format box
>
> Hi,
>
> I like the 2nd one.
>
> We will have to add more dropdowns (locale, icompatible_improvemets,
> time_zone, maybe some more), and those could be next to this drop
> down. Like if each would be a column in an table.
>
> In reality, we will need no blanks dropdown options. For output_format
> we should pre-select "undefined" (which is an actual output format),
> for locale "en_US", for time_zone "null", for
> incompatible_improvements the current FM version (like "2.3.24" now).
>
> --
> Thanks,
>  Daniel Dekany
>
>
> Monday, February 8, 2016, 9:04:40 PM, Pradeep Murugesan wrote:
>
>> Hi Daniel,
>>
>>     I have attached a couple of thoughts for the places to put the
>> format box. I am not a designer though, so just put these in a place that I feel
it will good.
>>
>> Kindly let me know your thoughts.
>>
>> Pradeep.

-- 
Thanks,
 Daniel Dekany


Mime
View raw message