Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 282938 - [Tooling] servlet/entrypoint should validate against selected bundles
Summary: [Tooling] servlet/entrypoint should validate against selected bundles
Status: RESOLVED FIXED
Alias: None
Product: RAP
Classification: RT
Component: Tools (show other bugs)
Version: 1.3   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: 1.4 M6   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-08 18:37 EDT by Benjamin Muskalla CLA
Modified: 2011-02-24 09:30 EST (History)
2 users (show)

See Also:


Attachments
Validation for entrypoint/servletname (23.95 KB, patch)
2010-08-26 08:19 EDT, Artur Kronenberg CLA
no flags Details | Diff
Validation entrypoint/servletname (24.54 KB, patch)
2010-08-31 09:13 EDT, Artur Kronenberg CLA
no flags Details | Diff
Patch to validate servlet name and entrypoint (24.57 KB, patch)
2010-09-15 07:22 EDT, Artur Kronenberg CLA
no flags Details | Diff
Validation Entrypoint/Servletname (24.57 KB, patch)
2010-09-15 07:37 EDT, Artur Kronenberg CLA
no flags Details | Diff
Validation Entrypoint/Servletname (40.33 KB, patch)
2011-02-19 14:33 EST, Beyhan Veliev CLA
no flags Details | Diff
Validation Entrypoint/Serveltname v2 (43.64 KB, patch)
2011-02-24 05:44 EST, Beyhan Veliev CLA
holger.staudacher: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Benjamin Muskalla CLA 2009-07-08 18:37:46 EDT
When selecting a branding or entrypoint we currently offer a list based on all plugins in the workspace.
We should rather only show brandings/entrypoints from the selected bundles or vice-versa warn the user if he selected something that is not included in the selected bundles.
Comment 1 Artur Kronenberg CLA 2010-08-26 08:19:14 EDT
Created attachment 177520 [details]
Validation for entrypoint/servletname

Validating the selected EntryPoint against the extensions for Application and EntryPoint and the Servlet Name against the Branding extensions.
Comment 2 Artur Kronenberg CLA 2010-08-31 09:13:53 EDT
Created attachment 177833 [details]
Validation entrypoint/servletname

Changed the validation since there were problems with duplicated entrypoint names and servlet names. Now, validation will be successful on entrypoints if one of the selected bundles contains an entrypoint with the specified name and servlet names if one of the selected bundles contains a branding extension with the specified servlet name. Also added tests for duplicated servlet and entrypoint.
Comment 3 Holger Staudacher CLA 2010-09-08 10:08:54 EDT
Hey Artur, 
I reviewed your patch. Looks good from a short look. But here are some drawbacks:
- You use Java 1.5 api. We should only use Java 1.4. So, the code's not compiling.
- There is a strange pattern in RAPLaunchConfigValidator. You have two loops. The count variable from the outer loop is called j and the inner i. These two should be reversed.
- There are some really long methods e.g. RAPLaunchConfigValidator#getEntryPointExtensionForName. I think you should refactor them to have more shorter and meaningful methods.

Really good that you found the solution with ILaunchConfigurationListener. It's nice to have a non internal way to get changes from the bundles tab without a dependency to it. 

When your code compiles on my machine (Java 1.4) I will test if it's working ;)
Comment 4 Artur Kronenberg CLA 2010-09-15 07:22:12 EDT
Created attachment 178913 [details]
Patch to validate servlet name and entrypoint

Refactored and compiling with Java 1.4.2 now.
Comment 5 Artur Kronenberg CLA 2010-09-15 07:37:23 EDT
Created attachment 178915 [details]
Validation Entrypoint/Servletname

Forgot about the weird pattern. Applied the changes to this patch.
Comment 6 Beyhan Veliev CLA 2011-02-19 14:33:40 EST
Created attachment 189351 [details]
Validation Entrypoint/Servletname

I changed the way how validation works because there are new APIs which can be used. Patch was tested with Eclipse 3.6 and 3.7. I think this is a good feature for our luncher. Good work Artur!
Comment 7 Holger Staudacher CLA 2011-02-22 05:40:38 EST
The changes harm our coding conventions. Please follow the the conventions when you attach a patch. See http://wiki.eclipse.org/RAP/CodingConventions for more detailed information.
Comment 8 Rüdiger Herrmann CLA 2011-02-22 06:45:54 EST
If this change requires specific versions, it should be reflected in the bundle dependencies.
Comment 9 Beyhan Veliev CLA 2011-02-24 05:44:16 EST
Created attachment 189684 [details]
Validation Entrypoint/Serveltname v2

I updated the formatting. Most of the problem occur because the convention '80 characters per line is maximum'. It is a little bit hart :)

comment 8: Rüdiger I don't use any specific APIs. There are new utilities which I implemented for bug 323702. My use of the word APIs was wrong.
Comment 10 Holger Staudacher CLA 2011-02-24 09:30:20 EST
I committed your patch to CVS HEAD with some small changes. I did a little formattitng and changes some message. I also refactored some methods and did some naming.