List of usage examples for org.apache.wicket.javascript DefaultJavaScriptCompressor DefaultJavaScriptCompressor
DefaultJavaScriptCompressor
From source file:de.alpharogroup.wicket.base.util.application.ApplicationExtensions.java
License:Apache License
/** * Sets the deployment settings for deployment mode for the given application. * * @param application/* w w w . j a va 2s . c o m*/ * the application to set the settings */ public static void setDeploymentModeConfiguration(final Application application) { application.getMarkupSettings().setStripComments(true); // The resources are never polled. This are properties, html, // css, js files. application.getResourceSettings().setResourcePollFrequency(null); application.getResourceSettings().setJavaScriptCompressor(new DefaultJavaScriptCompressor()); // set the behavior if an missing resource is found... application.getResourceSettings().setThrowExceptionOnMissingResource(false); // debug settings... application.getDebugSettings().setComponentUseCheck(false); application.getDebugSettings().setAjaxDebugModeEnabled(false); application.getDebugSettings().setDevelopmentUtilitiesEnabled(false); application.getDebugSettings().setOutputMarkupContainerClassName(false); application.getDebugSettings().setLinePreciseReportingOnAddComponentEnabled(false); application.getDebugSettings().setLinePreciseReportingOnNewComponentEnabled(false); }
From source file:org.efaps.ui.wicket.EFapsApplication.java
License:Apache License
/** * @see org.apache.wicket.protocol.http.WebApplication#init() */// w w w .ja v a 2 s. c o m @Override protected void init() { super.init(); final String appKey = getInitParameter(AbstractFilter.INITPARAM_APP_KEY); final String loginRolesTmp = getInitParameter(AbstractFilter.INITPARAM_LOGIN_ROLES); final Set<UUID> temp = new HashSet<>(); if (loginRolesTmp != null) { final String[] loginRolesAr = loginRolesTmp.split(","); for (final String loginRole : loginRolesAr) { temp.add(UUID.fromString(loginRole)); } } AppAccessHandler.init(appKey, temp); final Map<String, String> map = new HashMap<>(); for (final AppConfigHandler.Parameter param : AppConfigHandler.Parameter.values()) { final String configTmp = getInitParameter(param.getKey()); if (configTmp != null) { map.put(param.getKey(), configTmp); } } if (!map.containsKey(AppConfigHandler.Parameter.TEMPFOLDER.getKey())) { map.put(AppConfigHandler.Parameter.TEMPFOLDER.getKey(), getStoreSettings().getFileStoreFolder().toURI().toString()); } AppConfigHandler.init(map); getJavaScriptLibrarySettings().setJQueryReference(new DynamicJQueryResourceReference()); getApplicationSettings().setPageExpiredErrorPage(LoginPage.class); getApplicationSettings().setInternalErrorPage(UnexpectedErrorPage.class); final CompoundClassResolver resolver = new CompoundClassResolver(); resolver.add(new DefaultClassResolver()); resolver.add(new AbstractClassResolver() { @Override public ClassLoader getClassLoader() { return EFapsClassLoader.getInstance(); } }); getApplicationSettings().setClassResolver(resolver); getApplicationSettings().setUploadProgressUpdatesEnabled(true); getDebugSettings().setAjaxDebugModeEnabled(false); getDebugSettings().setDevelopmentUtilitiesEnabled(false); setPageManagerProvider(new EFapsPageManagerProvider(this)); getStoreSettings().setMaxSizePerSession( Bytes.megabytes(Configuration.getAttributeAsInteger(ConfigAttribute.STORE_MAXSIZEPERSESSION))); getStoreSettings() .setInmemoryCacheSize(Configuration.getAttributeAsInteger(ConfigAttribute.STORE_INMEMORYCACHE)); getMarkupSettings().setStripWicketTags(true); getMarkupSettings().setStripComments(true); getMarkupSettings().setCompressWhitespace(true); getMarkupSettings().setAutomaticLinking(false); getRequestCycleSettings().setGatherExtendedBrowserInfo(true); getRequestCycleListeners().add(new EFapsRequestCycleListener()); getRequestLoggerSettings().setRequestLoggerEnabled(false); getSecuritySettings().setAuthorizationStrategy(new EFapsFormBasedAuthorizationStartegy()); getResourceSettings().setJavaScriptCompressor(new DefaultJavaScriptCompressor()); // allow svg resources final IPackageResourceGuard guard = getResourceSettings().getPackageResourceGuard(); if (guard instanceof SecurePackageResourceGuard) { ((SecurePackageResourceGuard) guard).addPattern("+*.svg"); } setHeaderResponseDecorator(new IHeaderResponseDecorator() { @Override public IHeaderResponse decorate(final IHeaderResponse _response) { return new EFapsResourceAggregator(_response); } }); getRequestCycleSettings().addResponseFilter(new IResponseFilter() { @Override public AppendingStringBuffer filter(final AppendingStringBuffer _responseBuffer) { final AppendingStringBuffer ret; if (RequestCycle.get().getActiveRequestHandler() instanceof ACAjaxRequestTarget) { ret = new AppendingStringBuffer().append(_responseBuffer.subSequence(0, _responseBuffer.length() - XmlPartialPageUpdate.END_ROOT_ELEMENT.length())); } else { ret = _responseBuffer; } return ret; } }); }
From source file:org.jaulp.wicket.base.util.application.ApplicationUtils.java
License:Apache License
/** * Sets the debug settings for deployment mode for the given application. * * @param application// ww w . j a va 2s . c o m * the application to set the settings */ public static void setDeploymentModeConfiguration(final Application application) { application.getMarkupSettings().setStripComments(true); // The resources are never polled. This are properties, html, // css, js files. application.getResourceSettings().setResourcePollFrequency(null); application.getResourceSettings().setJavaScriptCompressor(new DefaultJavaScriptCompressor()); // set the behavior if an missing resource is found... application.getResourceSettings().setThrowExceptionOnMissingResource(false); // debug settings... application.getDebugSettings().setComponentUseCheck(false); application.getDebugSettings().setAjaxDebugModeEnabled(false); application.getDebugSettings().setDevelopmentUtilitiesEnabled(false); application.getDebugSettings().setOutputComponentPath(false); application.getDebugSettings().setOutputMarkupContainerClassName(false); application.getDebugSettings().setLinePreciseReportingOnAddComponentEnabled(false); application.getDebugSettings().setLinePreciseReportingOnNewComponentEnabled(false); }