Example #1
0
 /**
  * Initializes the NodeTypeDefinition from the given DOM
  * @param DOMElement NodeTypeElement
  */
 public function __construct(DOMElement $node, jackalope_NodeType_NodeTypeManager $nodeTypeManager)
 {
     $this->nodeTypeManager = $nodeTypeManager;
     $this->name = $node->getAttribute('name');
     $this->isAbstract = jackalope_Helper::getBoolAttribute($node, 'isAbstract');
     $this->isMixin = jackalope_Helper::getBoolAttribute($node, 'isMixin');
     $this->isQueryable = jackalope_Helper::getBoolAttribute($node, 'isQueryable');
     $this->hasOrderableChildNodes = jackalope_Helper::getBoolAttribute($node, 'hasOrderableChildNodes');
     $this->primaryItemName = $node->getAttribute('primaryItemName');
     if (empty($this->primaryItemName)) {
         $this->primaryItemName = null;
     }
     $xp = new DOMXPath($node->ownerDocument);
     $supertypes = $xp->query('supertypes/supertype', $node);
     foreach ($supertypes as $supertype) {
         array_push($this->declaredSuperTypeNames, $supertype->nodeValue);
     }
     $properties = $xp->query('propertyDefinition', $node);
     foreach ($properties as $property) {
         array_push($this->declaredPropertyDefinitions, jackalope_Factory::get('NodeType_PropertyDefinition', array($property, $nodeTypeManager)));
     }
     $declaredNodeDefinitions = $xp->query('childNodeDefinition', $node);
     foreach ($declaredNodeDefinitions as $nodeDefinition) {
         array_push($this->declaredNodeDefinitions, jackalope_Factory::get('NodeType_NodeDefinition', array($nodeDefinition, $this->nodeTypeManager)));
     }
 }
Example #2
0
 public function __construct(DOMElement $node, jackalope_NodeType_NodeTypeManager $nodeTypeManager)
 {
     $this->nodeTypeManager = $nodeTypeManager;
     $this->declaringNodeType = $node->getAttribute('declaringNodeType');
     $this->name = $node->getAttribute('name');
     $this->isAutoCreated = jackalope_Helper::getBoolAttribute($node, 'isAutoCreated');
     $this->isMandatory = jackalope_Helper::getBoolAttribute($node, 'mandatory');
     $this->isProtected = jackalope_Helper::getBoolAttribute($node, 'isProtected');
     $this->onParentVersion = PHPCR_Version_OnParentVersionAction::valueFromName($node->getAttribute('onParentVersion'));
 }
Example #3
0
 public function __construct(DOMElement $node, jackalope_NodeType_NodeTypeManager $nodeTypeManager)
 {
     parent::__construct($node, $nodeTypeManager);
     $this->allowsSameNameSiblings = jackalope_Helper::getBoolAttribute($node, 'sameNameSiblings');
     $this->defaultPrimaryTypeName = $node->getAttribute('defaultPrimaryType');
     if (empty($this->defaultPrimaryTypeName)) {
         $this->defaultPrimaryTypeName = null;
     }
     $xp = new DOMXpath($node->ownerDocument);
     $requiredPrimaryTypes = $xp->query('requiredPrimaryTypes/requiredPrimaryType', $node);
     if (0 < $requiredPrimaryTypes->length) {
         foreach ($requiredPrimaryTypes as $requiredPrimaryType) {
             array_push($this->requiredPrimaryTypeNames, $requiredPrimaryType->nodeValue);
         }
     } else {
         array_push($this->requiredPrimaryTypeNames, self::DEFAULT_PRIMARY_NODE);
     }
 }
Example #4
0
 public function __construct(DOMElement $node, jackalope_NodeType_NodeTypeManager $nodeTypeManager)
 {
     parent::__construct($node, $nodeTypeManager);
     $this->requiredType = PHPCR_PropertyType::valueFromName($node->getAttribute('requiredType'));
     $this->isMultiple = jackalope_Helper::getBoolAttribute($node, 'multiple');
     $this->isFullTextSearchable = jackalope_Helper::getBoolAttribute($node, 'fullTextSearchable');
     $this->isQueryOrderable = jackalope_Helper::getBoolAttribute($node, 'queryOrderable');
     $xp = new DOMXpath($node->ownerDocument);
     $valueConstraints = $xp->query('valueConstraints/valueConstraint', $node);
     foreach ($valueConstraints as $valueConstraint) {
         array_push($this->valueConstraints, $valueConstraint->nodeValue);
     }
     $availableQueryOperators = $xp->query('availableQueryOperators/availableQueryOperator', $node);
     foreach ($availableQueryOperators as $availableQueryOperator) {
         array_push($this->availableQueryOperators, $availableQueryOperator->nodeValue);
     }
     $defaultValues = $xp->query('defaultValues/defaultValue', $node);
     foreach ($defaultValues as $defaultValue) {
         array_push($this->defaultValues, jackalope_Factory::get('Value', array(PHPCR_PropertyType::valueFromType($defaultValue->nodeValue), $defaultValue->nodeValue)));
     }
 }