"Fossies" - the Fresh Open Source Software Archive

Member "geoserver-2.17.2/user/rest/appschema.html" (20 Jul 2020, 32444 Bytes) of package /linux/www/geoserver-2.17.2-htmldoc.zip:


The requested HTML page contains a <FORM> tag that is unusable on "Fossies" in "automatic" (rendered) mode so that page is shown as HTML source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    2   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    3 <html xmlns="http://www.w3.org/1999/xhtml" lang="en-US" xml:lang="en-US">
    4 <head>
    5   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    6   
    7   <title>Uploading an app-schema mapping file &mdash; GeoServer 2.17.2 User Manual</title>
    8   <link rel="stylesheet" href="../_static/blueprint/screen.css" type="text/css" media="screen, projection" />
    9   <link rel="stylesheet" href="../_static/blueprint/print.css" type="text/css" media="print" /> 
   10   <!--[if IE]>
   11   <link rel="stylesheet" href="../_static/blueprint/ie.css" type="text/css" media="screen, projection" />
   12   <![endif]-->
   13   <link rel="stylesheet" href="../_static/default.css" type="text/css" />
   14   <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
   15   <script type="text/javascript">
   16     var DOCUMENTATION_OPTIONS = {
   17         URL_ROOT:    '../',
   18         VERSION:     '2.17.2',
   19         COLLAPSE_MODINDEX: false,
   20         FILE_SUFFIX: '.html'
   21     };
   22   </script>
   23   <script type="text/javascript" src="../_static/jquery.js"></script>
   24   <script type="text/javascript" src="../_static/doctools.js"></script>
   25   <script type="text/javascript" src="../_static/searchtools.js"></script>
   26   <script type="text/javascript" src="../searchindex.js"></script>
   27   <link rel="shortcut icon" href="../_static/geoserver.ico"/>
   28       <link rel="search" title="Search" href="../search.html" />
   29       <link rel="top" title="GeoServer 2.17.2 User Manual" href="../index.html" />
   30       <link rel="up" title="REST" href="index.html" />
   31       <link rel="next" title="REST configuration API reference" href="api/index.html" />
   32       <link rel="prev" title="Uploading a new image mosaic" href="imagemosaic.html" />
   33 </head>
   34 <body class="rest/appschema">
   35   <div id="header" class="selfclear">
   36     <div class="wrap selfclear">
   37       <div id="logo"><a href="../index.html">GeoServer 2.17.2 User Manual</a></div>
   38       <ul id="top-nav">
   39         <li class="first"><a href="http://geoserver.org/about">About</a></li>
   40         <li><a href="http://blog.geoserver.org/">Blog</a></li>
   41         <li><a href="http://geoserver.org/download">Download</a></li>
   42         <!--<li><a href="../index.html">Documentation</a></li>-->
   43       </ul>
   44         <form id="quick-search" action="../search.html" method="get">
   45           <fieldset>
   46             <input type="hidden" name="check_keywords" value="yes" />
   47             <input type="hidden" name="area" value="default" />
   48             <input id="quick-search-query" type="text" name="q" accessKey="q" name="searchQuery.queryString" size="25" value="Search Documentation&hellip;" size="20" tabindex="3" onblur="if(this.value=='') this.value='Search Documentation&hellip;';" onfocus="if(this.value=='Search Documentation&hellip;') this.value='';" />
   49             <input id="quick-search-submit" type="image" value="Search" src="../_static/chrome/search_icon_green.png" />
   50           </fieldset>
   51         </form>
   52     </div><!-- /.wrap -->
   53   </div><!-- /#header -->
   54   <div id="main">
   55     <div class="wrap selfclear">
   56       <div id="content-left" class="content-border"></div>
   57       <div id="content">
   58 <ul id="breadcrumbs">
   59   
   60   <li><a href="../index.html">GeoServer 2.17.2 User Manual</a> &raquo;</li>
   61   <li><a href="index.html" accesskey="U">REST</a> &raquo;</li>
   62   <li>Uploading an app-schema mapping file</li>
   63 </ul>
   64 <ul id="relatedlinks" class="selfclear">
   65   <li class="first">
   66     <a href="../py-modindex.html" title="Python Module Index"
   67        accesskey="">modules</a></li>
   68   <li>
   69     <a href="api/index.html" title="REST configuration API reference"
   70        accesskey="N">next</a>|</li>
   71   <li>
   72     <a href="imagemosaic.html" title="Uploading a new image mosaic"
   73        accesskey="P">previous</a>|</li>
   74 </ul>
   75         
   76   <div class="section" id="uploading-an-app-schema-mapping-file">
   77 <span id="rest-app-schema"></span><h1>Uploading an app-schema mapping file<a class="headerlink" href="#uploading-an-app-schema-mapping-file" title="Permalink to this headline"></a></h1>
   78 <p><strong>Create a new app-schema store and update the feature type mappings of an existing app-schema store by uploading a mapping configuration file</strong></p>
   79 <div class="admonition note" id="appschema-upload-create">
   80 <p class="admonition-title">Note</p>
   81 <p>The following request uploads an app-schema mapping file called <code class="docutils literal notranslate"><span class="pre">LandCoverVector.xml</span></code> to a data store called <code class="docutils literal notranslate"><span class="pre">LandCoverVector</span></code>. If no <code class="docutils literal notranslate"><span class="pre">LandCoverVector</span></code> data store existed in workspace <code class="docutils literal notranslate"><span class="pre">lcv</span></code> prior to the request, it would be created.</p>
   82 </div>
   83 <p><em>Request</em></p>
   84 <div class="admonition-curl admonition">
   85 <p class="admonition-title">curl</p>
   86 <div class="highlight-default notranslate"><div class="highlight"><pre><span></span>curl -v -X PUT -d @LandCoverVector.xml -H &quot;Content-Type: text/xml&quot;
   87 -u admin:geoserver http://localhost:8080/geoserver/rest/workspaces/lcv/datastores/LandCoverVector/file.appschema?configure=all
   88 </pre></div>
   89 </div>
   90 </div>
   91 <p><em>Response</em></p>
   92 <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="mi">201</span> <span class="n">Created</span>
   93 </pre></div>
   94 </div>
   95 </div>
   96 <div class="section" id="listing-app-schema-store-details">
   97 <h1>Listing app-schema store details<a class="headerlink" href="#listing-app-schema-store-details" title="Permalink to this headline"></a></h1>
   98 <p><em>Request</em></p>
   99 <div class="admonition-curl admonition">
  100 <p class="admonition-title">curl</p>
  101 <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">curl</span> <span class="o">-</span><span class="n">v</span> <span class="o">-</span><span class="n">u</span> <span class="n">admin</span><span class="p">:</span><span class="n">geoserver</span> <span class="o">-</span><span class="n">X</span> <span class="n">GET</span>
  102 <span class="n">http</span><span class="p">:</span><span class="o">//</span><span class="n">localhost</span><span class="p">:</span><span class="mi">8080</span><span class="o">/</span><span class="n">geoserver</span><span class="o">/</span><span class="n">rest</span><span class="o">/</span><span class="n">workspaces</span><span class="o">/</span><span class="n">lcv</span><span class="o">/</span><span class="n">datastores</span><span class="o">/</span><span class="n">LandCoverVector</span><span class="o">.</span><span class="n">xml</span>
  103 </pre></div>
  104 </div>
  105 </div>
  106 <p><em>Response</em></p>
  107 <div class="highlight-xml notranslate"><div class="highlight"><pre><span></span><span class="nt">&lt;dataStore&gt;</span>
  108   <span class="nt">&lt;name&gt;</span>LandCoverVector<span class="nt">&lt;/name&gt;</span>
  109   <span class="nt">&lt;type&gt;</span>Application Schema DataAccess<span class="nt">&lt;/type&gt;</span>
  110   <span class="nt">&lt;enabled&gt;</span>true<span class="nt">&lt;/enabled&gt;</span>
  111   <span class="nt">&lt;workspace&gt;</span>
  112     <span class="nt">&lt;name&gt;</span>lcv<span class="nt">&lt;/name&gt;</span>
  113     <span class="nt">&lt;atom:link</span> <span class="na">xmlns:atom=</span><span class="s">&quot;http://www.w3.org/2005/Atom&quot;</span> <span class="na">rel=</span><span class="s">&quot;alternate&quot;</span> <span class="na">href=</span><span class="s">&quot;http://localhost:8080/geoserver/rest/workspaces/lcv.xml&quot;</span> <span class="na">type=</span><span class="s">&quot;application/xml&quot;</span><span class="nt">/&gt;</span>
  114   <span class="nt">&lt;/workspace&gt;</span>
  115   <span class="nt">&lt;connectionParameters&gt;</span>
  116     <span class="nt">&lt;entry</span> <span class="na">key=</span><span class="s">&quot;dbtype&quot;</span><span class="nt">&gt;</span>app-schema<span class="nt">&lt;/entry&gt;</span>
  117     <span class="nt">&lt;entry</span> <span class="na">key=</span><span class="s">&quot;namespace&quot;</span><span class="nt">&gt;</span>http://inspire.ec.europa.eu/schemas/lcv/3.0<span class="nt">&lt;/entry&gt;</span>
  118     <span class="nt">&lt;entry</span> <span class="na">key=</span><span class="s">&quot;url&quot;</span><span class="nt">&gt;</span>file:/path/to/data_dir/data/lcv/LandCoverVector/LandCoverVector.appschema<span class="nt">&lt;/entry&gt;</span>
  119   <span class="nt">&lt;/connectionParameters&gt;</span>
  120   <span class="nt">&lt;__default&gt;</span>false<span class="nt">&lt;/__default&gt;</span>
  121   <span class="nt">&lt;featureTypes&gt;</span>
  122     <span class="nt">&lt;atom:link</span> <span class="na">xmlns:atom=</span><span class="s">&quot;http://www.w3.org/2005/Atom&quot;</span> <span class="na">rel=</span><span class="s">&quot;alternate&quot;</span> <span class="na">href=</span><span class="s">&quot;http://localhost:8080/geoserver/rest/workspaces/lcv/datastores/LandCoverVector/featuretypes.xml&quot;</span> <span class="na">type=</span><span class="s">&quot;application/xml&quot;</span><span class="nt">/&gt;</span>
  123   <span class="nt">&lt;/featureTypes&gt;</span>
  124 <span class="nt">&lt;/dataStore&gt;</span>
  125 </pre></div>
  126 </div>
  127 </div>
  128 <div class="section" id="uploading-a-new-app-schema-mapping-configuration-file">
  129 <h1>Uploading a new app-schema mapping configuration file<a class="headerlink" href="#uploading-a-new-app-schema-mapping-configuration-file" title="Permalink to this headline"></a></h1>
  130 <p><strong>Upload a new mapping configuration, stored in the mapping file “`LandCoverVector_alternative.xml”, to the “LandCoverVector” data store</strong></p>
  131 <p><em>Request</em></p>
  132 <div class="admonition-curl admonition">
  133 <p class="admonition-title">curl</p>
  134 <div class="highlight-default notranslate"><div class="highlight"><pre><span></span>curl -v -X PUT -d @LandCoverVector_alternative.xml -H &quot;Content-Type: text/xml&quot;
  135   -u admin:geoserver http://localhost:8080/geoserver/rest/workspaces/lcv/datastores/LandCoverVector/file.appschema?configure=none
  136 </pre></div>
  137 </div>
  138 </div>
  139 <p><em>Response</em></p>
  140 <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="mi">200</span> <span class="n">OK</span>
  141 </pre></div>
  142 </div>
  143 <div class="admonition note">
  144 <p class="admonition-title">Note</p>
  145 <p>This time the <code class="docutils literal notranslate"><span class="pre">configure</span></code> parameter is set to <code class="docutils literal notranslate"><span class="pre">none</span></code>, because we don’t want to configure again the feature types, just replace their mapping configuration.</p>
  146 </div>
  147 <div class="admonition note">
  148 <p class="admonition-title">Note</p>
  149 <p>If the set of feature types mapped in the new configuration file differs from the set of feature types mapped in the old one (either some are missing, or some are new, or both), the best way to proceed is to delete the data store and create it anew issuing another PUT request, <a class="reference internal" href="#appschema-upload-create"><span class="std std-ref">as shown above</span></a>.</p>
  150 </div>
  151 </div>
  152 <div class="section" id="uploading-multiple-app-schema-mapping-files">
  153 <h1>Uploading multiple app-schema mapping files<a class="headerlink" href="#uploading-multiple-app-schema-mapping-files" title="Permalink to this headline"></a></h1>
  154 <p><strong>Create a new app-schema data store based on a complex mapping configuration split into multiple files, and show how to upload application schemas (i.e. XSD files) along with the mapping configuration.</strong></p>
  155 <div class="admonition note">
  156 <p class="admonition-title">Note</p>
  157 <p>In the previous example, we have seen how to create a new app-schema data store by uploading a mapping configuration stored in a single file; this time, things are more complicated, since the mappings have been spread over two configuration files: the main configuration file is called <code class="docutils literal notranslate"><span class="pre">geosciml.appschema</span></code> and contains the mappings for three feature types: <code class="docutils literal notranslate"><span class="pre">GeologicUnit</span></code>, <code class="docutils literal notranslate"><span class="pre">MappedFeature</span></code> and <code class="docutils literal notranslate"><span class="pre">GeologicEvent</span></code>; the second file is called <code class="docutils literal notranslate"><span class="pre">cgi_termvalue.xml</span></code> and contains the mappings for a single non-feature type, <code class="docutils literal notranslate"><span class="pre">CGI_TermValue</span></code>.</p>
  158 </div>
  159 <div class="admonition note">
  160 <p class="admonition-title">Note</p>
  161 <p>As explained in the <a class="reference internal" href="api/datastores.html#rest-api-datastores-file-put-appschema"><span class="std std-ref">REST API reference documentation for data stores</span></a>, when the mapping configuration is spread over multiple files, the extension of the main configuration file must be <code class="docutils literal notranslate"><span class="pre">.appschema</span></code>.</p>
  162 </div>
  163 <p>The main configuration file includes the second file:</p>
  164 <div class="highlight-xml notranslate"><div class="highlight"><pre><span></span>...
  165 <span class="nt">&lt;includedTypes&gt;</span>
  166   <span class="nt">&lt;Include&gt;</span>cgi_termvalue.xml<span class="nt">&lt;/Include&gt;</span>
  167 <span class="nt">&lt;/includedTypes&gt;</span>
  168 ...
  169 </pre></div>
  170 </div>
  171 <p>We also want to upload to GeoServer the schemas required to define the mapping, instead of having GeoServer retrieve them from the internet (which is especially useful in case our server doesn’t have access to the web). The main schema is called <code class="docutils literal notranslate"><span class="pre">geosciml.xsd</span></code> and is referred to in <code class="docutils literal notranslate"><span class="pre">geosciml.appschema</span></code> as such:</p>
  172 <div class="highlight-xml notranslate"><div class="highlight"><pre><span></span>...
  173 <span class="nt">&lt;targetTypes&gt;</span>
  174   <span class="nt">&lt;FeatureType&gt;</span>
  175     <span class="nt">&lt;schemaUri&gt;</span>geosciml.xsd<span class="nt">&lt;/schemaUri&gt;</span>
  176   <span class="nt">&lt;/FeatureType&gt;</span>
  177 <span class="nt">&lt;/targetTypes&gt;</span>
  178 ...
  179 </pre></div>
  180 </div>
  181 <p>In this case, the main schema depends on several other schemas:</p>
  182 <div class="highlight-xml notranslate"><div class="highlight"><pre><span></span><span class="nt">&lt;include</span> <span class="na">schemaLocation=</span><span class="s">&quot;geologicUnit.xsd&quot;</span><span class="nt">/&gt;</span>
  183 <span class="nt">&lt;include</span> <span class="na">schemaLocation=</span><span class="s">&quot;borehole.xsd&quot;</span><span class="nt">/&gt;</span>
  184 <span class="nt">&lt;include</span> <span class="na">schemaLocation=</span><span class="s">&quot;vocabulary.xsd&quot;</span><span class="nt">/&gt;</span>
  185 <span class="nt">&lt;include</span> <span class="na">schemaLocation=</span><span class="s">&quot;geologicRelation.xsd&quot;</span><span class="nt">/&gt;</span>
  186 <span class="nt">&lt;include</span> <span class="na">schemaLocation=</span><span class="s">&quot;fossil.xsd&quot;</span><span class="nt">/&gt;</span>
  187 <span class="nt">&lt;include</span> <span class="na">schemaLocation=</span><span class="s">&quot;value.xsd&quot;</span><span class="nt">/&gt;</span>
  188 <span class="nt">&lt;include</span> <span class="na">schemaLocation=</span><span class="s">&quot;geologicFeature.xsd&quot;</span><span class="nt">/&gt;</span>
  189 <span class="nt">&lt;include</span> <span class="na">schemaLocation=</span><span class="s">&quot;geologicAge.xsd&quot;</span><span class="nt">/&gt;</span>
  190 <span class="nt">&lt;include</span> <span class="na">schemaLocation=</span><span class="s">&quot;earthMaterial.xsd&quot;</span><span class="nt">/&gt;</span>
  191 <span class="nt">&lt;include</span> <span class="na">schemaLocation=</span><span class="s">&quot;collection.xsd&quot;</span><span class="nt">/&gt;</span>
  192 <span class="nt">&lt;include</span> <span class="na">schemaLocation=</span><span class="s">&quot;geologicStructure.xsd&quot;</span><span class="nt">/&gt;</span>
  193 </pre></div>
  194 </div>
  195 <p>They don’t need to be listed in the <code class="docutils literal notranslate"><span class="pre">targetTypes</span></code> section of the mapping configuration, but they must be included in the ZIP archive that will be uploaded.</p>
  196 <div class="admonition note">
  197 <p class="admonition-title">Note</p>
  198 <p>The GeoSciML schemas listed above, as pretty much any application schema out there, reference the base GML schemas (notably, <code class="docutils literal notranslate"><span class="pre">http://schemas.opengis.net/gml/3.1.1/base/gml.xsd</span></code>) and a few other remotely hosted schemas (e.g. <code class="docutils literal notranslate"><span class="pre">http://www.geosciml.org/cgiutilities/1.0/xsd/cgiUtilities.xsd</span></code>).
  199 For the example to work in a completely offline environment, one would have to either replace all remote references with local ones, or pre-populate the app-schema cache with a copy of the remote schemas. <a class="reference internal" href="../data/app-schema/app-schema-resolution.html#app-schema-cache"><span class="std std-ref">GeoServer’s user manual</span></a> contains more information on the app-schema cache.</p>
  200 </div>
  201 <p>To summarize, we’ll upload to GeoServer a ZIP archive with the following contents:</p>
  202 <div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">geosciml.appschema      # main mapping file</span>
  203 <span class="go">cgi_termvalue.xml       # secondary mapping file</span>
  204 <span class="go">geosciml.xsd            # main schema</span>
  205 <span class="go">borehole.xsd</span>
  206 <span class="go">collection.xsd</span>
  207 <span class="go">earthMaterial.xsd</span>
  208 <span class="go">fossil.xsd</span>
  209 <span class="go">geologicAge.xsd</span>
  210 <span class="go">geologicFeature.xsd</span>
  211 <span class="go">geologicRelation.xsd</span>
  212 <span class="go">geologicStructure.xsd</span>
  213 <span class="go">geologicUnit.xsd</span>
  214 <span class="go">value.xsd</span>
  215 <span class="go">vocabulary.xsd</span>
  216 </pre></div>
  217 </div>
  218 <p><em>Request</em></p>
  219 <div class="admonition-curl admonition">
  220 <p class="admonition-title">curl</p>
  221 <div class="highlight-default notranslate"><div class="highlight"><pre><span></span>curl -X PUT --data-binary @geosciml.zip -H &quot;Content-Type: application/zip&quot;
  222 -u admin:geoserver http://localhost:8080/geoserver/rest/workspaces/gsml/datastores/geosciml/file.appschema?configure=all
  223 </pre></div>
  224 </div>
  225 </div>
  226 <p><em>Response</em></p>
  227 <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="mi">200</span> <span class="n">OK</span>
  228 </pre></div>
  229 </div>
  230 <p>A new <code class="docutils literal notranslate"><span class="pre">geosciml</span></code> data store will be created with three feature types in it:</p>
  231 <div class="highlight-xml notranslate"><div class="highlight"><pre><span></span><span class="nt">&lt;featureTypes&gt;</span>
  232   <span class="nt">&lt;featureType&gt;</span>
  233     <span class="nt">&lt;name&gt;</span>MappedFeature<span class="nt">&lt;/name&gt;</span>
  234     <span class="nt">&lt;atom:link</span> <span class="na">xmlns:atom=</span><span class="s">&quot;http://www.w3.org/2005/Atom&quot;</span> <span class="na">rel=</span><span class="s">&quot;alternate&quot;</span> <span class="na">href=</span><span class="s">&quot;http://localhost:8080/geoserver/rest/workspaces/gsml/datastores/geosciml/featuretypes/MappedFeature.xml&quot;</span> <span class="na">type=</span><span class="s">&quot;application/xml&quot;</span><span class="nt">/&gt;</span>
  235   <span class="nt">&lt;/featureType&gt;</span>
  236   <span class="nt">&lt;featureType&gt;</span>
  237     <span class="nt">&lt;name&gt;</span>GeologicEvent<span class="nt">&lt;/name&gt;</span>
  238     <span class="nt">&lt;atom:link</span> <span class="na">xmlns:atom=</span><span class="s">&quot;http://www.w3.org/2005/Atom&quot;</span> <span class="na">rel=</span><span class="s">&quot;alternate&quot;</span> <span class="na">href=</span><span class="s">&quot;http://localhost:8080/geoserver/rest/workspaces/gsml/datastores/geosciml/featuretypes/GeologicEvent.xml&quot;</span> <span class="na">type=</span><span class="s">&quot;application/xml&quot;</span><span class="nt">/&gt;</span>
  239   <span class="nt">&lt;/featureType&gt;</span>
  240   <span class="nt">&lt;featureType&gt;</span>
  241     <span class="nt">&lt;name&gt;</span>GeologicUnit<span class="nt">&lt;/name&gt;</span>
  242     <span class="nt">&lt;atom:link</span> <span class="na">xmlns:atom=</span><span class="s">&quot;http://www.w3.org/2005/Atom&quot;</span> <span class="na">rel=</span><span class="s">&quot;alternate&quot;</span> <span class="na">href=</span><span class="s">&quot;http://localhost:8080/geoserver/rest/workspaces/gsml/datastores/geosciml/featuretypes/GeologicUnit.xml&quot;</span> <span class="na">type=</span><span class="s">&quot;application/xml&quot;</span><span class="nt">/&gt;</span>
  243   <span class="nt">&lt;/featureType&gt;</span>
  244 <span class="nt">&lt;/featureTypes&gt;</span>
  245 </pre></div>
  246 </div>
  247 </div>
  248 <div class="section" id="cleaning-schemas-on-internal-mongodb-stores">
  249 <h1>Cleaning schemas on internal MongoDB stores<a class="headerlink" href="#cleaning-schemas-on-internal-mongodb-stores" title="Permalink to this headline"></a></h1>
  250 <p><strong>Clean persisted schema on an internal MongoDB Store, allowing it to generate a new one from data.</strong></p>
  251 <p><em>Request template</em></p>
  252 <div class="admonition-curl admonition">
  253 <p class="admonition-title">curl</p>
  254 <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">curl</span> <span class="o">-</span><span class="n">v</span> <span class="o">-</span><span class="n">X</span> <span class="n">POST</span>
  255   <span class="o">-</span><span class="n">u</span> <span class="n">admin</span><span class="p">:</span><span class="n">geoserver</span> <span class="n">http</span><span class="p">:</span><span class="o">//</span><span class="n">localhost</span><span class="p">:</span><span class="mi">8080</span><span class="o">/</span><span class="n">geoserver</span><span class="o">/</span><span class="n">rest</span><span class="o">/</span><span class="n">workspaces</span><span class="o">/</span><span class="p">{</span><span class="n">WORKSPACE</span><span class="p">}</span><span class="o">/</span><span class="n">appschemastores</span><span class="o">/</span><span class="p">{</span><span class="n">APP_SCHEMA_STORE_NAME</span><span class="p">}</span><span class="o">/</span><span class="n">datastores</span><span class="o">/</span><span class="p">{</span><span class="n">INTERNAL_STORE_ID</span><span class="p">}</span><span class="o">/</span><span class="n">cleanSchemas</span>
  256 </pre></div>
  257 </div>
  258 </div>
  259 <p><em>Request</em></p>
  260 <div class="admonition-curl admonition">
  261 <p class="admonition-title">curl</p>
  262 <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">curl</span> <span class="o">-</span><span class="n">v</span> <span class="o">-</span><span class="n">X</span> <span class="n">POST</span>
  263   <span class="o">-</span><span class="n">u</span> <span class="n">admin</span><span class="p">:</span><span class="n">geoserver</span> <span class="n">http</span><span class="p">:</span><span class="o">//</span><span class="n">localhost</span><span class="p">:</span><span class="mi">8080</span><span class="o">/</span><span class="n">geoserver</span><span class="o">/</span><span class="n">rest</span><span class="o">/</span><span class="n">workspaces</span><span class="o">/</span><span class="n">st</span><span class="o">/</span><span class="n">appschemastores</span><span class="o">/</span><span class="n">AppSchemaStoreName</span><span class="o">/</span><span class="n">datastores</span><span class="o">/</span><span class="n">store_id</span><span class="o">/</span><span class="n">cleanSchemas</span>
  264 </pre></div>
  265 </div>
  266 </div>
  267 <p><em>Response</em></p>
  268 <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="mi">200</span> <span class="n">OK</span>
  269 </pre></div>
  270 </div>
  271 <p><strong>Clean persisted schema on all internal MongoDB Stores, allowing it to generate them from data.</strong></p>
  272 <p><em>Request template</em></p>
  273 <div class="admonition-curl admonition">
  274 <p class="admonition-title">curl</p>
  275 <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">curl</span> <span class="o">-</span><span class="n">v</span> <span class="o">-</span><span class="n">X</span> <span class="n">POST</span>
  276   <span class="o">-</span><span class="n">u</span> <span class="n">admin</span><span class="p">:</span><span class="n">geoserver</span> <span class="n">http</span><span class="p">:</span><span class="o">//</span><span class="n">localhost</span><span class="p">:</span><span class="mi">8080</span><span class="o">/</span><span class="n">geoserver</span><span class="o">/</span><span class="n">rest</span><span class="o">/</span><span class="n">workspaces</span><span class="o">/</span><span class="p">{</span><span class="n">WORKSPACE</span><span class="p">}</span><span class="o">/</span><span class="n">appschemastores</span><span class="o">/</span><span class="p">{</span><span class="n">APP_SCHEMA_STORE_NAME</span><span class="p">}</span><span class="o">/</span><span class="n">cleanSchemas</span>
  277 </pre></div>
  278 </div>
  279 </div>
  280 <p><em>Request</em></p>
  281 <div class="admonition-curl admonition">
  282 <p class="admonition-title">curl</p>
  283 <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">curl</span> <span class="o">-</span><span class="n">v</span> <span class="o">-</span><span class="n">X</span> <span class="n">POST</span>
  284   <span class="o">-</span><span class="n">u</span> <span class="n">admin</span><span class="p">:</span><span class="n">geoserver</span> <span class="n">http</span><span class="p">:</span><span class="o">//</span><span class="n">localhost</span><span class="p">:</span><span class="mi">8080</span><span class="o">/</span><span class="n">geoserver</span><span class="o">/</span><span class="n">rest</span><span class="o">/</span><span class="n">workspaces</span><span class="o">/</span><span class="n">st</span><span class="o">/</span><span class="n">appschemastores</span><span class="o">/</span><span class="n">AppSchemaStoreName</span><span class="o">/</span><span class="n">cleanSchemas</span>
  285 </pre></div>
  286 </div>
  287 </div>
  288 <p><em>Response</em></p>
  289 <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="mi">200</span> <span class="n">OK</span>
  290 </pre></div>
  291 </div>
  292 <p><strong>Rebuild persisted schema on internal MongoDB Store, allowing it to generate them from data and query parameters.</strong></p>
  293 <p><em>Request template</em></p>
  294 <div class="admonition-curl admonition">
  295 <p class="admonition-title">curl</p>
  296 <div class="highlight-default notranslate"><div class="highlight"><pre><span></span>curl -v -X POST
  297   -u admin:geoserver http://localhost:8080/geoserver/rest/workspaces/{WORKSPACE}/appschemastores/{APP_SCHEMA_STORE_NAME}/datastores/{INTERNAL_STORE_ID}/rebuildMongoSchemas?ids={ID_1},{ID_2}&amp;max={MAX_OBJECTS}
  298 </pre></div>
  299 </div>
  300 </div>
  301 <ul class="simple">
  302 <li><p>ids: Comma separated MongoDB JSON objects ids to query for generating schemas.  Not required if the ‘max’ is setted.</p></li>
  303 <li><p>max: Max number of MongoDB JSON objects to get for generating schemas.  Not required if the ‘ids’ is setted.</p></li>
  304 </ul>
  305 <p><em>Request</em></p>
  306 <div class="admonition-curl admonition">
  307 <p class="admonition-title">curl</p>
  308 <div class="highlight-default notranslate"><div class="highlight"><pre><span></span>curl -v -X POST
  309   -u admin:geoserver http://localhost:8080/geoserver/rest/workspaces/st/appschemastores/AppSchemaStoreName/datastores/store_id/rebuildMongoSchemas?ids=58e5889ce4b02461ad5af081,58e5889ce4b02461ad5af080&amp;max=5
  310 </pre></div>
  311 </div>
  312 </div>
  313 <p><em>Response</em></p>
  314 <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="mi">200</span> <span class="n">OK</span>
  315 </pre></div>
  316 </div>
  317 <p><strong>Rebuild persisted schema on all internal MongoDB Stores, allowing it to generate them from data and query parameters.</strong></p>
  318 <p><em>Request template</em></p>
  319 <div class="admonition-curl admonition">
  320 <p class="admonition-title">curl</p>
  321 <div class="highlight-default notranslate"><div class="highlight"><pre><span></span>curl -v -X POST
  322   -u admin:geoserver http://localhost:8080/geoserver/rest/workspaces/{WORKSPACE}/appschemastores/{APP_SCHEMA_STORE_NAME}/rebuildMongoSchemas?ids={ID_1},{ID_2}&amp;max={MAX_OBJECTS}
  323 </pre></div>
  324 </div>
  325 </div>
  326 <ul class="simple">
  327 <li><p>ids: Comma separated MongoDB JSON objects ids to query for generating schemas.  Not required if the ‘max’ is setted.</p></li>
  328 <li><p>max: Max number of MongoDB JSON objects to get for generating schemas.  Not required if the ‘ids’ is setted.</p></li>
  329 </ul>
  330 <p><em>Request</em></p>
  331 <div class="admonition-curl admonition">
  332 <p class="admonition-title">curl</p>
  333 <div class="highlight-default notranslate"><div class="highlight"><pre><span></span>curl -v -X POST
  334   -u admin:geoserver http://localhost:8080/geoserver/rest/workspaces/st/appschemastores/AppSchemaStoreName/rebuildMongoSchemas?ids=58e5889ce4b02461ad5af081,58e5889ce4b02461ad5af080&amp;max=5
  335 </pre></div>
  336 </div>
  337 </div>
  338 <p><em>Response</em></p>
  339 <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="mi">200</span> <span class="n">OK</span>
  340 </pre></div>
  341 </div>
  342 <div class="admonition note">
  343 <p class="admonition-title">Note</p>
  344 <p>This endpoins are only available when App-Schema and MongoDB modules are installed on Geoserver, and involved app-schema store have internal MongoDB stores in mappings definition.</p>
  345 </div>
  346 </div>
  347 
  348 
  349       <div class="selfclear pagination-nav">
  350           <div class="leftwise"><strong>Previous</strong>: <a href="imagemosaic.html" title="previous chapter">Uploading a new image mosaic</a></div>
  351           <div class="rightwise"><strong>Next</strong>: <a href="api/index.html" title="next chapter">REST configuration API reference</a></div>
  352       </div>
  353       </div><!-- /#content> -->
  354       <div id="content-right" class="content-border"></div>
  355   <div id="sidebar" class="contrast">
  356       <div id="toc" class="section">
  357         <h3 class="pngfix">Table Of Contents</h3>
  358         <ul>
  359 <li><a class="reference internal" href="#">Uploading an app-schema mapping file</a></li>
  360 <li><a class="reference internal" href="#listing-app-schema-store-details">Listing app-schema store details</a></li>
  361 <li><a class="reference internal" href="#uploading-a-new-app-schema-mapping-configuration-file">Uploading a new app-schema mapping configuration file</a></li>
  362 <li><a class="reference internal" href="#uploading-multiple-app-schema-mapping-files">Uploading multiple app-schema mapping files</a></li>
  363 <li><a class="reference internal" href="#cleaning-schemas-on-internal-mongodb-stores">Cleaning schemas on internal MongoDB stores</a></li>
  364 </ul>
  365 
  366         <div class="section-footer"></div>
  367       </div>
  368         <div class="section">
  369           <h3>Continue Reading</h3>
  370           <ul>
  371             <li>Previous: <a href="imagemosaic.html" title="previous chapter">Uploading a new image mosaic</a></li>
  372             <li>Next: <a href="api/index.html" title="next chapter">REST configuration API reference</a></li>
  373           </ul>
  374         </div>
  375         <div class="section">
  376         <h3>This Page</h3>
  377         <ul class="this-page-menu">
  378                 
  379         <li><a href="https://github.com/geoserver/geoserver/tree/master/doc/en/user/source/rest/appschema.rst">Edit</a></li>
  380         </ul>
  381         </div>
  382   </div><!-- /#sidebar -->
  383   </div><!-- /.wrap> -->
  384 </div><!-- /#main -->
  385 <div id="footer">
  386   <div class="wrap">
  387     &copy; Copyright 2020, Open Source Geospatial Foundation. License <a href="http://creativecommons.org/licenses/by/3.0/">Creative Commons Attribution</a>.
  388     Last updated on Jul 20, 2020.
  389     Created using <a href="http://sphinx.pocoo.org/">Sphinx</a>.
  390   </div><!-- /.wrap> -->
  391 </div><!-- /#footer -->
  392   </body>
  393 </html>