Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 195450 - improve documentation for APIs and extension point definitions
Summary: improve documentation for APIs and extension point definitions
Status: CLOSED MOVED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: 2.0   Edit
Hardware: All All
: P4 enhancement with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-04 17:51 EDT by Lukasz Dywicki CLA
Modified: 2009-08-19 21:50 EDT (History)
4 users (show)

See Also:


Attachments
javadocs for the AbstractTaskListFactory class (6.15 KB, patch)
2007-12-17 00:07 EST, Eugene Kuleshov CLA
no flags Details | Diff
mylyn/context/zip (1.30 KB, application/octet-stream)
2007-12-17 00:07 EST, Eugene Kuleshov CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lukasz Dywicki CLA 2007-07-04 17:51:39 EDT
Hello everyone,
I found some extension points without documentation and correct definition when i try do any simple bridge to PDT.

All given extension points don't have an description and information. We have Eclipse wiki but schema documentation gone.
org.eclipse.mylar.monitor.ui.user - no description
org.eclipse.mylyn.context.core.bridges
org.eclipse.mylyn.context.core.study - no description, attributes questionnairePage and backgroundPage defined as type Java but haven't base type (maybe it's not bug, i don't know).
org.eclipse.mylar.context.ui.bridges - no description, attribute lavelProvider is type java but haven't base class/interface.
Comment 1 Lukasz Dywicki CLA 2007-07-05 18:12:53 EDT
The base classes also have empty comments. The names isn't always good way for doing documentation.. One sentence per method or all class is insufficiently.

For example what given method should do:
String org.eclipse.mylyn.context.core.AbstractContextStructureBridge.getParentHandle(String handle)
String org.eclipse.mylyn.context.core.AbstractRelationProvider.getSourceId()
String org.eclipse.mylyn.context.core.AbstractRelationProvider.getGenericId()
List<IDegreeOfSeparation> org.eclipse.mylyn.context.core.AbstractRelationProvider.getDegreesOfSeparation()

That's not internal classes, but fragment of public API and gaps in documentation should not take place.

Regards,
Lukasz
Comment 2 Mik Kersten CLA 2007-07-06 21:24:44 EDT
Yes, we need to improve the extension point and public class documentation.  Doing so is always at the cost of fixing bugs or improving API, so it's a fine balance and we have been encouraging integrators to look to the reference implementations.  In order to help us prioritize adding documentation please feel free to file bugs or send messages to mylyn-integrators and we will add the docs as we answer the questions.  

Let's continue to use this bug report to gather and prioritize feedback on documenting the extension points and corresponding APIs.

Regarding comment#1, AbstractRelationProvider's Javadoc already has a prominent note that this class is currently in flux even though it is being used by some internal clients.  To learn more about its use take a look at how the Sandbox Active Search uses it, but we recommended using it with caution since it will change for 3.0.  I added docs to AbstractContextStructureBridge.

