本文整理汇总了Java中org.apache.wicket.protocol.http.WebApplication类的典型用法代码示例。如果您正苦于以下问题:Java WebApplication类的具体用法?Java WebApplication怎么用?Java WebApplication使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WebApplication类属于org.apache.wicket.protocol.http包,在下文中一共展示了WebApplication类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ImageModel
import org.apache.wicket.protocol.http.WebApplication; //导入依赖的package包/类
/**
* The constructor for this class, which provides the images for the web
* application.
*
* @param component
*/
public ImageModel(final Component component) {
final SharedResources sharedResources = WebApplication.get().getSharedResources();
final ResourceReference aligmentImageReference = sharedResources.get(ImageReference.class, "alignment.jpg", null, null, null, false);
final ResourceReference eventStreamImageReference = sharedResources.get(ImageReference.class, "eventStream.jpg", null, null, null, false);
final ResourceReference groupImageReference = sharedResources.get(ImageReference.class, "group.jpg", null, null, null, false);
final ResourceReference processImageReference = sharedResources.get(ImageReference.class, "process.jpg", null, null, null, false);
this.images.add(new CarouselImage(component.getRequestCycle().urlFor(eventStreamImageReference, null).toString(), "Event streaming platform", "Capture all your event streams in one platform"));
this.images.add(new CarouselImage(component.getRequestCycle().urlFor(groupImageReference, null).toString(), "Next generation process management", "Monitor and analyze your processes"));
this.images.add(new CarouselImage(component.getRequestCycle().urlFor(processImageReference, null).toString(), "Process optimization", "Capture running process instances to optimize them"));
this.images.add(new CarouselImage(component.getRequestCycle().urlFor(aligmentImageReference, null).toString(), "Business and IT alignment", "Gain knowlegde through combining business and IT"));
}
示例2: init
import org.apache.wicket.protocol.http.WebApplication; //导入依赖的package包/类
@Override
public void init(WebApplication webApplication) {
webApplication.setPageManagerProvider(new DefaultPageManagerProvider(webApplication) {
protected IDataStore newDataStore() {
IRedisSettings settings = new RedisSettings();
settings.setHostname(prop.getHostname());
settings.setPort(prop.getPort());
settings.setRecordTtl(TypeParser.parse(prop.getRecordTtl(), prop.getRecordTtlUnit()));
RedisDataStore redisDataStore = new RedisDataStore(settings );
return new SessionQuotaManagingDataStore(redisDataStore, TypeParser.parse(prop.getSessionSize(), prop.getSessionUnit()));
}
});
wicketEndpointRepository.add(new WicketAutoConfig.Builder(this.getClass())
.withDetail("properties", prop)
.build());
}
示例3: init
import org.apache.wicket.protocol.http.WebApplication; //导入依赖的package包/类
@Override
public void init(WebApplication webApplication) {
webApplication.setPageManagerProvider(new DefaultPageManagerProvider(webApplication) {
@Override
protected IDataStore newDataStore() {
HazelcastDataStore hazelcastDataStore = new HazelcastDataStore(hazelcastInstance);
return new SessionQuotaManagingDataStore(hazelcastDataStore, TypeParser.parse(prop.getSessionSize(), prop.getSessionUnit()));
}
});
wicketEndpointRepository.add(new WicketAutoConfig.Builder(this.getClass())
.withDetail("properties", prop)
.build());
}
示例4: init
import org.apache.wicket.protocol.http.WebApplication; //导入依赖的package包/类
@Override
public void init(WebApplication webApplication) {
final ICassandraSettings settings = new CassandraSettings();
settings.getContactPoints().addAll(prop.getContactPoints());
settings.setTableName(prop.getTableName());
settings.setKeyspaceName(prop.getKeyspaceName());
settings.setRecordTtl(TypeParser.parse(prop.getRecordTtl(), prop.getRecordTtlUnit()));
webApplication.setPageManagerProvider(new DefaultPageManagerProvider(webApplication) {
@Override
protected IDataStore newDataStore() {
return new SessionQuotaManagingDataStore(new CassandraDataStore(settings),
TypeParser.parse(prop.getSessionSize(), prop.getSessionUnit()));
}
});
wicketEndpointRepository.add(new WicketAutoConfig.Builder(this.getClass())
.withDetail("properties", prop)
.build());
}
示例5: init
import org.apache.wicket.protocol.http.WebApplication; //导入依赖的package包/类
@Override
public void init(WebApplication webApplication) {
AnnotationsShiroAuthorizationStrategy authz = new AnnotationsShiroAuthorizationStrategy();
webApplication.getSecuritySettings().setAuthorizationStrategy( authz );
if ( classCandidates.getSignInPageCandidates().size() <= 0 ) {
throw new IllegalStateException( "Couln't find sign in page - please annotated the sign in page with @" + WicketSignInPage.class.getName() );
}
if ( classCandidates.getAccessDeniedPageCandidates().size() <= 0 ) {
throw new IllegalStateException( "Couln't find access denied in page - please annotated the sign in page with @" + WicketAccessDeniedPage.class.getName() );
}
Class<WebPage> signInPage = classCandidates.getSignInPageCandidates().iterator().next().getCandidate();
Class<Page> accessDeniedPage = classCandidates.getAccessDeniedPageCandidates().iterator().next().getCandidate();
webApplication.getSecuritySettings()
.setUnauthorizedComponentInstantiationListener( new ShiroUnauthorizedComponentListener( signInPage, accessDeniedPage, authz ) );
}
示例6: init
import org.apache.wicket.protocol.http.WebApplication; //导入依赖的package包/类
@Override
public void init(WebApplication webApplication) {
MarkupSettings markupSettings = webApplication.getMarkupSettings();
if(props.getDefaultMarkupEncoding() != null){
markupSettings.setDefaultMarkupEncoding(props.getDefaultMarkupEncoding());
}
markupSettings.setAutomaticLinking(props.isAutomaticLinking());
markupSettings.setCompressWhitespace(props.isCompressWhitespace());
markupSettings.setStripComments(props.isStripComments());
markupSettings.setStripWicketTags(props.isStripWicketTags());
markupSettings.setThrowExceptionOnMissingXmlDeclaration(props.isThrowExceptionOnMissingXmlDeclaration());
wicketEndpointRepository.add(new WicketAutoConfig.Builder(this.getClass())
.withDetail("properties", props)
.build());
}
示例7: init
import org.apache.wicket.protocol.http.WebApplication; //导入依赖的package包/类
@Override
public void init(WebApplication webApplication) {
StoreSettings storeSettings = webApplication.getStoreSettings();
if (props.getAsynchronous() != null) {
storeSettings.setAsynchronous(props.getAsynchronous());
}
if (props.getAsynchronousQueueCapacity() != null) {
storeSettings.setAsynchronousQueueCapacity(props.getAsynchronousQueueCapacity());
}
if (props.getFileStoreFolder() != null) {
storeSettings.setFileStoreFolder(new File(props.getFileStoreFolder()));
}
if (props.getInmemoryCacheSize() != null) {
storeSettings.setInmemoryCacheSize(props.getInmemoryCacheSize());
}
storeSettings.setMaxSizePerSession(TypeParser.parse(props.getSessionSize(), props.getSessionUnit()));
wicketEndpointRepository.add(new WicketAutoConfig.Builder(this.getClass())
.withDetail("properties", props)
.build());
}
示例8: init
import org.apache.wicket.protocol.http.WebApplication; //导入依赖的package包/类
@Override
public void init(WebApplication webApplication) {
CsrfPreventionRequestCycleListener listener = new CsrfPreventionRequestCycleListener();
listener.setConflictingOriginAction(props.getConflictingOriginAction());
listener.setErrorCode(props.getErrorCode());
listener.setErrorMessage(props.getErrorMessage());
listener.setNoOriginAction(props.getNoOriginAction());
for (String acceptedOrigin : props.getAcceptedOrigins()) {
listener.addAcceptedOrigin(acceptedOrigin);
}
webApplication.getRequestCycleListeners().add(listener);
wicketEndpointRepository.add(new WicketAutoConfig.Builder(this.getClass())
.withDetail("properties", props)
.build());
}
示例9: createTester
import org.apache.wicket.protocol.http.WebApplication; //导入依赖的package包/类
private WicketTester createTester(){
WicketTester tester = new WicketTester(new WebApplication() {
@Override
public Class<? extends Page> getHomePage() {
return null;
}
}){
@Override
protected String createPageMarkup(String componentId) {
return "<div class=\"pagination pagination-small pagination-right\" wicket:id=\"paginator\">"+
"</div>";
}
};
return tester;
}
示例10: notify
import org.apache.wicket.protocol.http.WebApplication; //导入依赖的package包/类
public static void notify(AjaxRequestTarget target, String message, String notificationFunction) {
final String contextPath = WebApplication.get().getServletContext().getContextPath();
// Das hier ist etwas tricky: die Javascript-Module für die schicke Meldungsanzeige
// über PNotify müssen in den Body und nicht in den Header. Wir dürfen aber keine
// Annahme darüber treffen, ob die Module im Body der aktuellen Page bereits drin
// stecken. Insbesondere modale Dialoge sind direkt von DMDWebPage abgeleitet und
// erhalten keine Body-Bestandteile über irgend ein Basis-HTML. Deswegen laden wir
// die Skripte über eine enstrechende jQuery-Funktion dynamisch nach. Das Auslösen
// der eigentlichen Benachrichtigung erfolgt dann als Callback, den jQuery nach dem
// vollständigen Laden der Skripte aufruft. Der Code ist nach den Beispielen auf
// http://api.jquery.com/jQuery.getScript/ gebaut.
String escapedMessage = message.replace("'", "\\'").replace("\"", """);
String script = "$.getScript('" + contextPath + "/js/add-ons/jquery.pnotify.js', function() {" + //
" $.getScript('" + contextPath + "/js/add-ons/dmd.notifier.js', function() { " + //
" Notifier." + notificationFunction + "('" + escapedMessage + "');" + //
" });" + //
"});";
target.appendJavaScript(script);
}
示例11: loadDomainRegistry
import org.apache.wicket.protocol.http.WebApplication; //导入依赖的package包/类
private DomainRegistry<DomainObjectReference> loadDomainRegistry() {
// Wicket's development mode allows to reload classes at runtime, so in that mode
// we must not cache any data structures which depend on class structures. The
// domain registry prototypes are such a candidate.
if (WebApplication.get().getConfigurationType() == RuntimeConfigurationType.DEVELOPMENT)
return constructDomainRegistry();
synchronized (DMDWebGenPageContext.class) {
String domainClassName = page.getDefaultModelObject().getClass().getName();
DomainRegistry<DomainObjectReference> registry = domainRegistryPrototypes.get(domainClassName);
if (registry == null) {
registry = constructDomainRegistry();
domainRegistryPrototypes.put(domainClassName, registry);
return registry;
} else {
// Construct a new DomainRegistry from an existing prototype rather than from
// traversing the domain class structure. Creation from prototype is much faster.
return registry.replicate(page.getDefaultModelObject());
}
}
}
示例12: getDomainClassReference
import org.apache.wicket.protocol.http.WebApplication; //导入依赖的package包/类
public static DomainClassReference getDomainClassReference(Class<?> domainClass, boolean runtime) {
// Wicket's development mode allows to reload classes at runtime, so in that mode
// we must not cache any data structures which depend on class structures. The
// DomainClassReference cache is such a candidate.
if (!runtime || WebApplication.get().getConfigurationType() == RuntimeConfigurationType.DEVELOPMENT) {
return new DomainClassReference(domainClass);
}
synchronized (DomainClassReferenceFactory.class) {
String domainClassName = domainClass.getName();
DomainClassReference ref = domainClassReferenceCache.get(domainClassName);
if (ref == null) {
ref = new DomainClassReference(domainClass);
domainClassReferenceCache.put(domainClassName, ref);
}
return ref;
}
}
示例13: install
import org.apache.wicket.protocol.http.WebApplication; //导入依赖的package包/类
/**
* Install Leaflet with given settings to application.
* If application already has Leaflet installed, it ignores new settings.
*
* @param application application, which Leaflet should be bounded to.
* @param settings custom settings, which are used to initialized library
* @throws IllegalArgumentException if application is {@code null}.
*/
public static void install(WebApplication application, LeafletSettings settings) {
// install Leaflet.js with given configuration
Args.notNull(application, "application");
if (application.getMetaData(LEAFLET_SETTINGS_KEY) == null) {
LeafletSettings settingsOrDefault = settings != null ? settings : new DefaultLeafletSettings();
application.setMetaData(LEAFLET_SETTINGS_KEY, settingsOrDefault);
if (settingsOrDefault.autoAppendResources()) {
application.getComponentInstantiationListeners().add(new LeafletResourceAppender());
}
if (settingsOrDefault.useWebJars()) {
WicketWebjars.install(application);
}
}
}
示例14: createWebApp
import org.apache.wicket.protocol.http.WebApplication; //导入依赖的package包/类
private WebApplication createWebApp(final LeafletSettings settings, final boolean installLeaflets) {
return new WebApplication() {
@Override
protected void init() {
super.init();
if (installLeaflets) {
if (settings == null) {
Leaflet.install(this);
} else {
Leaflet.install(this, settings);
}
}
}
@Override
public Class<? extends Page> getHomePage() {
return Page.class;
}
};
}
示例15: createApplication
import org.apache.wicket.protocol.http.WebApplication; //导入依赖的package包/类
/**
* Creates new web application instance with installed Leaflet library.
* Application is configured by overriding different methods in this class,
* e.g. you can configure Leaflet by overriding {@link #getSettings() } method.
*
* @return new web application instace with installed Leaflet.
*/
private WebApplication createApplication() {
final LeafletSettings settings = getSettings();
return new WebApplication() {
@Override
protected void init() {
super.init();
// create based on settings
Leaflet.install(this, settings);
// execute children init setup
AbstractLeafletTest.this.init(this);
}
@Override
public Class<? extends Page> getHomePage() {
return AbstractLeafletTest.this.getHomePage();
}
};
}