Search in sources :

Example 1 with ContentPropertyValue

use of org.alfresco.solr.client.ContentPropertyValue in project SearchServices by Alfresco.

the class LoadAFTSTestData method loadMntTestData.

public static void loadMntTestData() throws Exception {
    SolrCore core = h.getCore();
    properties19 = new HashMap<QName, PropertyValue>();
    properties19.put(ContentModel.PROP_NAME, new StringPropertyValue("Test.hello.txt"));
    n19NodeRef = new NodeRef(new StoreRef("workspace", "SpacesStore"), createGUID());
    n19QName = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "nineteen");
    n19CAR = new ChildAssociationRef(ContentModel.ASSOC_CONTAINS, rootNodeRef, n19QName, n19NodeRef, true, 0);
    addNode(core, dataModel, 1, 19, 1, ContentModel.TYPE_CONTENT, null, properties19, null, "system", new ChildAssociationRef[] { n19CAR }, new NodeRef[] { rootNodeRef }, new String[] { "/" + n19QName.toString() }, n19NodeRef, true);
    properties20 = new HashMap<QName, PropertyValue>();
    properties20.put(ContentModel.PROP_NAME, new StringPropertyValue("Test1.hello.txt"));
    n20NodeRef = new NodeRef(new StoreRef("workspace", "SpacesStore"), createGUID());
    n20QName = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "twenty");
    n20CAR = new ChildAssociationRef(ContentModel.ASSOC_CONTAINS, rootNodeRef, n20QName, n20NodeRef, true, 0);
    addNode(core, dataModel, 1, 20, 1, ContentModel.TYPE_CONTENT, null, properties20, null, "system", new ChildAssociationRef[] { n20CAR }, new NodeRef[] { rootNodeRef }, new String[] { "/" + n20QName.toString() }, n20NodeRef, true);
    properties21 = new HashMap<QName, PropertyValue>();
    properties21.put(ContentModel.PROP_NAME, new StringPropertyValue("one_two_three.txt"));
    n21NodeRef = new NodeRef(new StoreRef("workspace", "SpacesStore"), createGUID());
    n21QName = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "twentyone");
    n21CAR = new ChildAssociationRef(ContentModel.ASSOC_CONTAINS, rootNodeRef, n21QName, n21NodeRef, true, 0);
    addNode(core, dataModel, 1, 21, 1, ContentModel.TYPE_CONTENT, null, properties21, null, "system", new ChildAssociationRef[] { n21CAR }, new NodeRef[] { rootNodeRef }, new String[] { "/" + n21QName.toString() }, n21NodeRef, true);
    properties22 = new HashMap<QName, PropertyValue>();
    properties22.put(ContentModel.PROP_NAME, new StringPropertyValue("one_two_four.txt"));
    n22NodeRef = new NodeRef(new StoreRef("workspace", "SpacesStore"), createGUID());
    n22QName = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "twnetytwo");
    n22CAR = new ChildAssociationRef(ContentModel.ASSOC_CONTAINS, rootNodeRef, n22QName, n22NodeRef, true, 0);
    addNode(core, dataModel, 1, 22, 1, ContentModel.TYPE_CONTENT, null, properties22, null, "system", new ChildAssociationRef[] { n22CAR }, new NodeRef[] { rootNodeRef }, new String[] { "/" + n22QName.toString() }, n22NodeRef, true);
    properties23 = new HashMap<QName, PropertyValue>();
    properties23.put(ContentModel.PROP_NAME, new StringPropertyValue("one_two.txt"));
    n23NodeRef = new NodeRef(new StoreRef("workspace", "SpacesStore"), createGUID());
    n23QName = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "twentythree");
    n23CAR = new ChildAssociationRef(ContentModel.ASSOC_CONTAINS, rootNodeRef, n23QName, n23NodeRef, true, 0);
    addNode(core, dataModel, 1, 23, 1, ContentModel.TYPE_CONTENT, null, properties23, null, "system", new ChildAssociationRef[] { n23CAR }, new NodeRef[] { rootNodeRef }, new String[] { "/" + n23QName.toString() }, n23NodeRef, true);
    properties24 = new HashMap<QName, PropertyValue>();
    properties24.put(ContentModel.PROP_NAME, new StringPropertyValue("Print-Toolkit-3204-The-Print-Toolkit-has-a-new-look-565022.html"));
    n24NodeRef = new NodeRef(new StoreRef("workspace", "SpacesStore"), createGUID());
    n24QName = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "twentyfour");
    n24CAR = new ChildAssociationRef(ContentModel.ASSOC_CONTAINS, rootNodeRef, n24QName, n24NodeRef, true, 0);
    addNode(core, dataModel, 1, 24, 1, ContentModel.TYPE_CONTENT, null, properties24, null, "system", new ChildAssociationRef[] { n24CAR }, new NodeRef[] { rootNodeRef }, new String[] { "/" + n24QName.toString() }, n24NodeRef, true);
    properties25 = new HashMap<QName, PropertyValue>();
    properties25.put(ContentModel.PROP_NAME, new StringPropertyValue("Print-Toolkitf-3204-The-Print-Toolkit-has-a-new-look-565022.html"));
    n25NodeRef = new NodeRef(new StoreRef("workspace", "SpacesStore"), createGUID());
    n25QName = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "twentyfive");
    n25CAR = new ChildAssociationRef(ContentModel.ASSOC_CONTAINS, rootNodeRef, n25QName, n25NodeRef, true, 0);
    addNode(core, dataModel, 1, 25, 1, ContentModel.TYPE_CONTENT, null, properties25, null, "system", new ChildAssociationRef[] { n25CAR }, new NodeRef[] { rootNodeRef }, new String[] { "/" + n25QName.toString() }, n25NodeRef, true);
    properties26 = new HashMap<QName, PropertyValue>();
    properties26.put(ContentModel.PROP_NAME, new StringPropertyValue("apple pear peach 20150911100000.txt"));
    n26NodeRef = new NodeRef(new StoreRef("workspace", "SpacesStore"), createGUID());
    n26QName = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "twentysix");
    n26CAR = new ChildAssociationRef(ContentModel.ASSOC_CONTAINS, rootNodeRef, n26QName, n26NodeRef, true, 0);
    addNode(core, dataModel, 1, 26, 1, ContentModel.TYPE_CONTENT, null, properties26, null, "system", new ChildAssociationRef[] { n26CAR }, new NodeRef[] { rootNodeRef }, new String[] { "/" + n26QName.toString() }, n26NodeRef, true);
    properties27 = new HashMap<QName, PropertyValue>();
    properties27.put(ContentModel.PROP_NAME, new StringPropertyValue("Craig.txt"));
    properties27.put(ContentModel.PROP_CONTENT, new ContentPropertyValue(Locale.UK, 0l, "UTF-8", "text/plain", null));
    content27 = new HashMap<QName, String>();
    content27.put(ContentModel.PROP_CONTENT, "AnalystName Craig");
    n27NodeRef = new NodeRef(new StoreRef("workspace", "SpacesStore"), createGUID());
    n27QName = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "twentyseven");
    n27CAR = new ChildAssociationRef(ContentModel.ASSOC_CONTAINS, rootNodeRef, n27QName, n27NodeRef, true, 0);
    addNode(core, dataModel, 1, 27, 1, ContentModel.TYPE_CONTENT, null, properties27, content27, "system", new ChildAssociationRef[] { n27CAR }, new NodeRef[] { rootNodeRef }, new String[] { "/" + n27QName.toString() }, n27NodeRef, true);
    properties28 = new HashMap<QName, PropertyValue>();
    properties28.put(ContentModel.PROP_NAME, new StringPropertyValue("Scott.txt"));
    properties28.put(ContentModel.PROP_CONTENT, new ContentPropertyValue(Locale.UK, 0l, "UTF-8", "text/plain", null));
    content28 = new HashMap<QName, String>();
    content28.put(ContentModel.PROP_CONTENT, "AnalystName Scott \n Craig");
    n28NodeRef = new NodeRef(new StoreRef("workspace", "SpacesStore"), createGUID());
    n28QName = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "twentyeight");
    n28CAR = new ChildAssociationRef(ContentModel.ASSOC_CONTAINS, rootNodeRef, n28QName, n28NodeRef, true, 0);
    addNode(core, dataModel, 1, 28, 1, ContentModel.TYPE_CONTENT, null, properties28, content28, "system", new ChildAssociationRef[] { n28CAR }, new NodeRef[] { rootNodeRef }, new String[] { "/" + n28QName.toString() }, n28NodeRef, true);
    properties29 = new HashMap<QName, PropertyValue>();
    properties29.put(ContentModel.PROP_NAME, new StringPropertyValue("BASF_2016.txt"));
    n29NodeRef = new NodeRef(new StoreRef("workspace", "SpacesStore"), createGUID());
    n29QName = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "twentynine");
    n29CAR = new ChildAssociationRef(ContentModel.ASSOC_CONTAINS, rootNodeRef, n29QName, n29NodeRef, true, 0);
    addNode(core, dataModel, 1, 29, 1, ContentModel.TYPE_CONTENT, null, properties29, null, "system", new ChildAssociationRef[] { n29CAR }, new NodeRef[] { rootNodeRef }, new String[] { "/" + n29QName.toString() }, n29NodeRef, true);
    properties30 = new HashMap<QName, PropertyValue>();
    properties30.put(ContentModel.PROP_NAME, new StringPropertyValue("BASF_2016(GMT0800).txt"));
    n30NodeRef = new NodeRef(new StoreRef("workspace", "SpacesStore"), createGUID());
    n30QName = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "thirty");
    n30CAR = new ChildAssociationRef(ContentModel.ASSOC_CONTAINS, rootNodeRef, n30QName, n30NodeRef, true, 0);
    addNode(core, dataModel, 1, 30, 1, ContentModel.TYPE_CONTENT, null, properties30, null, "system", new ChildAssociationRef[] { n30CAR }, new NodeRef[] { rootNodeRef }, new String[] { "/" + n30QName.toString() }, n30NodeRef, true);
    properties31 = new HashMap<QName, PropertyValue>();
    properties31.put(ContentModel.PROP_NAME, new StringPropertyValue("BASF_2016-03-08-10-42-19.txt"));
    n31NodeRef = new NodeRef(new StoreRef("workspace", "SpacesStore"), createGUID());
    n31QName = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "thirtyone");
    n31CAR = new ChildAssociationRef(ContentModel.ASSOC_CONTAINS, rootNodeRef, n31QName, n31NodeRef, true, 0);
    addNode(core, dataModel, 1, 31, 1, ContentModel.TYPE_CONTENT, null, properties31, null, "system", new ChildAssociationRef[] { n31CAR }, new NodeRef[] { rootNodeRef }, new String[] { "/" + n31QName.toString() }, n31NodeRef, true);
    properties32 = new HashMap<QName, PropertyValue>();
    properties32.put(ContentModel.PROP_NAME, new StringPropertyValue("BASF_2016 GMT 0800.txt"));
    n32NodeRef = new NodeRef(new StoreRef("workspace", "SpacesStore"), createGUID());
    n32QName = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "thirtytwo");
    n32CAR = new ChildAssociationRef(ContentModel.ASSOC_CONTAINS, rootNodeRef, n32QName, n32NodeRef, true, 0);
    addNode(core, dataModel, 1, 32, 1, ContentModel.TYPE_CONTENT, null, properties32, null, "system", new ChildAssociationRef[] { n32CAR }, new NodeRef[] { rootNodeRef }, new String[] { "/" + n32QName.toString() }, n32NodeRef, true);
}
Also used : StringPropertyValue(org.alfresco.solr.client.StringPropertyValue) NodeRef(org.alfresco.service.cmr.repository.NodeRef) StoreRef(org.alfresco.service.cmr.repository.StoreRef) SolrCore(org.apache.solr.core.SolrCore) QName(org.alfresco.service.namespace.QName) MLTextPropertyValue(org.alfresco.solr.client.MLTextPropertyValue) MultiPropertyValue(org.alfresco.solr.client.MultiPropertyValue) PropertyValue(org.alfresco.solr.client.PropertyValue) StringPropertyValue(org.alfresco.solr.client.StringPropertyValue) ContentPropertyValue(org.alfresco.solr.client.ContentPropertyValue) ChildAssociationRef(org.alfresco.service.cmr.repository.ChildAssociationRef) ContentPropertyValue(org.alfresco.solr.client.ContentPropertyValue)

Example 2 with ContentPropertyValue

use of org.alfresco.solr.client.ContentPropertyValue in project SearchServices by Alfresco.

the class LoadAFTSTestData method loadTestSet.

