Package org.geoserver.config

Examples of org.geoserver.config.GeoServer


     *
     * @throws Exception
     */
    @Test
    public void testPrefixedGetStrictCite() throws Exception {
        GeoServer geoServer = getGeoServer();
        WFSInfo service = geoServer.getService(WFSInfo.class);
        try {
            service.setCiteCompliant(true);
            geoServer.save(service);
           
            final QName typeName = CiteTestData.POLYGONS;
            String path = "ows?service=WFS&version=1.1.0&request=DescribeFeatureType&typeName="
                    + getLayerId(typeName);
            Document doc = getAsDOM(path);
            //print(doc);
            assertEquals("xsd:schema", doc.getDocumentElement().getNodeName());
        } finally {
            service.setCiteCompliant(false);
            geoServer.save(service);
        }
    }
View Full Code Here


        initer = new WPSInitializer(execMgr, procMgr, cleaner);
    }

    @Test
    public void testNoSave() throws Exception {
        GeoServer gs = createMock(GeoServer.class);

        List<ConfigurationListener> listeners = new ArrayList();
        gs.addListener(capture(listeners));
        expectLastCall().atLeastOnce();

        //load all process groups so there is no call to save
        List<ProcessGroupInfo> procGroups = WPSInitializer.lookupProcessGroups();

        WPSInfo wps = createNiceMock(WPSInfo.class);
        expect(wps.getProcessGroups()).andReturn(procGroups).anyTimes();
        replay(wps);
       
        expect(gs.getService(WPSInfo.class)).andReturn(wps).anyTimes();
        replay(gs);

        initer.initialize(gs);

        assertEquals(1, listeners.size());
View Full Code Here

    }

    @Test
    public void testSingleSave() throws Exception {
       
        GeoServer gs = createMock(GeoServer.class);

        List<ConfigurationListener> listeners = new ArrayList();
        gs.addListener(capture(listeners));
        expectLastCall().atLeastOnce();

        //empty list should cause save
        List<ProcessGroupInfo> procGroups = new ArrayList();

        WPSInfo wps = createNiceMock(WPSInfo.class);
        expect(wps.getProcessGroups()).andReturn(procGroups).anyTimes();
        replay(wps);
       
        expect(gs.getService(WPSInfo.class)).andReturn(wps).anyTimes();
        gs.save(wps);
        expectLastCall().once();
        replay(gs);

        initer.initialize(gs);
View Full Code Here

         *
         * @param wcs
         *            the service.
         */
        protected void handleContact() {
            final GeoServer gs = wcs.getGeoServer();
            start("ows:ServiceContact");

            ContactInfo contact = gs.getSettings().getContact();
            elementIfNotEmpty("ows:IndividualName", contact.getContactPerson());
            elementIfNotEmpty("ows:PositionName", contact.getContactPosition());

            start("ows:ContactInfo");
            start("ows:Phone");
            elementIfNotEmpty("ows:Voice", contact.getContactVoice());
            elementIfNotEmpty("ows:Facsimile", contact.getContactFacsimile());
            end("ows:Phone");
            start("ows:Address");
            elementIfNotEmpty("ows:DeliveryPoint", contact.getAddress());
            elementIfNotEmpty("ows:City", contact.getAddressCity());
            elementIfNotEmpty("ows:AdministrativeArea", contact.getAddressState());
            elementIfNotEmpty("ows:PostalCode", contact.getAddressPostalCode());
            elementIfNotEmpty("ows:Country", contact.getAddressCountry());
            elementIfNotEmpty("ows:ElectronicMailAddress", contact.getContactEmail());
            end("ows:Address");

            String or = gs.getSettings().getOnlineResource();
            if ((or != null) && !"".equals(or.trim())) {
                AttributesImpl attributes = new AttributesImpl();
                attributes.addAttribute("", "xlink:href", "xlink:href", "", or);
                start("ows:OnlineResource", attributes);
                end("OnlineResource");
View Full Code Here

        @Override
        protected Object load() {
            Collection<WorkspaceInfo> workspaces = (Collection<WorkspaceInfo>) wsModel.getObject();

            GeoServer gs = getGeoServer();
            for (Iterator<WorkspaceInfo> it = workspaces.iterator(); it.hasNext();) {
                if (gs.getService(it.next(), getServiceClass()) == null) {
                    it.remove();
                }
            }
            return workspaces;
        }
View Full Code Here

        form.add(new ContactPanel("contact", contactModel));
        form.add(new Button("submit") {
            @Override
            public void onSubmit() {
                GeoServer gs = (GeoServer)geoServerModel.getObject();
                GeoServerInfo global = gs.getGlobal();
                global.setContact((ContactInfo)contactModel.getObject());
                gs.save(global);
                doReturn();
            }
        });
        form.add(new Button("cancel") {
            @Override
View Full Code Here

        form.add(new CheckBox("allowNativeWarp"));

        Button submit = new Button("submit", new StringResourceModel("submit", this, null)) {
            @Override
            public void onSubmit() {
                GeoServer gs = (GeoServer) geoServerModel.getObject();
                GeoServerInfo global = gs.getGlobal();
                global.setJAI( (JAIInfo)jaiModel.getObject());
                gs.save( global );
                doReturn();
            }
        };
        form.add(submit);
       
View Full Code Here

//        return "/DEFAULT_LOGGING.properties";
//    }
    
    @Test
    public void testContextStartup() {
        GeoServer config = (GeoServer) applicationContext.getBean("geoServer");
        assertNotNull(config.getCatalog().getFeatureTypeByName(MockData.BUILDINGS.getNamespaceURI(), MockData.BUILDINGS.getLocalPart()));
        assertNotNull(config.getCatalog().getFeatureTypeByName(MockData.BASIC_POLYGONS.getNamespaceURI(), MockData.BASIC_POLYGONS.getLocalPart()));
    }
View Full Code Here

        form.add(extensions);
       
        Button submit = new Button("submit", new StringResourceModel("submit", this, null)) {
            @Override
            public void onSubmit() {
                GeoServer gs = getGeoServer();
                gs.save( (GeoServerInfo) globalInfoModel.getObject() );
                gs.save( (LoggingInfo) loggingInfoModel.getObject() );
                doReturn();
            }
        };
        form.add(submit);
       
View Full Code Here

*/
public class GeoServerHomePage extends GeoServerBasePage {

    @SuppressWarnings({ "rawtypes", "unchecked" })
    public GeoServerHomePage() {
        GeoServer gs = getGeoServer();
        ContactInfo contact = gs.getGlobal().getSettings().getContact();

        //add some contact info
        add(new ExternalLink("contactURL", contact.getOnlineResource())
            .add( new Label("contactName", contact.getContactOrganization())));
        {
View Full Code Here

TOP

Related Classes of org.geoserver.config.GeoServer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.