protected String aggregatorAddModules(String serverUrl, String js, boolean includeLibraryModules) throws IOException {
// XPages aggregator
ResourceFactory factory = ResourceFactory.get();
DojoLibrary dojoLibrary = DojoLibraryFactory.getDefaultLibrary(false);
String dojoLocale = "en-us";
DojoDependencyList dojoResources = new DojoDependencyList(factory,dojoLibrary,dojoLocale);
aggregatorAddDojoModules(dojoResources);
if(includeLibraryModules) {
aggregatorAddLibraryModules(dojoResources);
}
aggregatorAddJSDependencyModules(dojoResources, js);
StringBuilder b = new StringBuilder();
b.append(MinifierResourceProvider.URL_DOJO);
if(dojoLibrary.isUncompressed() || dojoLibrary!=DojoLibraryFactory.getDefaultLibrary(false)) {
b.append('-');
b.append(dojoLibrary.getVersionTag());
}
b.append('/');
b.append(dojoResources.getUrlParameter());
b.append(".js"); // $NON-NLS-1$
String fullUrl = b.toString();
String dojoAgg = PathUtil.concat(serverUrl, fullUrl, '/');
return dojoAgg;
}