@BeforeClass
public static void loadTestSet() throws Exception {
    initAlfrescoCore("schema.xml");
    Thread.sleep(1000);
    // Root
    SolrCore core = h.getCore();
    AlfrescoSolrDataModel dataModel = AlfrescoSolrDataModel.getInstance();
    dataModel.getNamespaceDAO().removePrefix("");
    dataModel.setCMDefaultUri();
    rootNodeRef = new NodeRef(new StoreRef("workspace", "SpacesStore"), createGUID());
    addStoreRoot(core, dataModel, rootNodeRef, 1, 1, 1, 1);
    // 1
    n01NodeRef = new NodeRef(new StoreRef("workspace", "SpacesStore"), createGUID());
    n01QName = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "one");
    n01CAR = new ChildAssociationRef(ContentModel.ASSOC_CHILDREN, rootNodeRef, n01QName, n01NodeRef, true, 0);
    addNode(core, dataModel, 1, 2, 1, testSuperType, null, getOrderProperties(), null, "andy", new ChildAssociationRef[] { n01CAR }, new NodeRef[] { rootNodeRef }, new String[] { "/" + n01QName.toString() }, n01NodeRef, true);
    testNodeRef = n01NodeRef;
    // 2
    n02NodeRef = new NodeRef(new StoreRef("workspace", "SpacesStore"), createGUID());
    n02QName = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "two");
    n02CAR = new ChildAssociationRef(ContentModel.ASSOC_CHILDREN, rootNodeRef, n02QName, n02NodeRef, true, 0);
    addNode(core, dataModel, 1, 3, 1, testSuperType, null, getOrderProperties(), null, "bob", new ChildAssociationRef[] { n02CAR }, new NodeRef[] { rootNodeRef }, new String[] { "/" + n02QName.toString() }, n02NodeRef, true);
    // 3
    n03NodeRef = new NodeRef(new StoreRef("workspace", "SpacesStore"), createGUID());
    n03QName = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "three");
    n03CAR = new ChildAssociationRef(ContentModel.ASSOC_CHILDREN, rootNodeRef, n03QName, n03NodeRef, true, 0);
    addNode(core, dataModel, 1, 4, 1, testSuperType, null, getOrderProperties(), null, "cid", new ChildAssociationRef[] { n03CAR }, new NodeRef[] { rootNodeRef }, new String[] { "/" + n03QName.toString() }, n03NodeRef, true);
    // 4
    properties04 = new HashMap<QName, PropertyValue>();
    content04 = new HashMap<QName, String>();
    properties04.putAll(getOrderProperties());
    properties04.put(QName.createQName(TEST_NAMESPACE, "text-indexed-stored-tokenised-atomic"), new StringPropertyValue("TEXT THAT IS INDEXED STORED AND TOKENISED ATOMICALLY KEYONE"));
    properties04.put(QName.createQName(TEST_NAMESPACE, "text-indexed-unstored-tokenised-atomic"), new StringPropertyValue("TEXT THAT IS INDEXED STORED AND TOKENISED ATOMICALLY KEYUNSTORED"));
    properties04.put(QName.createQName(TEST_NAMESPACE, "text-indexed-stored-tokenised-nonatomic"), new StringPropertyValue("TEXT THAT IS INDEXED STORED AND TOKENISED BUT NOT ATOMICALLY KEYTWO"));
    properties04.put(QName.createQName(TEST_NAMESPACE, "int-ista"), new StringPropertyValue("1"));
    properties04.put(QName.createQName(TEST_NAMESPACE, "long-ista"), new StringPropertyValue("2"));
    properties04.put(QName.createQName(TEST_NAMESPACE, "float-ista"), new StringPropertyValue("3.4"));
    properties04.put(QName.createQName(TEST_NAMESPACE, "double-ista"), new StringPropertyValue("5.6"));
    Calendar c = new GregorianCalendar();
    c.setTime(new Date(((new Date().getTime() - 10000))));
    Date testDate = c.getTime();
    ftsTestDate = testDate;
    properties04.put(QName.createQName(TEST_NAMESPACE, "date-ista"), new StringPropertyValue(DefaultTypeConverter.INSTANCE.convert(String.class, testDate)));
    properties04.put(QName.createQName(TEST_NAMESPACE, "datetime-ista"), new StringPropertyValue(DefaultTypeConverter.INSTANCE.convert(String.class, testDate)));
    properties04.put(QName.createQName(TEST_NAMESPACE, "boolean-ista"), new StringPropertyValue(DefaultTypeConverter.INSTANCE.convert(String.class, Boolean.valueOf(true))));
    properties04.put(QName.createQName(TEST_NAMESPACE, "qname-ista"), new StringPropertyValue(DefaultTypeConverter.INSTANCE.convert(String.class, QName.createQName("{wibble}wobble"))));
    properties04.put(QName.createQName(TEST_NAMESPACE, "category-ista"), new StringPropertyValue(DefaultTypeConverter.INSTANCE.convert(String.class, new NodeRef(new StoreRef("proto", "id"), "CategoryId"))));
    properties04.put(QName.createQName(TEST_NAMESPACE, "noderef-ista"), new StringPropertyValue(DefaultTypeConverter.INSTANCE.convert(String.class, n01NodeRef)));
    properties04.put(QName.createQName(TEST_NAMESPACE, "path-ista"), new StringPropertyValue("/" + n03QName.toString()));
    properties04.put(QName.createQName(TEST_NAMESPACE, "locale-ista"), new StringPropertyValue(DefaultTypeConverter.INSTANCE.convert(String.class, Locale.UK)));
    properties04.put(QName.createQName(TEST_NAMESPACE, "period-ista"), new StringPropertyValue(DefaultTypeConverter.INSTANCE.convert(String.class, new Period("period|12"))));
    properties04.put(QName.createQName(TEST_NAMESPACE, "null"), null);
    MultiPropertyValue list_0 = new MultiPropertyValue();
    list_0.addValue(new StringPropertyValue("one"));
    list_0.addValue(new StringPropertyValue("two"));
    properties04.put(QName.createQName(TEST_NAMESPACE, "list"), list_0);
    MLTextPropertyValue mlText = new MLTextPropertyValue();
    mlText.addValue(Locale.ENGLISH, "banana");
    mlText.addValue(Locale.FRENCH, "banane");
    mlText.addValue(Locale.CHINESE, "香蕉");
    mlText.addValue(new Locale("nl"), "banaan");
    mlText.addValue(Locale.GERMAN, "banane");
    mlText.addValue(new Locale("el"), "μπανάνα");
    mlText.addValue(Locale.ITALIAN, "banana");
    mlText.addValue(new Locale("ja"), "バナナ");
    mlText.addValue(new Locale("ko"), "바나나");
    mlText.addValue(new Locale("pt"), "banana");
    mlText.addValue(new Locale("ru"), "банан");
    mlText.addValue(new Locale("es"), "plátano");
    properties04.put(QName.createQName(TEST_NAMESPACE, "ml"), mlText);
    MultiPropertyValue list_1 = new MultiPropertyValue();
    list_1.addValue(new StringPropertyValue("100"));
    list_1.addValue(new StringPropertyValue("anyValueAsString"));
    properties04.put(QName.createQName(TEST_NAMESPACE, "any-many-ista"), list_1);
    MultiPropertyValue list_2 = new MultiPropertyValue();
    list_2.addValue(new ContentPropertyValue(Locale.ENGLISH, 12L, "UTF-16", "text/plain", null));
    properties04.put(QName.createQName(TEST_NAMESPACE, "content-many-ista"), list_2);
    content04.put(QName.createQName(TEST_NAMESPACE, "content-many-ista"), "multicontent");
    MLTextPropertyValue mlText1 = new MLTextPropertyValue();
    mlText1.addValue(Locale.ENGLISH, "cabbage");
    mlText1.addValue(Locale.FRENCH, "chou");
    MLTextPropertyValue mlText2 = new MLTextPropertyValue();
    mlText2.addValue(Locale.ENGLISH, "lemur");
    mlText2.addValue(new Locale("ru"), "лемур");
    MultiPropertyValue list_3 = new MultiPropertyValue();
    list_3.addValue(mlText1);
    list_3.addValue(mlText2);
    properties04.put(QName.createQName(TEST_NAMESPACE, "mltext-many-ista"), list_3);
    MultiPropertyValue list_4 = new MultiPropertyValue();
    list_4.addValue(null);
    properties04.put(QName.createQName(TEST_NAMESPACE, "nullist"), list_4);
    n04NodeRef = new NodeRef(new StoreRef("workspace", "SpacesStore"), createGUID());
    n04QName = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "four");
    n04CAR = new ChildAssociationRef(ContentModel.ASSOC_CHILDREN, rootNodeRef, n04QName, n04NodeRef, true, 0);
    properties04.put(QName.createQName(TEST_NAMESPACE, "aspectProperty"), new StringPropertyValue(""));
    addNode(core, dataModel, 1, 5, 1, testType, new QName[] { testAspect }, properties04, content04, "dave", new ChildAssociationRef[] { n04CAR }, new NodeRef[] { rootNodeRef }, new String[] { "/" + n04QName.toString() }, n04NodeRef, true);
    // 5
    n05NodeRef = new NodeRef(new StoreRef("workspace", "SpacesStore"), createGUID());
    n05QName = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "five");
    n05CAR = new ChildAssociationRef(ContentModel.ASSOC_CONTAINS, n01NodeRef, n05QName, n05NodeRef, true, 0);
    addNode(core, dataModel, 1, 6, 1, testSuperType, null, getOrderProperties(), null, "eoin", new ChildAssociationRef[] { n05CAR }, new NodeRef[] { rootNodeRef, n01NodeRef }, new String[] { "/" + n01QName.toString() + "/" + n05QName.toString() }, n05NodeRef, true);
    // 6
    n06NodeRef = new NodeRef(new StoreRef("workspace", "SpacesStore"), createGUID());
    n06QName = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "six");
    n06CAR = new ChildAssociationRef(ContentModel.ASSOC_CONTAINS, n01NodeRef, n06QName, n06NodeRef, true, 0);
    addNode(core, dataModel, 1, 7, 1, testSuperType, null, getOrderProperties(), null, "fred", new ChildAssociationRef[] { n06CAR }, new NodeRef[] { rootNodeRef, n01NodeRef }, new String[] { "/" + n01QName.toString() + "/" + n06QName.toString() }, n06NodeRef, true);
    // 7
    n07NodeRef = new NodeRef(new StoreRef("workspace", "SpacesStore"), createGUID());
    n07QName = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "seven");
    n07CAR = new ChildAssociationRef(ContentModel.ASSOC_CONTAINS, n02NodeRef, n07QName, n07NodeRef, true, 0);
    addNode(core, dataModel, 1, 8, 1, testSuperType, null, getOrderProperties(), null, "gail", new ChildAssociationRef[] { n07CAR }, new NodeRef[] { rootNodeRef, n02NodeRef }, new String[] { "/" + n02QName.toString() + "/" + n07QName.toString() }, n07NodeRef, true);
    // 8
    n08NodeRef = new NodeRef(new StoreRef("workspace", "SpacesStore"), createGUID());
    n08QName_0 = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "eight-0");
    n08QName_1 = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "eight-1");
    n08QName_2 = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "eight-2");
    n08CAR_0 = new ChildAssociationRef(ContentModel.ASSOC_CHILDREN, rootNodeRef, n08QName_0, n08NodeRef, false, 2);
    n08CAR_1 = new ChildAssociationRef(ContentModel.ASSOC_CONTAINS, n01NodeRef, n08QName_1, n08NodeRef, false, 1);
    n08CAR_2 = new ChildAssociationRef(ContentModel.ASSOC_CONTAINS, n02NodeRef, n08QName_2, n08NodeRef, true, 0);
    addNode(core, dataModel, 1, 9, 1, testSuperType, null, getOrderProperties(), null, "hal", new ChildAssociationRef[] { n08CAR_0, n08CAR_1, n08CAR_2 }, new NodeRef[] { rootNodeRef, rootNodeRef, n01NodeRef, rootNodeRef, n02NodeRef }, new String[] { "/" + n08QName_0, "/" + n01QName.toString() + "/" + n08QName_1.toString(), "/" + n02QName.toString() + "/" + n08QName_2.toString() }, n08NodeRef, true);
    // 9
    n09NodeRef = new NodeRef(new StoreRef("workspace", "SpacesStore"), createGUID());
    n09QName = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "nine");
    n09CAR = new ChildAssociationRef(ContentModel.ASSOC_CONTAINS, n05NodeRef, n09QName, n09NodeRef, true, 0);
    addNode(core, dataModel, 1, 10, 1, testSuperType, null, getOrderProperties(), null, "ian", new ChildAssociationRef[] { n09CAR }, new NodeRef[] { rootNodeRef, n01NodeRef, n05NodeRef }, new String[] { "/" + n01QName.toString() + "/" + n05QName.toString() + "/" + n09QName }, n09NodeRef, true);
    // 10
    n10NodeRef = new NodeRef(new StoreRef("workspace", "SpacesStore"), createGUID());
    n10QName = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "ten");
    n10CAR = new ChildAssociationRef(ContentModel.ASSOC_CONTAINS, n05NodeRef, n10QName, n10NodeRef, true, 0);
    addNode(core, dataModel, 1, 11, 1, testSuperType, null, getOrderProperties(), null, "jake", new ChildAssociationRef[] { n10CAR }, new NodeRef[] { rootNodeRef, n01NodeRef, n05NodeRef }, new String[] { "/" + n01QName.toString() + "/" + n05QName.toString() + "/" + n10QName }, n10NodeRef, true);
    // 11
    n11NodeRef = new NodeRef(new StoreRef("workspace", "SpacesStore"), createGUID());
    n11QName = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "eleven");
    n11CAR = new ChildAssociationRef(ContentModel.ASSOC_CONTAINS, n05NodeRef, n11QName, n11NodeRef, true, 0);
    addNode(core, dataModel, 1, 12, 1, testSuperType, null, getOrderProperties(), null, "kara", new ChildAssociationRef[] { n11CAR }, new NodeRef[] { rootNodeRef, n01NodeRef, n05NodeRef }, new String[] { "/" + n01QName.toString() + "/" + n05QName.toString() + "/" + n11QName }, n11NodeRef, true);
    // 12
    n12NodeRef = new NodeRef(new StoreRef("workspace", "SpacesStore"), createGUID());
    n12QName = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "twelve");
    n12CAR = new ChildAssociationRef(ContentModel.ASSOC_CONTAINS, n05NodeRef, n12QName, n12NodeRef, true, 0);
    addNode(core, dataModel, 1, 13, 1, testSuperType, null, getOrderProperties(), null, "loon", new ChildAssociationRef[] { n12CAR }, new NodeRef[] { rootNodeRef, n01NodeRef, n05NodeRef }, new String[] { "/" + n01QName.toString() + "/" + n05QName.toString() + "/" + n12QName }, n12NodeRef, true);
    // 13
    n13NodeRef = new NodeRef(new StoreRef("workspace", "SpacesStore"), createGUID());
    n13QName = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "thirteen");
    n13QNameLink = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "link");
    n13CAR = new ChildAssociationRef(ContentModel.ASSOC_CONTAINS, n12NodeRef, n13QName, n13NodeRef, true, 0);
    n13CARLink = new ChildAssociationRef(ContentModel.ASSOC_CONTAINS, n02NodeRef, n13QName, n13NodeRef, false, 0);
    addNode(core, dataModel, 1, 14, 1, testSuperType, null, getOrderProperties(), null, "mike", new ChildAssociationRef[] { n13CAR, n13CARLink }, new NodeRef[] { rootNodeRef, n01NodeRef, n05NodeRef, n12NodeRef, rootNodeRef, n02NodeRef }, new String[] { "/" + n01QName.toString() + "/" + n05QName.toString() + "/" + n12QName + "/" + n13QName, "/" + n02QName.toString() + "/" + n13QNameLink }, n13NodeRef, true);
    // 14
    properties14 = new HashMap<QName, PropertyValue>();
    properties14.putAll(getOrderProperties());
    content14 = new HashMap<QName, String>();
    MLTextPropertyValue desc1 = new MLTextPropertyValue();
    desc1.addValue(Locale.ENGLISH, "Alfresco tutorial");
    desc1.addValue(Locale.US, "Alfresco tutorial");
    Date explicitCreatedDate = new Date();
    try {
        Thread.sleep(2000);
    } catch (InterruptedException e) {
        e.printStackTrace();
    }
    properties14.put(ContentModel.PROP_CONTENT, new ContentPropertyValue(Locale.UK, 298L, "UTF-8", "text/plain", null));
    content14.put(ContentModel.PROP_CONTENT, "The quick brown fox jumped over the lazy dog and ate the Alfresco Tutorial, in pdf format, along with the following stop words;  a an and are" + " as at be but by for if in into is it no not of on or such that the their then there these they this to was will with: " + " and random charcters \u00E0\u00EA\u00EE\u00F0\u00F1\u00F6\u00FB\u00FF");
    properties14.put(ContentModel.PROP_DESCRIPTION, desc1);
    properties14.put(ContentModel.PROP_CREATED, new StringPropertyValue(DefaultTypeConverter.INSTANCE.convert(String.class, explicitCreatedDate)));
    properties14.put(ContentModel.PROP_MODIFIED, new StringPropertyValue(DefaultTypeConverter.INSTANCE.convert(String.class, explicitCreatedDate)));
    MLTextPropertyValue title = new MLTextPropertyValue();
    title.addValue(Locale.ENGLISH, "English123");
    title.addValue(Locale.FRENCH, "French123");
    properties14.put(ContentModel.PROP_TITLE, title);
    n14NodeRef = new NodeRef(new StoreRef("workspace", "SpacesStore"), createGUID());
    n14QName = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "fourteen");
    n14QNameCommon = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "common");
    n14CAR = new ChildAssociationRef(ContentModel.ASSOC_CONTAINS, n13NodeRef, n14QName, n14NodeRef, true, 0);
    n14CAR_1 = new ChildAssociationRef(ContentModel.ASSOC_CONTAINS, n01NodeRef, n14QNameCommon, n14NodeRef, false, 0);
    n14CAR_2 = new ChildAssociationRef(ContentModel.ASSOC_CONTAINS, n02NodeRef, n14QNameCommon, n14NodeRef, false, 0);
    n14CAR_5 = new ChildAssociationRef(ContentModel.ASSOC_CONTAINS, n05NodeRef, n14QNameCommon, n14NodeRef, false, 0);
    n14CAR_6 = new ChildAssociationRef(ContentModel.ASSOC_CONTAINS, n06NodeRef, n14QNameCommon, n14NodeRef, false, 0);
    n14CAR_12 = new ChildAssociationRef(ContentModel.ASSOC_CONTAINS, n12NodeRef, n14QNameCommon, n14NodeRef, false, 0);
    n14CAR_13 = new ChildAssociationRef(ContentModel.ASSOC_CONTAINS, n13NodeRef, n14QNameCommon, n14NodeRef, false, 0);
    addNode(core, dataModel, 1, 15, 1, ContentModel.TYPE_CONTENT, new QName[] { ContentModel.ASPECT_TITLED }, properties14, content14, "noodle", new ChildAssociationRef[] { n14CAR, n14CAR_1, n14CAR_2, n14CAR_5, n14CAR_6, n14CAR_12, n14CAR_13 }, new NodeRef[] { rootNodeRef, n01NodeRef, n05NodeRef, n12NodeRef, n13NodeRef }, new String[] { "/" + n01QName.toString() + "/" + n05QName.toString() + "/" + n12QName + "/" + n13QName + "/" + n14QName, "/" + n02QName.toString() + "/" + n13QNameLink + "/" + n14QName, "/" + n01QName + "/" + n14QNameCommon, "/" + n02QName + "/" + n14QNameCommon, "/" + n01QName + "/" + n05QName + "/" + n14QNameCommon, "/" + n01QName + "/" + n06QName + "/" + n14QNameCommon, "/" + n01QName + "/" + n05QName + "/" + n12QName + "/" + n14QNameCommon, "/" + n01QName + "/" + n05QName + "/" + n12QName + "/" + n13QName + "/" + n14QNameCommon }, n14NodeRef, true);
    // 15
    properties15 = new HashMap<QName, PropertyValue>();
    properties15.putAll(getOrderProperties());
    properties15.put(ContentModel.PROP_MODIFIED, new StringPropertyValue(DefaultTypeConverter.INSTANCE.convert(String.class, explicitCreatedDate)));
    content15 = new HashMap<QName, String>();
    content15.put(ContentModel.PROP_CONTENT, "          ");
    n15NodeRef = new NodeRef(new StoreRef("workspace", "SpacesStore"), createGUID());
    n15QName = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "fifteen");
    n15CAR = new ChildAssociationRef(ContentModel.ASSOC_CONTAINS, n13NodeRef, n15QName, n15NodeRef, true, 0);
    addNode(core, dataModel, 1, 16, 1, ContentModel.TYPE_THUMBNAIL, null, properties15, content15, "ood", new ChildAssociationRef[] { n15CAR }, new NodeRef[] { rootNodeRef, n01NodeRef, n05NodeRef, n12NodeRef, n13NodeRef }, new String[] { "/" + n01QName.toString() + "/" + n05QName.toString() + "/" + n12QName + "/" + n13QName + "/" + n15QName, "/" + n02QName.toString() + "/" + n13QNameLink + "/" + n14QName }, n15NodeRef, true);
}
Also used : Locale(java.util.Locale) StoreRef(org.alfresco.service.cmr.repository.StoreRef) StringPropertyValue(org.alfresco.solr.client.StringPropertyValue) MultiPropertyValue(org.alfresco.solr.client.MultiPropertyValue) SolrCore(org.apache.solr.core.SolrCore) QName(org.alfresco.service.namespace.QName) Calendar(java.util.Calendar) GregorianCalendar(java.util.GregorianCalendar) GregorianCalendar(java.util.GregorianCalendar) MLTextPropertyValue(org.alfresco.solr.client.MLTextPropertyValue) MultiPropertyValue(org.alfresco.solr.client.MultiPropertyValue) PropertyValue(org.alfresco.solr.client.PropertyValue) StringPropertyValue(org.alfresco.solr.client.StringPropertyValue) ContentPropertyValue(org.alfresco.solr.client.ContentPropertyValue) Period(org.alfresco.service.cmr.repository.Period) ChildAssociationRef(org.alfresco.service.cmr.repository.ChildAssociationRef) AlfrescoSolrDataModel(org.alfresco.solr.AlfrescoSolrDataModel) Date(java.util.Date) ContentPropertyValue(org.alfresco.solr.client.ContentPropertyValue) NodeRef(org.alfresco.service.cmr.repository.NodeRef) MLTextPropertyValue(org.alfresco.solr.client.MLTextPropertyValue) BeforeClass(org.junit.BeforeClass)

