Package org.geoserver.config

Examples of org.geoserver.config.SettingsInfo


            final SettingsInfo deserInfo) throws IllegalAccessException, InvocationTargetException {
        if (geoServer == null || deserInfo == null)
            throw new IllegalArgumentException("Wrong passed arguments are null");

        // get local instance
        final SettingsInfo info = geoServer.getSettings();

        // overwrite all members
        BeanUtils.copyProperties(info, deserInfo);

        final WorkspaceInfo workspace = info.getWorkspace();
        if (workspace != null) {
            info.setWorkspace(CatalogUtils.localizeWorkspace(workspace, geoServer.getCatalog()));
        }

        final ContactInfo contact = info.getContact();
        if (contact != null) {
            info.setContact(localizeContactInfo(geoServer, contact));
        }

        return info;
    }
View Full Code Here


         * @throws SAXException
         *             For any errors.
         */
        protected void handleServiceProvider() {
            start("ows:ServiceProvider");
            SettingsInfo settings = wcs.getGeoServer().getSettings();
            element("ows:ProviderName", settings.getContact().getContactOrganization());
            AttributesImpl attributes = new AttributesImpl();
            attributes.addAttribute("", "xlink:href", "xlink:href", "",
                settings.getOnlineResource() != null ? settings.getOnlineResource() : "");
            element("ows:ProviderSite", null, attributes);

            handleContact();

            end("ows:ServiceProvider");
View Full Code Here

    public void addSettings(String workspace, GeoServer geoServer) {
        WorkspaceInfo ws = workspace != null ?
            geoServer.getCatalog().getWorkspaceByName(workspace) : null;

        GeoServerInfo global = geoServer.getGlobal();
        SettingsInfo settings = ws != null ? geoServer.getSettings(ws) : global.getSettings();
        if (settings == null) {
            settings = geoServer.getFactory().createSettings();
        }
        settings.setWorkspace(ws);
        settings.getContact().setContactPerson("Andrea Aime");
        settings.setNumDecimals(8);
        settings.setOnlineResource("http://geoserver.org");
        settings.setVerbose(false);
        settings.setVerboseExceptions(false);
        settings.setLocalWorkspaceIncludesPrefix(false);

        if (ws != null) {
            if (settings.getId() != null) {
                geoServer.save(settings);
            }
            else {
                geoServer.add(settings);
            }
View Full Code Here

import static org.junit.Assert.*;

public class ResponseUtilsTest {

    void createAppContext(String proxyBaseUrl) {
        SettingsInfo settings = createNiceMock(SettingsInfo.class);
        expect(settings.getProxyBaseUrl()).andReturn(proxyBaseUrl).anyTimes();
        replay(settings);
       
        GeoServer geoServer = createNiceMock(GeoServer.class);
        expect(geoServer.getSettings()).andReturn(settings).anyTimes();
        replay(geoServer);
View Full Code Here

    public static MetadataMap loadMapfromWorkSpace(String workspaceName, Catalog catalog) {
       WorkspaceInfo wsInfo = catalog.getWorkspaceByName(workspaceName);
       // If the WorkSpace is present, then the associated MetadataMap is selected
       if(wsInfo != null){
           GeoServer gs = GeoServerExtensions.bean(GeoServer.class);
           SettingsInfo info = gs.getSettings(wsInfo);
           MetadataMap map = info != null ? info.getMetadata() : null;
           return map;
       }
       return null;
    }
View Full Code Here

     */
    public static MetadataMap loadMapFromGlobal() {
       GeoServerInfo gsInfo = GeoServerExtensions.bean(GeoServer.class).getGlobal();
       // Global info should be always not null
       if(gsInfo != null){
           SettingsInfo info = gsInfo.getSettings();
           MetadataMap map = info != null ? info.getMetadata() : null;
           return map;
       }
       return null;
    }
View Full Code Here

    public void init() {
        login();
        citeWorkspace = getCatalog().getWorkspaceByName(MockData.CITE_PREFIX);
       
        GeoServer gs = getGeoServer();
        SettingsInfo s = gs.getSettings(citeWorkspace);
        if (s != null) {
            gs.remove(s);
        }
        NamespaceInfo citeNS = getCatalog().getNamespaceByPrefix(MockData.CITE_PREFIX);
        citeNS.setURI(MockData.CITE_URI);
View Full Code Here

    }
   
    @Test
    public void testLocalworkspaceRemovePrefix() throws Exception {
        GeoServer gs = getGeoServer();
        SettingsInfo settings = gs.getFactory().createSettings();
        settings.setLocalWorkspaceIncludesPrefix(true);
        settings.setWorkspace(citeWorkspace);
        gs.add(settings);

        assertNotNull(gs.getSettings(citeWorkspace));
        tester.startPage(new WorkspaceEditPage(citeWorkspace));
        tester.assertRenderedPage(WorkspaceEditPage.class);

        FormTester form = tester.newFormTester("form");
        form.setValue("settings:settingsContainer:otherSettings:localWorkspaceIncludesPrefix", false);
        form.submit();

        assertEquals(false, settings.isLocalWorkspaceIncludesPrefix());
    }
View Full Code Here

    }

    @Test
    public void testDisableSettings() throws Exception {
        GeoServer gs = getGeoServer();
        SettingsInfo settings = gs.getFactory().createSettings();
        settings.setProxyBaseUrl("http://foo.org");
        settings.setWorkspace(citeWorkspace);
        gs.add(settings);

        assertNotNull(gs.getSettings(citeWorkspace));
        tester.startPage(new WorkspaceEditPage(citeWorkspace));
        tester.assertRenderedPage(WorkspaceEditPage.class);
View Full Code Here

         */
        private void handleContact() {
            final GeoServer gs = wcs.getGeoServer();
            String tmp = "";

            SettingsInfo settings = gs.getSettings();
            ContactInfo contact = settings.getContact();

            if (((contact != null) && (contact.getContactPerson() != "")) ||
                ((contact.getContactOrganization() != null) && (contact.getContactOrganization() != ""))) {
                start("wcs:responsibleParty");

View Full Code Here

TOP

Related Classes of org.geoserver.config.SettingsInfo

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.