|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jasig.portal.tools.chanpub.ChannelPublisher
public class ChannelPublisher
This is a Channel Publisher tool to install uPortal channels from outside of the portal or from within a channel archive. Currently configured to be executed via Jakarta Ant or via a channel-definition block within a CAR deployment descriptor. Sample of command line arguments: ant publish -Dchannel=all (this will publish all channels that have a corresponding xml file) ant publish -Dchannel=webmail.xml (this will publish the specified channels)
Nested Class Summary | |
---|---|
private static class |
ChannelPublisher.ChannelInfo
|
Field Summary | |
---|---|
private static java.lang.String |
chanDefsLocation
|
private java.util.Map |
chanTypesNamesToIds
|
private IChannelRegistryStore |
crs
|
private javax.xml.parsers.DocumentBuilder |
domParser
|
private static java.lang.String |
FRAMEWORK_OWNER
|
private static java.lang.String |
GRANT_PERMISSION_TYPE
|
private static int |
LOAD_ALL_FILES
|
private static int |
LOAD_ONE_FILE
|
private static org.apache.commons.logging.Log |
log
|
private boolean |
mOnCommandLine
|
private boolean |
mOverrideExisting
|
private static java.lang.String |
SUBSCRIBER_ACTIVITY
|
private IPerson |
systemUser
|
Constructor Summary | |
---|---|
private |
ChannelPublisher(boolean onCommandLine)
|
Method Summary | |
---|---|
void |
error(org.xml.sax.SAXParseException arg0)
|
void |
fatalError(org.xml.sax.SAXParseException arg0)
|
private IEntityGroup[] |
getAdminGroup()
Gets the portal administrators group. |
private void |
getCategories(ChannelPublisher.ChannelInfo ci,
org.w3c.dom.Element pele)
Translate channel category names into category ids. |
static ChannelPublisher |
getChannelArchiveInstance()
|
private ChannelPublisher.ChannelInfo |
getChannelInfo(java.io.InputStream is)
Populates and returns a ChannelInfo object based on the input stream containing XML data structured according to the channel-definition dtd. |
private ChannelPublisher.ChannelInfo |
getChannelInfo(java.lang.String chanDefFile)
Populates and returns a ChannelInfo object based on the passed in file name containing XML data structured according to the channel-definition dtd. |
static ChannelPublisher |
getCommandLineInstance()
|
private ChannelCategory[] |
getDefaultCategory(boolean fNameAccessibleOnly)
Obtains an auto-publish category located in the root category or creates if not found. |
private java.lang.String |
getFname(org.w3c.dom.Element chanDefE)
Determines the functional name of the channel. |
private static IEntityGroup |
getGroup(java.lang.String groupName,
java.lang.Class entityType)
Attempts to determine group key based on a group name or fully qualifed group key. |
private void |
getGroups(ChannelPublisher.ChannelInfo ci,
org.w3c.dom.Element pele)
Translate access group names into group ids. |
private void |
getParameters(ChannelPublisher.ChannelInfo ci,
org.w3c.dom.Element pele)
Load the declared parameters. |
private void |
getType(ChannelPublisher.ChannelInfo ci,
java.lang.String value)
Translate the declared channel type name into a channel type id. |
private void |
getUsers(ChannelPublisher.ChannelInfo ci,
org.w3c.dom.Element pele)
Translate access user ids into the user entity objects. |
private void |
initChanTypeMap()
Load the lookup table to translate channel type names into ids. |
static void |
main(java.lang.String[] args)
|
private ChannelDefinition |
publishChannel(ChannelPublisher.ChannelInfo ci)
Publishes the channel represented by the passed in ChannelDefinition object and returns the resultant ChannelDefinition object. |
ChannelDefinition |
publishChannel(java.io.InputStream is)
Publishes the channel represented by the XML accessed via the passed in InputStream object and returns the resultant ChannelDefinition object. |
ChannelDefinition |
publishChannel(java.lang.String filename)
Publishes the channel represented by the XML located in the file represented by the passed in filename and returns the resultant ChannelDefinition object. |
void |
setOverride(boolean b)
|
private void |
setupDomParser()
Set up a DOM parser for handling the XML channel-definition data. |
private void |
setupSystemUser()
Sets up the system user for use during publishing. |
void |
warning(org.xml.sax.SAXParseException arg0)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final org.apache.commons.logging.Log log
private static final java.lang.String FRAMEWORK_OWNER
private static final java.lang.String SUBSCRIBER_ACTIVITY
private static final java.lang.String GRANT_PERMISSION_TYPE
private static final int LOAD_ALL_FILES
private static final int LOAD_ONE_FILE
private IPerson systemUser
private javax.xml.parsers.DocumentBuilder domParser
private IChannelRegistryStore crs
private java.util.Map chanTypesNamesToIds
private boolean mOnCommandLine
private boolean mOverrideExisting
private static final java.lang.String chanDefsLocation
Constructor Detail |
---|
private ChannelPublisher(boolean onCommandLine) throws java.lang.Exception
java.lang.Exception
Method Detail |
---|
public static void main(java.lang.String[] args) throws java.lang.Exception
args
-
java.lang.Exception
- We let Exceptions bubble up so that ant will know
that the publishing failed and can report the error message and stack
trace to the user.private void setupSystemUser()
public ChannelDefinition publishChannel(java.lang.String filename) throws java.lang.Exception
filename
- the name of a file containing the channel XML definition
java.lang.Exception
public ChannelDefinition publishChannel(java.io.InputStream is) throws java.lang.Exception
is
- and InputStream containing the channel XML definition
java.lang.Exception
private ChannelDefinition publishChannel(ChannelPublisher.ChannelInfo ci) throws java.lang.Exception
ci
-
java.lang.Exception
private void setupDomParser() throws java.lang.Exception
java.lang.Exception
private ChannelPublisher.ChannelInfo getChannelInfo(java.lang.String chanDefFile) throws java.lang.Exception
chanDefFile
-
java.lang.Exception
private ChannelPublisher.ChannelInfo getChannelInfo(java.io.InputStream is) throws java.lang.Exception
is
-
java.lang.Exception
private java.lang.String getFname(org.w3c.dom.Element chanDefE) throws java.lang.Exception
chanDefE
-
java.lang.Exception
private void getType(ChannelPublisher.ChannelInfo ci, java.lang.String value) throws java.lang.Exception
ci
- value
-
java.lang.Exception
private void getCategories(ChannelPublisher.ChannelInfo ci, org.w3c.dom.Element pele) throws java.lang.Exception
ci
- The ChannelInfo object being populated.pele
- The Element containing the category elements.
java.lang.Exception
private void getParameters(ChannelPublisher.ChannelInfo ci, org.w3c.dom.Element pele)
ci
- The ChannelInfo object being populated.pele
- The Element containing the parameter elements.private void getGroups(ChannelPublisher.ChannelInfo ci, org.w3c.dom.Element pele) throws java.lang.Exception
ci
- The ChannelInfo object being populated.pele
- The Element containing the group elements.
java.lang.Exception
private void getUsers(ChannelPublisher.ChannelInfo ci, org.w3c.dom.Element pele) throws java.lang.Exception
ci
- The ChannelInfo object being populated.pele
- The Element containing the user elements.
java.lang.Exception
private IEntityGroup[] getAdminGroup() throws java.lang.Exception
java.lang.Exception
private ChannelCategory[] getDefaultCategory(boolean fNameAccessibleOnly) throws java.lang.Exception
java.lang.Exception
private static IEntityGroup getGroup(java.lang.String groupName, java.lang.Class entityType) throws java.lang.Exception
groupName
- a String
valueentityType
- the kind of entity the group contains
java.lang.Exception
private void initChanTypeMap() throws java.lang.Exception
java.lang.Exception
public void setOverride(boolean b)
public static ChannelPublisher getCommandLineInstance() throws java.lang.Exception
java.lang.Exception
public static ChannelPublisher getChannelArchiveInstance() throws java.lang.Exception
java.lang.Exception
public void warning(org.xml.sax.SAXParseException arg0) throws org.xml.sax.SAXException
warning
in interface org.xml.sax.ErrorHandler
org.xml.sax.SAXException
public void error(org.xml.sax.SAXParseException arg0) throws org.xml.sax.SAXException
error
in interface org.xml.sax.ErrorHandler
org.xml.sax.SAXException
public void fatalError(org.xml.sax.SAXParseException arg0) throws org.xml.sax.SAXException
fatalError
in interface org.xml.sax.ErrorHandler
org.xml.sax.SAXException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |