SilverStream
Application Server 3.5

com.sssw.rt.util
Class AgMisc

java.lang.Object
 |
 +--com.sssw.rt.util.AgMisc

public final class AgMisc
extends Object

The AgMisc class provides miscellaneous static helper methods that can be called from forms, pages, or business objects.

These methods provide access to the database URLs for the General, Images, Jars, and Sounds areas of the Media tool located in the SilverStream Main Designer.

These methods enable dynamic access to the URLs instead of hard-coding an URL structure that might change over time.

Images, for example, are stored in a particular location within a database in a SilverStream Server. They are accessible in the Designer in the Images directory under the Media section. There is also an URL for the images directory and an URL associated with every image.

These URLs may be used, for example, by putting one in a mail message, into a control on a page, or even using one on a form, perhaps for a useful bean that requires an URL.

SilverStream does not guarantee that the URL of the images directory on a SilverStream server will not change between SilverStream versions. For this reason, the AgMisc.getImagesDirectory(URL databaseURL) method that returns the URL of the images directory should be used. Code that uses this function (rather than code that hard-wires the current URL structure), will work in all versions, even if the URL structure within the SilverStream Server changes.


Method Summary
static URL getGeneralDirectory(URL databaseURL)
          Returns the URL to the location where uncategorized files are stored in the General section of the Media tool.
static URL getImagesDirectory(URL databaseURL)
          Returns the URL to the location where images are stored in the Images section of the Media tool.
static URL getJarsDirectory(URL databaseURL)
          Returns the URL to the location where JAR files are stored in the Jars section of the Media tool.
static URL getSoundsDirectory(URL databaseURL)
          Returns the URL to the location where sound files are stored in the Sounds section of the Media tool.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getImagesDirectory

public static URL getImagesDirectory(URL databaseURL)
                              throws MalformedURLException
Returns the URL to the location where images are stored in the Images section of the Media tool.
Parameters:
databaseURL - the URL of the database where the Images are stored. This is available from a method on an object such as agGeneral.getDatabaseURL() on forms, or AgoBusinessObjectEvent.getDatabaseURL() in business objects.

getSoundsDirectory

public static URL getSoundsDirectory(URL databaseURL)
                              throws MalformedURLException
Returns the URL to the location where sound files are stored in the Sounds section of the Media tool.
Parameters:
databaseURL - the URL of the database where the sounds are stored. This is available from a method on an object such as agGeneral.getDatabaseURL() on forms, or AgoBusinessObjectEvent.getDatabaseURL() in business objects.

getGeneralDirectory

public static URL getGeneralDirectory(URL databaseURL)
                               throws MalformedURLException
Returns the URL to the location where uncategorized files are stored in the General section of the Media tool.
Parameters:
databaseURL - the URL of the database where the general items are stored. This is available from a method on an object such as agGeneral.getDatabaseURL() on forms, or AgoBusinessObjectEvent.getDatabaseURL() in business objects.

getJarsDirectory

public static URL getJarsDirectory(URL databaseURL)
                            throws MalformedURLException
Returns the URL to the location where JAR files are stored in the Jars section of the Media tool.
Parameters:
databaseURL - the URL of the database where the JAR files are stored. This is available from a method on an object such as agGeneral.getDatabaseURL() on forms, or AgoBusinessObjectEvent.getDatabaseURL() in business objects.

SilverStream
Application Server 3.5