Example 3 with ContentPropertyValue

use of org.alfresco.solr.client.ContentPropertyValue in project SearchServices by Alfresco.

the class LoadCMISData method loadCMISTestSet.

@BeforeClass
public static void loadCMISTestSet() throws Exception {
    initAlfrescoCore("schema.xml");
    SolrCore core = h.getCore();
    AlfrescoSolrDataModel dataModel = AlfrescoSolrDataModel.getInstance();
    dataModel.getNamespaceDAO().removePrefix("");
    dataModel.setCMDefaultUri();
    NodeRef rootNodeRef = new NodeRef(new StoreRef("workspace", "SpacesStore"), createGUID());
    testCMISRootNodeRef = rootNodeRef;
    addStoreRoot(core, dataModel, rootNodeRef, 1, 1, 1, 1);
    // Base
    HashMap<QName, PropertyValue> baseFolderProperties = new HashMap<QName, PropertyValue>();
    baseFolderProperties.put(ContentModel.PROP_NAME, new StringPropertyValue("Base Folder"));
    // This variable is never used. What was it meant to be used for?
    NodeRef baseFolderNodeRef = new NodeRef(new StoreRef("workspace", "SpacesStore"), createGUID());
    testCMISBaseFolderNodeRef = baseFolderNodeRef;
    QName baseFolderQName = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "baseFolder");
    testCMISBaseFolderQName = baseFolderQName;
    ChildAssociationRef n01CAR = new ChildAssociationRef(ContentModel.ASSOC_CHILDREN, rootNodeRef, baseFolderQName, baseFolderNodeRef, true, 0);
    addNode(core, dataModel, 1, 2, 1, ContentModel.TYPE_FOLDER, null, baseFolderProperties, null, "andy", new ChildAssociationRef[] { n01CAR }, new NodeRef[] { rootNodeRef }, new String[] { "/" + baseFolderQName.toString() }, baseFolderNodeRef, true);
    // Folders
    HashMap<QName, PropertyValue> folder00Properties = new HashMap<QName, PropertyValue>();
    folder00Properties.put(ContentModel.PROP_NAME, new StringPropertyValue("Folder 0"));
    NodeRef folder00NodeRef = new NodeRef(new StoreRef("workspace", "SpacesStore"), createGUID());
    testCMISFolder00NodeRef = folder00NodeRef;
    QName folder00QName = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "Folder 0");
    testCMISFolder00QName = folder00QName;
    ChildAssociationRef folder00CAR = new ChildAssociationRef(ContentModel.ASSOC_CONTAINS, baseFolderNodeRef, folder00QName, folder00NodeRef, true, 0);
    addNode(core, dataModel, 1, 3, 1, ContentModel.TYPE_FOLDER, null, folder00Properties, null, "andy", new ChildAssociationRef[] { folder00CAR }, new NodeRef[] { baseFolderNodeRef, rootNodeRef }, new String[] { "/" + baseFolderQName.toString() + "/" + folder00QName.toString() }, folder00NodeRef, true);
    HashMap<QName, PropertyValue> folder01Properties = new HashMap<QName, PropertyValue>();
    folder01Properties.put(ContentModel.PROP_NAME, new StringPropertyValue("Folder 1"));
    NodeRef folder01NodeRef = new NodeRef(new StoreRef("workspace", "SpacesStore"), createGUID());
    QName folder01QName = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "Folder 1");
    ChildAssociationRef folder01CAR = new ChildAssociationRef(ContentModel.ASSOC_CONTAINS, baseFolderNodeRef, folder01QName, folder01NodeRef, true, 0);
    addNode(core, dataModel, 1, 4, 1, ContentModel.TYPE_FOLDER, null, folder01Properties, null, "bob", new ChildAssociationRef[] { folder01CAR }, new NodeRef[] { baseFolderNodeRef, rootNodeRef }, new String[] { "/" + baseFolderQName.toString() + "/" + folder01QName.toString() }, folder01NodeRef, true);
    HashMap<QName, PropertyValue> folder02Properties = new HashMap<QName, PropertyValue>();
    folder02Properties.put(ContentModel.PROP_NAME, new StringPropertyValue("Folder 2"));
    NodeRef folder02NodeRef = new NodeRef(new StoreRef("workspace", "SpacesStore"), createGUID());
    QName folder02QName = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "Folder 2");
    ChildAssociationRef folder02CAR = new ChildAssociationRef(ContentModel.ASSOC_CONTAINS, baseFolderNodeRef, folder02QName, folder02NodeRef, true, 0);
    addNode(core, dataModel, 1, 5, 1, ContentModel.TYPE_FOLDER, null, folder02Properties, null, "cid", new ChildAssociationRef[] { folder02CAR }, new NodeRef[] { baseFolderNodeRef, rootNodeRef }, new String[] { "/" + baseFolderQName.toString() + "/" + folder02QName.toString() }, folder02NodeRef, true);
    HashMap<QName, PropertyValue> folder03Properties = new HashMap<QName, PropertyValue>();
    folder03Properties.put(ContentModel.PROP_NAME, new StringPropertyValue("Folder 3"));
    NodeRef folder03NodeRef = new NodeRef(new StoreRef("workspace", "SpacesStore"), createGUID());
    QName folder03QName = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "Folder 3");
    ChildAssociationRef folder03CAR = new ChildAssociationRef(ContentModel.ASSOC_CONTAINS, baseFolderNodeRef, folder03QName, folder03NodeRef, true, 0);
    addNode(core, dataModel, 1, 6, 1, ContentModel.TYPE_FOLDER, null, folder03Properties, null, "dave", new ChildAssociationRef[] { folder03CAR }, new NodeRef[] { baseFolderNodeRef, rootNodeRef }, new String[] { "/" + baseFolderQName.toString() + "/" + folder03QName.toString() }, folder03NodeRef, true);
    HashMap<QName, PropertyValue> folder04Properties = new HashMap<QName, PropertyValue>();
    folder04Properties.put(ContentModel.PROP_NAME, new StringPropertyValue("Folder 4"));
    NodeRef folder04NodeRef = new NodeRef(new StoreRef("workspace", "SpacesStore"), createGUID());
    QName folder04QName = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "Folder 4");
    ChildAssociationRef folder04CAR = new ChildAssociationRef(ContentModel.ASSOC_CONTAINS, folder00NodeRef, folder04QName, folder04NodeRef, true, 0);
    addNode(core, dataModel, 1, 7, 1, ContentModel.TYPE_FOLDER, null, folder04Properties, null, "eoin", new ChildAssociationRef[] { folder04CAR }, new NodeRef[] { baseFolderNodeRef, rootNodeRef, folder00NodeRef }, new String[] { "/" + baseFolderQName.toString() + "/" + folder00QName.toString() + "/" + folder04QName.toString() }, folder04NodeRef, true);
    HashMap<QName, PropertyValue> folder05Properties = new HashMap<QName, PropertyValue>();
    folder05Properties.put(ContentModel.PROP_NAME, new StringPropertyValue("Folder 5"));
    NodeRef folder05NodeRef = new NodeRef(new StoreRef("workspace", "SpacesStore"), createGUID());
    QName folder05QName = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "Folder 5");
    ChildAssociationRef folder05CAR = new ChildAssociationRef(ContentModel.ASSOC_CONTAINS, folder00NodeRef, folder05QName, folder05NodeRef, true, 0);
    addNode(core, dataModel, 1, 8, 1, ContentModel.TYPE_FOLDER, null, folder05Properties, null, "fred", new ChildAssociationRef[] { folder05CAR }, new NodeRef[] { baseFolderNodeRef, rootNodeRef, folder00NodeRef }, new String[] { "/" + baseFolderQName.toString() + "/" + folder00QName.toString() + "/" + folder05QName.toString() }, folder05NodeRef, true);
    HashMap<QName, PropertyValue> folder06Properties = new HashMap<QName, PropertyValue>();
    folder06Properties.put(ContentModel.PROP_NAME, new StringPropertyValue("Folder 6"));
    NodeRef folder06NodeRef = new NodeRef(new StoreRef("workspace", "SpacesStore"), createGUID());
    QName folder06QName = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "Folder 6");
    ChildAssociationRef folder06CAR = new ChildAssociationRef(ContentModel.ASSOC_CONTAINS, folder05NodeRef, folder06QName, folder06NodeRef, true, 0);
    addNode(core, dataModel, 1, 9, 1, ContentModel.TYPE_FOLDER, null, folder06Properties, null, "gail", new ChildAssociationRef[] { folder06CAR }, new NodeRef[] { baseFolderNodeRef, rootNodeRef, folder00NodeRef, folder05NodeRef }, new String[] { "/" + baseFolderQName.toString() + "/" + folder00QName.toString() + "/" + folder05QName.toString() + "/" + folder06QName.toString() }, folder06NodeRef, true);
    HashMap<QName, PropertyValue> folder07Properties = new HashMap<QName, PropertyValue>();
    folder07Properties.put(ContentModel.PROP_NAME, new StringPropertyValue("Folder 7"));
    NodeRef folder07NodeRef = new NodeRef(new StoreRef("workspace", "SpacesStore"), createGUID());
    QName folder07QName = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "Folder 7");
    ChildAssociationRef folder07CAR = new ChildAssociationRef(ContentModel.ASSOC_CONTAINS, folder06NodeRef, folder07QName, folder07NodeRef, true, 0);
    addNode(core, dataModel, 1, 10, 1, ContentModel.TYPE_FOLDER, null, folder07Properties, null, "hal", new ChildAssociationRef[] { folder07CAR }, new NodeRef[] { baseFolderNodeRef, rootNodeRef, folder00NodeRef, folder05NodeRef, folder06NodeRef }, new String[] { "/" + baseFolderQName.toString() + "/" + folder00QName.toString() + "/" + folder05QName.toString() + "/" + folder06QName.toString() + "/" + folder07QName.toString() }, folder07NodeRef, true);
    HashMap<QName, PropertyValue> folder08Properties = new HashMap<QName, PropertyValue>();
    folder08Properties.put(ContentModel.PROP_NAME, new StringPropertyValue("Folder 8"));
    NodeRef folder08NodeRef = new NodeRef(new StoreRef("workspace", "SpacesStore"), createGUID());
    QName folder08QName = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "Folder 8");
    ChildAssociationRef folder08CAR = new ChildAssociationRef(ContentModel.ASSOC_CONTAINS, folder07NodeRef, folder08QName, folder08NodeRef, true, 0);
    addNode(core, dataModel, 1, 11, 1, ContentModel.TYPE_FOLDER, null, folder08Properties, null, "ian", new ChildAssociationRef[] { folder08CAR }, new NodeRef[] { baseFolderNodeRef, rootNodeRef, folder00NodeRef, folder05NodeRef, folder06NodeRef, folder07NodeRef }, new String[] { "/" + baseFolderQName.toString() + "/" + folder00QName.toString() + "/" + folder05QName.toString() + "/" + folder06QName.toString() + "/" + folder07QName.toString() + "/" + folder08QName.toString() }, folder08NodeRef, true);
    HashMap<QName, PropertyValue> folder09Properties = new HashMap<QName, PropertyValue>();
    folder09Properties.put(ContentModel.PROP_NAME, new StringPropertyValue("Folder 9'"));
    NodeRef folder09NodeRef = new NodeRef(new StoreRef("workspace", "SpacesStore"), createGUID());
    QName folder09QName = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "Folder 9'");
    ChildAssociationRef folder09CAR = new ChildAssociationRef(ContentModel.ASSOC_CONTAINS, folder08NodeRef, folder09QName, folder09NodeRef, true, 0);
    addNode(core, dataModel, 1, 12, 1, ContentModel.TYPE_FOLDER, null, folder09Properties, null, "jake", new ChildAssociationRef[] { folder09CAR }, new NodeRef[] { baseFolderNodeRef, rootNodeRef, folder00NodeRef, folder05NodeRef, folder06NodeRef, folder07NodeRef, folder08NodeRef }, new String[] { "/" + baseFolderQName.toString() + "/" + folder00QName.toString() + "/" + folder05QName.toString() + "/" + folder06QName.toString() + "/" + folder07QName.toString() + "/" + folder08QName.toString() + "/" + folder09QName.toString() }, folder09NodeRef, true);
    // content
    HashMap<QName, PropertyValue> content00Properties = new HashMap<QName, PropertyValue>();
    MLTextPropertyValue desc00 = new MLTextPropertyValue();
    desc00.addValue(Locale.ENGLISH, "Alfresco tutorial");
    desc00.addValue(Locale.US, "Alfresco tutorial");
    content00Properties.put(ContentModel.PROP_DESCRIPTION, desc00);
    content00Properties.put(ContentModel.PROP_TITLE, desc00);
    content00Properties.put(ContentModel.PROP_CONTENT, new ContentPropertyValue(Locale.UK, 0l, "UTF-8", "text/plain", null));
    content00Properties.put(ContentModel.PROP_NAME, new StringPropertyValue("Alfresco Tutorial"));
    content00Properties.put(ContentModel.PROP_CREATOR, new StringPropertyValue("System"));
    content00Properties.put(ContentModel.PROP_MODIFIER, new StringPropertyValue("System"));
    content00Properties.put(ContentModel.PROP_VERSION_LABEL, new StringPropertyValue("1.0"));
    content00Properties.put(ContentModel.PROP_OWNER, new StringPropertyValue("andy"));
    Date date00 = new Date();
    testCMISDate00 = date00;
    content00Properties.put(ContentModel.PROP_CREATED, new StringPropertyValue(DefaultTypeConverter.INSTANCE.convert(String.class, date00)));
    content00Properties.put(ContentModel.PROP_MODIFIED, new StringPropertyValue(DefaultTypeConverter.INSTANCE.convert(String.class, date00)));
    HashMap<QName, String> content00Content = new HashMap<QName, String>();
    content00Content.put(ContentModel.PROP_CONTENT, "The quick brown fox jumped over the lazy dog and ate the Alfresco Tutorial, in pdf format, along with the following stop words;  a an and are" + " as at be but by for if in into is it no not of on or such that the their then there these they this to was will with: " + " and random charcters \u00E0\u00EA\u00EE\u00F0\u00F1\u00F6\u00FB\u00FF score");
    NodeRef content00NodeRef = new NodeRef(new StoreRef("workspace", "SpacesStore"), createGUID());
    testCMISContent00NodeRef = content00NodeRef;
    QName content00QName = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "Alfresco Tutorial");
    ChildAssociationRef content00CAR = new ChildAssociationRef(ContentModel.ASSOC_CONTAINS, folder00NodeRef, content00QName, content00NodeRef, true, 0);
    addNode(core, dataModel, 1, 13, 1, ContentModel.TYPE_CONTENT, new QName[] { ContentModel.ASPECT_OWNABLE, ContentModel.ASPECT_TITLED }, content00Properties, content00Content, "andy", new ChildAssociationRef[] { content00CAR }, new NodeRef[] { baseFolderNodeRef, rootNodeRef, folder00NodeRef }, new String[] { "/" + baseFolderQName.toString() + "/" + folder00QName.toString() + "/" + content00QName.toString() }, content00NodeRef, true);
    HashMap<QName, PropertyValue> content01Properties = new HashMap<QName, PropertyValue>();
    MLTextPropertyValue desc01 = new MLTextPropertyValue();
    desc01.addValue(Locale.ENGLISH, "One");
    desc01.addValue(Locale.US, "One");
    content01Properties.put(ContentModel.PROP_DESCRIPTION, desc01);
    content01Properties.put(ContentModel.PROP_TITLE, desc01);
    content01Properties.put(ContentModel.PROP_CONTENT, new ContentPropertyValue(Locale.UK, 0l, "UTF-8", "text/plain", null));
    content01Properties.put(ContentModel.PROP_NAME, new StringPropertyValue("AA%"));
    content01Properties.put(ContentModel.PROP_CREATOR, new StringPropertyValue("System"));
    content01Properties.put(ContentModel.PROP_MODIFIER, new StringPropertyValue("System"));
    Date date01 = new Date(date00.getTime() + 1000);
    content01Properties.put(ContentModel.PROP_CREATED, new StringPropertyValue(DefaultTypeConverter.INSTANCE.convert(String.class, date01)));
    content01Properties.put(ContentModel.PROP_MODIFIED, new StringPropertyValue(DefaultTypeConverter.INSTANCE.convert(String.class, date01)));
    HashMap<QName, String> content01Content = new HashMap<QName, String>();
    content01Content.put(ContentModel.PROP_CONTENT, "One Zebra Apple score score score score score score score score score score score");
    NodeRef content01NodeRef = new NodeRef(new StoreRef("workspace", "SpacesStore"), createGUID());
    QName content01QName = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "AA%");
    ChildAssociationRef content01CAR = new ChildAssociationRef(ContentModel.ASSOC_CONTAINS, folder01NodeRef, content01QName, content01NodeRef, true, 0);
    addNode(core, dataModel, 1, 14, 1, ContentModel.TYPE_CONTENT, new QName[] { ContentModel.ASPECT_TITLED }, content01Properties, content01Content, "cmis", new ChildAssociationRef[] { content01CAR }, new NodeRef[] { baseFolderNodeRef, rootNodeRef, folder01NodeRef }, new String[] { "/" + baseFolderQName.toString() + "/" + folder01QName.toString() + "/" + content01QName.toString() }, content01NodeRef, true);
    HashMap<QName, PropertyValue> content02Properties = new HashMap<QName, PropertyValue>();
    MLTextPropertyValue desc02 = new MLTextPropertyValue();
    desc02.addValue(Locale.ENGLISH, "Two");
    desc02.addValue(Locale.US, "Two");
    content02Properties.put(ContentModel.PROP_DESCRIPTION, desc02);
    content02Properties.put(ContentModel.PROP_TITLE, desc02);
    content02Properties.put(ContentModel.PROP_CONTENT, new ContentPropertyValue(Locale.UK, 0l, "UTF-8", "text/plain", null));
    content02Properties.put(ContentModel.PROP_NAME, new StringPropertyValue("BB_"));
    content02Properties.put(ContentModel.PROP_CREATOR, new StringPropertyValue("System"));
    content02Properties.put(ContentModel.PROP_MODIFIER, new StringPropertyValue("System"));
    Date date02 = new Date(date01.getTime() + 1000);
    content02Properties.put(ContentModel.PROP_CREATED, new StringPropertyValue(DefaultTypeConverter.INSTANCE.convert(String.class, date02)));
    content02Properties.put(ContentModel.PROP_MODIFIED, new StringPropertyValue(DefaultTypeConverter.INSTANCE.convert(String.class, date02)));
    HashMap<QName, String> content02Content = new HashMap<QName, String>();
    content02Content.put(ContentModel.PROP_CONTENT, "Two Zebra Banana score score score score score score score score score score pad");
    NodeRef content02NodeRef = new NodeRef(new StoreRef("workspace", "SpacesStore"), createGUID());
    QName content02QName = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "BB_");
    ChildAssociationRef content02CAR = new ChildAssociationRef(ContentModel.ASSOC_CONTAINS, folder02NodeRef, content02QName, content02NodeRef, true, 0);
    addNode(core, dataModel, 1, 15, 1, ContentModel.TYPE_CONTENT, new QName[] { ContentModel.ASPECT_TITLED }, content02Properties, content02Content, "cmis", new ChildAssociationRef[] { content02CAR }, new NodeRef[] { baseFolderNodeRef, rootNodeRef, folder02NodeRef }, new String[] { "/" + baseFolderQName.toString() + "/" + folder02QName.toString() + "/" + content02QName.toString() }, content02NodeRef, true);
    HashMap<QName, PropertyValue> content03Properties = new HashMap<QName, PropertyValue>();
    MLTextPropertyValue desc03 = new MLTextPropertyValue();
    desc03.addValue(Locale.ENGLISH, "Three");
    desc03.addValue(Locale.US, "Three");
    content03Properties.put(ContentModel.PROP_DESCRIPTION, desc03);
    content03Properties.put(ContentModel.PROP_TITLE, desc03);
    content03Properties.put(ContentModel.PROP_CONTENT, new ContentPropertyValue(Locale.UK, 0l, "UTF-8", "text/plain", null));
    content03Properties.put(ContentModel.PROP_NAME, new StringPropertyValue("CC\\"));
    content03Properties.put(ContentModel.PROP_CREATOR, new StringPropertyValue("System"));
    content03Properties.put(ContentModel.PROP_MODIFIER, new StringPropertyValue("System"));
    Date date03 = new Date(date02.getTime() + 1000);
    content03Properties.put(ContentModel.PROP_CREATED, new StringPropertyValue(DefaultTypeConverter.INSTANCE.convert(String.class, date03)));
    content03Properties.put(ContentModel.PROP_MODIFIED, new StringPropertyValue(DefaultTypeConverter.INSTANCE.convert(String.class, date03)));
    HashMap<QName, String> content03Content = new HashMap<QName, String>();
    content03Content.put(ContentModel.PROP_CONTENT, "Three Zebra Clementine score score score score score score score score score pad pad");
    NodeRef content03NodeRef = new NodeRef(new StoreRef("workspace", "SpacesStore"), createGUID());
    QName content03QName = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "CC\\");
    ChildAssociationRef content03CAR = new ChildAssociationRef(ContentModel.ASSOC_CONTAINS, folder03NodeRef, content03QName, content03NodeRef, true, 0);
    addNode(core, dataModel, 1, 16, 1, ContentModel.TYPE_CONTENT, new QName[] { ContentModel.ASPECT_TITLED }, content03Properties, content03Content, "cmis", new ChildAssociationRef[] { content03CAR }, new NodeRef[] { baseFolderNodeRef, rootNodeRef, folder03NodeRef }, new String[] { "/" + baseFolderQName.toString() + "/" + folder03QName.toString() + "/" + content03QName.toString() }, content03NodeRef, true);
    HashMap<QName, PropertyValue> content04Properties = new HashMap<QName, PropertyValue>();
    MLTextPropertyValue desc04 = new MLTextPropertyValue();
    desc04.addValue(Locale.ENGLISH, "Four");
    desc04.addValue(Locale.US, "Four");
    content04Properties.put(ContentModel.PROP_DESCRIPTION, desc04);
    content04Properties.put(ContentModel.PROP_TITLE, desc04);
    content04Properties.put(ContentModel.PROP_CONTENT, new ContentPropertyValue(Locale.UK, 0l, "UTF-8", "text/plain", null));
    content04Properties.put(ContentModel.PROP_NAME, new StringPropertyValue("DD\'"));
    content04Properties.put(ContentModel.PROP_CREATOR, new StringPropertyValue("System"));
    content04Properties.put(ContentModel.PROP_MODIFIER, new StringPropertyValue("System"));
    Date date04 = new Date(date03.getTime() + 1000);
    content04Properties.put(ContentModel.PROP_CREATED, new StringPropertyValue(DefaultTypeConverter.INSTANCE.convert(String.class, date04)));
    content04Properties.put(ContentModel.PROP_MODIFIED, new StringPropertyValue(DefaultTypeConverter.INSTANCE.convert(String.class, date04)));
    HashMap<QName, String> content04Content = new HashMap<QName, String>();
    content04Content.put(ContentModel.PROP_CONTENT, "Four zebra durian score score score score score score score score pad pad pad");
    NodeRef content04NodeRef = new NodeRef(new StoreRef("workspace", "SpacesStore"), createGUID());
    QName content04QName = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "DD\'");
    ChildAssociationRef content04CAR = new ChildAssociationRef(ContentModel.ASSOC_CONTAINS, folder04NodeRef, content04QName, content04NodeRef, true, 0);
    addNode(core, dataModel, 1, 17, 1, ContentModel.TYPE_CONTENT, new QName[] { ContentModel.ASPECT_TITLED }, content04Properties, content04Content, null, new ChildAssociationRef[] { content04CAR }, new NodeRef[] { baseFolderNodeRef, rootNodeRef, folder00NodeRef, folder04NodeRef }, new String[] { "/" + baseFolderQName.toString() + "/" + folder00QName.toString() + "/" + folder04QName.toString() + "/" + content04QName.toString() }, content04NodeRef, true);
    HashMap<QName, PropertyValue> content05Properties = new HashMap<QName, PropertyValue>();
    MLTextPropertyValue desc05 = new MLTextPropertyValue();
    desc05.addValue(Locale.ENGLISH, "Five");
    desc05.addValue(Locale.US, "Five");
    content05Properties.put(ContentModel.PROP_DESCRIPTION, desc05);
    content05Properties.put(ContentModel.PROP_TITLE, desc05);
    content05Properties.put(ContentModel.PROP_CONTENT, new ContentPropertyValue(Locale.UK, 0l, "UTF-8", "text/plain", null));
    content05Properties.put(ContentModel.PROP_NAME, new StringPropertyValue("EE.aa"));
    content05Properties.put(ContentModel.PROP_CREATOR, new StringPropertyValue("System"));
    content05Properties.put(ContentModel.PROP_MODIFIER, new StringPropertyValue("System"));
    Date date05 = new Date(date04.getTime() + 1000);
    content05Properties.put(ContentModel.PROP_CREATED, new StringPropertyValue(DefaultTypeConverter.INSTANCE.convert(String.class, date05)));
    content05Properties.put(ContentModel.PROP_MODIFIED, new StringPropertyValue(DefaultTypeConverter.INSTANCE.convert(String.class, date05)));
    content05Properties.put(ContentModel.PROP_EXPIRY_DATE, new StringPropertyValue(DefaultTypeConverter.INSTANCE.convert(String.class, DefaultTypeConverter.INSTANCE.convert(Date.class, "2012-12-12T12:12:12.012Z"))));
    content05Properties.put(ContentModel.PROP_LOCK_OWNER, new StringPropertyValue("andy"));
    content05Properties.put(ContentModel.PROP_LOCK_TYPE, new StringPropertyValue("WRITE_LOCK"));
    HashMap<QName, String> content05Content = new HashMap<QName, String>();
    content05Content.put(ContentModel.PROP_CONTENT, "Five zebra Ebury score score score score score score score pad pad pad pad");
    NodeRef content05NodeRef = new NodeRef(new StoreRef("workspace", "SpacesStore"), createGUID());
    QName content05QName = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "EE.aa");
    ChildAssociationRef content05CAR = new ChildAssociationRef(ContentModel.ASSOC_CONTAINS, folder05NodeRef, content05QName, content05NodeRef, true, 0);
    addNode(core, dataModel, 1, 18, 1, ContentModel.TYPE_CONTENT, new QName[] { ContentModel.ASPECT_TITLED, ContentModel.ASPECT_LOCKABLE }, content05Properties, content05Content, null, new ChildAssociationRef[] { content05CAR }, new NodeRef[] { baseFolderNodeRef, rootNodeRef, folder00NodeRef, folder05NodeRef }, new String[] { "/" + baseFolderQName.toString() + "/" + folder00QName.toString() + "/" + content05QName.toString() }, content05NodeRef, true);
    HashMap<QName, PropertyValue> content06Properties = new HashMap<QName, PropertyValue>();
    MLTextPropertyValue desc06 = new MLTextPropertyValue();
    desc06.addValue(Locale.ENGLISH, "Six");
    desc06.addValue(Locale.US, "Six");
    content06Properties.put(ContentModel.PROP_DESCRIPTION, desc06);
    content06Properties.put(ContentModel.PROP_TITLE, desc06);
    content06Properties.put(ContentModel.PROP_CONTENT, new ContentPropertyValue(Locale.UK, 0l, "UTF-8", "text/plain", null));
    content06Properties.put(ContentModel.PROP_NAME, new StringPropertyValue("FF.EE"));
    content06Properties.put(ContentModel.PROP_CREATOR, new StringPropertyValue("System"));
    content06Properties.put(ContentModel.PROP_MODIFIER, new StringPropertyValue("System"));
    Date date06 = new Date(date05.getTime() + 1000);
    content06Properties.put(ContentModel.PROP_CREATED, new StringPropertyValue(DefaultTypeConverter.INSTANCE.convert(String.class, date06)));
    content06Properties.put(ContentModel.PROP_MODIFIED, new StringPropertyValue(DefaultTypeConverter.INSTANCE.convert(String.class, date06)));
    HashMap<QName, String> content06Content = new HashMap<QName, String>();
    content06Content.put(ContentModel.PROP_CONTENT, "Six zebra fig score score score score score score pad pad pad pad pad");
    NodeRef content06NodeRef = new NodeRef(new StoreRef("workspace", "SpacesStore"), createGUID());
    QName content06QName = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "FF.EE");
    ChildAssociationRef content06CAR = new ChildAssociationRef(ContentModel.ASSOC_CONTAINS, folder06NodeRef, content06QName, content06NodeRef, true, 0);
    addNode(core, dataModel, 1, 19, 1, ContentModel.TYPE_CONTENT, new QName[] { ContentModel.ASPECT_TITLED }, content06Properties, content06Content, null, new ChildAssociationRef[] { content06CAR }, new NodeRef[] { baseFolderNodeRef, rootNodeRef, folder00NodeRef, folder05NodeRef, folder06NodeRef }, new String[] { "/" + baseFolderQName.toString() + "/" + folder00QName.toString() + "/" + folder05QName.toString() + "/" + folder06QName.toString() + "/" + content06QName.toString() }, content06NodeRef, true);
    HashMap<QName, PropertyValue> content07Properties = new HashMap<QName, PropertyValue>();
    MLTextPropertyValue desc07 = new MLTextPropertyValue();
    desc07.addValue(Locale.ENGLISH, "Seven");
    desc07.addValue(Locale.US, "Seven");
    content07Properties.put(ContentModel.PROP_DESCRIPTION, desc07);
    content07Properties.put(ContentModel.PROP_TITLE, desc07);
    content07Properties.put(ContentModel.PROP_CONTENT, new ContentPropertyValue(Locale.UK, 0l, "UTF-8", "text/plain", null));
    content07Properties.put(ContentModel.PROP_NAME, new StringPropertyValue("GG*GG"));
    content07Properties.put(ContentModel.PROP_CREATOR, new StringPropertyValue("System"));
    content07Properties.put(ContentModel.PROP_MODIFIER, new StringPropertyValue("System"));
    Date date07 = new Date(date06.getTime() + 1000);
    content07Properties.put(ContentModel.PROP_CREATED, new StringPropertyValue(DefaultTypeConverter.INSTANCE.convert(String.class, date07)));
    content07Properties.put(ContentModel.PROP_MODIFIED, new StringPropertyValue(DefaultTypeConverter.INSTANCE.convert(String.class, date07)));
    HashMap<QName, String> content07Content = new HashMap<QName, String>();
    content07Content.put(ContentModel.PROP_CONTENT, "Seven zebra grapefruit score score score score score pad pad pad pad pad pad");
    NodeRef content07NodeRef = new NodeRef(new StoreRef("workspace", "SpacesStore"), createGUID());
    QName content07QName = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "GG*GG");
    ChildAssociationRef content07CAR = new ChildAssociationRef(ContentModel.ASSOC_CONTAINS, folder07NodeRef, content07QName, content07NodeRef, true, 0);
    addNode(core, dataModel, 1, 20, 1, ContentModel.TYPE_CONTENT, new QName[] { ContentModel.ASPECT_TITLED }, content07Properties, content07Content, null, new ChildAssociationRef[] { content07CAR }, new NodeRef[] { baseFolderNodeRef, rootNodeRef, folder00NodeRef, folder05NodeRef, folder06NodeRef, folder07NodeRef }, new String[] { "/" + baseFolderQName.toString() + "/" + folder00QName.toString() + "/" + folder05QName.toString() + "/" + folder06QName.toString() + "/" + folder07QName.toString() + "/" + content07QName.toString() }, content07NodeRef, true);
    HashMap<QName, PropertyValue> content08Properties = new HashMap<QName, PropertyValue>();
    MLTextPropertyValue desc08 = new MLTextPropertyValue();
    desc08.addValue(Locale.ENGLISH, "Eight");
    desc08.addValue(Locale.US, "Eight");
    content08Properties.put(ContentModel.PROP_DESCRIPTION, desc08);
    content08Properties.put(ContentModel.PROP_TITLE, desc08);
    content08Properties.put(ContentModel.PROP_CONTENT, new ContentPropertyValue(Locale.UK, 0l, "UTF-8", "text/plain", null));
    content08Properties.put(ContentModel.PROP_NAME, new StringPropertyValue("HH?HH"));
    content08Properties.put(ContentModel.PROP_CREATOR, new StringPropertyValue("System"));
    content08Properties.put(ContentModel.PROP_MODIFIER, new StringPropertyValue("System"));
    Date date08 = new Date(date07.getTime() + 1000);
    content08Properties.put(ContentModel.PROP_CREATED, new StringPropertyValue(DefaultTypeConverter.INSTANCE.convert(String.class, date08)));
    content08Properties.put(ContentModel.PROP_MODIFIED, new StringPropertyValue(DefaultTypeConverter.INSTANCE.convert(String.class, date08)));
    HashMap<QName, String> content08Content = new HashMap<QName, String>();
    content08Content.put(ContentModel.PROP_CONTENT, "Eight zebra jackfruit score score score score pad pad pad pad pad pad pad");
    NodeRef content08NodeRef = new NodeRef(new StoreRef("workspace", "SpacesStore"), createGUID());
    QName content08QName = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "HH?HH");
    ChildAssociationRef content08CAR = new ChildAssociationRef(ContentModel.ASSOC_CONTAINS, folder08NodeRef, content08QName, content08NodeRef, true, 0);
    addNode(core, dataModel, 1, 21, 1, ContentModel.TYPE_CONTENT, new QName[] { ContentModel.ASPECT_TITLED }, content08Properties, content08Content, null, new ChildAssociationRef[] { content08CAR }, new NodeRef[] { baseFolderNodeRef, rootNodeRef, folder00NodeRef, folder05NodeRef, folder06NodeRef, folder07NodeRef, folder08NodeRef }, new String[] { "/" + baseFolderQName.toString() + "/" + folder00QName.toString() + "/" + folder05QName.toString() + "/" + folder06QName.toString() + "/" + folder07QName.toString() + "/" + folder08QName.toString() + "/" + content08QName.toString() }, content08NodeRef, true);
    HashMap<QName, PropertyValue> content09Properties = new HashMap<QName, PropertyValue>();
    MLTextPropertyValue desc09 = new MLTextPropertyValue();
    desc09.addValue(Locale.ENGLISH, "Nine");
    desc09.addValue(Locale.US, "Nine");
    content09Properties.put(ContentModel.PROP_DESCRIPTION, desc09);
    content09Properties.put(ContentModel.PROP_TITLE, desc09);
    content09Properties.put(ContentModel.PROP_CONTENT, new ContentPropertyValue(Locale.UK, 0l, "UTF-9", "text/plain", null));
    content09Properties.put(ContentModel.PROP_NAME, new StringPropertyValue("aa"));
    content09Properties.put(ContentModel.PROP_CREATOR, new StringPropertyValue("System"));
    content09Properties.put(ContentModel.PROP_MODIFIER, new StringPropertyValue("System"));
    Date date09 = new Date(date08.getTime() + 1000);
    content09Properties.put(ContentModel.PROP_CREATED, new StringPropertyValue(DefaultTypeConverter.INSTANCE.convert(String.class, date09)));
    content09Properties.put(ContentModel.PROP_MODIFIED, new StringPropertyValue(DefaultTypeConverter.INSTANCE.convert(String.class, date09)));
    content09Properties.put(ContentModel.PROP_VERSION_LABEL, new StringPropertyValue("label"));
    HashMap<QName, String> content09Content = new HashMap<QName, String>();
    content09Content.put(ContentModel.PROP_CONTENT, "Nine zebra kiwi score score score pad pad pad pad pad pad pad pad");
    NodeRef content09NodeRef = new NodeRef(new StoreRef("workspace", "SpacesStore"), createGUID());
    QName content09QName = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "aa");
    ChildAssociationRef content09CAR = new ChildAssociationRef(ContentModel.ASSOC_CONTAINS, folder09NodeRef, content09QName, content09NodeRef, true, 0);
    addNode(core, dataModel, 1, 22, 1, ContentModel.TYPE_CONTENT, new QName[] { ContentModel.ASPECT_TITLED }, content09Properties, content09Content, null, new ChildAssociationRef[] { content09CAR }, new NodeRef[] { baseFolderNodeRef, rootNodeRef, folder00NodeRef, folder05NodeRef, folder06NodeRef, folder07NodeRef, folder08NodeRef, folder09NodeRef }, new String[] { "/" + baseFolderQName.toString() + "/" + folder00QName.toString() + "/" + folder05QName.toString() + "/" + folder06QName.toString() + "/" + folder07QName.toString() + "/" + folder08QName.toString() + "/" + folder09QName.toString() + "/" + content09QName.toString() }, content09NodeRef, true);
    HashMap<QName, PropertyValue> content10Properties = new HashMap<QName, PropertyValue>();
    MLTextPropertyValue desc10 = new MLTextPropertyValue();
    desc10.addValue(Locale.ENGLISH, "Ten");
    desc10.addValue(Locale.US, "Ten");
    content10Properties.put(ContentModel.PROP_DESCRIPTION, desc10);
    content10Properties.put(ContentModel.PROP_TITLE, desc10);
    content10Properties.put(ContentModel.PROP_CONTENT, new ContentPropertyValue(Locale.UK, 0l, "UTF-9", "text/plain", null));
    content10Properties.put(ContentModel.PROP_NAME, new StringPropertyValue("aa-thumb"));
    content10Properties.put(ContentModel.PROP_CREATOR, new StringPropertyValue("System"));
    content10Properties.put(ContentModel.PROP_MODIFIER, new StringPropertyValue("System"));
    Date date10 = new Date(date09.getTime() + 1000);
    content10Properties.put(ContentModel.PROP_CREATED, new StringPropertyValue(DefaultTypeConverter.INSTANCE.convert(String.class, date10)));
    content10Properties.put(ContentModel.PROP_MODIFIED, new StringPropertyValue(DefaultTypeConverter.INSTANCE.convert(String.class, date10)));
    content10Properties.put(ContentModel.PROP_VERSION_LABEL, new StringPropertyValue("label"));
    HashMap<QName, String> content10Content = new HashMap<QName, String>();
    content10Content.put(ContentModel.PROP_CONTENT, "Ten zebra kiwi thumb score pad pad pad pad pad pad pad pad pad");
    NodeRef content10NodeRef = new NodeRef(new StoreRef("workspace", "SpacesStore"), createGUID());
    QName content10QName = QName.createQName(NamespaceService.CONTENT_MODEL_1_0_URI, "aa-thumb");
    ChildAssociationRef content10CAR = new ChildAssociationRef(ContentModel.ASSOC_CONTAINS, folder09NodeRef, content10QName, content10NodeRef, true, 0);
    addNode(core, dataModel, 1, 23, 1, ContentModel.TYPE_DICTIONARY_MODEL, new QName[] { ContentModel.ASPECT_TITLED }, content10Properties, content10Content, null, new ChildAssociationRef[] { content10CAR }, new NodeRef[] { baseFolderNodeRef, rootNodeRef, folder00NodeRef, folder05NodeRef, folder06NodeRef, folder07NodeRef, folder08NodeRef, folder09NodeRef }, new String[] { "/" + baseFolderQName.toString() + "/" + folder00QName.toString() + "/" + folder05QName.toString() + "/" + folder06QName.toString() + "/" + folder07QName.toString() + "/" + folder08QName.toString() + "/" + folder09QName.toString() + "/" + content10QName.toString() }, content10NodeRef, true);
}
Also used : StoreRef(org.alfresco.service.cmr.repository.StoreRef) StringPropertyValue(org.alfresco.solr.client.StringPropertyValue) HashMap(java.util.HashMap) SolrCore(org.apache.solr.core.SolrCore) QName(org.alfresco.service.namespace.QName) MLTextPropertyValue(org.alfresco.solr.client.MLTextPropertyValue) MultiPropertyValue(org.alfresco.solr.client.MultiPropertyValue) PropertyValue(org.alfresco.solr.client.PropertyValue) StringPropertyValue(org.alfresco.solr.client.StringPropertyValue) ContentPropertyValue(org.alfresco.solr.client.ContentPropertyValue) ChildAssociationRef(org.alfresco.service.cmr.repository.ChildAssociationRef) AlfrescoSolrDataModel(org.alfresco.solr.AlfrescoSolrDataModel) Date(java.util.Date) ContentPropertyValue(org.alfresco.solr.client.ContentPropertyValue) NodeRef(org.alfresco.service.cmr.repository.NodeRef) MLTextPropertyValue(org.alfresco.solr.client.MLTextPropertyValue) BeforeClass(org.junit.BeforeClass)

