Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 289823

Summary: JSLib Element of org.eclipse.birt.core.ScriptFunctionService not working
Product: z_Archived Reporter: Jan Kohnert <jan.kohnert>
Component: BIRTAssignee: Wenjie Tu <wtu>
Status: VERIFIED FIXED QA Contact: Xiaoying Gu <bluesoldier>
Severity: normal    
Priority: P3 CC: bluesoldier, dani, lzhu, mwu, wenfeng.fwd, wyan
Version: 2.5.0   
Target Milestone: 2.6.1   
Hardware: PC   
OS: Windows Vista   
Whiteboard: Obsolete

Description Jan Kohnert CLA 2009-09-18 05:05:47 EDT
The jslib Path feature does not work.
This appears to be a bug in the populateResources method of FunctionProviderImpl.java  If the location is jslib the url that gets created with the following:

while ( files.hasMoreElements( ) )
{
String element = files.nextElement( ).toString( );
if ( element.toLowerCase( ).endsWith( suffix ) )
{
try
{
libs.add( new URL( url, element ) );
}
catch ( MalformedURLException e1 )
{
}
}
}

Produces a url /jslib/jslib/javascriptfile.js


As a work around take the jslib directory and nest a copy inside the same jslib dir.
Comment 1 Mingxia Wu CLA 2010-05-13 04:51:16 EDT
There is workaround for user to make it work.
Comment 2 Wenjie Tu CLA 2010-08-11 23:04:41 EDT
Hi there,
Thanks for reporting this issue and helping find out the real cause. 

Now, correct the logic to get URLs of *.js files which are under the directory specifed thru "location" attribute of "JSLib" element.
Comment 3 Xiaoying Gu CLA 2010-08-17 05:15:52 EDT
Verified in 261 build 2.6.1.v20100617-0630.