implemented the "pics in posts" flag globally...it marks the first appearance

of "properties" storage and editing for conferences, communities, users, and
the global system.  In addition, the "global properties" editing screen got
implemented, because it wasn't there yet.
This commit is contained in:
Eric J. Bowersox
2001-11-11 01:22:07 +00:00
parent b105a43619
commit 070fd2c9e2
46 changed files with 2135 additions and 87 deletions

View File

@@ -25,6 +25,13 @@ import com.silverwrist.venice.core.*;
public class EditConferenceDialog extends ContentDialog
{
/*--------------------------------------------------------------------------------
* Static data members
*--------------------------------------------------------------------------------
*/
private static final String YES = "Y";
/*--------------------------------------------------------------------------------
* Constructors
*--------------------------------------------------------------------------------
@@ -41,7 +48,7 @@ public class EditConferenceDialog extends ContentDialog
addFormField(new CDTextFormField("name","Conference Name",null,true,32,128));
addFormField(new CDTextFormField("descr","Description",null,false,32,255));
addFormField(new CDCheckBoxFormField("hide","Hide conference in the community's conference list",
null,"Y"));
null,YES));
addFormField(new CDFormCategoryHeader("Security Information"));
addFormField(new CDRoleListFormField("read_lvl","Security level required to read conference",null,true,
Role.getConferenceReadList()));
@@ -64,6 +71,9 @@ public class EditConferenceDialog extends ContentDialog
addFormField(new CDRoleListFormField("delete_lvl",
"Security level required to delete conference",null,true,
Role.getConferenceDeleteList()));
addFormField(new CDFormCategoryHeader("Conference Properties"));
addFormField(new CDCheckBoxFormField("pic_in_post","Display users' pictures next to their posts",
"(user can override)",YES));
addCommandButton(new CDImageButton("update","bn_update.gif","Update",80,24));
addCommandButton(new CDImageButton("cancel","bn_cancel.gif","Cancel",80,24));
@@ -88,7 +98,7 @@ public class EditConferenceDialog extends ContentDialog
setFieldValue("name",conf.getName());
setFieldValue("descr",conf.getDescription());
if (conf.getHideList())
setFieldValue("hide","Y");
setFieldValue("hide",YES);
else
setFieldValue("hide","");
setFieldValue("read_lvl",String.valueOf(conf.getReadLevel()));
@@ -98,14 +108,19 @@ public class EditConferenceDialog extends ContentDialog
setFieldValue("nuke_lvl",String.valueOf(conf.getNukeLevel()));
setFieldValue("change_lvl",String.valueOf(conf.getChangeLevel()));
setFieldValue("delete_lvl",String.valueOf(conf.getDeleteLevel()));
ConferenceProperties props = conf.getProperties();
if (props.getDisplayPostPictures())
setFieldValue("pic_in_post",YES);
else
setFieldValue("pic_in_post","");
} // end setupDialog
public void doDialog(ConferenceContext conf) throws ValidationException, DataException, AccessError
{
final String yes = "Y"; // the "yes" string
validate(); // validate the dialog entries
ConferenceProperties props = conf.getProperties();
int read_lvl, post_lvl, create_lvl, hide_lvl, nuke_lvl, change_lvl, delete_lvl;
try
{ // get all the security levels out of their form fields
@@ -127,9 +142,13 @@ public class EditConferenceDialog extends ContentDialog
// sweep through the conference and set the appropriate changes
conf.setName(getFieldValue("name"));
conf.setDescription(getFieldValue("descr"));
conf.setHideList(yes.equals(getFieldValue("hide")));
conf.setHideList(YES.equals(getFieldValue("hide")));
conf.setSecurityLevels(read_lvl,post_lvl,create_lvl,hide_lvl,nuke_lvl,change_lvl,delete_lvl);
// reset the properties
props.setDisplayPostPictures(YES.equals(getFieldValue("pic_in_post")));
conf.setProperties(props);
} // end doDialog
public void resetOnError(CommunityContext comm, ConferenceContext conf, String message)