Example 4 with ContentPropertyValue

use of org.alfresco.solr.client.ContentPropertyValue in project SearchServices by Alfresco.

the class AlfrescoSolrUtils method getNodeMetaData.

/**
 * Get a nodes meta data.
 * @param node
 * @param txn
 * @param acl
 * @param owner
 * @param ancestors
 * @param createError
 * @return {@link NodeMetaData}
 */
public static NodeMetaData getNodeMetaData(Node node, Transaction txn, Acl acl, String owner, Set<NodeRef> ancestors, boolean createError) {
    NodeMetaData nodeMetaData = new NodeMetaData();
    nodeMetaData.setId(node.getId());
    nodeMetaData.setAclId(acl.getId());
    nodeMetaData.setTxnId(txn.getId());
    nodeMetaData.setOwner(owner);
    nodeMetaData.setAspects(new HashSet<QName>());
    nodeMetaData.setAncestors(ancestors);
    Map<QName, PropertyValue> props = new HashMap<QName, PropertyValue>();
    props.put(ContentModel.PROP_IS_INDEXED, new StringPropertyValue("true"));
    props.put(ContentModel.PROP_CONTENT, new ContentPropertyValue(Locale.US, 0l, "UTF-8", "text/plain", null));
    nodeMetaData.setProperties(props);
    // If create createError is true then we leave out the nodeRef which will cause an error
    if (!createError) {
        NodeRef nodeRef = new NodeRef(new StoreRef("workspace", "SpacesStore"), createGUID());
        nodeMetaData.setNodeRef(nodeRef);
    }
    nodeMetaData.setType(QName.createQName(TEST_NAMESPACE, "testSuperType"));
    nodeMetaData.setAncestors(ancestors);
    nodeMetaData.setPaths(new ArrayList<Pair<String, QName>>());
    nodeMetaData.setNamePaths(new ArrayList<List<String>>());
    return nodeMetaData;
}
Also used : StringPropertyValue(org.alfresco.solr.client.StringPropertyValue) StoreRef(org.alfresco.service.cmr.repository.StoreRef) NodeMetaData(org.alfresco.solr.client.NodeMetaData) HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap) QName(org.alfresco.service.namespace.QName) ContentPropertyValue(org.alfresco.solr.client.ContentPropertyValue) PropertyValue(org.alfresco.solr.client.PropertyValue) StringPropertyValue(org.alfresco.solr.client.StringPropertyValue) ContentPropertyValue(org.alfresco.solr.client.ContentPropertyValue) NodeRef(org.alfresco.service.cmr.repository.NodeRef) List(java.util.List) ArrayList(java.util.ArrayList) NamedList(org.apache.solr.common.util.NamedList) Pair(org.alfresco.util.Pair)

Example 5 with ContentPropertyValue

use of org.alfresco.solr.client.ContentPropertyValue in project SearchServices by Alfresco.

the class AlfrescoSolrTrackerTest method testTrackers.

@Test
public void testTrackers() throws Exception {
    /*
        * Create and index an AclChangeSet.
        */
    logger.info("######### Starting tracker test ###########");
    AclChangeSet aclChangeSet = getAclChangeSet(1);
    Acl acl = getAcl(aclChangeSet);
    // Test with long value
    Acl acl2 = getAcl(aclChangeSet, Long.MAX_VALUE - 10);
    AclReaders aclReaders = getAclReaders(aclChangeSet, acl, list("joel"), list("phil"), null);
    AclReaders aclReaders2 = getAclReaders(aclChangeSet, acl2, list("jim"), list("phil"), null);
    indexAclChangeSet(aclChangeSet, list(acl, acl2), list(aclReaders, aclReaders2));
    // Check for the ACL state stamp.
    BooleanQuery.Builder builder = new BooleanQuery.Builder();
    builder.add(new BooleanClause(new TermQuery(new Term(QueryConstants.FIELD_SOLR4_ID, "TRACKER!STATE!ACLTX")), BooleanClause.Occur.MUST));
    builder.add(new BooleanClause(LegacyNumericRangeQuery.newLongRange(QueryConstants.FIELD_S_ACLTXID, aclChangeSet.getId(), aclChangeSet.getId() + 1, true, false), BooleanClause.Occur.MUST));
    BooleanQuery waitForQuery = builder.build();
    waitForDocCount(waitForQuery, 1, MAX_WAIT_TIME);
    logger.info("#################### Passed First Test ##############################");
    /*
        * Create and index a Transaction
        */
    // First create a transaction.
    Transaction txn = getTransaction(0, 2);
    // Next create two nodes to update for the transaction
    Node folderNode = getNode(txn, acl, Node.SolrApiNodeStatus.UPDATED);
    Node fileNode = getNode(txn, acl, Node.SolrApiNodeStatus.UPDATED);
    Node errorNode = getNode(txn, acl, Node.SolrApiNodeStatus.UPDATED);
    logger.info("######### error node:" + errorNode.getId());
    // Next create the NodeMetaData for each node. TODO: Add more metadata
    NodeMetaData folderMetaData = getNodeMetaData(folderNode, txn, acl, "mike", null, false);
    NodeMetaData fileMetaData = getNodeMetaData(fileNode, txn, acl, "mike", ancestors(folderMetaData.getNodeRef()), false);
    // The errorNodeMetaData will cause an exception.
    NodeMetaData errorMetaData = getNodeMetaData(errorNode, txn, acl, "lisa", ancestors(folderMetaData.getNodeRef()), true);
    // Index the transaction, nodes, and nodeMetaDatas.
    // Note that the content is automatically created by the test framework.
    indexTransaction(txn, list(errorNode, folderNode, fileNode), list(errorMetaData, folderMetaData, fileMetaData));
    // Check for the TXN state stamp.
    logger.info("#################### Started Second Test ##############################");
    builder = new BooleanQuery.Builder();
    builder.add(new BooleanClause(new TermQuery(new Term(QueryConstants.FIELD_SOLR4_ID, "TRACKER!STATE!TX")), BooleanClause.Occur.MUST));
    builder.add(new BooleanClause(LegacyNumericRangeQuery.newLongRange(QueryConstants.FIELD_S_TXID, txn.getId(), txn.getId() + 1, true, false), BooleanClause.Occur.MUST));
    waitForQuery = builder.build();
    waitForDocCount(waitForQuery, 1, MAX_WAIT_TIME);
    logger.info("#################### Passed Second Test ##############################");
    /*
        * Query the index for the content
        */
    waitForDocCount(new TermQuery(new Term(QueryConstants.FIELD_READER, "jim")), 1, MAX_WAIT_TIME);
    waitForDocCount(new TermQuery(new Term("content@s___t@{http://www.alfresco.org/model/content/1.0}content", "world")), 2, MAX_WAIT_TIME);
    waitForDocCount(new TermQuery(new Term("content@s___t@{http://www.alfresco.org/model/content/1.0}content", Long.toString(fileNode.getId()))), 1, MAX_WAIT_TIME);
    logger.info("#################### Passed Third Test ##############################");
    ModifiableSolrParams params = new ModifiableSolrParams();
    // Query for an id in the content field. The node id is automatically populated into the content field by test framework
    params.add("q", "t1:" + fileNode.getId());
    params.add("qt", "/afts");
    params.add("start", "0");
    params.add("rows", "6");
    params.add("sort", "id asc");
    params.add("fq", "{!afts}AUTHORITY_FILTER_FROM_JSON");
    SolrServletRequest req = areq(params, "{\"locales\":[\"en\"], \"templates\": [{\"name\":\"t1\", \"template\":\"%cm:content\"}], \"authorities\": [ \"joel\"], \"tenants\": [ \"\" ]}");
    assertQ(req, "*[count(//doc)=1]", "//result/doc[1]/long[@name='DBID'][.='" + fileNode.getId() + "']");
    logger.info("#################### Passed Fourth Test ##############################");
    // Check for the error doc
    waitForDocCount(new TermQuery(new Term(QueryConstants.FIELD_DOC_TYPE, "ErrorNode")), 1, MAX_WAIT_TIME);
    logger.info("#################### Passed Fifth Test ##############################");
    // Mark the folder as needing cascade
    Transaction txn1 = getTransaction(0, 1);
    // Update the properties on the Node and NodeMetaData to simulate an update to the Node.
    folderMetaData.getProperties().put(ContentModel.PROP_CASCADE_TX, new StringPropertyValue(Long.toString(txn1.getId())));
    // Update the txnId
    folderNode.setTxnId(txn1.getId());
    folderMetaData.setTxnId(txn1.getId());
    // Change the ancestor on the file just to see if it's been updated
    NodeRef nodeRef = new NodeRef(new StoreRef("workspace", "SpacesStore"), createGUID());
    fileMetaData.setAncestors(ancestors(nodeRef));
    // This will add the PROP_CASCADE_TX property to the folder.
    logger.info("################### ADDING CASCADE TRANSACTION #################");
    indexTransaction(txn1, list(folderNode), list(folderMetaData));
    // Check for the TXN state stamp.
    builder = new BooleanQuery.Builder();
    builder.add(new BooleanClause(new TermQuery(new Term(QueryConstants.FIELD_SOLR4_ID, "TRACKER!STATE!TX")), BooleanClause.Occur.MUST));
    builder.add(new BooleanClause(LegacyNumericRangeQuery.newLongRange(QueryConstants.FIELD_S_TXID, txn1.getId(), txn1.getId() + 1, true, false), BooleanClause.Occur.MUST));
    waitForDocCount(builder.build(), 1, MAX_WAIT_TIME);
    logger.info("#################### Passed Sixth Test ##############################");
    TermQuery termQuery1 = new TermQuery(new Term(QueryConstants.FIELD_ANCESTOR, nodeRef.toString()));
    waitForDocCount(termQuery1, 1, MAX_WAIT_TIME);
    params = new ModifiableSolrParams();
    params.add("q", QueryConstants.FIELD_ANCESTOR + ":\"" + nodeRef.toString() + "\"");
    params.add("qt", "/afts");
    params.add("start", "0");
    params.add("rows", "6");
    params.add("sort", "id asc");
    params.add("fq", "{!afts}AUTHORITY_FILTER_FROM_JSON");
    req = areq(params, "{\"locales\":[\"en\"], \"templates\": [{\"name\":\"t1\", \"template\":\"%cm:content\"}], \"authorities\": [ \"mike\"], \"tenants\": [ \"\" ]}");
    assertQ(req, "*[count(//doc)=1]", "//result/doc[1]/long[@name='DBID'][.='" + fileNode.getId() + "']");
    logger.info("#################### Passed Seventh Test ##############################");
    // Check that both documents have been indexed and have content.
    waitForDocCount(new TermQuery(new Term("content@s___t@{http://www.alfresco.org/model/content/1.0}content", "world")), 2, MAX_WAIT_TIME);
    logger.info("#################### Passed Eighth Test ##############################");
    // Add document with isContentIndexed=false
    Transaction txnNoContent = getTransaction(0, 1);
    Node noContentNode = getNode(txnNoContent, acl, Node.SolrApiNodeStatus.UPDATED);
    NodeMetaData noContentMetaData = getNodeMetaData(noContentNode, txnNoContent, acl, "mike", null, false);
    noContentMetaData.getProperties().put(ContentModel.PROP_IS_CONTENT_INDEXED, new StringPropertyValue("false"));
    noContentMetaData.getProperties().put(ContentModel.PROP_CONTENT, new ContentPropertyValue(Locale.UK, 298L, "UTF-8", "text/json", null));
    indexTransaction(txnNoContent, list(noContentNode), list(noContentMetaData));
    // This tests that the mime type has been added for this document. It is the only document with text/json in the index.
    waitForDocCount(new TermQuery(new Term("content@s__mimetype@{http://www.alfresco.org/model/content/1.0}content", "text/json")), 1, MAX_WAIT_TIME);
    // Many of the tests beyond this point rely on a specific count of documents in the index that have content.
    // This document should not have had the content indexed so the tests following will pass.
    // If the content had been indexed the tests following this one would have failed.
    // This proves that the ContentModel.PROP_IS_CONTENT_INDEXED property is being followed by the tracker
    // Try bulk loading
    Transaction txn2 = getTransaction(0, 550);
    List<Node> nodes = new ArrayList();
    List<NodeMetaData> nodeMetaDatas = new ArrayList();
    for (int i = 0; i < 550; i++) {
        Node n = getNode(txn2, acl, Node.SolrApiNodeStatus.UPDATED);
        NodeMetaData nm = getNodeMetaData(n, txn2, acl, "mike", ancestors(folderMetaData.getNodeRef()), false);
        nodes.add(n);
        nodeMetaDatas.add(nm);
    }
    logger.info("############################ Bulk Nodes:" + nodes.size());
    indexTransaction(txn2, nodes, nodeMetaDatas);
    waitForDocCount(new TermQuery(new Term("content@s___t@{http://www.alfresco.org/model/content/1.0}content", "world")), 552, MAX_WAIT_TIME);
    logger.info("#################### Passed Ninth Test ##############################");
    for (int i = 0; i < 1000; i++) {
        Transaction txnX = getTransaction(0, 1);
        List<Node> nodesX = new ArrayList();
        List<NodeMetaData> nodeMetaDatasX = new ArrayList();
        Node n = getNode(txnX, acl, Node.SolrApiNodeStatus.UPDATED);
        NodeMetaData nm = getNodeMetaData(n, txnX, acl, "mike", ancestors(folderMetaData.getNodeRef()), false);
        nodesX.add(n);
        nodeMetaDatasX.add(nm);
        indexTransaction(txnX, nodesX, nodeMetaDatasX);
    }
    waitForDocCount(new TermQuery(new Term("content@s___t@{http://www.alfresco.org/model/content/1.0}content", "world")), 1552, MAX_WAIT_TIME);
    logger.info("#################### Passed Tenth Test ##############################");
    // Test the maintenance methods
    fileMetaData.setOwner("amy");
    reindexTransactionId(txn.getId());
    folderMetaData.setOwner("jill");
    reindexNodeId(folderNode.getId());
    // Wait for a document that has the new owner and the content populated.
    builder = new BooleanQuery.Builder();
    builder.add(new BooleanClause(new TermQuery(new Term("content@s___t@{http://www.alfresco.org/model/content/1.0}content", "world")), BooleanClause.Occur.MUST));
    builder.add(new BooleanClause(new TermQuery(new Term(QueryConstants.FIELD_OWNER, "amy")), BooleanClause.Occur.MUST));
    waitForDocCount(builder.build(), 1, MAX_WAIT_TIME);
    logger.info("#################### Passed Eleventh Test ##############################");
    // Wait for a document that has the new owner and the content populated.
    builder = new BooleanQuery.Builder();
    builder.add(new BooleanClause(new TermQuery(new Term("content@s___t@{http://www.alfresco.org/model/content/1.0}content", "world")), BooleanClause.Occur.MUST));
    builder.add(new BooleanClause(new TermQuery(new Term(QueryConstants.FIELD_OWNER, "jill")), BooleanClause.Occur.MUST));
    waitForDocCount(builder.build(), 1, MAX_WAIT_TIME);
    logger.info("#################### Passed Twelth Test ##############################");
    params = new ModifiableSolrParams();
    // Query for an id in the content field. The node id is automatically populated into the content field by test framework
    params.add("q", "t1:" + fileNode.getId());
    params.add("qt", "/afts");
    params.add("start", "0");
    params.add("rows", "6");
    params.add("sort", "id asc");
    params.add("fq", "{!afts}AUTHORITY_FILTER_FROM_JSON");
    req = areq(params, "{\"locales\":[\"en\"], \"templates\": [{\"name\":\"t1\", \"template\":\"%cm:content\"}], \"authorities\": [ \"amy\"], \"tenants\": [ \"\" ]}");
    assertQ(req, "*[count(//doc)=1]", "//result/doc[1]/long[@name='DBID'][.='" + fileNode.getId() + "']");
    logger.info("#################### Passed Fourteenth Test ##############################");
    params = new ModifiableSolrParams();
    // Query for an id in the content field. The node id is automatically populated into the content field by test framework
    params.add("q", "t1:" + folderNode.getId());
    params.add("qt", "/afts");
    params.add("start", "0");
    params.add("rows", "6");
    params.add("sort", "id asc");
    params.add("fq", "{!afts}AUTHORITY_FILTER_FROM_JSON");
    req = areq(params, "{\"locales\":[\"en\"], \"templates\": [{\"name\":\"t1\", \"template\":\"%cm:content\"}], \"authorities\": [ \"jill\"], \"tenants\": [ \"\" ]}");
    assertQ(req, "*[count(//doc)=1]", "//result/doc[1]/long[@name='DBID'][.='" + folderNode.getId() + "']");
    logger.info("#################### Passed Fifteenth Test ##############################");
    List<String> readers = aclReaders.getReaders();
    // Change the aclReader
    readers.set(0, "andy");
    indexAclId(acl.getId());
    List<String> readers2 = aclReaders2.getReaders();
    // Change the aclReader
    readers2.set(0, "ice");
    reindexAclId(acl2.getId());
    waitForDocCount(new TermQuery(new Term(QueryConstants.FIELD_READER, "andy")), 1, MAX_WAIT_TIME);
    // Ice should have replaced jim in acl2.
    waitForDocCount(new TermQuery(new Term(QueryConstants.FIELD_READER, "ice")), 1, MAX_WAIT_TIME);
    waitForDocCount(new TermQuery(new Term(QueryConstants.FIELD_READER, "jim")), 0, MAX_WAIT_TIME);
    logger.info("#################### Passed Sixteenth Test ##############################");
    params = new ModifiableSolrParams();
    // Query for an id in the content field. The node id is automatically populated into the content field by test framework
    params.add("q", "t1:" + fileNode.getId());
    params.add("qt", "/afts");
    params.add("start", "0");
    params.add("rows", "6");
    params.add("sort", "id asc");
    params.add("fq", "{!afts}AUTHORITY_FILTER_FROM_JSON");
    req = areq(params, "{\"locales\":[\"en\"], \"templates\": [{\"name\":\"t1\", \"template\":\"%cm:content\"}], \"authorities\": [ \"andy\"], \"tenants\": [ \"\" ]}");
    // FIX ME assertQ(req, "*[count(//doc)=1]","//result/doc[1]/long[@name='DBID'][.='" + fileNode.getId() + "']");
    logger.info("#################### Passed Seventeenth Test ##############################");
    // Change the aclReader
    readers.set(0, "alan");
    // Change the aclReader
    readers2.set(0, "paul");
    // This should replace "andy" and "ice" with "alan" and "paul"
    reindexAclChangeSetId(aclChangeSet.getId());
    // Test that "alan" and "paul" are in the index
    waitForDocCount(new TermQuery(new Term(QueryConstants.FIELD_READER, "alan")), 1, MAX_WAIT_TIME);
    waitForDocCount(new TermQuery(new Term(QueryConstants.FIELD_READER, "paul")), 1, MAX_WAIT_TIME);
    // Test that "andy" and "ice" are removed
    waitForDocCount(new TermQuery(new Term(QueryConstants.FIELD_READER, "andy")), 0, MAX_WAIT_TIME);
    waitForDocCount(new TermQuery(new Term(QueryConstants.FIELD_READER, "ice")), 0, MAX_WAIT_TIME);
    // Test Maintenance acl purge
    purgeAclId(acl2.getId());
    // Test Maintenance node purge
    purgeNodeId(fileNode.getId());
    purgeTransactionId(txn2.getId());
    // paul should be purged
    waitForDocCount(new TermQuery(new Term(QueryConstants.FIELD_READER, "paul")), 0, MAX_WAIT_TIME);
    waitForDocCount(new TermQuery(new Term("content@s___t@{http://www.alfresco.org/model/content/1.0}content", Long.toString(fileNode.getId()))), 0, MAX_WAIT_TIME);
    // Refects the purged node and transaction
    waitForDocCount(new TermQuery(new Term("content@s___t@{http://www.alfresco.org/model/content/1.0}content", "world")), 1001, MAX_WAIT_TIME);
    logger.info("#################### Passed Eighteenth Test ##############################");
    purgeAclChangeSetId(aclChangeSet.getId());
    // alan should be purged
    waitForDocCount(new TermQuery(new Term(QueryConstants.FIELD_READER, "alan")), 0, MAX_WAIT_TIME);
    // Fix the error node
    errorMetaData.setNodeRef(new NodeRef(new StoreRef("workspace", "SpacesStore"), createGUID()));
    // Reload the error node.
    logger.info("Retry the error node");
    retry();
    // The error in the index should disappear.
    waitForDocCount(new TermQuery(new Term(QueryConstants.FIELD_DOC_TYPE, "ErrorNode")), 0, MAX_WAIT_TIME);
    // And the error node should be present
    waitForDocCount(new TermQuery(new Term("content@s___t@{http://www.alfresco.org/model/content/1.0}content", Long.toString(errorNode.getId()))), 1, MAX_WAIT_TIME);
    logger.info("#################### Passed Nineteenth Test ##############################");
}
Also used : BooleanQuery(org.apache.lucene.search.BooleanQuery) TermQuery(org.apache.lucene.search.TermQuery) StringPropertyValue(org.alfresco.solr.client.StringPropertyValue) StoreRef(org.alfresco.service.cmr.repository.StoreRef) NodeMetaData(org.alfresco.solr.client.NodeMetaData) AlfrescoSolrUtils.getNodeMetaData(org.alfresco.solr.AlfrescoSolrUtils.getNodeMetaData) Node(org.alfresco.solr.client.Node) AlfrescoSolrUtils.getNode(org.alfresco.solr.AlfrescoSolrUtils.getNode) ArrayList(java.util.ArrayList) Acl(org.alfresco.solr.client.Acl) AlfrescoSolrUtils.getAcl(org.alfresco.solr.AlfrescoSolrUtils.getAcl) Term(org.apache.lucene.index.Term) ModifiableSolrParams(org.apache.solr.common.params.ModifiableSolrParams) ContentPropertyValue(org.alfresco.solr.client.ContentPropertyValue) BooleanClause(org.apache.lucene.search.BooleanClause) NodeRef(org.alfresco.service.cmr.repository.NodeRef) Transaction(org.alfresco.solr.client.Transaction) AlfrescoSolrUtils.getTransaction(org.alfresco.solr.AlfrescoSolrUtils.getTransaction) AlfrescoSolrUtils.getAclChangeSet(org.alfresco.solr.AlfrescoSolrUtils.getAclChangeSet) AlfrescoSolrUtils.indexAclChangeSet(org.alfresco.solr.AlfrescoSolrUtils.indexAclChangeSet) AclChangeSet(org.alfresco.solr.client.AclChangeSet) AlfrescoSolrUtils.getAclReaders(org.alfresco.solr.AlfrescoSolrUtils.getAclReaders) AclReaders(org.alfresco.solr.client.AclReaders) Test(org.junit.Test)

Aggregations

ContentPropertyValue (org.alfresco.solr.client.ContentPropertyValue)7 StringPropertyValue (org.alfresco.solr.client.StringPropertyValue)7 NodeRef (org.alfresco.service.cmr.repository.NodeRef)6 StoreRef (org.alfresco.service.cmr.repository.StoreRef)6 QName (org.alfresco.service.namespace.QName)6 PropertyValue (org.alfresco.solr.client.PropertyValue)6 MLTextPropertyValue (org.alfresco.solr.client.MLTextPropertyValue)5 ChildAssociationRef (org.alfresco.service.cmr.repository.ChildAssociationRef)4 MultiPropertyValue (org.alfresco.solr.client.MultiPropertyValue)4 Date (java.util.Date)3 HashMap (java.util.HashMap)3 SolrCore (org.apache.solr.core.SolrCore)3 BeforeClass (org.junit.BeforeClass)3 ArrayList (java.util.ArrayList)2 AlfrescoSolrDataModel (org.alfresco.solr.AlfrescoSolrDataModel)2 NodeMetaData (org.alfresco.solr.client.NodeMetaData)2 Calendar (java.util.Calendar)1 GregorianCalendar (java.util.GregorianCalendar)1 LinkedHashMap (java.util.LinkedHashMap)1 List (java.util.List)1