Modification Operations
438821
@Override
  public Collection<V> put(K key, Collection<V> value) {
    throw new UnsupportedOperationException();
  }
1318553
def apply(modifications, state):
        
        count = 0
        for a in modifications:
            if _debug:
                assert a[0] in ('set', 'mv', 'map', 'rm')
                logger.debug("processing rule: %s", str(a))
            if len(a) == 3:
                operation, name, value = a
                if operation == 'set':
                    state[name] = value
                    count += 1
                elif operation == 'mv':
                    try:
                        arg = state.pop(name)
                        state[value] = arg
                        count += 1
                    except KeyError:
                        raise ClassVersionException("the previous version didn't "
                                                    "store an attribute named '{}'".format(a[1]))
                elif operation == 'map':
                    func = value
                    if hasattr(func, '__func__'):
                        func = func.__func__
                    assert callable(func)
                    state[name] = func(state[name])
                    count += 1
            elif len(a) == 2:
                operation, value = a
                if operation == 'rm':
                    state.pop(value, None)
                    count += 1
                elif operation == 'transform':
                    assert callable(value)
                    value(state)
                    count += 1

        assert count == len(modifications), 'was not able to process all modifications on state'
200576
function modify(query, res) {
	// jshint ignore:line
	//	console.log(arguments);

	/* If source is a primitive value then return it */
	if (
		typeof res === 'undefined' ||
		typeof res === 'number' ||
		typeof res === 'string' ||
		typeof res === 'boolean'
	) {
		return res;
	}

	var modifier = query.modifier || alasql.options.modifier;
	var columns = query.columns;
	if (typeof columns === 'undefined' || columns.length == 0) {
		// Try to create columns
		if (res.length > 0) {
			var allcol = {};
			for (var i = Math.min(res.length, alasql.options.columnlookup || 10) - 1; 0 <= i; i--) {
				for (var key in res[i]) {
					allcol[key] = true;
				}
			}

			columns = Object.keys(allcol).map(function(columnid) {
				return {columnid: columnid};
			});
		} else {
			// Cannot recognize columns
			columns = [];
		}
	}

	//	console.log(columns);

	if (modifier === 'VALUE') {
		//		console.log(222,res);
		if (res.length > 0) {
			var key;
			if (columns && columns.length > 0) {
				key = columns[0].columnid;
			} else {
				key = Object.keys(res[0])[0];
			}
			res = res[0][key];
		} else {
			res = undefined;
		}
	} else if (modifier === 'ROW') {
		if (res.length > 0) {
			var key;
			var a = [];
			for (var key in res[0]) {
				a.push(res[0][key]);
			}
			res = a;
		} else {
			res = undefined;
		}
	} else if (modifier === 'COLUMN') {
		var ar = [];
		if (res.length > 0) {
			var key;
			if (columns && columns.length > 0) {
				key = columns[0].columnid;
			} else {
				key = Object.keys(res[0])[0];
			}

			for (var i = 0, ilen = res.length; i < ilen; i++) {
				ar.push(res[i][key]);
			}
		}
		res = ar;
	} else if (modifier === 'MATRIX') {
		// Returns square matrix of rows
		var ar = [];
		for (var i = 0; i < res.length; i++) {
			var a = [];
			var r = res[i];
			for (var j = 0; j < columns.length; j++) {
				a.push(r[columns[j].columnid]);
			}
			ar.push(a);
		}
		res = ar;
	} else if (modifier === 'INDEX') {
		var ar = {};
		var key, val;
		if (columns && columns.length > 0) {
			key = columns[0].columnid;
			val = columns[1].columnid;
		} else {
			var okeys = Object.keys(res[0]);
			key = okeys[0];
			val = okeys[1];
		}
		for (var i = 0, ilen = res.length; i < ilen; i++) {
			ar[res[i][key]] = res[i][val];
		}
		res = ar;
		//		res = arrayOfArrays(res);
	} else if (modifier === 'RECORDSET') {
		res = new alasql.Recordset({columns: columns, data: res});
		//		res = arrayOfArrays(res);
	} else if (modifier === 'TEXTSTRING') {
		var key;
		if (columns && columns.length > 0) {
			key = columns[0].columnid;
		} else {
			key = Object.keys(res[0])[0];
		}

		for (var i = 0, ilen = res.length; i < ilen; i++) {
			res[i] = res[i][key];
		}
		res = res.join('\n');
		//		res = arrayOfArrays(res);
	}
	return res;
}
431878
public function applyOperations()
    {
        // Renders the effects
        foreach ($this->operations as $operation) {
            call_user_func_array(array($this->adapter, $operation[0]), $operation[1]);
        }
    }
229163
private List<OperationPair> createMutateOperationPairs() {
    List<OperationPair> ops = Lists.newArrayList();

    if (originalRoot == null) {
      // The original tree was empty, so treat all nodes in this tree as ADDs.
      return createAddOperations(root);
    }

    // Add the mutate operations required to apply changes to the root node.
    Set<ProductDimension> dimensionsToProcess = addMutateOperations(originalRoot, root, ops);

    // Add additional mutate operations for the remaining child dimensions to process.
    addMutateOperationsByParent(originalRoot, root, dimensionsToProcess, ops);
    return ops;
  }
