/* * This is part of Geomajas, a GIS framework, http://www.geomajas.org/. * * Copyright 2008-2015 Geosparc nv, http://www.geosparc.com/, Belgium. * * The program is available in open source according to the GNU Affero * General Public License. All contributions in this program are covered * by the Geomajas Contributors License Agreement. For full licensing * details, see LICENSE.txt in the project root. */ package org.geomajas.gwt.example.client.security; import com.google.gwt.core.client.GWT; import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.layout.HLayout; import com.smartgwt.client.widgets.layout.VLayout; import org.geomajas.gwt.client.controller.PanController; import org.geomajas.gwt.client.widget.MapWidget; import org.geomajas.gwt.example.base.SamplePanel; import org.geomajas.gwt.example.base.SamplePanelFactory; import org.geomajas.gwt.example.client.i18n.ShowcaseMessages; /** * <p> * Sample that tests security on feature level by using filters. * </p> * * @author Pieter De Graef */ public class FilterSecuritySample extends SamplePanel { public static final String TITLE = "FilterSecurity"; private static final ShowcaseMessages MESSAGES = GWT.create(ShowcaseMessages.class); public static final SamplePanelFactory FACTORY = new SamplePanelFactory() { public SamplePanel createPanel() { return new FilterSecuritySample(); } }; @Override public Canvas getViewPanel() { final VLayout layout = new VLayout(); layout.setMembersMargin(10); layout.setWidth100(); layout.setHeight100(); // Map with ID duisburgMap is defined in the XML configuration. (mapDuisburg.xml) final VLayout mapLayout = new VLayout(); mapLayout.setShowEdges(true); mapLayout.setHeight("60%"); MapWidget map = new MapWidget("mapVectorSecurity", "gwtExample"); map.setController(new PanController(map)); mapLayout.addMember(map); // Create horizontal layout for login buttons: HLayout buttonLayout = new HLayout(); buttonLayout.setMembersMargin(10); buttonLayout.addMember(new UserLoginButton("jan")); buttonLayout.addMember(new UserLoginButton("luc")); layout.addMember(mapLayout); layout.addMember(buttonLayout); return layout; } @Override public String getDescription() { return MESSAGES.filterSecurityDescription(); } @Override public String[] getConfigurationFiles() { return new String[] { "WEB-INF/security.xml", "WEB-INF/mapVectorSecurity.xml", "classpath:org/geomajas/gwt/example/base/layerCountries110m2.xml", "classpath:org/geomajas/gwt/example/base/layerWmsBluemarble.xml" }; } @Override public String ensureUserLoggedIn() { return "luc"; } }