Ejemplo n.º 1
0
 public function handle(DOMElement $row, XMLAConnectionContext $context, NamedList $list)
 {
     /*
           Example:
     
           <row>
               <CATALOG_NAME>FoodMart</CATALOG_NAME>
               <SCHEMA_NAME>FoodMart</SCHEMA_NAME>
               <CUBE_NAME>Sales</CUBE_NAME>
               <MEASURE_NAME>Profit</MEASURE_NAME>
               <MEASURE_UNIQUE_NAME>[Measures].[Profit]</MEASURE_UNIQUE_NAME>
               <MEASURE_CAPTION>Profit</MEASURE_CAPTION>
               <MEASURE_AGGREGATOR>127</MEASURE_AGGREGATOR>
               <DATA_TYPE>130</DATA_TYPE>
               <MEASURE_IS_VISIBLE>true</MEASURE_IS_VISIBLE>
               <DESCRIPTION>Sales Cube - Profit Member</DESCRIPTION>
           </row>
     */
     $measureName = XMLAUtil::stringElement($row, 'MEASURE_NAME');
     $measureUniqueName = XMLAUtil::stringElement($row, 'MEASURE_UNIQUE_NAME');
     $measureCaption = XMLAUtil::stringElement($row, 'MEASURE_CAPTION');
     $description = XMLAUtil::stringElement($row, 'DESCRIPTION');
     $measureAggregator = NULL;
     /*$measureAggregator =
       MeasureAggregator::getDictionary ( )::forOrdinal (
          XMLAUtil::integerElement (
             $row, 'MEASURE_AGGREGATOR' ) );*/
     // Figure out datatype
     $datatype = NULL;
     $ordinalDatatype = DataType::getDictionary()->forName(XMLAUtil::stringElement($row, 'DATA_TYPE'));
     if ($ordinalDatatype == null) {
         $datatype = Datatype::getDictionary()->forOrdinal(XMLAUtil::integerElement($row, 'DATA_TYPE'));
     } else {
         $datatype = $ordinalDatatype;
     }
     $measureIsVisible = XMLAUtil::booleanElement($row, 'MEASURE_IS_VISIBLE');
     $member = $context->getCube($row)->getMetadataReader()->lookupMemberByUniqueName($measureUniqueName);
     if ($member == null) {
         throw new OLAPException('The server failed to resolve a member with the same unique name as a measure named ' . $measureUniqueName);
     }
     $list->add(new XMLAMeasure($member->getLevel(), $measureUniqueName, $measureName, $measureCaption, $description, null, $measureAggregator, $datatype, $measureIsVisible, $member->getOrdinal()));
 }
Ejemplo n.º 2
0
 public function handle(DOMElement $row, XMLAConnectionContext $context, NamedList $list)
 {
     /*
           Example:
     
           <row>
        <CATALOG_NAME>FoodMart</CATALOG_NAME>
        <SCHEMA_NAME>FoodMart</SCHEMA_NAME>
        <CUBE_NAME>HR</CUBE_NAME>
        <DIMENSION_UNIQUE_NAME>[Store]</DIMENSION_UNIQUE_NAME>
        <HIERARCHY_UNIQUE_NAME>[Store]</HIERARCHY_UNIQUE_NAME>
        <LEVEL_UNIQUE_NAME>[Store].[Store Name]</LEVEL_UNIQUE_NAME>
        <PROPERTY_NAME>Store Manager</PROPERTY_NAME>
        <PROPERTY_CAPTION>Store Manager</PROPERTY_CAPTION>
        <PROPERTY_TYPE>1</PROPERTY_TYPE>
        <DATA_TYPE>130</DATA_TYPE>
        <PROPERTY_CONTENT_TYPE>0</PROPERTY_CONTENT_TYPE>
        <DESCRIPTION>HR Cube - Store Hierarchy - Store
            Name Level - Store Manager Property</DESCRIPTION>
           </row>
     */
     $description = XMLAUtil::stringElement($row, 'DESCRIPTION');
     $uniqueName = XMLAUtil::stringElement($row, 'DESCRIPTION');
     $caption = XMLAUtil::stringElement($row, 'PROPERTY_CAPTION');
     $name = XMLAUtil::stringElement($row, 'PROPERTY_NAME');
     $datatype = null;
     $ordinalDatatype = DataType::getDictionary()->forName(XMLAUtil::stringElement($row, 'DATA_TYPE'));
     if ($ordinalDatatype == null) {
         $datatype = DataType::getDictionary()->forOrdinal(XMLAUtil::integerElement($row, 'DATA_TYPE'));
     } else {
         $datatype = $ordinalDatatype;
     }
     $contentTypeOrdinal = XMLAUtil::integerElement($row, 'PROPERTY_CONTENT_TYPE');
     $contentType = $contentTypeOrdinal == null ? null : PropertyContentType::getDictionary()->forOrdinal($contentTypeOrdinal);
     $propertyType = XMLAUtil::integerElement($row, 'PROPERTY_TYPE');
     $type = PropertyType::getDictionary()->forMask($propertyType);
     $list->add(new XMLAProperty($uniqueName, $name, $caption, $description, $datatype, $type, $contentType));
 }
Ejemplo n.º 3
0
 public function getDatatype()
 {
     return DataType::getEnum(DataType::STRING);
 }