Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 337083 - [api] provide an extensible task schema implementation
Summary: [api] provide an extensible task schema implementation
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: 3.5   Edit
Assignee: Steffen Pingel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-13 20:04 EST by Steffen Pingel CLA
Modified: 2011-03-05 02:16 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Steffen Pingel CLA 2011-02-13 20:04:35 EST
To simplify task schema definitions in connectors the framework should provide an extensible abstract implementation for specifying a schema. Connectors should also have a simple way of inheriting fields from the default task schema.
Comment 1 Steffen Pingel CLA 2011-02-13 20:07:45 EST
I have extracted a simple implementation for defining schemas from DefaultTaskSchema and committed that as AbstractTaskSchema. GerritTaskSchema is an example how that is inteded to be used. Thomas, Benjamin, if you get a chance it would be great if you took a look and let me know if it makes sense to move that into an API package.
Comment 2 Steffen Pingel CLA 2011-03-03 01:42:50 EST
We are past the API freeze. Please file another bug if you are interested in having the schema available as API.
Comment 3 Thomas Ehrnhoefer CLA 2011-03-03 13:05:10 EST
Steffen, I think the DefaultTaskSchema fields should not be static, right?
Comment 4 Thomas Ehrnhoefer CLA 2011-03-04 11:42:19 EST
Also, shouldn't the reporter be read only?

Also, if I want to add to the existing flags (e.g. make a field read only), I would need to call
.inheritFrom(DefaultTaskSchema.USER_REPORTER).flags(Flag.PEOPLE, Flag.READ_ONLY).create();
and thus know what the existing flags are. Do you think an addFlags makes sense?
Comment 5 Steffen Pingel CLA 2011-03-04 15:55:32 EST
Reopening to address comment #3.
Comment 6 Steffen Pingel CLA 2011-03-05 02:16:35 EST
Thanks for the feedback. I have moved this into API since its already being consumed by clients anyways.

(In reply to comment #4)
> Also, shouldn't the reporter be read only?

Fixed.

> Also, if I want to add to the existing flags (e.g. make a field read only), I
> would need to call
> .inheritFrom(DefaultTaskSchema.USER_REPORTER).flags(Flag.PEOPLE,
> Flag.READ_ONLY).create();
> and thus know what the existing flags are. Do you think an addFlags makes sense?

Good idea. I have added a addFlag() and removeFlag() method to modify the list of inherited flags.