How I use the existing .js modules in customization temlate?
Post here questions and problems related to editing and publishing DITA content.
			- 
				tmakita
 - Posts: 116
 - Joined: Fri Apr 08, 2011 7:58 am
 
How I use the existing .js modules in customization temlate?
Hi, 
I'm developing Oxygen WebHelp custom template that uses external search engine (AWS Elasticsearch). Currently basic connection test has done successfully and I could get the search query results from external search engine by JSON format.
Then now is the time to develop search result pages. I started this work and found I need existing Oxygen JavaScript modules to develop search result pages. For instance following JavaScript module is needed.
The former exists in the output directly so that I added it simply to [custom search template]/js/template-main.js, but the latter is not found in the output directly (may be because I'm developing alternative search templates), as the result I manually copied searchHistoryItems.js into the [custom search template]/js folder.
[custom search template]/js/template-main.js
However I got the following error when I execute the search in the browser development console.
Regards,
			
			
									
									I'm developing Oxygen WebHelp custom template that uses external search engine (AWS Elasticsearch). Currently basic connection test has done successfully and I could get the search query results from external search engine by JSON format.
Then now is the time to develop search result pages. I started this work and found I need existing Oxygen JavaScript modules to develop search result pages. For instance following JavaScript module is needed.
- webhelp-responsive/app/localization/localization.js
 
- webhelp-responsive/app/search/searchHistoryItems.js
 
The former exists in the output directly so that I added it simply to [custom search template]/js/template-main.js, but the latter is not found in the output directly (may be because I'm developing alternative search templates), as the result I manually copied searchHistoryItems.js into the [custom search template]/js folder.
[custom search template]/js/template-main.js
Code: Select all
define(['require'], function (require) {
    require([
        './suggest',
        './search-es',
        './build-param',
        './searchHistoryItems',
        '../../../oxygen-webhelp/app/localization/localization'
    ]);
});What is the right way to use (or load) existing Oxygen JavaScript modules from the custom template JavaScript?Failed to load resource: the server responded with a status of 404 (Not Found) http://wh/GR2-640/out/webhelp-responsiv ... 2021030218
require.js:5 Uncaught Error: Script error for "searchHistoryItems", needed by: template-base-dir/js/search-es
http://requirejs.org/docs/errors.html#scripterror
at makeError (require.js:5)
at HTMLScriptElement.onScriptError (require.js:5)
Regards,
-- 
/*--------------------------------------------------
Toshihiko Makita
Development Group. Antenna House, Inc. Ina Branch
Web site:
http://www.antenna.co.jp/
http://www.antennahouse.com/
--------------------------------------------------*/
						/*--------------------------------------------------
Toshihiko Makita
Development Group. Antenna House, Inc. Ina Branch
Web site:
http://www.antenna.co.jp/
http://www.antennahouse.com/
--------------------------------------------------*/
- 
				tmakita
 - Posts: 116
 - Joined: Fri Apr 08, 2011 7:58 am
 
Re: How I use the existing .js modules in customization temlate?
temlate ⇒ template
			
			
									
									-- 
/*--------------------------------------------------
Toshihiko Makita
Development Group. Antenna House, Inc. Ina Branch
Web site:
http://www.antenna.co.jp/
http://www.antennahouse.com/
--------------------------------------------------*/
						/*--------------------------------------------------
Toshihiko Makita
Development Group. Antenna House, Inc. Ina Branch
Web site:
http://www.antenna.co.jp/
http://www.antennahouse.com/
--------------------------------------------------*/
- 
				tmakita
 - Posts: 116
 - Joined: Fri Apr 08, 2011 7:58 am
 
Re: How I use the existing .js modules in customization temlate?
Solved!
			
			
									
									- Add extension plug-in that implements "ant.import" and changing "com.oxygenxml.responsive.internal.target.dependencies.topics.html"
 
- Implement custom .js file "copy" in the added build process.
 
-- 
/*--------------------------------------------------
Toshihiko Makita
Development Group. Antenna House, Inc. Ina Branch
Web site:
http://www.antenna.co.jp/
http://www.antennahouse.com/
--------------------------------------------------*/
						/*--------------------------------------------------
Toshihiko Makita
Development Group. Antenna House, Inc. Ina Branch
Web site:
http://www.antenna.co.jp/
http://www.antennahouse.com/
--------------------------------------------------*/
Return to “DITA (Editing and Publishing DITA Content)”
			
				Jump to
				
			
		
			
			
	
	- Oxygen XML Editor/Author/Developer
 - ↳ Feature Request
 - ↳ Common Problems
 - ↳ DITA (Editing and Publishing DITA Content)
 - ↳ Artificial Intelligence (AI Positron Assistant add-on)
 - ↳ SDK-API, Frameworks - Document Types
 - ↳ DocBook
 - ↳ TEI
 - ↳ XHTML
 - ↳ Other Issues
 - Oxygen XML Web Author
 - ↳ Feature Request
 - ↳ Common Problems
 - Oxygen Content Fusion
 - ↳ Feature Request
 - ↳ Common Problems
 - Oxygen JSON Editor
 - ↳ Feature Request
 - ↳ Common Problems
 - Oxygen PDF Chemistry
 - ↳ Feature Request
 - ↳ Common Problems
 - Oxygen Feedback
 - ↳ Feature Request
 - ↳ Common Problems
 - Oxygen XML WebHelp
 - ↳ Feature Request
 - ↳ Common Problems
 - XML
 - ↳ General XML Questions
 - ↳ XSLT and FOP
 - ↳ XML Schemas
 - ↳ XQuery
 - NVDL
 - ↳ General NVDL Issues
 - ↳ oNVDL Related Issues
 - XML Services Market
 - ↳ Offer a Service