|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectinfo.aduna.gee.spectacle.webserver.Channel
public class Channel
Class Channel provides a Java API to a channel on the a12r publication server. This API makes it possible to programmatically perform virtually all actions that are normally available through the web-based end-user GUI environment. Note that all changes are made in local memory only, until sync() is called.
| Field Summary | |
|---|---|
static int |
PRIVACY_BEST_FRIEND
The privacy level 'Best friend' |
static int |
PRIVACY_CLOSE_FRIEND
The privacy level 'Close friend' |
static int |
PRIVACY_FRIEND
The privacy level 'Friend' |
static int |
PRIVACY_OWNER
The privacy level 'Owner' |
static int |
PRIVACY_WORLD
The privacy level 'World' |
static String |
SORT_BY_LABELS
Sort by increasing label identifiers |
static String |
SORT_BY_TEXT
Sort by the visible text of objects |
static String |
SORT_BY_TYPES
Sort by the object types |
static int |
SUBSCRIPTION_LABEL_ID
The id of the synthetic label that is automatically added to information that comes from a subscription to this channel. |
| Fields inherited from interface info.aduna.gee.publication.servlets.ApiConstants |
|---|
CREATE_EMAIL_KEY, CREATE_NAME_KEY, CREATE_PASSWORD_KEY, CREATE_TIMETOLIVE_KEY, MESSAGE_KEY, RESULT_KEY, RETURN_CODE_KEY |
| Fields inherited from interface info.aduna.gee.publication.net.FileNames |
|---|
ASA_FILE_NAME, BAK_FILE_NAME, CAT_FILE_NAME, CFG_FILE_NAME, CHS_FILE_NAME, DAT_FILE_NAME, HLP_FILE_NAME, LOCAL_FILE_PREFIX, SBS_FILE_NAME, SSS_FILE_NAME, WIF_FILE_NAME |
| Fields inherited from interface info.aduna.gee.publication.UserTypes |
|---|
API_BIT, COVER_BUILDER_BIT, ENGINE_BIT, GUEST_BITS, OWNER_BITS, PRO_BITS, PROUSER_BIT, SERVER_BIT, SHOP_BIT, SHOW_BIT, SHOW_BITS, VISITOR_BIT |
| Constructor Summary | |
|---|---|
Channel(String server,
String name)
Construct a new Channel for the channel with the specified name on the specified server. |
|
Channel(String server,
String name,
String loginName,
String password)
Construct a new Channel for the channel with the specified name on the specified server and login with the specified loginName (optional) and password as login credentials. |
|
| Method Summary | |
|---|---|
void |
add(String source,
Properties options,
Properties attribs,
Properties params)
Add a content entry to the channel. |
void |
addSection(PathString dst)
|
void |
addSection(String dst)
Ensure the existence of a Section. |
void |
addSubscription(String name,
String startPoint,
String mountPoint,
String translation,
Set labels,
boolean occurringSelection,
boolean recursive,
int level)
Add a subscription. |
void |
changeCover(String coverName)
Change the presentation context (cover) of the channel. |
void |
changeSectionDesign(String sectionID,
int designID,
boolean allCovers)
Change the presentation template (design) for a single section in the channel. |
void |
changeSectionDesign(String sectionID,
String designName,
boolean allCovers)
Change the presentation template (design) for a single section in the channel. |
void |
clear()
Remove all content from the channel. |
void |
clearSubscriptions()
Remove all subscriptions (including the defaults). |
void |
close()
Close this Channel. |
protected void |
finalize()
|
Object |
getDatabase()
Get the (opaque) database underlying this channel. |
Collection |
getEntries()
Get the (opaque) entries in this channel. |
Properties |
getLabelDefinitions()
Get the effective label definitions (i.e. |
String |
getLoginName()
Get the name with which the Channel is currently logged in. |
String |
getName()
Get the name of the channel this Channel is using. |
String |
getPassword()
Get the plain-text password with which the Channel is currently logged in. |
List |
getSectionDesigns()
Get the list of Section Designs. |
String |
getServer()
Get the name of the server this Channel is using. |
void |
inheritLabels(String channel)
Let the current channel inherit label settings from another channel. |
void |
inheritPrivacyGroups(String channel)
Let the current channel inherit Privacy Group definitions from another channel. |
boolean |
isLoggedIn()
|
void |
login()
Login to a channel with the current credentials. |
void |
login(String loginName,
String password)
Login to a channel with the specified credentials. |
void |
logout()
This function is to explicitly forget password information. |
void |
preload(int delay)
Force loading of this channel at the server, using default parameters. |
void |
removeSection(PathString dst)
|
void |
removeSection(String dst)
Remove a Section. |
void |
setCategories(List categories)
Set the categories for this channel. |
void |
setDatabase(Object database)
Set the (opaque) database underlying this channel. |
void |
setLabelColors(Properties labelColors,
boolean merge)
Associate colors with the labels. |
void |
setLabelImages(Properties images,
Properties overImages,
boolean merge)
Associate images with the labels. |
void |
setLabels(Properties labels,
boolean merge)
Define the labels for the current channel. |
void |
setPrivacy(int level)
Set privacy level of the entire channel. |
void |
setPrivacyGroups(Properties friends,
Properties closeFriends,
Properties bestFriends,
Properties owners,
boolean merge)
Create or set privacy groups. |
void |
setSectionLabels(String sectionID,
Set labels,
boolean occurringLabels,
boolean merge)
Set the labels of a section of the channel. |
void |
setSectionPrivacy(String sectionID,
int level)
Set the privacy level of a Section. |
void |
setStartSection(String sectionID)
Set the start section of the channel. |
void |
setStorable(boolean storable)
Use WStorable's setStorable for all cached WStorable's of this channel. |
void |
setStoreVersion(char v)
|
void |
setTemplatePreference(String oldStream,
String oldID,
String newStream,
String newID)
Override template specifications of Entries. |
void |
sort()
Sort contents of all sections in the entire channel by label, type and description (in that order). |
void |
sort(Vector criteria)
Sort contents of all sections in the entire channel by label by application specific criteria. |
void |
sync()
Synchronize all changes with the server. |
static void |
syncAll()
Sync all information that has changed in a single, fast, though memory intensive batch. |
void |
uploadFile(String name,
byte[] contents)
Upload a file. |
void |
uploadImage(String name,
byte[] contents)
Upload an image. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int PRIVACY_WORLD
public static final int PRIVACY_FRIEND
public static final int PRIVACY_CLOSE_FRIEND
public static final int PRIVACY_BEST_FRIEND
public static final int PRIVACY_OWNER
public static String SORT_BY_LABELS
public static String SORT_BY_TYPES
public static String SORT_BY_TEXT
public static final int SUBSCRIPTION_LABEL_ID
setLabelColors(java.util.Properties, boolean),
setLabelImages(java.util.Properties, java.util.Properties, boolean),
Constant Field Values| Constructor Detail |
|---|
public Channel(String server,
String name)
throws ChannelException
server - the server this Channel is usingname - the name of the channel
ChannelExceptionChannel(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
public Channel(String server,
String name,
String loginName,
String password)
throws ChannelException
server - the server ("myhost") or already a serverPath ("https://www.mysecurehost.com:9898/")name - the name of the channelloginName - the name to login with, or null to login with the
name of the channel itselfpassword - the password to login with
ChannelException - if a problem occurred while logging in| Method Detail |
|---|
public void login()
throws ChannelException
ChannelExceptionlogin(java.lang.String, java.lang.String)
public void login(String loginName,
String password)
throws ChannelException
loginName - the name to login with, or null to login with the
name of the channel itselfpassword - the password to login with
ChannelException - if a problem occurred while logging in
public void logout()
throws ChannelException
ChannelExceptionpublic boolean isLoggedIn()
public String getServer()
public String getName()
public String getLoginName()
public String getPassword()
public void add(String source,
Properties options,
Properties attribs,
Properties params)
throws ChannelException
source - the source of the entry, or nulloptions - the entry options, or nullattribs - the HTML attributes of the entry, or nullparams - the parameters of the entry, or null
ChannelException - if a problem occurred while adding content
public void addSection(String dst)
throws ChannelException
ChannelException
public void addSection(PathString dst)
throws ChannelException
ChannelExceptionaddSection(String)
public void removeSection(String dst)
throws ChannelException
ChannelException
public void removeSection(PathString dst)
throws ChannelException
ChannelExceptionremoveSection(String)
public void uploadFile(String name,
byte[] contents)
throws ChannelException
name - the name for the file.contents - the contents of the file.
ChannelException - if a problem occurred while uploading the
file
public void uploadImage(String name,
byte[] contents)
throws ChannelException
name - the name for the image.contents - the contents of the image.
ChannelException - if a problem occurred while uploading the image
public void clear()
throws ChannelException
ChannelException - if a problem occurred while clearing the
channel.
public void setLabels(Properties labels,
boolean merge)
throws ChannelException
labels - set of key-value pairs, where key is a (positive
integer or predefined) label identifier and value
is the description of the label; or null. If
unspecified, the current labels will be removed
if merge is false.merge - if true, merge the new labels with the existing
ones, overwrite otherwise
ChannelException - if a problem occurred while setting the
labels
public void setLabelColors(Properties labelColors,
boolean merge)
throws ChannelException
labelColors - set of key-value pairs, where key is a
(positive integer or predefined) label
identifier and value is a 6-character
hexadecimal color string (e.g. "EE09FF");
or nullmerge - if true, merge the new label colors with the
existing ones, overwrite otherwise
ChannelException - if a problem occurred while setting the
label colorssetLabels(java.util.Properties, boolean),
setLabelImages(java.util.Properties, java.util.Properties, boolean)
public void setLabelImages(Properties images,
Properties overImages,
boolean merge)
throws ChannelException
images - set of key-value pairs, where key is a
(positive integer or predefined) label
identifier and value is a String representing
the URL of an image; or null.
If unspecified, the existing label/image
association will be removed if merge is false.overImages - set of key-value pairs, where key is a
(positive integer or predefined) label
identifier and value is a String representing
the URL of an image; or null.
If unspecified, the existing label/image
association will be removed if merge is false.merge - if true, merge the new label images with the
existing ones, overwrite otherwise
ChannelException - if a problem occurred while setting the
label imagessetLabels(java.util.Properties, boolean),
setLabelColors(java.util.Properties, boolean)
public void inheritLabels(String channel)
throws ChannelException
channel - the channel from which the label settings should be
inherited
ChannelException - if a problem occurred while setting the
label inheritance
public Properties getLabelDefinitions()
throws ChannelException
ChannelException - if a problem occurred while getting the
label definitions
public void addSubscription(String name,
String startPoint,
String mountPoint,
String translation,
Set labels,
boolean occurringSelection,
boolean recursive,
int level)
throws ChannelException
name - the name of the channel to subscribe tostartPoint - the starting path in the channel subscribed to or nullmountPoint - the path under which this subscription should appear or nulltranslation - the URL of the translation file or nulllabels - the label-identifiers (Strings) of the labels
from 'name' to subscribe to. This set may be
null or empty, in which case all
labels will be included in the subscription.occurringSelection - if true, a section appears when a
single entry matchesrecursive - if true, recursively subscribe to subscriptions
from 'name'level - the privacy level at which this subscription
will be visible
ChannelException - if a problem occurred while adding the
subscriptionclearSubscriptions()
public void clearSubscriptions()
throws ChannelException
ChannelException - if a problem occurred while removing the
subscriptions
public void changeCover(String coverName)
throws ChannelException
coverName - the (internal) name of the cover
ChannelException - if a problem occurred while changing the
cover
public void setStartSection(String sectionID)
throws ChannelException
sectionID - either the name of a section, a date in YYYYMMDD-
format, or null. If unspecified, the start section
will be set to the default ('today').
ChannelException
public void setSectionLabels(String sectionID,
Set labels,
boolean occurringLabels,
boolean merge)
throws ChannelException
sectionID - either the name of a section, or a date in
YYYYMMDD-format.labels - a Set of labels.merge - if true, add the labels, otherwise set them.
ChannelException - if a problem occurred while setting the
channels on the specified section
public void changeSectionDesign(String sectionID,
int designID,
boolean allCovers)
throws ChannelException
sectionID - either the name of a section, or a date in
YYYYMMDD-format, indicating the section to set
the design for.designID - the (internal) sequence number of the design.allCovers - if true, use the design in all covers
ChannelException - if a problem occurred while changing the
design for the sectionchangeCover(java.lang.String)
public void changeSectionDesign(String sectionID,
String designName,
boolean allCovers)
throws ChannelException
sectionID - either the name of a section, or a date in
YYYYMMDD-format, indicating the section to set
the design for.designName - the name of the design.allCovers - if true, use the design in all covers
ChannelException - if a problem occurred while changing the
design for the sectiongetSectionDesigns()
public List getSectionDesigns()
throws ChannelException
ChannelException
public void setPrivacy(int level)
throws ChannelException
level - the new privacy level for the channel
ChannelException - if a problem occurred while setting the privacy levelPRIVACY_WORLD,
PRIVACY_FRIEND,
PRIVACY_CLOSE_FRIEND,
PRIVACY_BEST_FRIEND,
PRIVACY_OWNER
public void setSectionPrivacy(String sectionID,
int level)
throws ChannelException
sectionID - either the name of a section, or a date in
YYYYMMDD-format, indicating the section to set
the privacy level forlevel - the new privacy level of the section
ChannelException - if a problem occurred while setting the
privacy levelPRIVACY_WORLD,
PRIVACY_FRIEND,
PRIVACY_CLOSE_FRIEND,
PRIVACY_BEST_FRIEND,
PRIVACY_OWNER
public void setPrivacyGroups(Properties friends,
Properties closeFriends,
Properties bestFriends,
Properties owners,
boolean merge)
throws ChannelException
friends - set of key-value pairs, where key is the
name of a channel that should be a "friend"
of this channel.
If the corresponding value is "true", all
associated owners of the channel are
friends too.closeFriends - set of key-value pairs, where key is the
name of a channel that should be a "good
friend" of this channel.
If the corresponding value is "true", all
associated owners of the channel are close
friends too.bestFriends - set of key-value pairs, where key is the
name of a channel that should be a "best
friend" of this channel.
If the corresponding value is "true", all
associated owners of the channel are best
friends too.owners - set of key-value pairs, where key is the
name of a channel that should be an
associated owner of this channel.
If the corresponding value is "true", all
associated owners of that channel are
associated owners of this one too.merge - if true merge the groups with the existing
ones, overwrite otherwise
ChannelException - if a problem occurred while setting the
privacy groups
public void inheritPrivacyGroups(String channel)
throws ChannelException
channel - the channel from which the Privacy Group
definitions should be inherited, or null
ChannelException - if a problem occurred while setting the
Privacy Group inheritance
public void setCategories(List categories)
throws ChannelException
categories - a list of category identifiers (Strings)
ChannelException - if a problem occurred while setting the
categories
public void sort()
throws ChannelException
ChannelException - if a problem occurred while sortingsort(java.util.Vector)
public void sort(Vector criteria)
throws ChannelException
criteria - a list of criteria (see below) to sort by, in order.
ChannelException - if a problem occurred while sortingSORT_BY_LABELS,
SORT_BY_TYPES,
SORT_BY_TEXT
public void sync()
throws ChannelException
ChannelException - if a problem occurred while storing
public void preload(int delay)
throws ChannelException
delay - the delay in seconds
ChannelException - if a problem occurred while loadingpublic void close()
public void setTemplatePreference(String oldStream,
String oldID,
String newStream,
String newID)
throws ChannelException
oldStream - the template Stream part to overrideoldID - the template ID part to override or null (ignored when newID is null)newStream - the template Stream part replacementnewID - the template ID part replacement or null (ignored when oldID is null)
ChannelExceptionpublic static void syncAll()
public Object getDatabase()
throws ChannelException
ChannelExceptionpublic Collection getEntries()
public void setDatabase(Object database)
throws ChannelException
ChannelExceptionpublic void setStorable(boolean storable)
public void setStoreVersion(char v)
throws ChannelException
ChannelExceptionDatabase.setStoreVersion(char)
protected void finalize()
throws Throwable
finalize in class ObjectThrowable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||