Search in sources :

Example 1 with OrchidRootExternalIndex

use of com.eden.orchid.impl.indexing.OrchidRootExternalIndex in project Orchid by JavaEden.

the class OrchidGenerators method buildExternalIndex.

private void buildExternalIndex() {
    this.externalIndex = new OrchidRootExternalIndex();
    JSONElement externalIndexReferences = context.query("options.data.externalIndex");
    if (OrchidUtils.elementIsArray(externalIndexReferences)) {
        JSONArray externalIndex = (JSONArray) externalIndexReferences.getElement();
        for (int i = 0; i < externalIndex.length(); i++) {
            JSONObject indexJson = this.orchidResources.loadAdditionalFile(externalIndex.getString(i));
            if (indexJson != null) {
                OrchidIndex index = OrchidIndex.fromJSON(context, indexJson);
                this.externalIndex.addChildIndex(index);
            }
        }
    }
}
Also used : OrchidRootExternalIndex(com.eden.orchid.impl.indexing.OrchidRootExternalIndex) JSONElement(com.eden.common.json.JSONElement) JSONObject(org.json.JSONObject) JSONArray(org.json.JSONArray) OrchidIndex(com.eden.orchid.api.indexing.OrchidIndex)

Aggregations

JSONElement (com.eden.common.json.JSONElement)1 OrchidIndex (com.eden.orchid.api.indexing.OrchidIndex)1 OrchidRootExternalIndex (com.eden.orchid.impl.indexing.OrchidRootExternalIndex)1 JSONArray (org.json.JSONArray)1 JSONObject (org.json.JSONObject)1