I've missed it. Sorry!

On Thu, Apr 18, 2019 at 11:34 AM Sven Meier <[email protected]> wrote:

> Hi Martin,
>
> I've just noticed that my commit made it into the 9.0.0-M1 release.
>
> I remember Andrea releasing the first milestone around the same time I
> pushed my changes.
>
> Sven
>
>
> Am 18.04.19 um 10:00 schrieb Martin Grigorov:
> > Hi Sven,
> >
> > There is no commit in master branch.
> > Did you forget to push it ? Or maybe the push failed for some reason.
> >
> > On Wed, Apr 17, 2019 at 11:23 PM <[email protected]> wrote:
> >
> >> This is an automated email from the ASF dual-hosted git repository.
> >>
> >> svenmeier pushed a commit to branch wicket-8.x
> >> in repository https://gitbox.apache.org/repos/asf/wicket.git
> >>
> >>
> >> The following commit(s) were added to refs/heads/wicket-8.x by this
> push:
> >>       new 8a73a9e  WICKET-6655 set cacheDuration
> >> 8a73a9e is described below
> >>
> >> commit 8a73a9e87525b7cd2d2589f7b490f927084587f5
> >> Author: Sven Meier <[email protected]>
> >> AuthorDate: Tue Apr 16 20:27:51 2019 +0200
> >>
> >>      WICKET-6655 set cacheDuration
> >>
> >>      and fileName lazily and wrap models
> >> ---
> >>   .../repeater/data/table/export/ExportToolbar.java  | 31
> >> ++++++++++++++++++----
> >>   1 file changed, 26 insertions(+), 5 deletions(-)
> >>
> >> diff --git
> >>
> a/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/repeater/data/table/export/ExportToolbar.java
> >>
> b/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/repeater/data/table/export/ExportToolbar.java
> >> index faad10e..1763848 100644
> >> ---
> >>
> a/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/repeater/data/table/export/ExportToolbar.java
> >> +++
> >>
> b/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/repeater/data/table/export/ExportToolbar.java
> >> @@ -39,6 +39,7 @@ import org.apache.wicket.util.lang.Args;
> >>   import org.apache.wicket.util.resource.AbstractResourceStreamWriter;
> >>   import org.apache.wicket.util.resource.IResourceStream;
> >>   import org.apache.wicket.util.resource.IResourceStreamWriter;
> >> +import org.apache.wicket.util.time.Duration;
> >>
> >>   /**
> >>    * A toolbar that provides links to download the data represented by
> all
> >> {@link IExportableColumn}s in the table
> >> @@ -102,8 +103,9 @@ public class ExportToolbar extends AbstractToolbar
> >>          public ExportToolbar(DataTable<?, ?> table, IModel<String>
> >> messageModel, IModel<String> fileNameModel)
> >>          {
> >>                  super(table);
> >> -               this.messageModel = messageModel;
> >> -               this.fileNameModel = fileNameModel;
> >> +
> >> +               setMessageModel(messageModel);
> >> +               setFileNameModel(fileNameModel);
> >>          }
> >>
> >>          /**
> >> @@ -115,7 +117,7 @@ public class ExportToolbar extends AbstractToolbar
> >>           */
> >>          public ExportToolbar setMessageModel(IModel<String>
> messageModel)
> >>          {
> >> -               this.messageModel = Args.notNull(messageModel,
> >> "messageModel");
> >> +               this.messageModel = wrap(Args.notNull(messageModel,
> >> "messageModel"));
> >>                  return this;
> >>          }
> >>
> >> @@ -128,7 +130,7 @@ public class ExportToolbar extends AbstractToolbar
> >>           */
> >>          public ExportToolbar setFileNameModel(IModel<String>
> fileNameModel)
> >>          {
> >> -               this.fileNameModel = Args.notNull(fileNameModel,
> >> "fileNameModel");
> >> +               this.fileNameModel = wrap(Args.notNull(fileNameModel,
> >> "fileNameModel"));
> >>                  return this;
> >>          }
> >>
> >> @@ -201,17 +203,36 @@ public class ExportToolbar extends AbstractToolbar
> >>          {
> >>                  IResource resource = new ResourceStreamResource()
> >>                  {
> >> +                       /**
> >> +                        * Set fileName and cacheDuration lazily
> >> +                        */
> >> +                       public void respond(Attributes attributes) {
> >> +                               setFileName(fileNameModel.getObject() +
> >> "." + dataExporter.getFileNameExtension());
> >> +
> >>   setCacheDuration(ExportToolbar.this.getCacheDuration());
> >> +
> >> +                               super.respond(attributes);
> >> +                       }
> >> +
> >>                          @Override
> >>                          protected IResourceStream
> >> getResourceStream(Attributes attributes)
> >>                          {
> >>                                  return new
> >> DataExportResourceStreamWriter(dataExporter, getTable());
> >>                          }
> >> -               }.setFileName(fileNameModel.getObject() + "." +
> >> dataExporter.getFileNameExtension());
> >> +               };
> >>
> >>                  return new ResourceLink<Void>(componentId, resource)
> >>
> .setBody(dataExporter.getDataFormatNameModel());
> >>          }
> >>
> >> +       /**
> >> +        * How long should the export be cached.
> >> +        *
> >> +        * @return default is {@link Duration#NONE}
> >> +        */
> >> +       protected Duration getCacheDuration() {
> >> +               return Duration.NONE;
> >> +       }
> >> +
> >>          @Override
> >>          protected void onConfigure()
> >>          {
> >>
> >>
>

Reply via email to