1059438
function modify( $tpl, $operatorName, $operatorParameters, $rootNamespace, $currentNamespace, &$value, $namedParameters,
                     $placement )
    {
        if ( $operatorName == $this->LtName or $operatorName == $this->GtName or
             $operatorName == $this->LeName or $operatorName == $this->GeName )
        {
            $val = $namedParameters["threshold"];

            if ( ( $val_cnt = $this->getValueCount( $val ) ) === false )
            {
                $tpl->warning( $operatorName, "Unsupported input type: " . gettype( $val ) . "( $val ), must be either array, attribute object or numerical", $placement );
                return;
            }
        }
        switch ( $operatorName )
        {
            case $this->TrueName:
            case $this->FalseName:
            {
                $value = ( $operatorName == $this->TrueName );
            } break;
            case $this->NeName:
            {
                if ( count( $operatorParameters ) >= 1 )
                {
                    if ( count( $operatorParameters ) == 1 )
                    {
                        $lastOperand = $tpl->elementValue( $operatorParameters[0], $rootNamespace, $currentNamespace, $placement );
                        $value = ( $lastOperand != $value );
                    }
                    else
                    {
                        $similar = false;
                        $value = false;
                        $lastOperand = $tpl->elementValue( $operatorParameters[0], $rootNamespace, $currentNamespace, $placement );
                        for ( $i = 1; $i < count( $operatorParameters ); ++$i )
                        {
                            $operand = $tpl->elementValue( $operatorParameters[$i], $rootNamespace, $currentNamespace, $placement );
                            if ( $operand != $lastOperand )
                            {
                                $value = true;
                                break;
                            }
                            unset( $lastOperand );
                            $lastOperand =& $operand;
                        }
                    }
                }
                else
                {
                    $value = false;
                    $tpl->warning( $operatorName, "Requires one parameter for input checking or two or more for parameter checking", $placement );
                }
            } break;
            case $this->EqName:
            {
                if ( count( $operatorParameters ) >= 1 )
                {
                    if ( count( $operatorParameters ) == 1 )
                    {
                        $lastOperand = $tpl->elementValue( $operatorParameters[0], $rootNamespace, $currentNamespace, $placement );
                        $value = ( $lastOperand == $value );
                    }
                    else
                    {
                        $similar = false;
                        $value = true;
                        $lastOperand = $tpl->elementValue( $operatorParameters[0], $rootNamespace, $currentNamespace, $placement );
                        for ( $i = 1; $i < count( $operatorParameters ); ++$i )
                        {
                            $operand = $tpl->elementValue( $operatorParameters[$i], $rootNamespace, $currentNamespace, $placement );
                            if ( $operand != $lastOperand )
                            {
                                $value = false;
                                break;
                            }
                            unset( $lastOperand );
                            $lastOperand =& $operand;
                        }
                    }
                }
                else
                {
                    $value = false;
                    $tpl->warning( $operatorName, "Requires one parameter for input checking or two or more for parameter checking", $placement );
                }
            } break;
            case $this->OrName:
            {
                for ( $i = 0; $i < count( $operatorParameters ); ++$i )
                {
                    $operand = $tpl->elementValue( $operatorParameters[$i], $rootNamespace, $currentNamespace, $placement );
                    $operand_logic = false;
                    if ( $operand === null )
                        $operand_logic = false;
                    else if ( $operand === true || $operand === false )
                        $operand_logic = $operand;
                    else if ( is_array( $operand ) )
                        $operand_logic = count( $operand ) > 0;
                    else if ( is_numeric( $operand ) )
                        $operand_logic = $operand != 0;
                    else if ( is_object( $operand ) )
                        $operand_logic = ( method_exists( $operand, "attributes" ) and
                                           method_exists( $operand, "attribute" ) );
                    else if ( is_string( $operand ) )
                        $operand_logic =  strlen(trim($operand)) > 0;
                    if ( $operand_logic )
                    {
                        $value = $operand;
                        return;
                    }
                }
                $value = false;
            } break;
            case $this->AndName:
            {
                $operand = null;
                for ( $i = 0; $i < count( $operatorParameters ); ++$i )
                {
                    $operand = $tpl->elementValue( $operatorParameters[$i], $rootNamespace, $currentNamespace, $placement );
                    $operand_logic = false;
                    if ( $operand === null || $operand === '' )
                        $operand_logic = false;
                    else if ( $operand === true || $operand === false )
                        $operand_logic = $operand;
                    else if ( is_array( $operand ) )
                        $operand_logic = count( $operand ) > 0;
                    else if ( is_numeric( $operand ) )
                        $operand_logic = $operand != 0;
                    else if ( is_object( $operand ) )
                        $operand_logic = ( method_exists( $operand, "attributes" ) and
                                           method_exists( $operand, "attribute" ) );
                    else if ( is_string( $operand ) )
                        $operand_logic =  strlen(trim($operand)) > 0;
                    if ( !$operand_logic )
                    {
                        $value = false;
                        return;
                    }
                }
                $value = $operand;
            } break;
            case $this->ChooseName:
            {
                if ( $value === null )
                    $index = 0;
                else if ( is_array( $value ) or
                     ( is_object( $value ) and
                       method_exists( $value, "attributes" ) ) )
                {
                    $tpl->error( $operatorName, "Only supports numeric and boolean values", $placement );
                    return;
                }
                else if ( is_numeric( $value ) )
                    $index = $value;
                else
                    $index = $value ? 1 : 0;
                if ( $index < 0 or
                     $index > count( $operatorParameters ) - 1 )
                {
                    $tpl->error( $operatorName, "Index $index out of range 0 => " . ( count( $operatorParameters ) - 1 ),
                                 $placement );
                    $value = false;
                    return;
                }
                $value = $tpl->elementValue( $operatorParameters[$index], $rootNamespace, $currentNamespace, $placement );
            } break;
            case $this->LtName:
            case $this->GtName:
            case $this->LeName:
            case $this->GeName:
            {
                if ( $value !== null )
                {
                    $operandA = $value;
                    $operandB = $tpl->elementValue( $operatorParameters[0], $rootNamespace, $currentNamespace, $placement );
                }
                else
                {
                    $operandA = $tpl->elementValue( $operatorParameters[0], $rootNamespace, $currentNamespace, $placement );
                    $operandB = $tpl->elementValue( $operatorParameters[1], $rootNamespace, $currentNamespace, $placement );
                }

                if ( ( $cnt = $this->getValueCount( $operandA ) ) === false )
                {
                    $tpl->warning( $operatorName, "Unsupported input type: " . gettype( $operandA ) . "( $operandA ), must be either array, attribute object or numerical", $placement );
                    return;
                }
                if ( ( $val_cnt = $this->getValueCount( $operandB ) ) === false )
                {
                    $tpl->warning( $operatorName, "Unsupported input type: " . gettype( $operandB ) . "( $operandB ), must be either array, attribute object or numerical", $placement );
                    return;
                }
                if ( $operatorName == $this->LtName )
                    $value = ( $cnt < $val_cnt );
                else if ( $operatorName == $this->GtName )
                    $value = ( $cnt > $val_cnt );
                else if ( $operatorName == $this->LeName )
                    $value = ( $cnt <= $val_cnt );
                else if ( $operatorName == $this->GeName )
                    $value = ( $cnt >= $val_cnt );
            } break;
            case $this->NullName:
            {
                $value = $value === null;
            } break;
            case $this->NotName:
            {
                if ( $value === null and isset( $operatorParameters[0] ) )
                {
                    $operand = $tpl->elementValue( $operatorParameters[0], $rootNamespace, $currentNamespace, $placement );
                }
                else
                {
                    $operand = $value;
                }
                if ( $operand === null )
                    $operand = true;
                else if ( is_array( $operand ) )
                    $operand = ( count( $operand ) == 0 );
                else if ( is_object( $operand ) and
                          method_exists( $operand, "attributes" ) )
                    $operand = ( count( $operand->attributes() ) == 0 );
                else if ( is_numeric( $operand ) )
                    $operand = ( $operand == 0 );
                else if ( is_string( $operand ) )
                    $operand = ( strlen( $operand ) == 0 );
                else
                    $operand = !$operand;
                $value = $operand;
            } break;
        }
    }
335447
protected void addSortedModifications(List<DbOperation> flush) {

    // calculate sorted set of all modified entity types
    SortedSet<Class<?>> modifiedEntityTypes = new TreeSet<Class<?>>(MODIFICATION_TYPE_COMPARATOR);
    modifiedEntityTypes.addAll(updates.keySet());
    modifiedEntityTypes.addAll(deletes.keySet());
    modifiedEntityTypes.addAll(bulkOperations.keySet());

    for (Class<?> type : modifiedEntityTypes) {
      // first perform entity UPDATES
      addSortedModificationsForType(type, updates.get(type), flush);
      // next perform entity DELETES
      addSortedModificationsForType(type, deletes.get(type), flush);
      // last perform bulk operations
      SortedSet<DbBulkOperation> bulkOperationsForType = bulkOperations.get(type);
      if(bulkOperationsForType != null) {
        flush.addAll(bulkOperationsForType);
      }
    }

    //the very last perform bulk operations for which the order is important
    if(bulkOperationsInsertionOrder != null) {
      flush.addAll(bulkOperationsInsertionOrder);
    }
  }
