Audium Knowledge Base

Knowledgebase Home | Contact Knowledgebase Home | Contact
Search the Knowledgebase Jump to ID Browse by Category
Can you add substitution to an element's configuration at runtime using custom code?
Categories: Audium OpenSDK
Article ID: 113
Last updated: January 08, 2007
User Opinions
No users have voted.

How would you rate this answer?
Helpful
Not helpful
SUMMARY

While substitution is inappropriate in this case, this article discusses how dynamic content (i.e. content that you might want to use via substitution) can be added to an element's configuration at runtime using custom code.

SYMPTOMS

Developer is familiar with using substitution in Audium Studio, and wonders if substitution strings could be set by custom code (e.g. a dynamic configuration class) at runtime, and work properly.

RESOLUTION

In custom code (most commonly a dynamic configuration class) attempting to include substitution strings in an Element's settings is strongly discouraged since it will generate errors at runtime due to the way substitution is processed.  For example, if you would like to dynamically configure the URI of an Audio Item, you should not use a dynamic configuration class to add a substitution string to the setting.

Instead, the Session API should be used to obtain the dynamic information, and then directly set that information in the configuration.  An example to illustrate this:

- The URI of an Audio Item is stored in session data
- The dynamic configuration class uses the Session API to find this URI
- The dynamic configuration class sets this URI in the configuration of the element

Note that substitution is in no way involved. 
Visitor Comments
No visitor comments posted. Post a comment
Related Questions
No related questions were found.
Attachments
No attachments were found.

Copyright (c) 2005 Audium Corporation. All rights reserved.
Audium Home | Audium Support Center Home | Audium Customer Care Home