Open GoogleCodeExporter opened 9 years ago
The problem I have is that the connector specific code goes into a fragment
that is hosted in the Core (non-UI) plugin.
Adding the wizard pages for this extension point to the same connector would
introduce a dependency on UI stuff.
Not impossible but not what fragments are intended for.
More important: what would this extension look like?
Should it handle the removal and addition of columns/free text fields in the UI
of the existing query page?
It would register a another wizard to be chosen on the first page, complete
with all pages following, but then how would it store its query in the query
properties, and how would the query be executed in code in a most generic way.
Please provide more specific details of what you want to accomplish.
Original comment by meijerf...@gmail.com
on 20 May 2010 at 8:11
No it is simple: I define an extension point in ui. Then in ui, to get the
querypage i check if there is a factory. If there is, i use it. The default
factory gets the default form page.
Original comment by wim.jong...@gmail.com
on 20 May 2010 at 8:50
We must think through the UI extension (wizard page), the storing format of the
query in the query properties
and the generic handling of alternative queries in Ibatis and JPA to come up
with a usable extension point
definition.
Or would you be happy with an alternative page layout to generate the same sort
of queries with exactly the
same number and type of parameters?
Original comment by meijerf...@gmail.com
on 20 May 2010 at 10:00
Sort of the same. Lets not make super changes. I think the criteria supports
properties
where we can put stuff.
Original comment by wim.jong...@gmail.com
on 20 May 2010 at 10:36
[deleted comment]
Hi Wim
To elabroate on the design of the query factory extension point, you need to
consider the following:
1) the UI part that you want to extend gathers all the user input and
translates this into a Query URL, for example this from one of my blogs:
jdbc:mysql://localhost:3306/lighting[IBATIS-QUERY]product=kantoor&issueStatus=em
pty&
It consists of three parts:
- jdbc:mysql://localhost:3306/lighting <-- the Repository URL
- [IBATIS-QUERY] <-- a unique separator per Query page, so the UI can decide
what wizard page to open
- product=kantoor&issueStatus=empty& <- the chose parameters as key-value pairs
2) the query parameters are passed into the query as an object of class
IndustrialQueryParams.
IndustrialQueryParams has methods void fromUrl(String) and String asUrl() to
store the various parameters
3) the query is executed using a object of type IndustrialQueryParams as
parameter.
I think that IndustrialQueryParams can be subclassed for more or different
params as it is read by Ibatis using reflection.
We cannot modify the code to use a Map as param vehicle, because we need to
have multi select for parameters (more than one allowed value for each key)
Example in the twitter connector I can query thus for two allowed values for
owner (separator is |):
http://twitter.com/maartenmeijer[IBATIS-QUERY]owner=industrial TSI
(industrialtsi)|Wim Jongman (wimjongman)&
When double clicking on a query, there must be enough information in the URL to
create the right kind of parameter object
This logic must be called from
com.industrialtsi.mylyn.ui.query.IndustrialQueryTypeWizardPage
so we must modify the constructor IndustrialQueryTypeWizardPage(TaskRepository
repository, IRepositoryQuery queryToEdit)
to choose the right page to display based on the information in
IRepositoryQuery queryToEdit. I propose to store that information in the Query
URL, rather than Summary
When creating an extension point to resolve this issue, I think we need to
specify three things in there:
- the factory for the UI query page layout
- the unique URL separator to distinguish the different types so we can match
URL to page
- the class of the DTO object used to pass information into the query, I think
such an object must extend
com.industrialtsi.mylyn.core.dto.IndustrialQueryParams
Please contact me when you need further assistance!
Original comment by meijerf...@gmail.com
on 29 May 2010 at 7:06
Hi Maarten,
The solution as quite simple. If the connector wants to add a page to the ui,
then the fragment host is no longer the core but the ui project. The only thing
I had to do for that is to re-export the commons bundle in the core. Please
check out this patch. If you are okay with it I will commit.
I noticed also that the repository name is stored in the task-repository rather
then the id. I had to make the name attribute of the persistor-config not
translatable, otherwise I could not use that to link the querypage factory to.
Original comment by wim.jong...@gmail.com
on 4 Jul 2010 at 5:16
Attachments:
Original comment by wim.jong...@gmail.com
on 5 Jul 2010 at 6:42
Original issue reported on code.google.com by
wim.jong...@gmail.com
on 20 May 2010 at 8:01