|
From: Peter S. <co...@pe...> - 2007-09-26 07:22:07
|
Hi Roberto,
Thanks for the explanation - I implemented a new SearchDataGetterSetter
extending the MetaDataLogGetterSetter - since I still need the
MetaDataLogViewer.extractSearchTextsFieldsAndColumnsFromSearchPanels()
method to be called (which is done by the saveSearch() method).
This means that I initially get a MetaDataSearchDTO which I'll then convert
to my own DTO.Correct me if I'm wrong, but it seems to me that I cannot
avoid this conversion from MetaDataSearchDTO to MyCustomSearchDTO - since
I'm dependent on what the MetaDataLogViewer.saveSearch() method does. ??
Would it be more correct if the saveSearch method took a SearchDTO object as
an argument, rather than creating a new instance inside the method?
regards,
Peter
On 9/25/07, Roberto Milev <rob...@gm...> wrote:
>
> Hi Peter,
>
> I agree, this is done intentionally, MetaDataSearchDTO extends
> AbstractSearchDTO. This saveSearch method that you're referring to is used
> to gather information from the panel and put it in an AbstractSearchDTO,
> than we get that object and store it in database. I might have named the
> method badly (if you think so, I can correct it immediately), but the idea
> is for this method to be unique for each applet. So you need to make another
> method like this to gather different kind of information for your custom
> searchDTO which will extend AbstractSearchDTO. Than another class to
> implement the SearchDataGetterSetter and that class name to set in the menu
> creation as it is in MetaDataLogViewerApplet.
>
> Regards,
> Roberto
>
> On 9/25/07, Peter Salomonsen <co...@pe...> wrote:
> >
> > Hi Roberto,
> >
> > Remember the Custom SearchDTO tutorial? I've tried this, and I'm using a
> > custom SearchDTO, but this will never work because of this:
> >
> > /**
> > * Saves the search in database
> > *
> > * @param searchName
> > * name that the search will be stored in database
> > */
> > public MetaDataSearchDTO saveSearch() {
> > // This has been changed in order to work with the search_addon
> > concept
> > extractSearchTextsFieldsAndColumnsFromSearchPanels();
> > MetaDataSearchDTO search = new MetaDataSearchDTO();
> > search.setMeta_ids(searchFieldArray);
> > search.setSearch_strings(searchTextArray);
> > search.setShownColumns(shownColumns);
> > return search;
> > // mdr.saveSearch(searchName, searchFieldArray, searchTextArray,
> > // shownColumns);
> > }
> >
> > which is from MetaDataLogViewer.
> >
> >
> > Reason is that this always return a MetaDataSearchDTO, while it should
> > return an instance of my custom searchDTO..
> >
> > This is top prio for me, you have a solution proposal?
> >
> > regards,
> >
> > Peter
> >
>
>
>
> --
> Regards,
> Roberto Milev
|