Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 357283 - Cannot load HTML file when service references a part not generated to JS
Summary: Cannot load HTML file when service references a part not generated to JS
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Huang Ji Yong CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-09 16:12 EDT by Justin Spadea CLA
Modified: 2017-02-23 14:20 EST (History)
3 users (show)

See Also:


Attachments
Patch (73.74 KB, text/plain)
2011-09-27 05:41 EDT, Yun Feng Ma CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Justin Spadea CLA 2011-09-09 16:12:13 EDT
The HTML generation template is gathering *all* referenced parts, but services and parts referenced by services should not be added to the include list.

Steps to reproduce: have a RUIHandler reference a service (not an interface), and put a record field inside the service. Make sure the record only has the Java generator. Cannot load the page because it tries to load record.js which doesn't exist. Same is true for libraries.

Also I noticied CommonUtilities.isUserPart() - which is wrong. There is nothing to stop a user from writing parts in packages "egl" or "eglx". You need to find some other way to determine if a part is built-in (check with Paul or Matt on this).
Comment 1 Justin Spadea CLA 2011-09-22 14:33:49 EDT
This problem is worse now. The latest code is trying to import .js files for interfaces and services, which do not exist. This renders the VE useless if invoking a service. I've put in a temporary workaround into EGLClassTemplate.java.
Comment 2 Huang Ji Yong CLA 2011-09-26 03:14:48 EDT
(In reply to comment #1)
> This problem is worse now. The latest code is trying to import .js files for
> interfaces and services, which do not exist. This renders the VE useless if
> invoking a service. I've put in a temporary workaround into
> EGLClassTemplate.java.

Hi Justin,
It seems your fix has resolved the problem. Can you confirm that?
The remaining problem is how to determine a built-in part, I will check with Paul about that.
Comment 3 Justin Spadea CLA 2011-09-26 10:42:52 EDT
Hi JiYong,

Your latest change backed out part of my temporary fix. It was just a temporary fix though, and I've put in a real fix that uses templates to do nothing in several methods for services and interfaces. The methods are:

genOutputFileName
genDependentParts
genDependentIncludeFiles
genDependentCSSs
genDependentProps

Interfaces and services do not have any of these files for inclusion in the HTML.

I'm leaving this open as there is still the issue about determining if a part is user defined. If there is no good solution - as a last resort you could probably use ir.getFileName() and walk the source folders in the egl path to see if the file exists. It will be a path relative to the source folder.
Comment 4 Yun Feng Ma CLA 2011-09-27 05:41:00 EDT
Created attachment 204060 [details]
Patch

Here is a patch. Thanks.
Comment 5 Huang Ji Yong CLA 2011-09-27 07:54:57 EDT
Code committed
Comment 6 Justin Spadea CLA 2011-11-04 14:15:12 EDT
Verified