1067591
def modify(name, old_value, new_value)
      @attributes[name] = new_value
      if @modifications && (old_value != new_value)
        original = @modifications[name].first if @modifications[name]
        @modifications[name] = [ (original || old_value), new_value ]
      end
    end
819159
def nii_modify(
        nii,
        fimout = '',
        outpath = '',
        fcomment = '',
        voxel_range=[]):

    ''' 
    '''

    if isinstance(nii, basestring) and os.path.isfile(nii):
        dctnii = imio.getnii(nii, output='all')
        fnii = nii
    if isinstance(nii, dict) and 'im' in nii:
        dctnii = nii
        if 'fim' in dctnii:
            fnii = dctnii['fim']

    #---------------------------------------------------------------------------
    #> output path
    if outpath=='' and fimout!='' and '/' in fimout:
        opth = os.path.dirname(fimout)
        if opth=='' and isinstance(fnii, basestring) and os.path.isfile(fnii):
            opth = os.path.dirname(nii)
        fimout = os.path.basename(fimout)

    elif outpath=='' and isinstance(fnii, basestring) and os.path.isfile(fnii):
        opth = os.path.dirname(fnii)
    else:
        opth = outpath
    imio.create_dir(opth)

    #> output floating and affine file names
    if fimout=='':

        if fcomment=='':
            fcomment += '_nimpa-modified'

        fout = os.path.join(
                opth,
                os.path.basename(fnii).split('.nii')[0]+fcomment+'.nii.gz')
    else:
        fout = os.path.join(
                opth,
                fimout.split('.')[0]+'.nii.gz')
    #---------------------------------------------------------------------------


    #> reduce the max value to 255
    if voxel_range and len(voxel_range)==1:
        im = voxel_range[0] * dctnii['im']/np.max(dctnii['im'])
    elif voxel_range and len(voxel_range)==2:
        #> normalise into range 0-1
        im = (dctnii['im'] - np.min(dctnii['im'])) / np.ptp(dctnii['im'])
        #> convert to voxel_range 
        im = voxel_range[0] + im*(voxel_range[1] - voxel_range[0])
    else:
        return None

    #> output file name for the extra reference image
    imio.array2nii(
        im,
        dctnii['affine'],
        fout,
        trnsp = (dctnii['transpose'].index(0),
                 dctnii['transpose'].index(1),
                 dctnii['transpose'].index(2)),
        flip = dctnii['flip'])

    return {'fim':fout, 'im':im, 'affine':dctnii['affine']}
697800
public OperationFuture<List<Group>> modify(GroupFilter groupFilter, GroupConfig groupConfig) {
        List<Group> groups = Arrays.asList(getRefsFromFilter(groupFilter));

        return modify(groups, groupConfig);
    }
452732
void put(Modification mod) {
      switch (mod.getType()) {
         case STORE:
            modifications.put(((Store) mod).getKey(), mod);
            break;
         case REMOVE:
            modifications.put(((Remove) mod).getKey(), mod);
            break;
         case LIST:
            for (Modification m : ((ModificationsList) mod).getList())
               put(m);
            break;
         default:
            throw new IllegalArgumentException("Unknown modification type " + mod.getType());
      }
   }
813576
void modifyData(final TrieNode<V> node, final V value) {
        node.value = value;
        ++modCount;
        ++size;
    }
