public class MediaSources extends MMObjectBuilder
| Modifier and Type | Field and Description |
|---|---|
static Parameter[] |
AVAILABLE_PARAMETERS |
static Parameter[] |
CODEC_PARAMETERS |
static Parameter[] |
FILTEREDURLS_PARAMETERS |
static Parameter[] |
FORMAT_PARAMETERS |
static String |
FUNCTION_AVAILABLE |
static String |
FUNCTION_CODEC |
static String |
FUNCTION_FILTEREDURLS |
static String |
FUNCTION_FORMAT |
static String |
FUNCTION_MIMETYPE |
static String |
FUNCTION_URL |
static String |
FUNCTION_URLS |
static Parameter[] |
MIMETYPE_PARAMETERS |
static int |
MONO |
static int |
STATE_DONE
Deprecated.
|
static int |
STATE_REMOVED
Deprecated.
|
static int |
STATE_SOURCE
Deprecated.
|
static String |
STATES_RESOURCE |
static int |
STEREO |
static Parameter[] |
URL_PARAMETERS |
static Parameter[] |
URLS_PARAMETERS |
AGE_PARAMETERS, broadCastChanges, DEFAULT_ALINEA, DEFAULT_EOL, description, descriptions, EVENT_TYPE_LOCAL, EVENT_TYPE_REMOTE, FIELD_NUMBER, FIELD_OBJECT_TYPE, FIELD_OWNER, fields, genericBlobCache, getFunctions, GUI_INDICATOR, GUI_PARAMETERS, guiFunction, infoFunction, internalVersion, nodeCache, oType, pluralNames, searchAge, singularNames, SYSTEM_OWNER, TEMPNODE_DEFAULT_SIZE, temporaryNodes, TMP_FIELD_EXISTS, TMP_FIELD_NUMBER, virtual, WRAP_PARAMETERS, wrapFunctionmaxNodesFromQuery, mmb, storageConnector, tableNamefunctions| Constructor and Description |
|---|
MediaSources() |
| Modifier and Type | Method and Description |
|---|---|
void |
addProvider(MMObjectNode source,
String providername,
String owner)
Relates a source with given provider.
|
boolean |
commit(MMObjectNode node)
The commit can be used to automatically fill unfilled fields.
|
MMObjectNode |
createSource(MMObjectNode mediafragment,
int status,
int format,
int speed,
int channels,
String url,
String owner)
create a new mediasource, and relate it with specified mediafragment.
|
protected Object |
executeFunction(MMObjectNode node,
String function,
List<?> args)
Executes a function on the field of a node, and returns the result.
|
int |
getChannels(MMObjectNode node) |
protected Codec |
getCodec(MMObjectNode source)
The codec field is an integer, this function returns a string-presentation
|
protected List<URLComposer> |
getFilteredURLs(MMObjectNode source,
MMObjectNode fragment,
Map<String,Object> info)
Returns all URLs for this source, but filtered, with the best ones on top.
|
protected Format |
getFormat(MMObjectNode source)
The format field is an integer, this function returns a string-presentation
|
protected String |
getFormat(MMObjectNode source,
Map<String,Object> info) |
String |
getGUIIndicator(MMObjectNode source)
Used in the editors
|
(package private) MimeType |
getMimeType(MMObjectNode source)
Resolve the mimetype for a certain media source
|
protected List<MMObjectNode> |
getProviders(MMObjectNode source)
Get all mediaproviders belonging to this mediasource
|
int |
getSpeed(MMObjectNode node) |
protected String |
getURL(MMObjectNode source,
Map<String,Object> info)
Resolve the url of the mediasource.
|
protected List<URLComposer> |
getURLs(MMObjectNode source,
MMObjectNode fragment,
Map<String,Object> info,
List<URLComposer> urls,
Set<MMObjectNode> cacheExpireObjects)
Returns all possible URLs for this source.
|
boolean |
init()
Initializes this builder
The property 'mmb' needs to be set for the builder before this method can be called.
|
int |
insert(String owner,
MMObjectNode node)
Insert a new object (content provided) in the cloud, including an entry for the object alias (if provided).
|
boolean |
setValue(MMObjectNode node,
String fieldName,
Object value)
Sets a key/value pair in the main values of this node.
|
addEventListener, addField, addLocalObserver, addRemoteObserver, broadcastChanges, checkAddTmpField, clearBlobCache, create, createAlias, createAlias, createIfNotExists, delete, equals, equals, executeFunction, fieldLocalChanged, getAncestors, getBlobCache, getClassName, getConfigFile, getConfigResource, getDataTypeCollector, getDBState, getDBType, getDefaultTeaser, getDefaultUrl, getDescendants, getDescription, getDescription, getDescriptions, getEmptyNode, getField, getFieldNames, getFields, getFields, getFunction, getFunctionParameters, getFunctions, getGUIIndicator, getGUIIndicator, getHTML, getInitParameter, getInitParameters, getInitParameters, getInternalVersion, getList, getLocaleGUIIndicator, getLocaleGUIIndicator, getMachineName, getMaintainer, getNewNode, getNewTmpNode, getNextField, getNextField, getNode, getNode, getNode, getNodeFromCache, getNodeGUIIndicator, getNumber, getObjectType, getObjectValue, getParentBuilder, getPluralName, getPluralName, getPluralNames, getRelations_main, getSearchAge, getShort, getShortedByte, getShortedInputStream, getShortedText, getSingularName, getSingularName, getSingularNames, getSmartPath, getTmpNode, getURLEncode, getValue, getVersion, getWAP, getXMLPath, hasField, hashCode, hashCode, hostname_function, insert, isExtensionOf, isNodeCached, isNull, isVirtual, loadInitParameters, newFunctionInstance, nodeLocalChanged, nodeRemoteChanged, notify, notify, preCommit, process, removeEventListener, removeField, removeLocalObserver, removeNode, removeRelations, removeRemoteObserver, removeSyncNodes, replace, safeCache, sendFieldChangeSignal, setDefaults, setDescription, setDescriptions, setFields, setInitParameter, setMaintainer, setPluralNames, setSearchAge, setSingularNames, setUniqueValue, setUniqueValue, setValue, setVersion, setXMLPath, shutdown, testValidData, toString, toString, update, updateFields, wrapcount, count, created, getFullTableName, getMMBase, getNode, getNodes, getNodes, getNodes, getNodeType, getStorageConnector, getTableName, search, searchVector, setMMBase, setTableName, sizeaddFunction, createParameters, getFunction, getFunctions, getFunctionValuepublic static final String FUNCTION_URLS
public static final String FUNCTION_FILTEREDURLS
public static final String FUNCTION_URL
public static final String FUNCTION_AVAILABLE
public static final String FUNCTION_FORMAT
public static final String FUNCTION_CODEC
public static final String FUNCTION_MIMETYPE
public static final Parameter[] URLS_PARAMETERS
public static final Parameter[] FILTEREDURLS_PARAMETERS
public static final Parameter[] URL_PARAMETERS
public static final Parameter[] AVAILABLE_PARAMETERS
public static final Parameter[] FORMAT_PARAMETERS
public static final Parameter[] CODEC_PARAMETERS
public static final Parameter[] MIMETYPE_PARAMETERS
public static final int STATE_DONE
public static final int STATE_SOURCE
public static final int STATE_REMOVED
public static final String STATES_RESOURCE
public static final int MONO
public static final int STEREO
public boolean init()
init in class MMObjectBuilderMMObjectBuilder.create()public MMObjectNode createSource(MMObjectNode mediafragment, int status, int format, int speed, int channels, String url, String owner)
mediafragment - the media fragment to which this source belongsstatus - of the media sourceformat - the format of the source (Real, Mp3)channels - stereo/monourl - the file name of the media sourceowner - creator of the new objectMediaSourceprotected String getURL(MMObjectNode source, Map<String,Object> info)
source - the media sourceinfo - extra info (i.e. HttpRequestIno, bitrate, etc.)MimeType getMimeType(MMObjectNode source)
source - the media sourcepublic String getGUIIndicator(MMObjectNode source)
getGUIIndicator in class MMObjectBuildersource - The node to displayStringpublic int getSpeed(MMObjectNode node)
public int getChannels(MMObjectNode node)
protected Format getFormat(MMObjectNode source)
protected String getFormat(MMObjectNode source, Map<String,Object> info)
protected Codec getCodec(MMObjectNode source)
protected Object executeFunction(MMObjectNode node, String function, List<?> args)
MMObjectBuilder.getValue(org.mmbase.module.core.MMObjectNode, java.lang.String) method.
Derived builders should override this method to provide additional functions.protected List<URLComposer> getURLs(MMObjectNode source, MMObjectNode fragment, Map<String,Object> info, List<URLComposer> urls, Set<MMObjectNode> cacheExpireObjects)
protected List<URLComposer> getFilteredURLs(MMObjectNode source, MMObjectNode fragment, Map<String,Object> info)
public void addProvider(MMObjectNode source, String providername, String owner)
source - the media source.providername - the name of the provider that is going to be related.owner - the owner name that is creating the relation.protected List<MMObjectNode> getProviders(MMObjectNode source)
source - the mediasourcepublic boolean setValue(MMObjectNode node, String fieldName, Object value)
MMObjectBuildersetValue in class MMObjectBuildernode - The node on which to change the field (the new value is in this node)fieldName - the name of the field to changevalue - the value which was original in the fieldtrue When an update is required(when changed),
false if original value was set back into the field.public boolean commit(MMObjectNode node)
commit in class MMObjectBuildernode - The node to be committedpublic int insert(String owner, MMObjectNode node)
MMObjectBuilderMMObjectBuilder.preCommit(org.mmbase.module.core.MMObjectNode).insert in class MMObjectBuilderowner - The administrator creating the nodenode - The object to insert. The object need be of the same type as the current builder.int value which is the new object's unique number, -1 if the insert failed.MMBase 1.9-SNAPSHOT - ${javadoctimestamp}