private void buildConfig(DataTypeCollection type, DocumentmanagerConfig.Builder documentConfigBuilder, Set<DataType> built) { for (DataType dataType : type.getTypes()) { if (built.contains(dataType)) continue; built.add(dataType); if (dataType instanceof TemporaryStructuredDataType) continue; if ((dataType.getId() < 0) || (dataType.getId()> DataType.lastPredefinedDataTypeId())) { Datatype.Builder dataTypeBuilder = new Datatype.Builder(); documentConfigBuilder.datatype(dataTypeBuilder); buildConfig(dataType, dataTypeBuilder); } } }
private Builder enablecompression(String __value) { return enablecompression(Boolean.valueOf(__value)); }
public DocumentmanagerConfig.Builder produce(DocumentModel model, DocumentmanagerConfig.Builder documentConfigBuilder) { documentConfigBuilder.enablecompression(false); Set<DataType> handled = new HashSet<>(); for(NewDocumentType documentType : model.getDocumentManager().getTypes()) { buildConfig(documentType, documentConfigBuilder, handled); buildConfig(documentType.getAnnotations(), documentConfigBuilder); if ( documentType != VespaDocumentType.INSTANCE) { DocumentmanagerConfig.Datatype.Builder dataTypeBuilder = new DocumentmanagerConfig.Datatype.Builder(); documentConfigBuilder.datatype(dataTypeBuilder); buildConfig(documentType, dataTypeBuilder); } } return documentConfigBuilder; }
public static DocumentmanagerConfig.Builder getDocumentManagerConfig(List<String> sds) { return new DocumentManager().produce(getSearchBuilder(sds).getModel(), new DocumentmanagerConfig.Builder()); }
private Builder override(Builder __superior) { if (__superior.enablecompression != null) enablecompression(__superior.enablecompression); if (!__superior.datatype.isEmpty()) datatype.addAll(__superior.datatype); if (!__superior.annotationtype.isEmpty()) annotationtype.addAll(__superior.annotationtype); return this; }
private void buildConfig(Collection<AnnotationType> types, DocumentmanagerConfig.Builder builder) { for (AnnotationType type : types) { DocumentmanagerConfig.Annotationtype.Builder atb = new DocumentmanagerConfig.Annotationtype.Builder(); buildConfig(type, atb); builder.annotationtype(atb); } }
public Builder(DocumentmanagerConfig config) { enablecompression(config.enablecompression()); for (Datatype d : config.datatype()) { datatype(new Datatype.Builder(d)); } for (Annotationtype a : config.annotationtype()) { annotationtype(new Annotationtype.Builder(a)); } }
@Override public void getConfig(DocumentmanagerConfig.Builder builder) { if (containerDocproc != null && containerDocproc.isCompressDocuments()) builder.enablecompression(true); }