889848
function modify( $tpl, $operatorName, $operatorParameters, $rootNamespace, $currentNamespace, &$operatorValue, $namedParameters, $placement )
    {
        $config = eZINI::instance( 'pdf.ini' );

        switch ( $namedParameters['operation'] )
        {
            case 'toc':
            {
                $operatorValue = '<C:callTOC';

                if ( count( $operatorParameters ) > 1 )
                {
                    $params = $tpl->elementValue( $operatorParameters[1], $rootNamespace, $currentNamespace );

                    $operatorValue .= isset( $params['size'] ) ? ':size:'. implode(',', $params['size'] ) : '';
                    $operatorValue .= isset( $params['dots'] ) ? ':dots:'. $params['dots'] : '';
                    $operatorValue .= isset( $params['contentText'] ) ? ':contentText:'. $params['contentText'] : '';
                    $operatorValue .= isset( $params['indent'] ) ? ':indent:'. implode(',', $params['indent'] ) : '';

                }

                $operatorValue .= '>';
                eZDebug::writeNotice( 'PDF: Generating TOC', __METHOD__ );
            } break;

            case 'set_font':
            {
                $params = $tpl->elementValue( $operatorParameters[1], $rootNamespace, $currentNamespace );

                $operatorValue = '<ezCall:callFont';

                foreach ( $params as $key => $value )
                {
                    if ( $key == 'colorCMYK' )
                    {
                        $operatorValue .= ':cmyk:' . implode( ',', $value );
                    }
                    else if ( $key == 'colorRGB' )
                    {
                        $operatorValue .= ':cmyk:' . implode( ',', eZMath::rgbToCMYK2( $value[0]/255,
                                                                                       $value[1]/255,
                                                                                       $value[2]/255 ) );
                    }
                    else
                    {
                        $operatorValue .= ':' . $key . ':' . $value;
                    }
                }
                $operatorValue .= '>';

                eZDebug::writeNotice( 'PDF: Changed font.' );
            } break;

            case 'table':
            {
                $operatorValue = '<ezGroup:callTable';

                if ( count( $operatorParameters > 2 ) )
                {
                    $tableSettings = $tpl->elementValue( $operatorParameters[2], $rootNamespace, $currentNamespace );

                    if ( is_array( $tableSettings ) )
                    {
                        foreach( array_keys( $tableSettings ) as $key )
                        {
                            switch( $key )
                            {
                                case 'headerCMYK':
                                case 'cellCMYK':
                                case 'textCMYK':
                                case 'titleCellCMYK':
                                case 'titleTextCMYK':
                                {
                                    $operatorValue .= ':' . $key . ':' . implode( ',', $tableSettings[$key] );
                                } break;

                                default:
                                {
                                    $operatorValue .= ':' . $key . ':' . $tableSettings[$key];
                                } break;
                            }
                        }
                    }
                }

                $operatorValue .= '>';

                $rows = $tpl->elementValue( $operatorParameters[1], $rootNamespace, $currentNamespace );

                $rows = str_replace( array( ' ', "\t", "\r\n", "\n" ),
                                                          '',
                                                          $rows );
                $httpCharset = eZTextCodec::internalCharset();
                $outputCharset = $config->hasVariable( 'PDFGeneral', 'OutputCharset' )
                                 ? $config->variable( 'PDFGeneral', 'OutputCharset' )
                                 : 'iso-8859-1';
                $codec = eZTextCodec::instance( $httpCharset, $outputCharset );
                // Convert current text to $outputCharset (by default iso-8859-1)
                $rows = $codec->convertString( $rows );

                $operatorValue .= urlencode( $rows );

                $operatorValue .= '</ezGroup:callTable><C:callNewLine>';

                eZDebug::writeNotice( 'PDF: Added table to PDF', __METHOD__ );
            } break;

            case 'header':
            {
                $header = $tpl->elementValue( $operatorParameters[1], $rootNamespace, $currentNamespace );

                $header['text'] = str_replace( array( ' ', "\t", "\r\n", "\n" ),
                                               '',
                                               $header['text'] );

                $operatorValue = '<ezCall:callHeader:level:'. $header['level'] .':size:'. $header['size'];

                if ( isset( $header['align'] ) )
                {
                    $operatorValue .= ':justification:'. $header['align'];
                }

                if ( isset( $header['font'] ) )
                {
                    $operatorValue .= ':fontName:'. $header['font'];
                }

                $operatorValue .= ':label:'. rawurlencode( $header['text'] );

                $operatorValue .= '><C:callNewLine>'. $header['text'] .'</ezCall:callHeader><C:callNewLine>';

                eZDebug::writeNotice( 'PDF: Added header: '. $header['text'] .', size: '. $header['size'] .
                                      ', align: '. $header['align'] .', level: '. $header['level'],
                                      __METHOD__ );
            } break;

            case 'create':
            {
                $this->createPDF();
            } break;

            case 'new_line':
            case 'newline':  // Deprecated
            {
                $operatorValue = '<C:callNewLine>';
            } break;

            case 'new_page':
            case 'newpage':  // Deprecated
            {
                $operatorValue = '<C:callNewPage><C:callNewLine>';

                eZDebug::writeNotice( 'PDF: New page', __METHOD__ );
            } break;

            case 'image':
            {
                $image = $tpl->elementValue( $operatorParameters[1], $rootNamespace, $currentNamespace );

                $width = isset( $image['width'] ) ? $image['width']: 100;
                $height = isset( $image['height'] ) ? $image['height']: 100;

                $operatorValue = '<C:callImage:src:'. rawurlencode( $image['src'] ) .':width:'. $width .':height:'. $height;

                if ( isset( $image['static'] ) )
                {
                    $operatorValue .= ':static:' . $image['static'];
                }

                if ( isset ( $image['x'] ) )
                {
                    $operatorValue .= ':x:' . $image['x'];
                }

                if ( isset( $image['y'] ) )
                {
                    $operatorValue .= ':y:' . $image['y'];
                }

                if ( isset( $image['dpi'] ) )
                {
                    $operatorValue .= ':dpi:' . $image['dpi'];
                }

                if ( isset( $image['align'] ) ) // left, right, center, full
                {
                    $operatorValue .= ':align:' . $image['align'];
                }

                $operatorValue .= '>';

                eZDebug::writeNotice( 'PDF: Added Image '.$image['src'].' to PDF file', __METHOD__ );
            } break;

            case 'anchor':
            {
                $name = $tpl->elementValue( $operatorParameters[1], $rootNamespace, $currentNamespace );

                $operatorValue = '<C:callAnchor:'. $name['name'] .':FitH:>';
                eZDebug::writeNotice( 'PDF: Added anchor: '.$name['name'], __METHOD__ );
            } break;

            case 'link': // external link
            {
                $link = $tpl->elementValue( $operatorParameters[1], $rootNamespace, $currentNamespace );

                $link['text'] = str_replace( '&quot;',
                                             '"',
                                             $link['text'] );

                $operatorValue = '<c:alink:'. rawurlencode( $link['url'] ) .'>'. $link['text'] .'</c:alink>';
                eZDebug::writeNotice( 'PDF: Added link: '. $link['text'] .', url: '.$link['url'], __METHOD__ );
            } break;

            case 'stream':
            {
                $this->PDF->ezStream();
            }

            case 'close':
            {
                $filename = $tpl->elementValue( $operatorParameters[1], $rootNamespace, $currentNamespace );

                eZDir::mkdir( eZDir::dirpath( $filename ), false, true );

                $file = eZClusterFileHandler::instance( $filename );
                $file->storeContents( $this->PDF->ezOutput(), 'viewcache', 'pdf' );

                eZDebug::writeNotice( 'PDF file closed and saved to '. $filename, __METHOD__ );
            } break;

            case 'strike':
            {
                $text = $tpl->elementValue( $operatorParameters[1], $rootNamespace, $currentNamespace );
                $operatorValue = '<c:strike>'. $text .'</c:strike>';
                eZDebug::writeNotice( 'Striked text added to PDF: "'. $text .'"', __METHOD__ );
            } break;

            /* usage : execute/add text to pdf file, pdf(execute,<text>) */
            case 'execute':
            {
                $text = $tpl->elementValue( $operatorParameters[1], $rootNamespace, $currentNamespace );

                if ( count ( $operatorParameters ) > 2 )
                {
                    $options = $tpl->elementValue( $operatorParameters[2], $rootNamespace, $currentNamespace );

                    $size = isset( $options['size'] ) ? $options['size'] : $config->variable( 'PDFGeneral', 'Format' );
                    $orientation = isset( $options['orientation'] ) ? $options['orientation'] : $config->variable( 'PDFGeneral', 'Orientation' );

                    $this->createPDF( $size, $orientation );
                }
                else
                {
                    $this->createPDF( $config->variable( 'PDFGeneral', 'Format' ), $config->variable( 'PDFGeneral', 'Orientation' ) );
                }

                $text = str_replace( array( ' ', "\n", "\t" ), '', $text );
                $httpCharset = eZTextCodec::internalCharset();
                $outputCharset = $config->hasVariable( 'PDFGeneral', 'OutputCharset' )
                                 ? $config->variable( 'PDFGeneral', 'OutputCharset' )
                                 : 'iso-8859-1';
                $codec = eZTextCodec::instance( $httpCharset, $outputCharset );
                // Convert current text to $outputCharset (by default iso-8859-1)
                $text = $codec->convertString( $text );

                $this->PDF->ezText( $text );
                eZDebug::writeNotice( 'Execute text in PDF, length: "'. strlen( $text ) .'"', __METHOD__ );
            } break;

            case 'page_number':
            case 'pageNumber':
            {
                $numberDesc = $tpl->elementValue( $operatorParameters[1], $rootNamespace, $currentNamespace );

                if ( isset( $numberDesc['identifier'] ) )
                {
                    $identifier = $numberDesc['identifier'];
                }
                else
                {
                    $identifier = 'main';
                }

                if ( isset( $numberDesc['start'] ) )
                {
                    $operatorValue = '<C:callStartPageCounter:start:'. $numberDesc['start'] .':identifier:'. $identifier .'>';
                }
                else if ( isset( $numberDesc['stop'] ) )
                {
                    $operatorValue = '<C:callStartPageCounter:stop:1:identifier:'. $identifier .'>';
                }
            } break;

            /* usage {pdf( line, hash( x1, <x>, y1, <y>, x2, <x2>, y2, <y2>, pages, <all|current>, thickness, <1..100>,  ) )} */
            case 'line':
            {
                $lineDesc = $tpl->elementValue( $operatorParameters[1], $rootNamespace, $currentNamespace );

                if ( isset( $lineDesc['pages']) and
                     $lineDesc['pages'] == 'all' )
                {
                    $operatorValue = '<ezGroup:callLine';
                }
                else
                {
                    $operatorValue = '<C:callDrawLine';
                }

                $operatorValue .= ':x1:' . $lineDesc['x1'];
                $operatorValue .= ':x2:' . $lineDesc['x2'];
                $operatorValue .= ':y1:' . $lineDesc['y1'];
                $operatorValue .= ':y2:' . $lineDesc['y2'];

                $operatorValue .= ':thickness:' . ( isset( $lineDesc['thickness'] ) ? $lineDesc['thickness'] : '1' );

                $operatorValue .= '>';

                if ( $lineDesc['pages'] == 'all' )
                {
                    $operatorValue .= '___</ezGroup:callLine>';
                }

                return $operatorValue;
            } break;

            case 'footer_block':
            case 'header_block':
            {
                $frameDesc = $tpl->elementValue( $operatorParameters[1], $rootNamespace, $currentNamespace );

                $operatorValue = '<ezGroup:callBlockFrame';
                $operatorValue .= ':location:'. $namedParameters['operation'];
                $operatorValue .= '>';

                if ( isset( $frameDesc['block_code'] ) )
                {
                    $httpCharset = eZTextCodec::internalCharset();
                    $outputCharset = $config->hasVariable( 'PDFGeneral', 'OutputCharset' )
                                 ? $config->variable( 'PDFGeneral', 'OutputCharset' )
                                 : 'iso-8859-1';
                    $codec = eZTextCodec::instance( $httpCharset, $outputCharset );
                    // Convert current text to $outputCharset (by default iso-8859-1)
                    $frameDesc['block_code'] = $codec->convertString( $frameDesc['block_code'] );
                    $operatorValue .= urlencode( $frameDesc['block_code'] );
                }

                $operatorValue .= '</ezGroup:callBlockFrame>';

                eZDebug::writeNotice( 'PDF: Added Block '.$namedParameters['operation'] .': '.$operatorValue, __METHOD__ );
                return $operatorValue;

            } break;

            /* deprecated */
            case 'footer':
            case 'frame_header':
            {
                $frameDesc = $tpl->elementValue( $operatorParameters[1], $rootNamespace, $currentNamespace );

                $operatorValue  = '<ezGroup:callFrame';
                $operatorValue .= ':location:'. $namedParameters['operation'];

                if ( $namedParameters['operation'] == 'footer' )
                {
                    $frameType = 'Footer';
                }
                else if( $namedParameters['operation'] == 'frame_header' )
                {
                    $frameType = 'Header';
                }

                if ( isset( $frameDesc['align'] ) )
                {
                    $operatorValue .= ':justification:'. $frameDesc['align'];
                }

                if ( isset( $frameDesc['page'] ) )
                {
                    $operatorValue .= ':page:'. $frameDesc['page'];
                }
                else
                {
                    $operatorValue .= ':page:all';
                }

                $operatorValue .= ':newline:' . ( isset( $frameDesc['newline'] ) ? $frameDesc['newline'] : 0 );

                $operatorValue .= ':pageOffset:';
                if ( isset( $frameDesc['pageOffset'] ) )
                {
                    $operatorValue .= $frameDesc['pageOffset'];
                }
                else
                {
                    $operatorValue .= $this->Config->variable( $frameType, 'PageOffset' );
                }

                if ( isset( $frameDesc['size'] ) )
                {
                    $operatorValue .= ':size:'. $frameDesc['size'];
                }

                if ( isset( $frameDesc['font'] ) )
                {
                    $operatorValue .= ':font:'. $frameDesc['font'];
                }

                $operatorValue .= '>';

                if ( isset( $frameDesc['text'] ) )
                {
                    $httpCharset = eZTextCodec::internalCharset();
                    $outputCharset = $config->hasVariable( 'PDFGeneral', 'OutputCharset' )
                                 ? $config->variable( 'PDFGeneral', 'OutputCharset' )
                                 : 'iso-8859-1';
                    $codec = eZTextCodec::instance( $httpCharset, $outputCharset );
                    // Convert current text to $outputCharset (by default iso-8859-1)
                    $frameDesc['text'] = $codec->convertString( $frameDesc['text'] );
                    $operatorValue .= urlencode( $frameDesc['text'] );
                }

                $operatorValue .= '</ezGroup:callFrame>';

                if ( isset( $frameDesc['margin'] ) )
                {
                    $operatorValue .= '<C:callFrameMargins';

                    $operatorValue .= ':identifier:'. $namedParameters['operation'];

                    $operatorValue .= ':topMargin:';
                    if ( isset( $frameDesc['margin']['top'] ) )
                    {
                        $operatorValue .= $frameDesc['margin']['top'];
                    }
                    else
                    {
                        $operatorValue .= $this->Config->variable( $frameType, 'TopMargin' );
                    }

                    $operatorValue .= ':bottomMargin:';
                    if ( isset( $frameDesc['margin']['bottom'] ) )
                    {
                        $operatorValue .= $frameDesc['margin']['bottom'];
                    }
                    else
                    {
                        $operatorValue .= $this->Config->variable( $frameType, 'BottomMargin' );
                    }

                    $operatorValue .= ':leftMargin:';
                    if ( isset( $frameDesc['margin']['left'] ) )
                    {
                        $operatorValue .= $frameDesc['margin']['left'];
                    }
                    else
                    {
                        $operatorValue .= $this->Config->variable( $frameType, 'LeftMargin' );
                    }

                    $operatorValue .= ':rightMargin:';
                    if ( isset( $frameDesc['margin']['right'] ) )
                    {
                        $operatorValue .= $frameDesc['margin']['right'];
                    }
                    else
                    {
                        $operatorValue .= $this->Config->variable( $frameType, 'RightMargin' );
                    }

                    $operatorValue .= ':height:';
                    if ( isset( $frameDesc['margin']['height'] ) )
                    {
                        $operatorValue .= $frameDesc['margin']['height'];
                    }
                    else
                    {
                        $operatorValue .= $this->Config->variable( $frameType, 'Height' );
                    }

                    $operatorValue .= '>';
                }

                if ( isset( $frameDesc['line'] ) )
                {
                    $operatorValue .= '<C:callFrameLine';
                    $operatorValue .= ':location:'. $namedParameters['operation'];

                    $operatorValue .= ':margin:';
                    if( isset( $frameDesc['line']['margin'] ) )
                    {
                        $operatorValue .= $frameDesc['line']['margin'];
                    }
                    else
                    {
                        $operatorValue .= $this->Config->variable( $frameType, 'LineMargin' );
                    }

                    if ( isset( $frameDesc['line']['leftMargin'] ) )
                    {
                        $operatorValue .= ':leftMargin:'. $frameDesc['line']['leftMargin'];
                    }
                    if ( isset( $frameDesc['line']['rightMargin'] ) )
                    {
                        $operatorValue .= ':rightMargin:'. $frameDesc['line']['rightMargin'];
                    }

                    $operatorValue .= ':pageOffset:';
                    if ( isset( $frameDesc['line']['pageOffset'] ) )
                    {
                        $operatorValue .= $frameDesc['line']['pageOffset'];
                    }
                    else
                    {
                        $operatorValue .= $this->Config->variable( $frameType, 'PageOffset' );
                    }

                    $operatorValue .= ':page:';
                    if ( isset( $frameDesc['line']['page'] ) )
                    {
                        $operatorValue .= $frameDesc['line']['page'];
                    }
                    else
                    {
                        $operatorValue .= $this->Config->variable( $frameType, 'Page' );
                    }

                    $operatorValue .= ':thickness:';
                    if ( isset( $frameDesc['line']['thickness'] ) )
                    {
                        $operatorValue .= $frameDesc['line']['thickness'];
                    }
                    else
                    {
                        $operatorValue .= $this->Config->variable( $frameType, 'LineThickness' );
                    }
                    $operatorValue .= '>';
                }

                eZDebug::writeNotice( 'PDF: Added frame '.$frameType .': '.$operatorValue, __METHOD__ );
            } break;

            case 'frontpage':
            {
                $pageDesc = $tpl->elementValue( $operatorParameters[1], $rootNamespace, $currentNamespace );

                $align = isset( $pageDesc['align'] ) ? $pageDesc['align'] : 'center';
                $text = isset( $pageDesc['text'] ) ? $pageDesc['text'] : '';
                $top_margin = isset( $pageDesc['top_margin'] ) ? $pageDesc['top_margin'] : 100;

                $operatorValue = '<ezGroup:callFrontpage:justification:'. $align .':top_margin:'. $top_margin;

                if ( isset( $pageDesc['size'] ) )
                {
                    $operatorValue .= ':size:'. $pageDesc['size'];
                }

                $text = str_replace( array( ' ', "\t", "\r\n", "\n" ),
                                     '',
                                     $text );
                $httpCharset = eZTextCodec::internalCharset();
                $outputCharset = $config->hasVariable( 'PDFGeneral', 'OutputCharset' )
                             ? $config->variable( 'PDFGeneral', 'OutputCharset' )
                             : 'iso-8859-1';
                $codec = eZTextCodec::instance( $httpCharset, $outputCharset );
                // Convert current text to $outputCharset (by default iso-8859-1)
                $text = $codec->convertString( $text );

                $operatorValue .= '>'. urlencode( $text ) .'</ezGroup:callFrontpage>';

                eZDebug::writeNotice( 'Added content to frontpage: '. $operatorValue, __METHOD__ );
            } break;

            /* usage: pdf(set_margin( hash( left, <left_margin>,
                                            right, <right_margin>,
                                            x, <x offset>,
                                            y, <y offset> )))
            */
            case 'set_margin':
            {
                $operatorValue = '<C:callSetMargin';
                $options = $tpl->elementValue( $operatorParameters[1], $rootNamespace, $currentNamespace );

                foreach( array_keys( $options ) as $key )
                {
                    $operatorValue .= ':' . $key . ':' . $options[$key];
                }

                $operatorValue .= '>';

                eZDebug::writeNotice( 'Added new margin/offset setup: ' . $operatorValue );

                return $operatorValue;
            } break;

            /* add keyword to pdf document */
            case 'keyword':
            {
                $text = $tpl->elementValue( $operatorParameters[1], $rootNamespace, $currentNamespace );

                $text = str_replace( array( ' ', "\n", "\t" ), '', $text );
                $httpCharset = eZTextCodec::internalCharset();
                $outputCharset = $config->hasVariable( 'PDFGeneral', 'OutputCharset' )
                             ? $config->variable( 'PDFGeneral', 'OutputCharset' )
                             : 'iso-8859-1';
                $codec = eZTextCodec::instance( $httpCharset, $outputCharset );
                // Convert current text to $outputCharset (by default iso-8859-1)
                $text = $codec->convertString( $text );

                $operatorValue = '<C:callKeyword:'. rawurlencode( $text ) .'>';
            } break;

            /* add Keyword index to pdf document */
            case 'createIndex':
            case 'create_index':
            {
                $operatorValue = '<C:callIndex>';

                eZDebug::writeNotice( 'Adding Keyword index to PDF', __METHOD__ );
            } break;

            case 'ul':
            {
                $text = $tpl->elementValue( $operatorParameters[1], $rootNamespace, $currentNamespace );
                if ( count( $operatorParameters ) > 2 )
                {
                    $params = $tpl->elementValue( $operatorParameters[2], $rootNamespace, $currentNamespace );
                }
                else
                {
                    $params = array();
                }

                if ( isset( $params['rgb'] ) )
                {
                    $params['rgb'] = eZMath::normalizeColorArray( $params['rgb'] );
                    $params['cmyk'] = eZMath::rgbToCMYK2( $params['rgb'][0]/255,
                                                          $params['rgb'][1]/255,
                                                          $params['rgb'][2]/255 );
                }

                if ( !isset( $params['cmyk'] ) )
                {
                    $params['cmyk'] = eZMath::rgbToCMYK2( 0, 0, 0 );
                }
                if ( !isset( $params['radius'] ) )
                {
                    $params['radius'] = 2;
                }
                if ( !isset ( $params['pre_indent'] ) )
                {
                    $params['pre_indent'] = 0;
                }
                if ( !isset ( $params['indent'] ) )
                {
                    $params['indent'] = 2;
                }
                if ( !isset ( $params['yOffset'] ) )
                {
                    $params['yOffset'] = -1;
                }

                $operatorValue = '<C:callCircle' .
                     ':pages:current' .
                     ':x:-1' .
                     ':yOffset:' . $params['yOffset'] .
                     ':y:-1' .
                     ':indent:' . $params['indent'] .
                     ':pre_indent:' . $params['pre_indent'] .
                     ':radius:' . $params['radius'] .
                     ':cmyk:' . implode( ',', $params['cmyk'] ) .
                     '>';

                $operatorValue .= '<C:callSetMargin' .
                     ':delta_left:' . ( $params['indent'] + $params['radius'] * 2 + $params['pre_indent'] ) .
                     '>';

                $operatorValue .= $text;

                $operatorValue .= '<C:callSetMargin' .
                     ':delta_left:' . -1 * ( $params['indent'] + $params['radius'] * 2 + $params['pre_indent'] ) .
                     '>';
            } break;

            case 'filled_circle':
            {
                $operatorValue = '';
                $options = $tpl->elementValue( $operatorParameters[1], $rootNamespace, $currentNamespace );

                if ( !isset( $options['pages'] ) )
                {
                    $options['pages'] = 'current';
                }

                if ( !isset( $options['x'] ) )
                {
                    $options['x'] = -1;
                }

                if ( !isset( $options['y'] ) )
                {
                    $options['y'] = -1;
                }

                if ( isset( $options['rgb'] ) )
                {
                    $options['rgb'] = eZMath::normalizeColorArray( $options['rgb'] );
                    $options['cmyk'] = eZMath::rgbToCMYK2( $options['rgb'][0]/255,
                                                           $options['rgb'][1]/255,
                                                           $options['rgb'][2]/255 );
                }

                $operatorValue = '<C:callCircle' .
                     ':pages:' . $options['pages'] .
                     ':x:' . $options['x'] .
                     ':y:' . $options['y'] .
                     ':radius:' . $options['radius'];

                if ( isset( $options['cmyk'] ) )
                {
                    $operatorValue .= ':cmyk:' . implode( ',', $options['cmyk'] );
                }

                $operatorValue .= '>';

                eZDebug::writeNotice( 'PDF Added circle: ' . $operatorValue );

                return $operatorValue;
            } break;

            case 'rectangle':
            {
                $operatorValue = '';
                $options = $tpl->elementValue( $operatorParameters[1], $rootNamespace, $currentNamespace );

                if ( !isset( $options['pages'] ) )
                {
                    $options['pages'] = 'current';
                }
                if ( !isset( $options['line_width'] ) )
                {
                    $options['line_width'] = 1;
                }
                if ( !isset( $options['round_corner'] ) )
                {
                    $options['round_corner'] = false;
                }

                $operatorValue = '<C:callRectangle';
                foreach ( $options as $key => $value )
                {
                    if ( $key == 'rgb' )
                    {
                        $options['rgb'] = eZMath::normalizeColorArray( $options['rgb'] );
                        $operatorValue .= ':cmyk:' . implode( ',',  eZMath::rgbToCMYK2( $options['rgb'][0]/255,
                                                                                        $options['rgb'][1]/255,
                                                                                        $options['rgb'][2]/255 ) );
                    }
                    else if ( $key == 'cmyk' )
                    {
                        $operatorValue .= ':cmyk:' . implode( ',', $value );
                    }
                    else
                    {
                        $operatorValue .= ':' . $key . ':' . $value;
                    }
                }
                $operatorValue .= '>';

                eZDebug::writeNotice( 'PDF Added rectangle: ' . $operatorValue );

                return $operatorValue;
            } break;

            /* usage: pdf( filled_rectangle, hash( 'x', <x offset>, 'y' => <y offset>, 'width' => <width>, 'height' => <height>,
                                                    'pages', <'all'|'current'|odd|even>, (supported, current)
                                                    'rgb', array( <r>, <g>, <b> ),
                                                    'cmyk', array( <c>, <m>, <y>, <k> ),
                                                    'rgbTop', array( <r>, <b>, <g> ),
                                                    'rgbBottom', array( <r>, <b>, <g> ),
                                                    'cmykTop', array( <c>, <m>, <y>, <k> ),
                                                    'cmykBottom', array( <c>, <m>, <y>, <k> ) ) ) */
            case 'filled_rectangle':
            {
                $operatorValue = '';
                $options = $tpl->elementValue( $operatorParameters[1], $rootNamespace, $currentNamespace );

                if ( !isset( $options['pages'] ) )
                {
                    $options['pages'] = 'current';
                }

                if ( isset( $options['rgb'] ) )
                {
                    $options['rgb'] = eZMath::normalizeColorArray( $options['rgb'] );
                    $options['cmyk'] = eZMath::rgbToCMYK2( $options['rgb'][0]/255,
                                                           $options['rgb'][1]/255,
                                                           $options['rgb'][2]/255 );
                }

                if ( isset( $options['cmyk'] ) )
                {
                    $options['cmykTop'] = $options['cmyk'];
                    $options['cmykBottom'] = $options['cmyk'];
                }

                if ( !isset( $options['cmykTop'] ) )
                {
                    if ( isset( $options['rgbTop'] ) )
                    {
                        $options['rgbTop'] = eZMath::normalizeColorArray( $options['rgbTop'] );
                        $options['cmykTop'] = eZMath::rgbToCMYK2( $options['rgbTop'][0]/255,
                                                                  $options['rgbTop'][1]/255,
                                                                  $options['rgbTop'][2]/255 );
                    }
                    else
                    {
                        $options['cmykTop'] = eZMath::rgbToCMYK2( 0, 0, 0 );
                    }
                }

                if ( !isset( $options['cmykBottom'] ) )
                {
                    if ( isset( $options['rgbBottom'] ) )
                    {
                        $options['rgbBottom'] = eZMath::normalizeColorArray( $options['rgbBottom'] );
                        $options['cmykBottom'] = eZMath::rgbToCMYK2( $options['rgbBottom'][0]/255,
                                                                     $options['rgbBottom'][1]/255,
                                                                     $options['rgbBottom'][2]/255 );
                    }
                    else
                    {
                        $options['cmykBottom'] = eZMath::rgbToCMYK2( 0, 0, 0 );
                    }
                }

                if ( !isset( $options['pages'] ) )
                {
                    $options['pages'] = 'current';
                }

                $operatorValue = '<C:callFilledRectangle' .
                     ':pages:' . $options['pages'] .
                     ':x:' . $options['x'] .
                     ':y:' . $options['y'] .
                     ':width:' . $options['width'] .
                     ':height:' . $options['height'] .
                     ':cmykTop:' . implode( ',', $options['cmykTop'] ) .
                     ':cmykBottom:' . implode( ',', $options['cmykBottom'] ) .
                     '>';

                eZDebug::writeNotice( 'Added rectangle: ' . $operatorValue );
            } break;

            /* usage : pdf(text, <text>, array( 'font' => <fontname>, 'size' => <fontsize> )) */
            case 'text':
            {
                $text = $tpl->elementValue( $operatorParameters[1], $rootNamespace, $currentNamespace );

                $operatorValue = '';
                $changeFont = false;

                if ( count( $operatorParameters ) >= 3)
                {
                    $textSettings = $tpl->elementValue( $operatorParameters[2], $rootNamespace, $currentNamespace );

                    if ( isset( $textSettings ) )
                    {
                        $operatorValue .= '<ezCall:callText';
                        $changeFont = true;

                        if ( isset( $textSettings['font'] ) )
                        {
                            $operatorValue .= ':font:'. $textSettings['font'];
                        }

                        if ( isset( $textSettings['size'] ) )
                        {
                            $operatorValue .= ':size:'. $textSettings['size'];
                        }

                        if ( isset( $textSettings['align'] ) )
                        {
                            $operatorValue .= ':justification:'. $textSettings['align'];
                        }

                        if ( isset( $textSettings['rgb'] ) )
                        {
                            $textSettings['cmyk'] = eZMath::rgbToCMYK2( $textSettings['rgb'][0]/255,
                                                                        $textSettings['rgb'][1]/255,
                                                                        $textSettings['rgb'][2]/255 );
                        }

                        if ( isset( $textSettings['cmyk'] ) )
                        {
                            $operatorValue .= ':cmyk:' . implode( ',', $textSettings['cmyk'] );
                        }

                        $operatorValue .= '>';
                    }
                }

                $operatorValue .= $text;
                if ( $changeFont )
                {
                    $operatorValue .= '</ezCall:callText>';
                }

            } break;

            case 'text_box':
            {
                $parameters = $tpl->elementValue( $operatorParameters[1], $rootNamespace, $currentNamespace );

                $operatorValue = '<ezGroup:callTextBox';

                foreach( array_keys( $parameters ) as $key )
                {
                    if ( $key != 'text' )
                    {
                        $operatorValue .= ':' . $key . ':' . urlencode( $parameters[$key] );
                    }
                }

                $httpCharset = eZTextCodec::internalCharset();
                $outputCharset = $config->hasVariable( 'PDFGeneral', 'OutputCharset' )
                             ? $config->variable( 'PDFGeneral', 'OutputCharset' )
                             : 'iso-8859-1';
                $codec = eZTextCodec::instance( $httpCharset, $outputCharset );
                // Convert current text to $outputCharset (by default iso-8859-1)
                $parameters['text'] = $codec->convertString( $parameters['text'] );

                $operatorValue .= '>';
                $operatorValue .= urlencode( $parameters['text'] );
                $operatorValue .= '</ezGroup:callTextBox>';

                return $operatorValue;
            } break;

            case 'text_frame':
            {
                $text = $tpl->elementValue( $operatorParameters[1], $rootNamespace, $currentNamespace );

                $operatorValue = '';
                $changeFont = false;

                if ( count( $operatorParameters ) >= 3)
                {
                    $textSettings = $tpl->elementValue( $operatorParameters[2], $rootNamespace, $currentNamespace );

                    if ( isset( $textSettings ) )
                    {
                        $operatorValue .= '<ezGroup:callTextFrame';
                        $changeFont = true;

                        foreach ( array_keys( $textSettings ) as $key ) //settings, padding (left, right, top, bottom), textcmyk, framecmyk
                        {
                            if ( $key == 'frameCMYK' )
                            {
                                $operatorValue .= ':frameCMYK:' . implode( ',', $textSettings['frameCMYK'] );
                            }
                            else if ( $key == 'frameRGB' )
                            {
                                $operatorValue .= ':frameCMYK:' . implode( ',', eZMath::rgbToCMYK2( $textSettings['frameRGB'][0]/255,
                                                                                                    $textSettings['frameRGB'][1]/255,
                                                                                                    $textSettings['frameRGB'][2]/255 ) );
                            }
                            else if ( $key == 'textCMYK' )
                            {
                                $operatorValue .= ':textCMYK:' . implode( ',', $textSettings['textCMYK'] );
                            }
                            else if ( $key == 'textRGB' )
                            {
                                $operatorValue .= ':textCMYK:' . implode( ',', eZMath::rgbToCMYK2( $textSettings['textRGB'][0]/255,
                                                                                                   $textSettings['textRGB'][1]/255,
                                                                                                   $textSettings['textRGB'][2]/255 ) );
                            }
                            else
                            {
                                $operatorValue .= ':' . $key . ':' . $textSettings[$key];
                            }
                        }

                        $httpCharset = eZTextCodec::internalCharset();
                        $outputCharset = $config->hasVariable( 'PDFGeneral', 'OutputCharset' )
                                     ? $config->variable( 'PDFGeneral', 'OutputCharset' )
                                     : 'iso-8859-1';
                        $codec = eZTextCodec::instance( $httpCharset, $outputCharset );
                        // Convert current text to $outputCharset (by default iso-8859-1)
                        $text = $codec->convertString( $text );

                        $operatorValue .= '>' . urlencode( $text ) . '</ezGroup::callTextFrame>';

                    }
                }

                eZDebug::writeNotice( 'Added TextFrame: ' . $operatorValue );
            } break;

            default:
            {
                eZDebug::writeError( 'PDF operation "'. $namedParameters['operation'] .'" undefined', __METHOD__ );
            }

        }

    }
