Command macros
- Topics:
- Dynamic Media Classic,SDK/API
CREATED FOR:
- Developer
- User
Command macros provide named shortcuts for sets of commands.
Macros are defined in separate macro definition files, which can be attached to image catalogs or the default catalog.
Macros may be invoked anywhere in a request after the ‘?’, and anywhere within a catalog::Modifier
field. Macros can only represent one or more full Image Serving commands, therefore it must be enclosed by ‘&’ separators (except when at the beginning or end of the modifier string).
Macro invocations are replaced by their substitution strings early during parsing. Commands within macros override the same commands in the request if they occur before the macro invocation in the request. This flow is different from catalog::Modifier
, where commands in the request string always override commands in the catalog::Modifier
string, regardless of the position in the request.
Macros can be nested. However, a macro can only be invoked if it is already defined at the time the macro definition is parsed. This flow is accomplished either by appearing earlier in the same macro definition file, or by placing the definition for such an embedded macro in the default macro definition file.
Macros can be useful if the same attributes are to be applied to different images.
http://server/cat/1345?wid=240&fmt=pdf&imageRes=300
http://server/cat/1435?wid=240&fmt=pdf&imageRes=300
http://server/cat/8243?wid=480&fmt=pdf&imageRes=300
You can define a macro for the common attributes:
view wid=240&fmt=pdf&imageRes=300
The macro would be used as follows:
http://server/cat/1345?$view$
http://server/cat/1435?$view$
http://server/cat/8243?$view$&wid=480
Because wid=
is different for the third request, you simply override the value after the macro is invoked (specifying wid=
before $view$
has no effect).
Experience Manager
- Dynamic Media Image Serving and Image Rendering API Home
- About this release
- System requirements and prerequisites
- Disk space requirements and recommendations
- Restrictions and known issues
- Technical support
- Document conventions
- Installation
- Image Serving API
- Image Serving API
- Intended audience
- Image Serving components
- Configuration and administration
- Serving static (non-image) contents
- Troubleshooting
- HTTP protocol reference
- HTTP protocol reference overview
- HTTP protocol introduction
- Syntax and features
- Syntax and features
- Image Serving HTTP protocol basic syntax
- Image Serving HTTP protocol command
- Layering
- Layer effects
- Request nesting and embedding
- Substitution variables
- Command macros
- Image catalogs
- Object ID translation
- Text string localization
- SVG support
- Request preprocessing
- Image maps
- Image Serving color management
- Image Serving HTTP encoding
- Request locking
- Request obfuscation
- Watermarks
- Serving static (non-image) content
- Media set requests
- Text formatting
- Data types
- Command reference
- Command reference overview
- align
- anchor
- bfc
- bgc
- bgColor
- blendMode
- cache
- clipPath
- clipXPath
- color
- crop
- cropPathE
- defaultImage
- dpr
- effect
- effectMask
- extend
- fit
- flip
- fmt
- hei
- hide
- icc
- iccEmbed
- id
- imageSet
- jpegSize
- layer
- locale
- map
- mask
- maskUse
- network
- op_blur
- op_brightness
- op_colorbalance
- op_colorize
- op_contrast
- op_grow
- op_growMask
- op_growMaskR
- op_hue
- op_invert
- op_noise
- op_saturation
- op_sharpen
- op_usm
- op_usmR
- opac
- origin
- pathAttr
- pathEmbed
- perspective
- pos
- printRes
- pscan
- qlt
- quantize
- rect
- req
- res
- resMode
- rgn
- rotate
- scale
- scl
- size
- src
- template
- text
- textAngle
- textAttr
- textFlowPath
- textFlowXPath
- textPath
- textPs
- type
- wid
- xmpEmbed
- Response data
- Server behavior
- Templates
- FXG server protocol reference
- Image catalog reference
- Attributes
- Attributes reference
- AllowDirectAccess
- AllowDirectUrls
- ApplyEffectMask
- AudioBitRate
- Bfc
- BkgColor
- CacheValidationPolicy
- ClientAddressFilter
- CatalogFile
- DefaultExpiration
- DefaultExt
- DefaultFont
- DefaultImage
- DefaultImageMode
- DefaultLocale
- DefaultPix
- DefaultThumbPix
- DigimarcId
- DigimarcInfo
- ErrorImage
- ErrorDetail
- Expiration
- FontMapFile
- FullMatch
- HttpAppleStreamingContext
- HttpFlashStreamingContext
- IccBlackPointCompensation
- IccDither
- IccProfileCmyk
- IccProfileGray
- IccProfileMapFile
- IccProfileRgb
- IccProfileSrcCmyk
- IccProfileSrcGray
- IccProfileSrcRgb
- IccRenderIntent
- JpegQuality
- LocaleMap
- LocaleStrMap
- MacroFile
- MaxPix
- NonImgExpiration
- PublishInfo
- PrintResolution
- RequestLock
- RequestObfuscation
- ResMode
- Resolution
- RootId
- RootPath
- RootUrl
- RuleSetFile
- SavePath
- StaticContentCatalogFile
- StaticContentRootPath
- SvgCatalogFile
- SynthesizeFontStyles
- ThumbBkgColor
- ThumbHorizAlign
- ThumbRes
- ThumbType
- ThumbVertAlign
- TimeStamp
- TotalStreamBitRate
- TrustedDomains
- UseLastModified
- VideoBitRate
- VideoSize
- Watermark
- Image/SVG data reference
- Macro definition
- Font map
- ICC profile map reference
- Rule set reference
- Image server proxy
- Responsive Static Image Library
- Image Rendering API
- Image Rendering API
- Configuration
- Server administration
- Server administration
- Server administration preface
- Server administration overview
- Configuring and managing the server
- Configuration settings reference
- HTTP protocol reference
- HTTP protocol reference
- Introduction
- HTTP protocol syntax and features
- HTTP protocol syntax and features
- Image Rendering HTTP protocol basic syntax
- Image Rendering HTTP protocol command overview
- Vignettes
- Materials
- Advanced Render effects
- Request nesting and embedding
- Material catalogs
- Request pre-processing *
- Custom variables
- Command macros *
- Image Rendering color management *
- Color values
- Image Rendering HTTP encoding
- HTTP protocol command reference
- HTTP protocol response data
- Material catalog
- Material catalog
- Introduction
- Material catalog overview
- Attributes reference
- Attributes reference
- AllowDirectURLs
- CacheValidationPolicy
- CatalogFile
- ClientAddressFilter
- DefaultPix
- ErrorDetail
- ErrorImage
- Expiration
- Format
- IccBlackPointCompensation
- IccDither
- IccProfileCmyk
- IccProfileGray
- IccProfileMapFile
- IccProfileRgb
- IccProfileSrcCmyk
- IccProfileSrcGray
- IccProfileSrcRgb
- IccRenderIntent
- JpegQuality
- MacroFile
- MaxPix
- OnFailObj
- OnFailSel
- RenderSettings
- ResMode
- Resolution
- RootId
- RootPath *
- RootUrl *
- RuleSetFile
- Sharp
- Sharpen
- ShowOverlapObjs
- TiffEncoding
- TimeStamp
- TrustedDomains *
- UseLastModified
- VignetteMapFile
- Material data reference
- Vignette map reference
- Macro definition reference
- ICC profile map reference
- Rule set reference
- Utilities