documents.html 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <!--
  2. /*
  3. * Licensed to the Apache Software Foundation (ASF) under one or more
  4. * contributor license agreements. See the NOTICE file distributed with
  5. * this work for additional information regarding copyright ownership.
  6. * The ASF licenses this file to You under the Apache License, Version 2.0
  7. * (the "License"); you may not use this file except in compliance with
  8. * the License. You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing, software
  13. * distributed under the License is distributed on an "AS IS" BASIS,
  14. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. * See the License for the specific language governing permissions and
  16. * limitations under the License.
  17. */
  18. -->
  19. <div id="documents" class="clearfix">
  20. <div id="form">
  21. <form>
  22. <label for="qt">
  23. <a rel="help">Request-Handler (qt)</a>
  24. </label>
  25. <input ng-model="handler" type="text" id="qt" value="/update" title="Request handler in solrconfig.xml.">
  26. <label for="document-type">
  27. <a rel="help">Document Type</a>
  28. </label>
  29. <div><select ng-model="type" id="document-type" ng-change="changeDocumentType()" placeholder="The type of the document field">
  30. <!-- TODO: support the Builder -->
  31. <option value="csv">CSV</option>
  32. <option value="wizard">Document Builder</option>
  33. <option value="upload">File Upload</option>
  34. <option value="json">JSON</option>
  35. <option value="solr">Solr Command (raw XML or JSON)</option>
  36. <option value="xml">XML</option>
  37. </select>
  38. </div>
  39. <div id="document-container">
  40. <div id="wizard" ng-show="type=='wizard'">
  41. <div id="wizard-fields">
  42. <div><span class="description">Field</span>: <select ng-model="fieldName" id="wiz-field-select" name="wiz-field-select"
  43. ng-options="field for field in fields"></select>
  44. </div>
  45. <div><span id="wiz-field-data"><span class="description">Field Data</span>:</span>
  46. <textarea ng-model="fieldData"
  47. id="wizard-doc"
  48. name="wizard-doc"
  49. rows="10"
  50. cols="40"
  51. placeholder="Enter your field text here and then click 'Add Field' to add the field to the document.">
  52. </textarea>
  53. </div>
  54. </div>
  55. <div id="wizard-add"><a ng-click="addWizardField()" id="add-field-href"><img border="0" src="./img/ico/plus-button.png"/>Add
  56. Field</a></div>
  57. </div>
  58. <label for="document">
  59. <a rel="help">Document(s)</a>
  60. </label>
  61. <textarea ng-show="type!='upload'" ng-model="document" name="document" id="document" title="The Document" rows="10"
  62. cols="70" placeholder="{{placeholder}}"></textarea>
  63. <div id="file-upload" ng-show="type=='upload'">
  64. <input type="file" id="the-file" name="the-file" file-model="fileUpload"/>
  65. </div>
  66. </div>
  67. <div id="advanced">
  68. <!-- TODO: only show for JSON/XML-->
  69. <div id="attribs">
  70. <div id="upload-only" ng-show="type=='upload'">
  71. <label for="erh-params"><!-- TODO: cleaner way to do this? -->
  72. <a rel="help">Extracting Req. Handler Params</a>
  73. </label>
  74. <input ng-model="literalParams" type="text" id="erh-params" value="&literal.id=change.me"
  75. title="Extracting Request Handler Parameters" size="50">
  76. </div>
  77. <div id="general-attribs">
  78. <label for="commitWithin">
  79. <a rel="help">Commit Within</a>
  80. </label>
  81. <input type="text" ng-model="commitWithin" id="commitWithin" value="1000" title="Commit Within (ms)">
  82. <label for="overwrite">
  83. <a rel="help">Overwrite</a>
  84. </label>
  85. <input ng-model="overwrite" type="text" id="overwrite" value="true" title="Overwrite">
  86. </div>
  87. </div>
  88. </div>
  89. <button type="submit" ng-click="submit()" id="submit">Submit Document</button>
  90. </form>
  91. </div>
  92. <div id="result">
  93. <div id="response" ng-show="response">
  94. <div>
  95. <span class="description">Status: </span>{{ responseStatus }}
  96. </div>
  97. <div>
  98. <span class="description">Response:</span>
  99. <pre class="syntax language-json"><code ng-bind-html="response | highlight:'json' | unsafe"></code></pre>
  100. </div>
  101. </div>
  102. </div>
  103. </div>