Example #1
0
            beforeEach(function () {
                var binder = BlueprintBinder.create().initWithName("Binder");
                personBlueprint = Blueprint.create().initWithNameAndModuleId("Person", "mymodule");
                personBlueprint.addAttribute(Attribute.create().initWithName("name"));
                personBlueprint.addAttribute(Attribute.create().initWithName("keywords"));

                binder.addBlueprint(personBlueprint);
                BlueprintBinder.manager.addBlueprintBinder(binder);

                louis = personBlueprint.newInstance().init();

                context = ChangeContext.create().init();
                context.insert(louis);
            });
Example #2
0
            beforeEach(function () {
                var binder = BlueprintBinder.create().initWithName("Binder");
                shapeBlueprint = Blueprint.create().initWithNameAndModuleId("Shape", "mymodule");
                binder.addBlueprint(shapeBlueprint);
                var attribute = Attribute.create().initWithName("size");
                shapeBlueprint.addAttribute(attribute);
                attribute = Attribute.create().initWithName("readOnlyAttribute");
                attribute.readOnly = true;
                shapeBlueprint.addAttribute(attribute);
                attribute = Attribute.create().initWithName("mandatoryAttribute");
                attribute.mandatory = true;
                shapeBlueprint.addAttribute(attribute);
                attribute = Attribute.create().initWithName("denyDelete");
                attribute.denyDelete = true;
                shapeBlueprint.addAttribute(attribute);
                BlueprintBinder.manager.addBlueprintBinder(binder);

                circle = shapeBlueprint.newInstance().init();

                context = ChangeContext.create().init();
                context.insert(circle);
            });