The Media editor allows the content administrator to select and link to media assets stored in a content repository.
The media editor consists of an Experience Manager editor and a lightweight Web application that enables the content administrator to browse and navigate across a set of media assets in order to more easily find specific files.
The default Discover Electronics reference application stores media directly in the Endeca Configuration Repository and uses a built-in asset browser to present these assets to the content administrator. You may also initialize an MDEX Engine to index media asset metadata and URIs as records, making them available for Guided Navigation in an enhanced Media Browser.
Note
The configuration repository provides an acceptable store for media files when used for preview purposes in an authoring environment, but Oracle recommends serving media assets from a media or content delivery server for production environments.
The default asset browser for the Media editor can only be configured to browse media assets in the Endeca Configuration Repository. If you are using another system for managing media assets, you must stand up a corresponding media MDEX Engine and enable the Media Browser in the editor configuration file.
A Media editor allows a content administrator to link media into a cartridge. It can be combined with the Link Builder in order to create images that link to destinations in your application, such as those used in site banners.
To add a Media editor to a template:
Insert an
Item
property namedmedia
, of classcom.endeca.infront.cartridge.model.MediaObject
, as in the following example:<Property name="media"> <Item class="com.endeca.infront.cartridge.model.MediaObject" xmlns="http://endeca.com/schema/xavia/2010"> </Item> </Property>
Within the
Item
property, insert six emptyProperty
elements:<Property name="media"> <Item class="com.endeca.infront.cartridge.model.MediaObject" xmlns="http://endeca.com/schema/xavia/2010"> <Property name="uri"></Property> <Property name="contentWidth"></Property> <Property name="contentHeight"></Property> <Property name="contentBytes"></Property> <Property name="contentType"></Property> <Property name="contentSrcKey"></Property> </Item> </Property>
These properties are populated by the Select Records dialog and processed by the cartridge handler.
Insert a corresponding
<editors:MediaEditor>
element within<BasicContentItemEditor>
.Specify the
propertyName
attribute for the editor:<editors:MediaEditor propertyName="media" enabled="true"/>
Specify any additional label attributes for the editor:
<editors:MediaEditor propertyName="media" label="Media Url" enabled="true"/>
The following shows an example of a template that includes a media editor as part of a media banner cartridge:
<ContentTemplate xmlns="http://endeca.com/schema/content-template/2008" xmlns:editors="editors" xmlns:xavia="http://endeca.com/schema/xavia/2010" type="MainContent"> <!-- additional elements omitted from this example --> <ContentItem> <Name>Media banner</Name> <!-- additional elements omitted from this example --> <Property name="media"> <Item class="com.endeca.infront.cartridge.model.MediaObject" xmlns="http://endeca.com/schema/xavia/2010"> <Property name="uri">/</Property> <Property name="contentWidth"></Property> <Property name="contentHeight"></Property> <Property name="contentBytes"></Property> <Property name="contentType"></Property> <Property name="contentSrcKey"></Property> </Item> </Property> </ContentItem> <EditorPanel> <BasicContentItemEditor> <!-- additional elements omitted from this example --> <GroupLabel label="Media"/> <editors:MediaEditor propertyName="media" label="Media Url" enabled="true"/> </BasicContentItemEditor> </EditorPanel> </ContentTemplate>
In order to use the Media editor, if you are using the Endeca Configuration Repository as your media store, you must upload any media files to the repository. If you are using an external digital asset management system with a corresponding MDEX Engine, the matching application must be configured and running and the Media Browser must be enabled.
Related links
You can specify allowable media formats in the editor configuration file. You can also enable or disable the Media Browser, and specify the MDEX Engine that it should query for media records.
The Discover Electronics reference application uses the Endeca Configuration Repository to store media and accesses these resources through a default asset browser, rather than relying on the Media Browser and an accompanying media MDEX Engine.
Below is the configuration for the Media editor in the editor
configuration file, located at
<app
dir>\config\import\configuration\tools\xmgr\editors.xml
:
<?xml version="1.0" encoding="UTF-8"?> <!-- additional text removed from this example --> <EditorConfig xmlns="http://endeca.com/schema/editor-config/2010"> <EditorModule url="/ifcr/tools/pbx/modules/editors.swf"> <!-- additional elements removed from this example --> <Editor name="editors:MediaEditor"> <EditorConfig> <useMediaBrowser>false</useMediaBrowser> <mediaRoots> <default>http://myhost.mydomain.com:8006/ifcr/sites/Discover/media/</default> <mediaSource>http://myhost.mydomain.com:8006/ifcr/sites/Discover/media/</mediaSource> </mediaRoots> <mdexPort>17000</mdexPort> <mdexHost>myhost.mydomain.com</mdexHost> <videoFormats>flv|f4v|3pg|mov|mp4</videoFormats> <imageFormats>jpg|jpeg|png|gif</imageFormats> <mediaURI>/ifcr/sites/Discover/media/</mediaURI> </EditorConfig> </Editor> <!-- additional elements removed from this example --> </EditorModule> <GlobalEditorConfig></GlobalEditorConfig> </EditorConfig>
This sets the following properties across all instances of the media editor in the application:
Property |
Description |
---|---|
|
This property enables or disables the media
browser. By default, it is set to
|
|
This property specifies the absolute URLs to
available media repositories. It includes a nested
|
|
The absolute URL to the Endeca Configuration Repository, used by the default asset browser. The specified host and port should match those used by Workbench. |
content source
|
An absolute URL to a media content source. In
the reference data application, records are assigned a
Your own data ingest process may assign different values for
media served from varying locations. In this case, each
|
|
For applications using the Media Browser, this is the hostname or IP address of the media MDEX Engine server. |
|
For applications using the Media Browser, this is the port on which the specified media MDEX Engine server listens. |
|
A pipe-delineated list of valid video formats. Any videos not matching a listed format do not display in either the default asset browser or Media Browser. |
|
A pipe-delineated list of valid image formats. Any images not matching a listed format do not display in either the default asset browser or Media Browser. |
|
The location of the media node within the Endeca Configuration Repository. This is only used by the default asset browser. |
Note
The default list of video and image formats includes only those that are supported by the included renderers for the Discover Electronics reference application. If you wish to extend this list for your own application, ensure that your cartridge renderers can handle additional formats, and that your application includes logic for displaying them.
If you wish to use the ECR as your media content source, you can upload assets directly to Experience Manager. This is required if you aren't using the Media Browser and are instead using the default Flex-based asset navigator for the media editor. It can also be useful in a development environment, where a separate media server may not be worth the effort of maintaining.
All applications created using the Deployment
Template include a
set_media
script in the
<app dir>\control
directory. This script
uploads media content from the
<app dir>\config\media
directory to the
Endeca Configuration Repository. After uploading content, it becomes available
for use in Experience Manager.
In general, you can store moderate amounts of media content in the Endeca Configuration Repository. Very roughly speaking, a moderate amount of media content is approximately thousands of media files but not tens of thousands of media files. This storage mechanism is intended as a convenience when you build an application in a development environment.
If you have larger amounts of media content, Oracle recommends employing a digital asset management system rather than uploading the media content into the Endeca Configuration Repository.
Here are a few specific guidelines to keep in mind before you upload media content to the Endeca Configuration Repository:
Do not upload more than approximately 1 GB of media content per transaction. In this context, a transaction is one run of
set_media
.Do not upload more than approximately 5000 files in one transaction. This guideline essentially means you should not have more than approximately 5000 files stored in
<app dir>\config\media
and its subdirectories.If you have more than approximately 1000 files to upload, create subdirectories under
<app dir>\config\media
and distribute the media files among the subdirectories. (One run ofset_media
uploads all content in all subdirectories.)
To upload media content for use in Experience Manager:
Ensure any new media content is stored locally in
<app dir>\config\media
.This may include image files, video files, and so on.
In a command prompt, navigate to the
<app dir>\control
directory of your deployed application.This is located under your application directory. For example:
C:\Endeca\apps\Discover\control
.
Links to media assets are resolved in the Media editor by
combining configuration in the editor configuration file with the
media.path
property on the selected record. At runtime,
these links are resolved against the media sources specified in the Assembler
context file.
You identify authoring content sources as nested elements within the
<mediaRoots>
element in the editor configuration
file. The name of each such element corresponds to the value of the
media.repository_id
property assigned to each record
in your media MDEX Engine. The value of each element identifies the root
location of the authoring content source.
When a content administrator opens the Media Browser in Experience
Manager, media assets are retrieved for preview by appending the value of the
media.path
property on the record to the corresponding
content source element within
<mediaRoots>
. The
media.path
is then saved to the content item when the
content administrator saves the cartridge configuration.
By keeping the relative location of your media assets consistent across environments, you can maintain separate content sources for authoring and live environments without requiring content administrators to reconfigure content items.
For example, assume the following element within
<mediaRoots>
in the editor configuration file:
<myMediaSource>http://myhost.mydomain.com:8006/myCMS/Discover/media/</myMediaSource>
A media record with a
media.repository_id
value of
"myMediaSource
" and a
media.path
value of "images/foo.jpg
"
would resolve to:
http://myhost.mydomain.com:8006/myCMS/Discover/media/images/foo.jpg
At runtime, the value of the
media.path
property is instead appended to the
appropriate media source configured in
assembler-context.xml
:
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~ Media Sources --> <bean id="authoringMediaSources" class="java.util.ArrayList" lazy-init="true"> <constructor-arg> <list> <bean class="com.endeca.infront.cartridge.model.MediaSourceConfig"> <property name="sourceName" value="MyMediaSource" /> <property name="sourceValue" value="http://${workbench.host}:${workbench.port}/ifcr/sites/ ${workbench.app.name}/media/" /> </bean> <bean class="com.endeca.infront.cartridge.model.MediaSourceConfig"> <property name="sourceName" value="default" /> <property name="sourceValue" value="http://${workbench.host}:${workbench.port}/ifcr/sites/ ${workbench.app.name}/media/" /> </bean> </list> </constructor-arg> </bean> <bean id="liveMediaSources" class="java.util.ArrayList" lazy-init="true"> <constructor-arg> <list> <bean class="com.endeca.infront.cartridge.model.MediaSourceConfig"> <property name="sourceName" value="MyMediaSource" /> <property name="sourceValue" value="/images/" /> </bean> <bean class="com.endeca.infront.cartridge.model.MediaSourceConfig"> <property name="sourceName" value="default" /> <property name="sourceValue" value="/images/" /> </bean> </list> </constructor-arg> </bean>
In a live environment, the aforementioned media record would resolve to:
http://myhost.mydomain.com:8006/myBiggerFasterCMS/Discover/media/assets/images/foo.jpg
Note
While the tooling, authoring, and live content sources can all differ, Oracle recommends configuring the Media Browser to use the authoring content source.
The default browser for the Media editor can only be configured to browse media assets in the Endeca Configuration Repository. If you are serving media assets from an external content source, you must enable the Media Browser and configure it to use your media MDEX Engine.
You can enable and configure the Media Browser by modifying the editor configuration file for your application.
To enable the Media Browser in the Media editor:
Navigate to the editor configuration file at
<app dir>\config\import\configuration\tools\xmgr\editors.xml
.Locate the
<EditorConfig>
element for the Media editor:<Editor name="editors:MediaEditor"> <EditorConfig> <useMediaBrowser>false</useMediaBrowser> <mediaRoots> <default>http://myhost.mydomain.com:8006/ifcr/sites/Discover/media/</default> <mediaSource>http://myhost.mydomain.com:8006/ifcr/sites/Discover/media/</mediaSource> </mediaRoots> <mdexPort>17000</mdexPort> <mdexHost>mymediahost.mydomain.com</mdexHost> <videoFormats>flv|f4v|3pg|mov|mp4</videoFormats> <imageFormats>jpg|jpeg|png|gif</imageFormats> <mediaURI>/ifcr/sites/Discover/media/</mediaURI> </EditorConfig> </Editor>
Within the
<EditorConfig>
element, change the value of the<useMediaBrowser>
property totrue
:<useMediaBrowser>true</useMediaBrowser>
Include a content source element under
<mediaRoots>
that points to your media host.The element name is a unique key that identifies a media host. Each record has a corresponding
media.repository_id
property that identifies its content source. The relevant content source property maps that source to a URL.For example, in the CAS crawl configuration for the reference data application, each record is assigned a
media.repository_id
property with a value ofmediaSource
. ThemediaSource
property in the editor configuration file specifies the URL:<mediaRoots> <default>http://myhost.mydomain.com:8006/ifcr/sites/Discover/media/</default> <mediaSource>http://myhost.mydomain.com:8006/ifcr/sites/Discover/media/</mediaSource> </mediaRoots>
Note
The
<default>
value is only used by the default asset browser. For more information, see "About Media editor configuration" and "Media MDEX Engine schema definition."Modify the
<mdexPort>
and<mdexHost>
elements to point to the host and port of the MDEX Engine backing your media host.Run the
set_editors_config
script to publish your changes to the Endeca Configuration Repository.
Related links
If you are storing media resources in an independent content store, you can set up an MDEX Engine where records represent media assets and include asset metadata and URIs. Storing this information as records allows content administrators to navigate assets based on image size, modification date, or other attributes when selecting media assets for a content item.
Tools and Frameworks includes a reference media MDEX application, including a CAS pipeline and Deployment Template configuration.
The interactions between a media MDEX Engine, Experience Manager, and an Assembler application are summarized below.
Experience Manager retrieves media asset information as follows:
Assuming that an MDEX Engine exists with media records that adhere to the required data schema:
In Experience Manager, the Media Browser queries the media MDEX Engine for media records. This allows the content administrator to select media assets by navigating across them with Guided Navigation.
The content administrator's configuration changes are published to the application each time a content item is saved.
In a production environment, the Assembler application can be configured to retrieve media assets from a content delivery network or another media delivery server:
Note
The server hosting media assets can differ between authoring and live environments, as long as the media path relative to the media root is consistent. In the case of the reference pipeline, the authoring Discover Electronics Web application serves as the content source. For more information on configuring content sources, see About Media editor configuration.
The Tools and Frameworks package includes a reference implementation of a media MDEX Engine that includes a CAS crawl and Forge pipeline for crawling resources on the file system and indexing the corresponding metadata and URIs. The Experience Manager can then query the MDEX Engine for record information.
The reference media application illustrates the schema requirements and configuration that you should use when building your own media pipeline.
In addition to the hardware and software required for Oracle Tools and Frameworks, the data ingest process for the reference data application requires the Oracle Content Acquisition System. You must have CAS installed on the machine on which you are running the ITL process for the data application.
The crawl uses the following manipulators:
Directory Filter: Filters out directory records, so that only media files are output to the MDEX Engine.
Image Property Generator: Analyzes image binaries to determine their width and height. It adds corresponding
image.width
andimage.height
properties to each record.Application Property Generator: Assigns a
media.application
property based on the application specified when running the Deployment Template. This allows the Media Browser to display only those media assets that are relevant to the application that the content administrator is currently modifying in Workbench.Path Manipulator: Creates a
media.path
property that contains the path to given asset with respect to the media root.
The Forge pipeline for the reference data application reads data from the Record Store populated by the CAS crawl and runs manipulators against the data to generate the required MDEX Engine schema.
The reference media MDEX Engine data application assumes an environment where all required Oracle components are running on the same machine.
You must have the Oracle Content Acquisition System and Oracle Tools and Frameworks installed on the machine onto which you wish to deploy the media MDEX Engine.
The reference data application runs an MDEX Engine with indexed media resources, and integrates with the Discover Electronics reference application to expose the media records to a business user in the Media editor in Experience Manager. The records include properties for metadata, such as image dimensions, making it easier to narrow down a large quantity of media assets to those that fit the requirements for a cartridge in the front-end application.
To deploy the reference data application:
Include the CAS manipulators for the reference data application as server plugins:
Deploy the reference data application:
Open a command prompt or command shell.
Note
If you are running the Tools and Frameworks from the included batch files, you must run
ToolsAndFrameworks/<version>/server/bin/setenv.bat
to set the environment variables for the current command window.Navigate to the
ToolsAndFrameworks\<version>\deployment_template\bin
directory.Run
deploy.bat
ordeploy.sh
with the following options:deploy --app
<Endeca Directory>
/ToolsAndFrameworks/<version>/reference/media-mdex-cas/deploy.xmlSpecify the application directory.
Typically, this is
C:\Endeca\apps
on Windows, or/usr/local/endeca/apps
on UNIX.Specify the EAC port previously used for the Discover Electronics reference application.
By default, this is port 8888.
Specify the port that Workbench runs on.
By default, this is port 8006.
Note
This must be a different port from any other Dgraphs used for other applications.
By default, this is port 17000. If you change this value, you must also update the configuration for the
MediaEditor
in theconfig\import\configuration\tools\xmgr\editors.xml
file after deploying the application.Enter the port that CAS runs on.
By default, this is port 8500.
Enter the name of the application in which you wish to enable media browsing.
For the Discover Electronics reference application this should be
Discover
.Enter the absolute path to the location on disk where media assets are stored.
This is the file path that the Content Acquisition System crawls to index the files. In a default Discover Electronics deployment it is
C:\Endeca\apps\Discover\config\media
on Windows, orusr/local/endeca/apps/Discover/config/media
on Unix.
Provision the application with the EAC and run a baseline update:
In order for the Media Browser in Experience Manager to have sufficient information for forming content XML, any pipeline that you configure for a media MDEX Engine must define specific properties and dimensions.
The following properties are required for the Media Browser to function correctly:
Field |
Description |
---|---|
|
A unique identifier for each of the media items. |
|
The filename of the media asset. |
|
The file path, relative to the root of the content source. |
|
The logical host of the content source. The value of this property is mapped to configuration elements for the Media editor in the editor configuration file, which in turn contain the path to the content source. For additional information, see "About Media editor configuration." |
|
The EAC application that the specified media asset is associated with. The Media editor in Experience Manager filters entries in the Media Browser based on which application the content administrator is currently editing. |
|
The binary size of the media asset, in bytes. |
|
The height of the media asset, if it is an image. The renderer for the Media editor uses this information to scale images appropriately. |
|
The width of the media asset, if it is an image. The renderer for the Media editor uses this information to scale images appropriately. |
Optionally, additional properties and dimensions can be displayed in the Media Browser. The reference implementation of a media MDEX Engine includes the following such fields:
Field |
Type |
Description |
---|---|---|
|
Property |
The MIME type of the media asset. This enables filtering by media type and file extension in the Media Browser. |
|
Property |
The date and time that the file was last modified prior to being crawled by the Content Acquisition System. |
|
Dimension |
A searchable dimension based on
|
|
Dimension |
Searchable dimensions based on
|
|
Dimension |
A searchable dimension based on
|
If you configure your own media MDEX Engine that includes properties or dimensions not listed above, they become available for Guided Navigation in the Media Browser. However, any such properties are not saved to content XML once a media asset has been selected.