I also added docs to everything mentioned in the description, as well as the missing class constraints (the constraints were already being checked at runtime).
Comment 3 Eugene Kuleshov CLA 2007-12-17 00:07:31 EST
Created attachment 85363 [details]
javadocs for the AbstractTaskListFactory class
Comment 4 Eugene Kuleshov CLA 2007-12-17 00:07:34 EST
Created attachment 85364 [details]
mylyn/context/zip
Comment 5 Dennis Rietmann CLA 2007-12-19 12:42:41 EST
Hi,
I noticed that the javadoc for AbstractRepositoryConnector.markStaleTasks is broken in the Mylyn 2.x stream for Eclipse 3.3 - it says that it returns a set of changed tasks but the method actually returns a boolean.
Comment 6 Mik Kersten CLA 2007-12-19 16:32:13 EST
 (In reply to comment #5)
> I noticed that the javadoc for AbstractRepositoryConnector.markStaleTasks is
> broken in the Mylyn 2.x stream for Eclipse 3.3 - it says that it returns a set
> of changed tasks but the method actually returns a boolean.

Thanks, fixed in HEAD.
Comment 7 Eugene Kuleshov CLA 2007-12-19 19:15:51 EST
(In reply to comment #6)
> Thanks, fixed in HEAD.

Mik, your change is not completely reflect expectations of the current API. Here is a slightly edited variant of what I posted to the integrator's mailing list:

---
The markStaleTasks() should return true if there are tasks changed since last synchronization, which also means that queries for the same repository need to be synchronized. Implementation of markStale() should call setStale(true) on each task from collection passed as a tasks parameter to specify if task data need to be updated from the issue tracking system.

Note that depends from the issue tracking system capabilities tasks data can be updated right in markStale() method to save additional round trips to server. In this case setStale(true) shouldn't be called, but it is still necessary to return true from markStale() method in order to refresh query results, in case tasks are added or removed from query results.
Comment 8 Steffen Pingel CLA 2007-12-19 19:38:41 EST
The documentation should specify the API contract and not how to implement the method.
Comment 9 Eugene Kuleshov CLA 2007-12-19 19:51:42 EST
True, that is why I didn't submitted patch for the javadoc, which still should state that API contract expects setStale() to be called on the changed tasks if those tasks should be included into the following synchronization. Otherwise it is completely unobvious what method should do.
Comment 10 Dennis Rietmann CLA 2008-01-08 10:15:35 EST
I agree with Eugene, it should at least be stated that setStale(true) has to be called on changed tasks. Besides that the phrasing is still incorrect, e.g. 
* "Of <code>tasks</code> provided, return all that have changed since last synchronization..." -> the method returns a boolean and not a collection.
* The mentioned "collector" is not passed as an argument (maybe this is left over from a previous version?)
Comment 11 Mik Kersten CLA 2008-01-31 22:11:32 EST
Rob: please update that Javadoc accordingly.
Comment 12 Eugene Kuleshov CLA 2008-02-01 02:16:53 EST
Mik, there is patch attached for AbstractTaskListFactory javadocs. Can you please take it or mark as obsolete. Thanks.
Comment 13 Dennis Rietmann CLA 2008-02-13 12:40:48 EST
please add doc for AbstractRepositoryTaskEditor.validateInput() - What should I do if the input is invalid (there is no return value)?
Comment 14 Eugene Kuleshov CLA 2008-02-13 13:28:03 EST
Mik, can you please review the javadoc contribution I've made? It is attached as a patch.

Dennis, as far as I know, only XPlanner connector has some dummy logic in that method. All other connectors rely on the server response after submission, so method is simply empty. Though you could do something like this if you want to validate input on the client side.

if(isValid()) {
	getParentEditor().setMessage(null, IMessageProvider.WARNING);
  submitButton.setEnabled(true);
} else {
	getParentEditor().setMessage("Field foo is invalid", IMessageProvider.WARNING);
  submitButton.setEnabled(false);
}
Comment 15 Dennis Rietmann CLA 2008-02-13 13:58:13 EST
(In reply to comment #14)
> Mik, can you please review the javadoc contribution I've made? It is attached
> as a patch.
> 
> Dennis, as far as I know, only XPlanner connector has some dummy logic in that
> method. All other connectors rely on the server response after submission, so
> method is simply empty. Though you could do something like this if you want to
> validate input on the client side.
> 
> if(isValid()) {
>         getParentEditor().setMessage(null, IMessageProvider.WARNING);
>   submitButton.setEnabled(true);
> } else {
>         getParentEditor().setMessage("Field foo is invalid",
> IMessageProvider.WARNING);
>   submitButton.setEnabled(false);
> }
> 

Eugene, thanks for the quick reply, unfortunately it seems like you forgot the attachment...
I want to do a quick "offline" check on the client side (eg. are all mandatory fields, like issue title, filled? Are the values valid?) to prevent any unnecessary server roundtrips and provide the user with immediate feedback. Of course the data is validated on the server again when submitted and not every thing can be validated on the client side.
Comment 16 Eugene Kuleshov CLA 2008-02-13 16:42:16 EST
(In reply to comment #15)
> Eugene, thanks for the quick reply, unfortunately it seems like you forgot the
> attachment...

I didn't. My first note was addressed to Mik, not you. The example I've posted was all.

> I want to do a quick "offline" check on the client side (eg. are all mandatory
> fields, like issue title, filled? Are the values valid?) to prevent any
> unnecessary server roundtrips and provide the user with immediate feedback. Of
> course the data is validated on the server again when submitted and not every
> thing can be validated on the client side.

Basically all validation is in your hands. If you created fields using some of the factory methods provided by the AbstractRepositoryTaskEditor and its subclasses (i.e. createTextField(), etc), change listener will call AbstractRepositoryTaskEditor.attributeChanged(), which will call validateInput(). For your own controls you may have to call attributeChanged() yourself, and to do the actual validation use code from my previous comment inside of the validateInput() method.
Comment 17 Mik Kersten CLA 2008-02-19 00:24:16 EST
 (In reply to comment #13)
> please add doc for AbstractRepositoryTaskEditor.validateInput() - What should I
> do if the input is invalid (there is no return value)?

Rob: when you get a chance please add that Javadoc that Dennis is asking for and take a look at Eugene's patch.
Comment 18 Steffen Pingel CLA 2008-02-29 02:38:38 EST
Patch applied. Thanks for the documentation Eugene.
Comment 19 Robert Elves CLA 2008-06-14 00:52:35 EDT
Need to defer: http://wiki.eclipse.org/index.php/Mylyn/3.0_Plan#Deferred_Items
Comment 20 Mik Kersten CLA 2008-09-04 14:20:18 EDT
Seems significant for 3.2/Galileo.
Comment 21 Eclipse Webmaster CLA 2022-11-15 11:45:08 EST
Mylyn has been restructured, and our issue tracking has moved to GitHub [1].

We are closing ~14K Bugzilla issues to give the new team a fresh start. If you feel that this issue is still relevant, please create a new one on GitHub.

[1] https://github.com/orgs/eclipse-mylyn