|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.stanwood.media.xml.XMLParser
org.stanwood.media.store.xmlstore.BaseXMLStore
org.stanwood.media.store.xmlstore.XMLStore2
public class XMLStore2
This store is used to store the show and film information in a XML called .mediaManager-xmlStore.xml. This is located in the root media directory.
Field Summary |
---|
Fields inherited from class org.stanwood.media.xml.XMLParser |
---|
SCHEMA_WEB_LOCATION |
Constructor Summary | |
---|---|
XMLStore2()
The constructor |
Method Summary | |
---|---|
void |
cacheEpisode(java.io.File rootMediaDir,
java.io.File episodeFile,
IEpisode episode)
This is used to write a episode or special too the store |
void |
cacheFilm(java.io.File rootMediaDir,
java.io.File filmFile,
IFilm film,
java.lang.Integer part)
This is used to write a film to the store. |
void |
cacheSeason(java.io.File rootMediaDir,
java.io.File episodeFile,
ISeason season)
This is used to write a season too the store. |
void |
cacheShow(java.io.File rootMediaDir,
java.io.File episodeFile,
IShow show)
This is used to write a show too the store. |
void |
fileDeleted(MediaDirectory dir,
java.io.File file)
This is called when a file is deleted from a media directory |
void |
fileUpdated(MediaDirectory mediaDirectory,
java.io.File file)
This is called when a file is updated within a media directory. |
protected StoreVersion |
getCurrentVersion(org.w3c.dom.Element storeNode)
|
IEpisode |
getEpisode(java.io.File rootMediaDir,
java.io.File episodeFile,
ISeason season,
int episodeNum)
This gets a episode from the store. |
IEpisode |
getEpisode(MediaDirectory dir,
java.io.File file)
This is used to get a episode from a store via it's file name. |
IFilm |
getFilm(java.io.File rootMediaDir,
java.io.File filmFile,
java.lang.String filmId)
This will get a film from the store. |
IFilm |
getFilm(MediaDirectory dir,
java.io.File file)
This is used to get a film from a store via it's file name. |
java.lang.String |
getParameter(java.lang.String key)
Used to get the value of a source parameter. |
ISeason |
getSeason(java.io.File rootMediaDir,
java.io.File episodeFile,
IShow show,
int seasonNum)
This will get a season from the store. |
IShow |
getShow(java.io.File rootMediaDir,
java.io.File episodeFile,
java.lang.String showId)
This will get a show from the store. |
IEpisode |
getSpecial(java.io.File rootMediaDir,
java.io.File episodeFile,
ISeason season,
int specialNumber)
This gets a special episode from the store. |
void |
init(Controller controller,
java.io.File nativeDir)
Called to initialise the stores and check all their resources can be found. |
java.util.Collection<IEpisode> |
listEpisodes(MediaDirConfig dirConfig,
IProgressMonitor monitor)
This is used to list all the episodes within the store if the store supports the operation. |
java.util.Collection<IFilm> |
listFilms(MediaDirConfig dirConfig,
IProgressMonitor monitor)
This is used to list all the films within the store if the store supports the operation. |
protected IEpisode |
parseEpisodeNode(java.io.File file,
java.io.File rootMediaDir,
org.w3c.dom.Element episodeNode)
|
void |
performedActions(MediaDirectory dir)
This is called after all the actions on all the media files have been performed so that the store can clean up any stale data. |
protected void |
readCertifications(IVideoCertification video,
org.w3c.dom.Node videoNode)
|
protected void |
readDirectors(IVideo video,
org.w3c.dom.Node videoNode)
|
protected void |
readExtraParams(IVideoExtra video,
org.w3c.dom.Node videoNode)
|
protected void |
readGenres(IVideoGenre video,
org.w3c.dom.Node videoNode)
|
protected void |
readWriters(IVideo video,
org.w3c.dom.Node videoNode)
|
void |
renamedFile(java.io.File rootMediaDir,
java.io.File oldFile,
java.io.File newFile)
This is used when a file that holds a episode or film has been renamed |
SearchResult |
searchMedia(java.lang.String name,
Mode mode,
java.lang.Integer part,
MediaDirConfig dirConfig,
java.io.File mediaFile)
Used to search for store for media |
void |
setParameter(java.lang.String key,
java.lang.String value)
Used to set source parameters. |
void |
upgrade(MediaDirectory mediaDirectory)
This is called to check if a upgrade is needed and perform the upgrade if required |
protected void |
writeFilenames(org.w3c.dom.Document doc,
org.w3c.dom.Node parent,
IVideo video,
java.io.File rootMediaDir)
Used to append a set of filenames to the document under the given parent node |
Methods inherited from class org.stanwood.media.store.xmlstore.BaseXMLStore |
---|
getCacheFile, urlToText, writeCache |
Methods inherited from class org.stanwood.media.xml.XMLParser |
---|
createDocBuilder, createFactory, deleteNode, domToStr, encodeAttributeValue, firstChild, getAttribute, getElement, getFirstChildElement, getFloatFromXML, getIntegerFromXML, getLastChildElement, getLongFromXML, getSchema, getStringFromXML, getStringFromXMLOrNull, getURLFromXML, getURLFromXMLOrNull, hasNode, parse, parse, parse, quoteXPathQuery, selectChildNodes, selectNodeList, selectSingleNode, strToDom, strToDom, strToDom, writeXML |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XMLStore2()
Method Detail |
---|
public void cacheEpisode(java.io.File rootMediaDir, java.io.File episodeFile, IEpisode episode) throws StoreException
cacheEpisode
in interface IStore
episode
- The episode or special too writeepisodeFile
- the file witch the episode is stored inrootMediaDir
- This is the directory which is the root of media, this can be the current directory if it was
not specified on the command line.
StoreException
- Thrown if their is a problem with the storepublic void cacheFilm(java.io.File rootMediaDir, java.io.File filmFile, IFilm film, java.lang.Integer part) throws StoreException
cacheFilm
in interface IStore
filmFile
- The file which the film is stored infilm
- The film to writerootMediaDir
- This is the directory which is the root of media, this can be the current directory if it was
not specified on the command line.part
- The part number of the film
StoreException
- Thrown if their is a problem with the storeprotected void readWriters(IVideo video, org.w3c.dom.Node videoNode) throws XMLParserException, NotInStoreException
XMLParserException
NotInStoreException
protected void readDirectors(IVideo video, org.w3c.dom.Node videoNode) throws XMLParserException, NotInStoreException
XMLParserException
NotInStoreException
protected void readCertifications(IVideoCertification video, org.w3c.dom.Node videoNode) throws XMLParserException, NotInStoreException
XMLParserException
NotInStoreException
protected void readGenres(IVideoGenre video, org.w3c.dom.Node videoNode) throws XMLParserException, NotInStoreException
XMLParserException
NotInStoreException
protected void readExtraParams(IVideoExtra video, org.w3c.dom.Node videoNode) throws XMLParserException, NotInStoreException
XMLParserException
NotInStoreException
protected void writeFilenames(org.w3c.dom.Document doc, org.w3c.dom.Node parent, IVideo video, java.io.File rootMediaDir) throws StoreException
doc
- The document to append the filenames toparent
- The parent nodefilenames
- The filenames to append
StoreException
- Thrown if their is a tore releated problempublic void cacheSeason(java.io.File rootMediaDir, java.io.File episodeFile, ISeason season) throws StoreException
cacheSeason
in interface IStore
season
- The season too writeepisodeFile
- The file the episode is stored inrootMediaDir
- This is the directory which is the root of media, this can be the current directory if it was
not specified on the command line.
StoreException
- Thrown if their is a problem with the storepublic void cacheShow(java.io.File rootMediaDir, java.io.File episodeFile, IShow show) throws StoreException
cacheShow
in interface IStore
show
- The show too writeepisodeFile
- The file the episode is stored inrootMediaDir
- This is the directory which is the root of media, this can be the current directory if it was
not specified on the command line.
StoreException
- Thrown if their is a problem with the storepublic IEpisode getEpisode(java.io.File rootMediaDir, java.io.File episodeFile, ISeason season, int episodeNum) throws StoreException, java.net.MalformedURLException
getEpisode
in interface IStore
rootMediaDir
- This is the directory which is the root of media, this can be the current directory if
it was not specified on the command line.episodeFile
- the file which the episode is stored inseason
- The season the episode belongs tooepisodeNum
- The number of the episode too get
StoreException
- Thrown if their is a problem with the store
java.net.MalformedURLException
- Thrown if their is a problem creating URL'spublic IFilm getFilm(java.io.File rootMediaDir, java.io.File filmFile, java.lang.String filmId) throws StoreException, java.net.MalformedURLException
getFilm
in interface IStore
filmFile
- The file the film is located in.filmId
- The id of the filmrootMediaDir
- This is the directory which is the root of media, this can be the current directory if it was
not specified on the command line.
StoreException
- Thrown if their is a problem retrieving the data
java.net.MalformedURLException
- Thrown if their is a problem creating URL'spublic ISeason getSeason(java.io.File rootMediaDir, java.io.File episodeFile, IShow show, int seasonNum) throws StoreException, java.net.MalformedURLException
getSeason
in interface IStore
rootMediaDir
- This is the directory which is the root of media, this can be the current directory if
it was not specified on the command line.episodeFile
- the file which the episode is stored inshow
- The show the season belongs tooseasonNum
- The number of the season that is to be fetched
StoreException
- Thrown if their is a problem with the store
java.net.MalformedURLException
public IShow getShow(java.io.File rootMediaDir, java.io.File episodeFile, java.lang.String showId) throws StoreException, java.net.MalformedURLException
getShow
in interface IStore
episodeFile
- the file which the episode is stored inshowId
- The id of the show to get.rootMediaDir
- This is the directory which is the root of media, this can be the current directory if it was
not specified on the command line.
StoreException
- Thrown if their is a problem with the store
java.net.MalformedURLException
- Thrown if their is a problem creating URL'spublic IEpisode getSpecial(java.io.File rootMediaDir, java.io.File episodeFile, ISeason season, int specialNumber) throws java.net.MalformedURLException, java.io.IOException, StoreException
getSpecial
in interface IStore
rootMediaDir
- This is the directory which is the root of media, this can be the current directory if
it was not specified on the command line.episodeFile
- the file which the episode is stored inseason
- The season the special episode belongs toospecialNumber
- The number of the special episode too get
java.net.MalformedURLException
- Thrown if their is a problem creating URL's
java.io.IOException
- Thrown if their is a I/O related problem.
StoreException
- Thrown if their is a problem with the storepublic void renamedFile(java.io.File rootMediaDir, java.io.File oldFile, java.io.File newFile) throws StoreException
renamedFile
in interface IStore
rootMediaDir
- This is the directory which is the root of media, this can be the current directory if
it was not specified on the command line.oldFile
- The old filenewFile
- The new file
StoreException
- Thrown if their is a problem renaming filespublic SearchResult searchMedia(java.lang.String name, Mode mode, java.lang.Integer part, MediaDirConfig dirConfig, java.io.File mediaFile) throws StoreException
searchMedia
in interface IStore
name
- The search termmode
- The mode of the searchpart
- The part number to search fordirConfig
- The Media directory configurationmediaFile
- The media file the search is associated with
StoreException
- Thrown if their is a problem with the storepublic void setParameter(java.lang.String key, java.lang.String value)
Used to set source parameters. If the key is not supported by this source, then a SourceException
is thrown.
setParameter
in interface IStore
key
- The key of the parametervalue
- The value of the parameterpublic java.lang.String getParameter(java.lang.String key)
Used to get the value of a source parameter. If the key is not supported by this source, then a SourceException
is thrown.
getParameter
in interface IStore
key
- The key of the parameter
public void performedActions(MediaDirectory dir) throws StoreException
performedActions
in interface IStore
dir
- The media directory
StoreException
- Thrown if their is a problempublic void fileDeleted(MediaDirectory dir, java.io.File file) throws StoreException
fileDeleted
in interface IStore
dir
- The media directoryfile
- The file
StoreException
- Thrown if their is a problempublic IEpisode getEpisode(MediaDirectory dir, java.io.File file) throws StoreException
getEpisode
in interface IStore
dir
- The media directoryfile
- The media file
StoreException
- Thrown if their are any problemsprotected IEpisode parseEpisodeNode(java.io.File file, java.io.File rootMediaDir, org.w3c.dom.Element episodeNode) throws StoreException, java.net.MalformedURLException
StoreException
java.net.MalformedURLException
public IFilm getFilm(MediaDirectory dir, java.io.File file) throws StoreException
getFilm
in interface IStore
dir
- The media directoryfile
- The media file
StoreException
- Thrown if their are any problemspublic void init(Controller controller, java.io.File nativeDir) throws StoreException
init
in interface IStore
controller
- The media controllernativeDir
- The native folder been used or configured. Null if can't be found
StoreException
- Thrown if their are any problemspublic java.util.Collection<IEpisode> listEpisodes(MediaDirConfig dirConfig, IProgressMonitor monitor) throws StoreException
listEpisodes
in interface IStore
dirConfig
- The media directory configurationmonitor
- The progress monitor
StoreException
- Thrown if their are any problemspublic java.util.Collection<IFilm> listFilms(MediaDirConfig dirConfig, IProgressMonitor monitor) throws StoreException
listFilms
in interface IStore
dirConfig
- The media directory configurationmonitor
- The progress monitor
StoreException
- Thrown if their are any problemspublic void upgrade(MediaDirectory mediaDirectory) throws StoreException
upgrade
in interface IStore
mediaDirectory
- The media directory been upgraded
StoreException
- Thrown if thier are any problemsprotected StoreVersion getCurrentVersion(org.w3c.dom.Element storeNode)
public void fileUpdated(MediaDirectory mediaDirectory, java.io.File file) throws StoreException
fileUpdated
in interface IStore
mediaDirectory
- The media directory the file belongs tofile
- The media file
StoreException
- Thrown if their are any problems
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |