jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Short <...@benshort.co.uk>
Subject Critique and Comments
Date Wed, 09 Dec 2009 13:04:04 GMT
Could anyone provide any comments or see any problems that might occur
with the following repository structure?

Node option = session.getRootNode().addNode("/product/options/size");
		option.addMixin("mix:referenceable");
		option.setProperty("name", "size");
		option.setProperty("values", new String[]{"250ml", "500ml", "1000ml"});

		Node product = session.getRootNode().addNode("/products/washing_up_liquid");
		product.setProperty("name", "Washing up Liquid");
		
		Node productOptions = product.addNode("options");
		productOptions.setProperty("size", option); // REFERENCE

		Node variation250ml = product.addNode("variation/250ml");
		variation250ml.setProperty("cost", new BigDecimal("1.99"));
		variation250ml.setProperty("stock", 1);
		variation250ml.setProperty("weight", 250);

		Node variation250mlOptions = variation250ml.addNode("options/size");
		variation250mlOptions.setProperty("value", "250ml");

		Node variation500ml = product.addNode("variation/500ml");
		variation500ml.setProperty("cost", new BigDecimal("2.99"));
		variation500ml.setProperty("stock", 1);
		variation500ml.setProperty("weight", 500);

		Node variation500mlOptions = variation500ml.addNode("options/size");
		variation500mlOptions.setProperty("value", "500ml");


Node waist = session.getRootNode().addNode("/product/options/waist");
		waist.addMixin("mix:referenceable");
		waist.setProperty("name", "waist");
		waist.setProperty("values", new String[]{"28", "30", "32"});

		Node leg = session.getRootNode().addNode("/product/options/leg");
		leg.addMixin("mix:referenceable");
		leg.setProperty("name", "leg");
		leg.setProperty("values", new String[]{"28", "30", "32"});

		Node product = session.getRootNode().addNode("/products/jeans");
		product.setProperty("name", "Jeans");

		Node productOptions = product.addNode("options");
		productOptions.setProperty("waist", waist); // REFERENCE
	    productOptions.setProperty("leg", leg); // REFERENCE

		Node variation28waist28leg = product.addNode("variation/28waist28leg");
		variation28waist28leg.setProperty("cost", new BigDecimal("49.99"));
		variation28waist28leg.setProperty("stock", 1);
		variation28waist28leg.setProperty("weight", 3000);

		Node option1 = variation28waist28leg.addNode("options/waist");
		option1.setProperty("value", "28");

		Node option2 = variation28waist28leg.addNode("options/leg");
		option2.setProperty("value", "28");

Mime
View raw message