946258
def _modify(self, **patch):
        """"""
        if 'state' in patch:
            if patch['state'] != 'user-up' and patch['state'] != 'user-down':
                msg = "The members resource does not support a modify with " \
                      "the value of the 'state' attribute as %s. " \
                      "The accepted values are 'user-up' or " \
                      "'user-down'" % patch['state']
                raise MemberStateModifyUnsupported(msg)
        if 'session' in patch:
            if patch['session'] != 'user-enabled' and patch['session'] != \
                    'user-disabled':
                msg = "The members resource does not support a modify with " \
                      "the value of the 'session' attribute as %s. " \
                      "The accepted values are 'user-enabled' or " \
                      "'user-disabled'" % patch['session']
                raise MemberStateModifyUnsupported(msg)
        super(Members, self)._modify(**patch)
115900
def modify(self, **params):
        """"""
        data = self.api_client.update_account(self.id, **params)
        self.update(data)
        return data
1152
def on_modified(self, event):
        """"""
        path = event.src_path
        if path not in self.saw:
            self.saw.add(path)
            self.recompile(path)
1032060
def modify(name, **kwargs):
    '''
    
    '''

    ret = {'comment': '',
           'changes': {},
           'result': True}

    time_conflict = False
    for item in ['seconds', 'minutes', 'hours', 'days']:
        if item in kwargs and 'when' in kwargs:
            time_conflict = True

        if item in kwargs and 'cron' in kwargs:
            time_conflict = True

    if time_conflict:
        ret['result'] = False
        ret['comment'] = 'Error: Unable to use "seconds", "minutes", "hours", or "days" with "when" option.'
        return ret

    if 'when' in kwargs and 'cron' in kwargs:
        ret['result'] = False
        ret['comment'] = 'Unable to use "when" and "cron" options together.  Ignoring.'
        return ret

    current_schedule = list_(show_all=True, return_yaml=False)

    if name not in current_schedule:
        ret['comment'] = 'Job {0} does not exist in schedule.'.format(name)
        ret['result'] = False
        return ret

    _current = current_schedule[name]
    if '_seconds' in _current:
        _current['seconds'] = _current['_seconds']
        del _current['_seconds']

    _new = build_schedule_item(name, **kwargs)
    if 'result' in _new and not _new['result']:
        return _new

    if _new == _current:
        ret['comment'] = 'Job {0} in correct state'.format(name)
        return ret

    _current_lines = ['{0}:{1}\n'.format(key, value)
                      for (key, value) in sorted(_current.items())]
    _new_lines = ['{0}:{1}\n'.format(key, value)
                  for (key, value) in sorted(_new.items())]
    _diff = difflib.unified_diff(_current_lines, _new_lines)

    ret['changes']['diff'] = ''.join(_diff)

    if 'test' in kwargs and kwargs['test']:
        ret['comment'] = 'Job: {0} would be modified in schedule.'.format(name)
    else:
        persist = True
        if 'persist' in kwargs:
            persist = kwargs['persist']
        if name in list_(show_all=True, where='opts', return_yaml=False):
            event_data = {'name': name,
                          'schedule': _new,
                          'func': 'modify',
                          'persist': persist}
        elif name in list_(show_all=True, where='pillar', return_yaml=False):
            event_data = {'name': name,
                          'schedule': _new,
                          'where': 'pillar',
                          'func': 'modify',
                          'persist': False}

        out = __salt__['event.fire'](event_data, 'manage_schedule')
        if out:
            ret['comment'] = 'Modified job: {0} in schedule.'.format(name)
        else:
            ret['comment'] = 'Failed to modify job {0} in schedule.'.format(name)
            ret['result'] = False
    return ret