当前位置: 首页>>代码示例>>Java>>正文


Java WebApplication类代码示例

本文整理汇总了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"));
}
 
开发者ID:bptlab,项目名称:Unicorn,代码行数:22,代码来源:ImageModel.java

示例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());
	
}
 
开发者ID:MarcGiffing,项目名称:wicket-spring-boot,代码行数:21,代码来源:DataStoreRedisConfig.java

示例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());

}
 
开发者ID:MarcGiffing,项目名称:wicket-spring-boot,代码行数:17,代码来源:DataStoreHazelcastConfig.java

示例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());
}
 
开发者ID:MarcGiffing,项目名称:wicket-spring-boot,代码行数:21,代码来源:DataStoreCassandraConfig.java

示例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 ) );

}
 
开发者ID:MarcGiffing,项目名称:wicket-spring-boot,代码行数:18,代码来源:ShiroSecurityConfig.java

示例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());
	
}
 
开发者ID:MarcGiffing,项目名称:wicket-spring-boot,代码行数:20,代码来源:MarkupSettingsConfig.java

示例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());
}
 
开发者ID:MarcGiffing,项目名称:wicket-spring-boot,代码行数:22,代码来源:StoreSettingsConfig.java

示例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());
}
 
开发者ID:MarcGiffing,项目名称:wicket-spring-boot,代码行数:17,代码来源:CsrfAttacksPreventionConfig.java

示例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;
}
 
开发者ID:premium-minds,项目名称:pm-wicket-utils,代码行数:18,代码来源:BootstrapPaginatorTest.java

示例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("\"", "&quot;");
        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);
    }
 
开发者ID:Nocket,项目名称:nocket,代码行数:22,代码来源:Notifier.java

示例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());
        }
    }
}
 
开发者ID:Nocket,项目名称:nocket,代码行数:22,代码来源:DMDWebGenPageContext.java

示例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;
    }
}
 
开发者ID:Nocket,项目名称:nocket,代码行数:19,代码来源:DomainClassReferenceFactory.java

示例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);
        }
    }
}
 
开发者ID:DrunkenPandaFans,项目名称:wicket-leaflet,代码行数:26,代码来源:Leaflet.java

示例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;
        }
    };
}
 
开发者ID:DrunkenPandaFans,项目名称:wicket-leaflet,代码行数:22,代码来源:LeafletTest.java

示例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();
        }
    };
}
 
开发者ID:DrunkenPandaFans,项目名称:wicket-leaflet,代码行数:28,代码来源:AbstractLeafletTest.java


注:本文中的org.apache.wicket.protocol.http.WebApplication类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。