This page details the set of changes you will have to make to upgrade an App from CT version 3.11.2 to version 4.0.
Previously, the production filters forced the content served to the browser to be UTF-8. For flat file export we had to move this responsibility out of the prod filters. Existing apps should add
<mime-mapping> tags to their web.xml as follows.
bladerunner-dev-servlets have been removed from BRJS. Existing apps will need to be updated to replace the filter and associated filter-mapping in the web.xml. Instead of
com.caplin.cutlass.filter.BladerunnerFilters, use this:
<filter> <filter-name>BRJSServletFilter</filter-name> <filter-class>org.bladerunnerjs.appserver.BRJSServletFilter</filter-class> </filter> <filter-mapping> <filter-name>BRJSServletFilter</filter-name> <url-pattern>/*</url-pattern> <dispatcher>REQUEST</dispatcher> <dispatcher>FORWARD</dispatcher> </filter-mapping>
Note that the development version of the filter should only be used in development when running BRJS, and should not be included when you export the app to run in an application server. By wrapping the configuration block with pre-processor comments you can ensure that BRJS will strip out the configuration block when you export the app.
com.caplin.cutlass.filter.BladerunnerDevFilters, use this:
<!-- start-env:dev --> <filter> <filter-name>BRJSDevServletFilter</filter-name> <filter-class>org.bladerunnerjs.appserver.BRJSDevServletFilter</filter-class> </filter> <filter-mapping> <filter-name>BRJSDevServletFilter</filter-name> <url-pattern>/*</url-pattern> <dispatcher>REQUEST</dispatcher> <dispatcher>FORWARD</dispatcher> </filter-mapping> <!-- end-env -->
You will also need the following filter, if you are deploying on an https accesible host:
<filter> <filter-name>HTTPS</filter-name> <filter-class>com.caplin.trader.filter.HttpsRedirect</filter-class> </filter> <filter-mapping> <filter-name>HTTPS</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>
Make sure you remove any references to
Remove any references to
You will need to add the following:
<!-- start-env:dev --> <servlet> <servlet-name>BRJSDevServlet</servlet-name> <servlet-class>org.bladerunnerjs.appserver.BRJSDevServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>BRJSDevServlet</servlet-name> <url-pattern>/brjs/*</url-pattern> </servlet-mapping> <!-- end-env -->
You may need to update URLs to servlets, e.g. any workbench index.html files that point to keymaster servlets.
BoneCp and Guava have been removed
CT4 has removed it’s dependency on BoneCp so its jar is no longer included with our libraries.
If you were using BoneCpDataSource in you web.xml you will need to replace it. The following is a suggested alternative:
<New class="org.eclipse.jetty.plus.jndi.Resource"> <!-- relative to this webapp's root directory --> <Arg><Ref id='webAppCtx'/></Arg> <Arg>jdbc/webcentricdb</Arg> <Arg> <Call class="org.h2.jdbcx.JdbcConnectionPool" name="create"> <Arg>jdbc:h2:../generated/app/fxtrader/webcentric-db/fxtrader;IFEXISTS=TRUE;AUTO_SERVER=TRUE</Arg> <Arg>sa</Arg> <Arg type="String"></Arg> </Call> </Arg> </New>
webcentric-db folder has been moved
Previously, webcentric-db folder was generated parallel to apps and sdk folder. Now it is created inside
Replace this configuration:
|To avoid the login page adding a jsessionid URL parameter, add the following:|
Previously, all code had to conform to the namespaced prototype Caplin style. Now, in order to inform BRJS that you are using the legacy style, you must have a
.js-style file inside your
<appName> folder with the contents:
This only has to be done once per app. If the
.js-style file is not provided, then common-js is assumed. To be explicit, you can specify:
XML comments are now stripped. So if you want to get the bundler to bundle something, instead of putting the class name in a comment, add a dummy attribute to an XML element e.g.
<compositeComponentDefinitions xmlns=" needs="caplin.bootstrap.bootstrap,caplin.component.composite.CompositeComponent">
In index.html files, the <@i18n.bundle@/> tag is now required to appear before the <@js.bundle@/> tag.
Within the workbench folders, the themes folder containing any CSS must now be at the same level as the resources folder, not inside it.
library.manifest files are now called
If the library is a commonjs style library, then the following line must be included:
The manifest files have the following format:
js: <comma separated list of js files that make up this lib, if empty include all js files>
css: <comma separated list of css files that make up this lib, if empty include all css files>
depends: <comma separated list of other thirdparty lib dependencies >
exports: the name of the global variable this library defines, this will then be used to automatically add a define block so the library can be 'required'.
Previously, all CSS for third parties were bundled in common.css, regardless of whether the library was included or not.
Now, BRJS will only bundle CSS for third-party libs you include. If you do not include explicit CSS file config inside your manifest, BRJS will bundle all your CSS files. You can however, choose to include specific CSS files only as follows:
css: myCssFile1.css, myCssFile2.css
BRJS no longer bundles resources (CSS, …) from third-party libs that aren’t used. This may cause problems if you are relying on the CSS reset that is present in a JS lib and you are otherwise not using that library.
Previously, the src-test folder could be used to auto-bundle test utility classes without having to specify them inside the 'load:' section in jsTestDriver.conf. Also, the src-test folder could live anywhere inside the library/tests folder.
Now, the src-test folder must either:
sit parallel to the src folder or
be located inside the test-unit/test-acceptance.
Libraries with tests will have to move these src-test folders around accordingly.
com.caplin.jstestdriver.plugin.CutlassBundleInjectorPlugin is now obsolete, this functionality is now handled by BRJS automatically. So any 'plugin:' sections in jsTestDriver.conf files should be removed.
All tests folder must be named "tests", not "test".
Remove this line from jsTestDriver.conf:
bladerunner.conf is now called brjs.conf
'appNamespace' renamed to 'requirePrefix' in 'app.conf' file.
'defaultInputEncoding' renamed to 'defaultFileCharacterEncoding' in 'brjs.conf' file
This token should be removed from brjs.conf, all content is encoded as utf-8
Themes and Styling
If you have a blade with theme X, and you want to use that theme in the application, then your aspect must now also contain a theme X (it can be just an empty folder) even if you don’t have any aspect level styles for that theme.
Remove any preceding slashes in CSS URL’s, e.g.