I am creating a subclass of AbstractJavaScriptComponent and my @JavaScript annotation to load CKEditor’s javascript seems to require that I specify all subparts or else I get an error.
Normally, to use CKEditor, I just need to reference a single JS file, and that JS will then load any other components that it needs. But my annotation was not enough. I originally tried:
@JavaScript({“ckeditor/ckeditor.js”,“ckeditorForVaadin7.js”,“ckeditor-connector.js”})
That would reference CKEditor itself, and my component script and my connector script. But then I ended up with various errors like:
WARNING: Rejecting published file request for file that has not been published: ckeditor/contents.css
Jun 17, 2013 2:35:42 PM com.vaadin.server.AbstractCommunicationManager servePublishedFile
WARNING: Rejecting published file request for file that has not been published: ckeditor/skins/moono/icons.png
So I started adding in the components listed in the errors, and ended up with:
@JavaScript({“ckeditor/ckeditor.js”,“ckeditor/config.js”,“ckeditor/skins/moono/editor.css”,“ckeditor/lang/en.js”,“ckeditor/styles.js”,“ckeditor/contents.css”,“ckeditor/skins/moono/icons.png”,“ckeditorForVaadin7.js”,“ckeditor-connector.js”})
That appears to now work to load, but of course all of components in the ‘ckeditor/’ path besides the first are parts loaded independently (and the exact contents will change on a per user basis based on what subcomponents they choose, language, skins, etc.) and seem like I shouldn’t have to list them.
Is this a bug, or is the @JavaScript not going to work to load a JS library that itself loads additional parts without listing every possible subpart that it could load?