Entfernen deprecated methods, Formatierungen, Dokumentation.

git-svn-id: https://svn.libreccm.org/ccm/trunk@362 8810af33-2d31-482b-a856-94f89814c4df
master
pb 2010-03-13 00:32:17 +00:00
parent f73c6e8984
commit c0422a394b
370 changed files with 2444 additions and 2335 deletions

View File

@ -248,32 +248,32 @@ public class Inet4AddressRange
String addrStr = inetAddressToString (addr);
String addr2Str = inetAddressToString (addr2);
System.out.println ("addr = " + addrStr + "; addr2 = " + addr2Str);
Assert.truth (addrStr.equals (addr2Str));
Assert.isTrue (addrStr.equals (addr2Str));
// Test makeNetmask.
addr = makeNetmask (0);
System.out.println ("makeNetmask(0) = " + addr);
Assert.truth (inetAddressToString (addr).equals ("0.0.0.0"));
Assert.isTrue (inetAddressToString (addr).equals ("0.0.0.0"));
addr = makeNetmask (8);
System.out.println ("makeNetmask(8) = " + addr);
Assert.truth (inetAddressToString (addr).equals ("255.0.0.0"));
Assert.isTrue (inetAddressToString (addr).equals ("255.0.0.0"));
addr = makeNetmask (16);
System.out.println ("makeNetmask(16) = " + addr);
Assert.truth (inetAddressToString (addr).equals ("255.255.0.0"));
Assert.isTrue (inetAddressToString (addr).equals ("255.255.0.0"));
addr = makeNetmask (24);
System.out.println ("makeNetmask(24) = " + addr);
Assert.truth (inetAddressToString (addr).equals ("255.255.255.0"));
Assert.isTrue (inetAddressToString (addr).equals ("255.255.255.0"));
addr = makeNetmask (28);
System.out.println ("makeNetmask(28) = " + addr);
Assert.truth (inetAddressToString (addr).equals ("255.255.255.240"));
Assert.isTrue (inetAddressToString (addr).equals ("255.255.255.240"));
addr = makeNetmask (32);
System.out.println ("makeNetmask(32) = " + addr);
Assert.truth (inetAddressToString (addr).equals ("255.255.255.255"));
Assert.isTrue (inetAddressToString (addr).equals ("255.255.255.255"));
// Test getByName.
Inet4AddressRange range
@ -284,7 +284,7 @@ public class Inet4AddressRange
= Inet4AddressRange.getByName ("192.168.0.0/255.255.0.0");
System.out.println ("range = " + range.toString ());
// Test equals.
Assert.truth (range.equals (range2));
Assert.isTrue (range.equals (range2));
range = Inet4AddressRange.getByName ("192.168.0.99");
System.out.println ("range = " + range.toString ());
@ -292,19 +292,19 @@ public class Inet4AddressRange
// Test inRange.
range = Inet4AddressRange.getByName ("192.168.0.0/16");
addr = InetAddress.getByName ("192.168.0.99");
Assert.truth (range.inRange (addr));
Assert.isTrue (range.inRange (addr));
range = Inet4AddressRange.getByName ("192.168.0.0/24");
addr = InetAddress.getByName ("192.168.2.99");
Assert.truth (! range.inRange (addr));
Assert.isTrue (! range.inRange (addr));
range = Inet4AddressRange.getByName ("192.168.0.99");
addr = InetAddress.getByName ("192.168.0.99");
Assert.truth (range.inRange (addr));
Assert.isTrue (range.inRange (addr));
range = Inet4AddressRange.getByName ("192.168.0.99");
addr = InetAddress.getByName ("192.168.3.99");
Assert.truth (! range.inRange (addr));
Assert.isTrue (! range.inRange (addr));
System.out.println ("All test completed OK.");
}

View File

@ -80,7 +80,7 @@ public class UserCSVEntry {
}
public static synchronized UserCSVEntry nextEntry() {
Assert.truth(hasMore(), "has more entries");
Assert.isTrue(hasMore(), "has more entries");
UserCSVEntry entry = new UserCSVEntry();
s_log.debug("Starting entry");

View File

@ -73,7 +73,7 @@ public class Bookmark extends ACSObject {
*
*/
public static Bookmark retrieveBookmark(BigDecimal bmrkID) {
Assert.assertNotNull(bmrkID);
Assert.exists(bmrkID);
return Bookmark.retrieveBookmark(new OID(BASE_DATA_OBJECT_TYPE, bmrkID));
}
@ -87,7 +87,7 @@ public class Bookmark extends ACSObject {
* @pre dataObject != null
*/
public static Bookmark retrieveBookmark(DataObject dataObject) {
Assert.assertNotNull(dataObject);
Assert.exists(dataObject);
return new Bookmark(dataObject);
}
@ -99,7 +99,7 @@ public class Bookmark extends ACSObject {
* @pre oid != null
*/
public static Bookmark retrieveBookmark(OID oid) {
Assert.assertNotNull(oid);
Assert.exists(oid);
DataObject dataObject = SessionManager.getSession().retrieve(oid);
@ -143,7 +143,7 @@ public class Bookmark extends ACSObject {
public String getName() {
String name = (String)get("bookmark_name");
Assert.assertNotNull(name);
Assert.exists(name);
return name;
}
@ -155,7 +155,7 @@ public class Bookmark extends ACSObject {
public String getURL() {
String url = (String)get("bookmark_url");
Assert.assertNotNull(url);
Assert.exists(url);
return url;
}
@ -167,7 +167,7 @@ public class Bookmark extends ACSObject {
public String getDescription() {
String description = (String)get("bookmark_desc");
Assert.assertNotNull(description);
Assert.exists(description);
return description;
}
@ -242,7 +242,7 @@ public class Bookmark extends ACSObject {
*
*/
public void setName(String name) {
Assert.assertNotNull(name);
Assert.exists(name);
set("bookmark_name", name);
}
@ -252,7 +252,7 @@ public class Bookmark extends ACSObject {
*
*/
public void setURL(String url) {
Assert.assertNotNull(url);
Assert.exists(url);
if(url.startsWith("http://"))
set("bookmark_url", url);
@ -277,7 +277,7 @@ public class Bookmark extends ACSObject {
*
*/
public void setDescription(String desc) {
//Assert.assertNotNull(desc);
//Assert.exists(desc);
set("bookmark_desc",desc);
}

View File

@ -37,7 +37,7 @@ public class BookmarkCollection extends DomainCollection {
public BigDecimal getID() {
BigDecimal id = (BigDecimal)m_dataCollection.get("id");
Assert.assertNotNull(id);
Assert.exists(id);
return id;
}
@ -51,7 +51,7 @@ public class BookmarkCollection extends DomainCollection {
public DomainObject getDomainObject() {
DomainObject domainObject = getBookmark();
Assert.assertNotNull(domainObject);
Assert.exists(domainObject);
return domainObject;
}
@ -67,7 +67,7 @@ public class BookmarkCollection extends DomainCollection {
Bookmark bookmark = Bookmark.retrieveBookmark(dataObject);
Assert.assertNotNull(bookmark);
Assert.exists(bookmark);
return bookmark;
}
@ -81,7 +81,7 @@ public class BookmarkCollection extends DomainCollection {
public String getName() {
String name = (String)m_dataCollection.get("bookmark_name");
Assert.assertNotNull(name);
Assert.exists(name);
return name;
}
@ -95,7 +95,7 @@ public class BookmarkCollection extends DomainCollection {
public String getURL() {
String url = (String)m_dataCollection.get("bookmark_url");
Assert.assertNotNull(url);
Assert.exists(url);
return url;
}

View File

@ -146,7 +146,7 @@ public class BookmarkBasePage extends Page {
Application application = Application.getCurrentApplication
(pageState.getRequest());
Assert.assertNotNull(application, "application");
Assert.exists(application, "application");
targetLabel.setLabel
(application.getTitle() + " Administration");
@ -287,7 +287,7 @@ public class BookmarkBasePage extends Page {
* @param pc the component to be added
*/
public void add(Component pc) {
Assert.assertNotLocked(this);
Assert.isUnlocked(this);
m_body.add(pc);
}
@ -319,7 +319,7 @@ public class BookmarkBasePage extends Page {
Application app = Application.getCurrentApplication
(pageState.getRequest());
Assert.assertNotNull(app, "Application app");
Assert.exists(app, "Application app");
link.setChild(new Label(app.getTitle()));
link.setTarget(app.getPrimaryURL());
@ -338,7 +338,7 @@ public class BookmarkBasePage extends Page {
Application app = Application.getCurrentApplication
(pageState.getRequest());
Assert.assertNotNull(app, "Application app");
Assert.exists(app, "Application app");
Application parent = app.getParentApplication();
@ -359,7 +359,7 @@ public class BookmarkBasePage extends Page {
Application app = Application.getCurrentApplication
(pageState.getRequest());
Assert.assertNotNull(app, "Application app");
Assert.exists(app, "Application app");
label.setLabel(app.getTitle());
}

View File

@ -109,35 +109,38 @@ public class BookmarkEditPane extends DynamicListWizard {
public BookmarkEditPane()
{
super("Current Bookmarks",
new ListModelBuilder() {
public ListModel makeModel(List l, PageState ps) {
return new BmrkListModel(ps);
}
public void lock() {}
public boolean isLocked() { return true; }
},
"Add a new Bookmark",
new Label(GlobalizationUtil.globalize("bookmarks.ui.select_a_bookmark_for_editing")));
/**
* Constructor
*
*/
public BookmarkEditPane() {
super("Current Bookmarks", new ListModelBuilder() {
public ListModel makeModel(List l, PageState ps) {
return new BmrkListModel(ps);
}
public void lock() {}
public boolean isLocked() { return true; }
},
"Add a new Bookmark",
new Label(GlobalizationUtil.globalize(
"bookmarks.ui.select_a_bookmark_for_editing")));
final DynamicListWizard dlw = this;
m_prtlRL = new RequestLocal()
{
protected Object initialValue(PageState ps)
{
return (BookmarkApplication)Application.getCurrentApplication(ps.getRequest());
}
};
m_prtlRL = new RequestLocal() {
protected Object initialValue(PageState ps) {
return (BookmarkApplication)Application.getCurrentApplication(
ps.getRequest());
}
};
// FORM FOR ADDING NEW Bookmarks
Form addForm = new Form("addBookmark", new GridPanel(2));
addForm.add(new Label(GlobalizationUtil.globalize("bookmarks.ui.name_of_new_bookmark")));
addForm.add(new Label(GlobalizationUtil.globalize(
"bookmarks.ui.name_of_new_bookmark")));
final TextField newBmrkName = new TextField("name");
newBmrkName.getParameterModel().addParameterListener
@ -205,7 +208,7 @@ public class BookmarkEditPane extends DynamicListWizard {
newBmrk.save();
}}.run();
dlw.getList()
dlw.getListOfComponents()
.getSelectionModel()
.setSelectedKey(ps, newBmrk.getID().toString());
}
@ -222,7 +225,9 @@ public class BookmarkEditPane extends DynamicListWizard {
m_mainDisplay.add(m_editBmrkForm);
ActionLink deleteLink = new ActionLink( (String) GlobalizationUtil.globalize("bookmarks.ui.delete_this_bookmark").localize());
ActionLink deleteLink = new ActionLink(
(String) GlobalizationUtil.globalize(
"bookmarks.ui.delete_this_bookmark").localize());
deleteLink.setClassAttr("actionLink");
deleteLink.addActionListener(new DeleteLinkListener());
@ -247,7 +252,8 @@ public class BookmarkEditPane extends DynamicListWizard {
public Component getComponent(List list, PageState state,
Object value, String key, int index, boolean isSelected) {
BookmarkApplication app = (BookmarkApplication) Web.getContext().getApplication();
BookmarkApplication app = (BookmarkApplication) Web.getContext()
.getApplication();
BookmarkCollection bColl = app.getBookmarks();
final long size = bColl.size();
bColl.close();
@ -339,65 +345,72 @@ public class BookmarkEditPane extends DynamicListWizard {
public EditBookmarkForm(GridPanel gp)
{
super("editbookmarkform",gp);
instruction = new Label(GlobalizationUtil.globalize("bookmarks.ui.edit_fields_and_click_save_button"));
instruction = new Label(GlobalizationUtil.globalize(
"bookmarks.ui.edit_fields_and_click_save_button"));
blank = new Label(" ");
instruction1 = new Label(GlobalizationUtil.globalize("bookmarks.ui.bookmark_name"));
instruction2 = new Label(GlobalizationUtil.globalize("bookmarks.ui.bookmark_url"));
instruction3 = new Label(GlobalizationUtil.globalize("bookmarks.ui.bookmark_description"));
instruction1 = new Label(GlobalizationUtil.globalize(
"bookmarks.ui.bookmark_name"));
instruction2 = new Label(GlobalizationUtil.globalize(
"bookmarks.ui.bookmark_url"));
instruction3 = new Label(GlobalizationUtil.globalize(
"bookmarks.ui.bookmark_description"));
blank1 = new Label("");
blank2 = new Label("");
blank3 = new Label("");
blank4 = new Label("");
creationDateLabel = new Label(GlobalizationUtil.globalize("bookmarks.ui.creation_date"));
modDateLabel = new Label(GlobalizationUtil.globalize("bookmarks.ui.last_modified_date"));
authorLabel = new Label(GlobalizationUtil.globalize("bookmarks.ui.created_by"));
visitsLabel = new Label(GlobalizationUtil.globalize("bookmarks.ui.number_of_visits"));
creationDateLabel = new Label(GlobalizationUtil.globalize(
"bookmarks.ui.creation_date"));
modDateLabel = new Label(GlobalizationUtil.globalize(
"bookmarks.ui.last_modified_date"));
authorLabel = new Label(GlobalizationUtil.globalize(
"bookmarks.ui.created_by"));
visitsLabel = new Label(GlobalizationUtil.globalize(
"bookmarks.ui.number_of_visits"));
bookmarkName = new TextField("BookmarkName");
bookmarkName.setDefaultValue("");
bookmarkName.addValidationListener(new NotNullValidationListener("Every Bookmark must have a name!"));
bookmarkName.addValidationListener(new NotNullValidationListener(
"Every Bookmark must have a name!"));
newWindowLabel = new Label(GlobalizationUtil.globalize("bookmarks.ui.bookmark_in_new_window"));
newWindowLabel = new Label(GlobalizationUtil.globalize(
"bookmarks.ui.bookmark_in_new_window"));
newWindow = new RadioGroup("newWin");
newWindow.addOption(new Option("true", "Yes"));
newWindow.addOption(new Option("false", "No"));
try {
newWindow.addPrintListener( new PrintListener() {
public void prepare(PrintEvent e) {
PageState s = e.getPageState();
if(getSelectionModel().isSelected(s))
{
BigDecimal bd =
new BigDecimal((String) getSelectionModel().getSelectedKey(s));
Bookmark bmrk = Bookmark.retrieveBookmark(bd);
RadioGroup group = (RadioGroup)e.getTarget();
group.setValue(s,String.valueOf(bmrk.getNewWindow()));
}
public void prepare(PrintEvent e) {
PageState s = e.getPageState();
if(getSelectionModel().isSelected(s)) {
BigDecimal bd = new BigDecimal((String)
getSelectionModel().getSelectedKey(s));
Bookmark bmrk = Bookmark.retrieveBookmark(bd);
RadioGroup group = (RadioGroup)e.getTarget();
group.setValue(s,String.valueOf(bmrk.getNewWindow()));
}
});
}
});
} catch(java.util.TooManyListenersException e) { }
try {
bookmarkName.addPrintListener( new PrintListener()
{
public void prepare(PrintEvent e)
{
PageState s = e.getPageState();
if(getSelectionModel().isSelected(s))
{
BigDecimal bd =
new BigDecimal((String) getSelectionModel().getSelectedKey(s));
Bookmark bmrk = Bookmark.retrieveBookmark(bd);
TextField tf = (TextField)e.getTarget();
tf.setValue(s,bmrk.getName());
}
bookmarkName.addPrintListener( new PrintListener() {
public void prepare(PrintEvent e) {
PageState s = e.getPageState();
if(getSelectionModel().isSelected(s)) {
BigDecimal bd = new BigDecimal((String)
getSelectionModel().getSelectedKey(s));
Bookmark bmrk = Bookmark.retrieveBookmark(bd);
TextField tf = (TextField)e.getTarget();
tf.setValue(s,bmrk.getName());
}
});
}
});
} catch(java.util.TooManyListenersException e) { }
bookmarkURL = new TextField("BookmarkURL");
bookmarkURL.setDefaultValue("");
bookmarkURL.addValidationListener(new NotEmptyValidationListener("White space is not allowed in URLs!"));
bookmarkURL.addValidationListener(new NotEmptyValidationListener(
"White space is not allowed in URLs!"));
try {

View File

@ -129,7 +129,7 @@ public class FileAttachment extends FileAsset {
}
public void setFileOwner(ContentItem fileOwner) {
Assert.assertNotNull(fileOwner);
Assert.exists(fileOwner);
this.setMaster(fileOwner);
setAssociation(FILE_OWNER, fileOwner);
@ -227,11 +227,11 @@ public class FileAttachment extends FileAsset {
*/
public void swapKeys(boolean swapNext) {
Assert.assertTrue(!isNew(), "swapKeys() cannot be called on an " +
Assert.isTrue(!isNew(), "swapKeys() cannot be called on an " +
"object that is new");
ContentItem fileOwner = getFileOwner();
Assert.assertNotNull(fileOwner, "fileOwner must be set for swapKeys() to work");
Assert.exists(fileOwner, "fileOwner must be set for swapKeys() to work");
Integer currentKey = getFileOrder();
// if the current item is not already ordered, alphabetize

View File

@ -58,7 +58,7 @@ public class RelatedLinkTableModelBuilder
* @return The DataCollection of RelatedLinks
*/
public DataCollection getLinks(PageState s) {
Assert.truth(m_itemModel.isSelected(s), "item selected");
Assert.isTrue(m_itemModel.isSelected(s), "item selected");
ContentItem item = m_itemModel.getSelectedItem(s);
s_log.debug("Getting related links for " + item.getName());
return RelatedLink.getRelatedLinks(item);

View File

@ -107,7 +107,7 @@ public class AddContactPropertiesStep extends ResettableContainer {
protected Object initialValue(PageState s) {
ContentItem item = (ContentItem) ((ItemSelectionModel) getSingleSelectionModel())
.getSelectedObject(s);
Assert.assertNotNull(item);
Assert.exists(item);
return Contact.getContactForItem(item);
}

View File

@ -95,7 +95,7 @@ public class FormSectionWrapper extends PersistentComponent
}
public void setFormSectionItem(FormSectionItem item) {
Assert.truth(ContentItem.DRAFT.equals(item.getVersion()),
Assert.isTrue(ContentItem.DRAFT.equals(item.getVersion()),
"item is draft");
setAssociation(FORM_SECTION_ITEM, item);

View File

@ -135,7 +135,7 @@ public class ArticleImageAssociation extends ContentItem {
*/
public static boolean imageHasAssociation
(ImageAsset image) {
Assert.assertNotNull(image);
Assert.exists(image);
boolean returnValue = imageHasDirectAssociation(image.getID());
if (!returnValue) {
if (!image.getVersion().equals(ContentItem.DRAFT)) {

View File

@ -88,7 +88,7 @@ public final class CMSContext {
*/
public final ContentSection getContentSection() {
// removing this which is not true when viewing category pages
//Assert.assertNotNull(m_section, "section");
//Assert.exists(m_section, "section");
return m_section;
}
@ -119,7 +119,7 @@ public final class CMSContext {
*/
public final ContentItem getContentItem() {
// removing this which is necessarily true in ContentList
//Assert.assertNotNull(m_item, "item");
//Assert.exists(m_item, "item");
if (s_log.isDebugEnabled() && m_item == null) {
s_log.debug("Content item is null");
}

View File

@ -136,7 +136,7 @@ public class CategoryTemplateMapping extends TemplateMapping {
* @param sec The ContentSection for which this mapping should be valid.
**/
public final void setContentSection(ContentSection sec) {
Assert.assertNotNull(sec);
Assert.exists(sec);
setAssociation(SECTION, sec);
}
@ -158,7 +158,7 @@ public class CategoryTemplateMapping extends TemplateMapping {
* @param cat The Category for which this mapping should be valid.
**/
public void setCategory(Category cat) {
Assert.assertNotNull(cat);
Assert.exists(cat);
setAssociation(CATEGORY, cat);
}
@ -192,7 +192,7 @@ public class CategoryTemplateMapping extends TemplateMapping {
* @param t The ContentType for which this mapping should be valid.
**/
public void setContentType(ContentType t) {
Assert.assertNotNull(t);
Assert.exists(t);
setAssociation(CONTENT_TYPE, t);
}
@ -213,7 +213,7 @@ public class CategoryTemplateMapping extends TemplateMapping {
* @param b whether the template is the default within its context.
*/
public void setDefault(Boolean b) {
Assert.assertNotNull(b);
Assert.exists(b);
set(IS_DEFAULT, b);
}
@ -237,7 +237,7 @@ public class CategoryTemplateMapping extends TemplateMapping {
c.addEqualsFilter(TEMPLATE + "." + ACSObject.ID, template.getID());
if(!c.next()) return null;
CategoryTemplateMapping m = (CategoryTemplateMapping)c.getDomainObject();
Assert.assertTrue(!c.next());
Assert.isTrue(!c.next());
c.close();
return m;
}
@ -260,7 +260,7 @@ public class CategoryTemplateMapping extends TemplateMapping {
if(!c.next()) return null;
CategoryTemplateMapping m = (CategoryTemplateMapping)c.getDomainObject();
// FIXME: There HAS to be a better way to enforce uniqueness here...
Assert.assertTrue(!c.next());
Assert.isTrue(!c.next());
c.close();
return m.getTemplate();
}

View File

@ -197,7 +197,7 @@ public class ContentBundle extends ContentItem {
public final void setDefaultLanguage(final String language) {
if (Assert.isEnabled()) {
Assert.exists(language, String.class);
Assert.truth(language.length() == 2,
Assert.isTrue(language.length() == 2,
language + " is not an ISO639 language code");
}
@ -224,7 +224,7 @@ public class ContentBundle extends ContentItem {
if (Assert.isEnabled()) {
Assert.exists(instance, ContentItem.class);
Assert.falsity(hasInstance(instance.getLanguage()),
Assert.isFalse(hasInstance(instance.getLanguage()),
"The bundle already contains an instance " +
"for the language " + instance.getLanguage());
}
@ -233,7 +233,7 @@ public class ContentBundle extends ContentItem {
instance.setContentSection(getContentSection());
if (Assert.isEnabled()) {
Assert.equal(this, instance.getParent());
Assert.isEqual(this, instance.getParent());
}
}
@ -252,14 +252,14 @@ public class ContentBundle extends ContentItem {
public void removeInstance(final ContentItem instance) {
if (Assert.isEnabled()) {
Assert.exists(instance, ContentItem.class);
Assert.equal(this, instance.getParent());
Assert.unequal(instance, getPrimaryInstance());
Assert.isEqual(this, instance.getParent());
Assert.isNotEqual(instance, getPrimaryInstance());
}
instance.setParent(null);
if (Assert.isEnabled()) {
Assert.truth(instance.getParent() == null);
Assert.isTrue(instance.getParent() == null);
}
}
@ -301,7 +301,7 @@ public class ContentBundle extends ContentItem {
public final ContentItem getInstance(final String language) {
if (Assert.isEnabled()) {
Assert.exists(language, String.class);
Assert.truth(language.length() == 2,
Assert.isTrue(language.length() == 2,
language + " does not look like a valid language " +
"code");
}
@ -315,7 +315,7 @@ public class ContentBundle extends ContentItem {
final DataObject data = instances.getDataObject();
if (Assert.isEnabled()) {
//Assert.falsity(instances.next(),
//Assert.isFalse(instances.next(),
// "There is more than one instance with the " +
// "same language");
}
@ -357,7 +357,7 @@ public class ContentBundle extends ContentItem {
public final boolean hasInstance(final String language) {
if (Assert.isEnabled()) {
Assert.exists(language, String.class);
Assert.truth(language.length() == 2,
Assert.isTrue(language.length() == 2,
language + " is not an ISO639 language code");
}
@ -390,7 +390,7 @@ public class ContentBundle extends ContentItem {
items.close();
if (Assert.isEnabled()) {
Assert.truth(!list.isEmpty() || getInstances().isEmpty());
Assert.isTrue(!list.isEmpty() || getInstances().isEmpty());
}
return list;
@ -407,7 +407,7 @@ public class ContentBundle extends ContentItem {
* @pre locales != null
*/
public ContentItem negotiate(Locale[] locales) {
Assert.assertNotNull(locales);
Assert.exists(locales);
DataAssociationCursor instancesCursor = instances();
DataObject dataObject = null;
int bestMatch = 0;
@ -462,7 +462,7 @@ public class ContentBundle extends ContentItem {
* @pre locales != null
*/
public ContentItem negotiate(Enumeration locales) {
Assert.assertNotNull(locales);
Assert.exists(locales);
/* copy "locales" enumeration, since we have to iterate
* over it several times
*/

View File

@ -1054,7 +1054,7 @@ public class ContentItem extends VersionedACSObject implements CustomCopy {
}
if (Assert.isEnabled()) {
Assert.truth(version == null || LIVE.equals(version.getVersion()),
Assert.isTrue(version == null || LIVE.equals(version.getVersion()),
"Item version " + version + " must be null or " +
"the live version");
}
@ -1195,7 +1195,7 @@ public class ContentItem extends VersionedACSObject implements CustomCopy {
if (Assert.isEnabled()) {
Assert.exists(pending, ContentItem.class);
Assert.truth(PENDING.equals(pending.getVersion()) ||
Assert.isTrue(PENDING.equals(pending.getVersion()) ||
LIVE.equals(pending.getVersion()),
"The new pending item must be pending or live; " +
"instead it is " + pending.getVersion());
@ -1273,7 +1273,7 @@ public class ContentItem extends VersionedACSObject implements CustomCopy {
applyTag( "Republished" );
Versions.suspendVersioning();
Assert.truth( isLive(), "Attempt to republish non live item " + getOID() );
Assert.isTrue( isLive(), "Attempt to republish non live item " + getOID() );
Lifecycle cycle = getLifecycle();
Assert.exists( cycle, Lifecycle.class );
@ -1936,21 +1936,21 @@ public class ContentItem extends VersionedACSObject implements CustomCopy {
* Assert that this item is a draft version
*/
public final void assertDraft() {
Assert.equal(DRAFT, getVersion());
Assert.isEqual(DRAFT, getVersion());
}
/**
* Assert that this item is a pending version
*/
public final void assertPending() {
Assert.equal(PENDING, getVersion());
Assert.isEqual(PENDING, getVersion());
}
/**
* Assert that this item is a live version
*/
public final void assertLive() {
Assert.equal(LIVE, getVersion());
Assert.isEqual(LIVE, getVersion());
}
//
@ -1962,7 +1962,7 @@ public class ContentItem extends VersionedACSObject implements CustomCopy {
* @deprecated with no replacement
*/
public final void assertMaster() {
Assert.truth(isMaster(), "Item " + getOID() + " is a top-level item");
Assert.isTrue(isMaster(), "Item " + getOID() + " is a top-level item");
}
//
@ -1986,7 +1986,7 @@ public class ContentItem extends VersionedACSObject implements CustomCopy {
}
ContentItem get() {
Assert.truth(m_cached);
Assert.isTrue(m_cached);
return m_version;
}

View File

@ -243,7 +243,7 @@ public class ContentSection extends Application {
*/
// public PackageInstance getPackageInstance() {
// DataObject pkg = (DataObject) get(PACKAGE);
// Assert.assertNotNull(pkg, "package instance");
// Assert.exists(pkg, "package instance");
// return new PackageInstance(pkg);
// }
@ -254,7 +254,7 @@ public class ContentSection extends Application {
* @pre ( pkg != null )
*/
// protected void setPackageInstance(PackageInstance pkg) {
// Assert.assertNotNull(pkg, "package instance");
// Assert.exists(pkg, "package instance");
// setAssociation(PACKAGE, pkg);
// }
@ -309,8 +309,8 @@ public class ContentSection extends Application {
// public final String getPath() {
// final String path = getSiteNode().getURL();
//
// if (Assert.isAssertEnabled()) {
// Assert.assertTrue(path.endsWith("/"));
// if (Assert.isEnabled()) {
// Assert.isTrue(path.endsWith("/"));
// }
//
// return path.substring(0, path.length() - 1);
@ -328,7 +328,7 @@ public class ContentSection extends Application {
*/
public Folder getRootFolder() {
DataObject folder = (DataObject) get(ROOT_FOLDER);
Assert.assertNotNull(folder, "root folder");
Assert.exists(folder, "root folder");
return new Folder(folder);
}
@ -338,7 +338,7 @@ public class ContentSection extends Application {
* @param root The root folder
*/
public void setRootFolder(Folder root) {
Assert.assertNotNull(root, "root folder");
Assert.exists(root, "root folder");
// Update the content section of the old and new root folders.
// This is necessary because the content section is used to determine
@ -397,7 +397,7 @@ public class ContentSection extends Application {
public Category getRootCategory() {
Category category = Category.getRootForObject(this);
Assert.assertNotNull(category, "root category");
Assert.exists(category, "root category");
return category;
}
@ -411,7 +411,7 @@ public class ContentSection extends Application {
* @pre ( root != null )
*/
public void setRootCategory(Category root) {
Assert.assertNotNull(root, "root category");
Assert.exists(root, "root category");
Category.setRootForObject(this, root);
}
@ -423,7 +423,7 @@ public class ContentSection extends Application {
*/
public Group getStaffGroup() {
DataObject group = (DataObject) get(STAFF_GROUP);
Assert.assertNotNull(group, "staff group");
Assert.exists(group, "staff group");
return new Group(group);
}
@ -434,7 +434,7 @@ public class ContentSection extends Application {
* @pre ( group != null )
*/
public void setStaffGroup(Group group) {
Assert.assertNotNull(group, "staff group");
Assert.exists(group, "staff group");
setAssociation(STAFF_GROUP, group);
}
@ -446,7 +446,7 @@ public class ContentSection extends Application {
*/
public Group getViewersGroup() {
DataObject group = (DataObject) get(VIEWERS_GROUP);
Assert.assertNotNull(group, "viewers group");
Assert.exists(group, "viewers group");
return new Group(group);
}
@ -457,7 +457,7 @@ public class ContentSection extends Application {
* @pre ( group != null )
*/
public void setViewersGroup(Group group) {
Assert.assertNotNull(group, "viewers group");
Assert.exists(group, "viewers group");
setAssociation(VIEWERS_GROUP, group);
}
@ -469,7 +469,7 @@ public class ContentSection extends Application {
*/
public String getPageResolverClass() {
String prc = (String) get(PAGE_RESOLVER_CLASS);
Assert.assertNotNull(prc, "Page Resolver class");
Assert.exists(prc, "Page Resolver class");
return prc;
}
@ -526,7 +526,7 @@ public class ContentSection extends Application {
*/
public String getItemResolverClass() {
String irc = (String) get(ITEM_RESOLVER_CLASS);
Assert.assertNotNull(irc, "Content Item Resolver class");
Assert.exists(irc, "Content Item Resolver class");
s_log.debug("Content Item Resolver Class is " + irc);
return irc;
}
@ -573,7 +573,7 @@ public class ContentSection extends Application {
*/
public String getTemplateResolverClass() {
String trc = (String) get(TEMPLATE_RESOLVER_CLASS);
Assert.assertNotNull(trc, "Template Resolver class");
Assert.exists(trc, "Template Resolver class");
return trc;
}
@ -618,7 +618,7 @@ public class ContentSection extends Application {
*/
public String getXMLGeneratorClass() {
String xgc = (String) get(XML_GENERATOR_CLASS);
Assert.assertNotNull(xgc, "XML Generator class");
Assert.exists(xgc, "XML Generator class");
return xgc;
}

View File

@ -240,7 +240,7 @@ public class Folder extends ContentItem {
DataQueryDataCollectionAdapter adapter = new DataQueryDataCollectionAdapter(ITEMS_QUERY, ITEM);
adapter.setParameter(PARENT, getID());
Assert.unequal(PENDING, getVersion());
Assert.isNotEqual(PENDING, getVersion());
adapter.setParameter(VERSION, getVersion());
return new ItemCollection(adapter, bSort);
@ -268,7 +268,7 @@ public class Folder extends ContentItem {
(PRIMARY_INSTANCES_QUERY);
query.setParameter(PARENT, getID());
Assert.unequal(PENDING, getVersion());
Assert.isNotEqual(PENDING, getVersion());
query.setParameter(VERSION, getVersion());
@ -431,7 +431,7 @@ public class Folder extends ContentItem {
}
public void removePendingVersion(final ContentItem version) {
Assert.unequal(PENDING, version.getVersion());
Assert.isNotEqual(PENDING, version.getVersion());
return;
}

View File

@ -136,7 +136,7 @@ public class ItemTemplateMapping extends TemplateMapping {
if(!c.next()) return null;
ItemTemplateMapping m = (ItemTemplateMapping)c.getDomainObject();
// FIXME: There HAS to be a better way to enforce uniqueness here...
Assert.assertTrue(!c.next());
Assert.isTrue(!c.next());
c.close();
return m;
}

View File

@ -262,7 +262,7 @@ class PublishedLink extends DomainObject {
if (target != null) {
ObjectType ot = src.getObjectType();
Property prop = ot.getProperty(propertyName);
Assert.assertNotNull(prop, propertyName + " for type " + ot.getQualifiedName() + ", ID: " + src.get("id"));
Assert.exists(prop, propertyName + " for type " + ot.getQualifiedName() + ", ID: " + src.get("id"));
if (prop.isCollection()) {
DataAssociation da = (DataAssociation) src.get(propertyName);
da.add(target);

View File

@ -86,7 +86,7 @@ public class SectionTemplateMapping extends TemplateMapping {
}
public final void setContentSection(ContentSection sec) {
Assert.assertNotNull(sec);
Assert.exists(sec);
setAssociation(SECTION, sec);
}
@ -100,7 +100,7 @@ public class SectionTemplateMapping extends TemplateMapping {
}
public final void setContentType(ContentType t) {
Assert.assertNotNull(t);
Assert.exists(t);
setAssociation(CONTENT_TYPE, t);
}
@ -117,7 +117,7 @@ public class SectionTemplateMapping extends TemplateMapping {
* context
*/
public void setDefault(Boolean b) {
Assert.assertNotNull(b);
Assert.exists(b);
set(IS_DEFAULT, b);
}
@ -148,7 +148,7 @@ public class SectionTemplateMapping extends TemplateMapping {
}
if(!c.next()) return null;
SectionTemplateMapping m = (SectionTemplateMapping)c.getDomainObject();
Assert.assertTrue(!c.next());
Assert.isTrue(!c.next());
c.close();
return m;
}
@ -169,7 +169,7 @@ public class SectionTemplateMapping extends TemplateMapping {
if(!c.next()) return null;
SectionTemplateMapping m = (SectionTemplateMapping)c.getDomainObject();
// FIXME: There HAS to be a better way to enforce uniqueness here...
Assert.assertTrue(!c.next());
Assert.isTrue(!c.next());
c.close();
return m.getTemplate();
}
@ -187,7 +187,7 @@ public class SectionTemplateMapping extends TemplateMapping {
if(!c.next()) return null;
SectionTemplateMapping m = (SectionTemplateMapping)c.getDomainObject();
// FIXME: There HAS to be a better way to enforce uniqueness here...
Assert.assertTrue(!c.next());
Assert.isTrue(!c.next());
c.close();
return m.getTemplate();
}

View File

@ -459,7 +459,7 @@ public class SecurityManager implements Security, SecurityConstants {
*/
private boolean hasPermission(Party party, String privilege) {
PrivilegeDescriptor pd = PrivilegeDescriptor.get(privilege);
Assert.assertNotNull(pd, "PrivilegeDescriptor.get(\"" + privilege + "\")");
Assert.exists(pd, "PrivilegeDescriptor.get(\"" + privilege + "\")");
return hasPermission(party, pd);
}
@ -477,7 +477,7 @@ public class SecurityManager implements Security, SecurityConstants {
private boolean hasPermission(Party party, String privilege,
ContentItem item) {
PrivilegeDescriptor pd = PrivilegeDescriptor.get(privilege);
Assert.assertNotNull(pd, "PrivilegeDescriptor.get(\"" + privilege + "\")");
Assert.exists(pd, "PrivilegeDescriptor.get(\"" + privilege + "\")");
return hasPermission(party, pd, item);
}
@ -487,7 +487,7 @@ public class SecurityManager implements Security, SecurityConstants {
*/
private boolean hasPermission(Party party, PrivilegeDescriptor pd,
ContentItem item) {
Assert.assertNotNull(pd, "PrivilegeDescriptor");
Assert.exists(pd, "PrivilegeDescriptor");
PermissionDescriptor perm = new PermissionDescriptor(pd, item, party);
return (PermissionService.checkPermission(perm));
}

View File

@ -158,7 +158,7 @@ public class StandalonePage extends ContentPage {
*/
public void setLive(ContentItem version) {
Template t = getTemplate();
Assert.assertNotNull(t);
Assert.exists(t);
if(version != null)
t.createLiveVersion();
super.setLive(version);

View File

@ -97,7 +97,7 @@ public abstract class TemplateMapping extends ACSObject {
* Set the new template for this mapping
*/
public void setTemplate(Template t) {
Assert.assertNotNull(t);
Assert.exists(t);
setAssociation(TEMPLATE, t);
}
@ -112,7 +112,7 @@ public abstract class TemplateMapping extends ACSObject {
* Set the use context for this mapping
*/
public void setUseContext(String context) {
Assert.assertNotNull(context);
Assert.exists(context);
set(USE_CONTEXT, context);
}

View File

@ -88,15 +88,15 @@ class VersionCopier extends ObjectCopier {
}
if (Assert.isEnabled()) {
//Assert.falsity(item instanceof ContentBundle);
//Assert.falsity(item instanceof Folder);
Assert.falsity(m_once);
//Assert.isFalse(item instanceof ContentBundle);
//Assert.isFalse(item instanceof Folder);
Assert.isFalse(m_once);
m_once = true;
}
m_topLevelSourceOID = item.getOID();
final ContentItem version = createVersion(item);
//Assert.truth(m_topLevelSourceOID == null,
//Assert.isTrue(m_topLevelSourceOID == null,
// "CopyItem should be called only once for a given copier instance");
if (m_lifecycle != null) {

View File

@ -98,7 +98,7 @@ public class ContentGroupAssociation extends ContentItem {
* Sets the content item for this association
*/
public void setContentItem(ContentItem item) {
//Assert.assertTrue(item != null, "The ConentItem must not be null");
//Assert.isTrue(item != null, "The ConentItem must not be null");
set(CONTENT_ITEM, item);
}
@ -107,7 +107,7 @@ public class ContentGroupAssociation extends ContentItem {
* @pre group != null
*/
protected void setContentGroup(ContentGroup group) {
Assert.assertTrue(group != null, "The ContentGroup must not be null");
Assert.isTrue(group != null, "The ContentGroup must not be null");
set(CONTENT_GROUP, group);
}
@ -180,11 +180,11 @@ public class ContentGroupAssociation extends ContentItem {
methodName = "swapWithPrevious";
}
Assert.assertTrue(!isNew(), methodName + " cannot be called on an " +
Assert.isTrue(!isNew(), methodName + " cannot be called on an " +
"object that is new");
Integer currentKey = (Integer)get(SORT_KEY);
Assert.assertTrue(currentKey != null, methodName + " cannot be " +
Assert.isTrue(currentKey != null, methodName + " cannot be " +
"called on an object that is not currently in the " +
"list");

View File

@ -165,7 +165,7 @@ public class Link extends ACSObject {
* Link.INTERNAL_LINK
*/
public void setTargetType(String type) {
Assert.assertTrue(type != null &&
Assert.isTrue(type != null &&
(type.equals(EXTERNAL_LINK)||type.equals(INTERNAL_LINK)));
set(TARGET_TYPE, type);
}
@ -276,7 +276,7 @@ public class Link extends ACSObject {
* @param order the link order
*/
public void setOrder(Integer order) {
Assert.assertNotNull(order);
Assert.exists(order);
set(ORDER, order);
}
@ -433,7 +433,7 @@ public class Link extends ACSObject {
methodName = "swapWithPrevious";
}
Assert.assertTrue(!isNew(), methodName + " cannot be called on an " +
Assert.isTrue(!isNew(), methodName + " cannot be called on an " +
"object that is new");
Integer currentKey = (Integer)get(ORDER);
@ -444,7 +444,7 @@ public class Link extends ACSObject {
alphabetize();
return;
}
Assert.assertTrue(currentKey != null, methodName + " cannot be " +
Assert.isTrue(currentKey != null, methodName + " cannot be " +
"called on an object that is not currently in the " +
"list");

View File

@ -111,7 +111,7 @@ public class LinkDisplayTable extends LinkTable {
private Link getLink(TableActionEvent e) {
String id = (String)e.getRowKey();
Assert.assertNotNull(id);
Assert.exists(id);
Link link;
try {
link = new Link(new BigDecimal(id));

View File

@ -99,7 +99,7 @@ public class ContentItemDispatcher implements Dispatcher {
final ContentSection section =
(ContentSection) Web.getContext().getApplication();
Assert.assertNotNull(item);
Assert.exists(item);
//get the item's template
final String sTemplateURL = getTemplatePath(item, request, actx);

View File

@ -105,7 +105,7 @@ public class ContentSectionDispatcher implements Dispatcher {
// Fetch the current site node from the request context;
SiteNode sn = actx.getSiteNode();
ContentSection section = ContentSection.getSectionFromNode(sn);
Assert.assertNotNull(section);
Assert.exists(section);
request.setAttribute(CONTENT_SECTION, section);

View File

@ -56,7 +56,7 @@ public class MasterPage extends CMSPage {
public ContentSection getContentSection(HttpServletRequest request) {
// Resets all content sections associations.
ContentSection section = super.getContentSection(request);
Assert.assertNotNull(section);
Assert.exists(section);
return section;
}

View File

@ -114,7 +114,7 @@ public class MultilingualItemResolver extends AbstractItemResolver implements It
// We allow for returning null, so the root folder may
// not be live.
//Assert.assertTrue(rootFolder.isLive(),
//Assert.isTrue(rootFolder.isLive(),
// "live context - root folder of secion must be live");
// If the context is 'live', we need the live item.
@ -659,7 +659,7 @@ public class MultilingualItemResolver extends AbstractItemResolver implements It
pos++; // skip the "="
// ID is the string between the equal (at pos) and the next separator
// ID is the string between the isEqual (at pos) and the next separator
int i = item_id.indexOf(SEPARATOR);
item_id = item_id.substring(pos, Math.min(i, item_id.length() -1));

View File

@ -64,7 +64,7 @@ public abstract class ResourceHandlerImpl implements ResourceHandler {
public ContentSection getContentSection(HttpServletRequest request) {
// resets all content sections associations
ContentSection section = CMSDispatcher.getContentSection(request);
Assert.assertNotNull(section);
Assert.exists(section);
return section;
}

View File

@ -15,71 +15,6 @@ init com.arsdigita.cms.installer.xml.ContentTypeInitializer {
};
}
//-- init com.arsdigita.cms.publishToFile.LegacyInitializer {
// List of publish destinations for content types
// Each element is a four-element list in the format
// '{ "content type", "root directory", "shared storage",
// "url stub" }'.
// "Content type" is the object type of the content type.
// "Root directory" must be a path to a writable directory, relative
// to the file-system root.
// (pboy): "Root directory here is relative to application base!
// "Shared storage" must be _true_ if the root
// directory is shared NFS storage, _false_ otherwise. "URL stub"
// must be the path component of the URL from which the live server
// will serve from this directory.
//-- destination = {
//-- { "com.arsdigita.cms.ContentItem",
//-- "p2fs",
//-- false,
//-- "/p2fs" },
// (pboy): starting with webapps refers to the CCM_HOME env variable which
// points to the installation root of the servlet container. This is not
// used anymore, all specifications are relative to webapplication base.
// So the following may have to be changed to "packages/content-section/templates"
// if someone tries to use p2fs
//-- { "com.arsdigita.cms.Template",
//-- // "webapps/ROOT/packages/content-section/templates",
//-- "packages/content-section/templates",
//-- false,
//-- "/templates" }
//-- };
// Class which implements PublishToFileListener used to perform
// additional actions when publishing or unpublishing to the file system.
//-- publishListener = "com.arsdigita.cms.publishToFile.PublishToFile";
// Queue management parameters.
// Set startupDelay to 0 to disable the processing of the queue
// Time (seconds) before starting to monitor the
// queue after a server start
//-- startupDelay = 30;
// Time (in seconds) between checking if there are entries in the
// publishToFile queue.
// A value <= 0 disables processing the queue on this server.
//-- pollDelay = 5;
// Time to wait (seconds) before retrying
// to process a failed entry
//-- retryDelay = 120;
// Number of queue entries to process at once.
//-- blockSize = 40;
// Number of times a failed queue entry will be
// reprocessed. If processing has failed more than
// that number of times, the entry will be
// ignored.
//-- maximumFailCount = 10;
// Method used to select entries for processing.
// 'QueuedOrder'-in queued order.
// 'GroupByParent'-group entries according to parent when selecting items
// (allows optimizations if a listener task required for all elements in a folder
// can be done only once for the folder).
//-- blockSelectMethod = "GroupByParent";
//-- }
init com.arsdigita.cms.installer.SectionInitializer {
@ -92,7 +27,8 @@ init com.arsdigita.cms.installer.SectionInitializer {
// - Parameter waf.pagemap.login_redirect=content/content-center-redirect.jsp
// in integrations.properties of the respective bundle
// - registerDomain(navigationKey, "/content/", null); in ldn.aplaws.Loader
name = "content";
//-- name = "content";
name = "intern";
// List of roles to create. First field is role name,
// second is the description, third is a list of
@ -138,14 +74,20 @@ init com.arsdigita.cms.installer.SectionInitializer {
// The types are registered when the content-section is created. Later
// modifications have no effect.
//-- types = {
//-- };
types = {
"com.arsdigita.cms.contenttypes.Address",
"com.arsdigita.cms.contenttypes.Article",
"com.arsdigita.cms.contenttypes.Contact"
};
// Category tree to load
categories = { "/WEB-INF/resources/article-categories.xml", "/WEB-INF/resources/navigation-categories.xml" };
// Wether to make content viewable to 'The Public', ie non-registered users
public = true;
//-- public = true;
public = false;
// When to generate email alerts: by default, generate email alerts
// on enable, finish, and rollback (happens on rejection)
@ -279,6 +221,147 @@ init com.arsdigita.formbuilder.installer.Initializer {
}
//Used when running CMS in conjunction with a Portal
init com.arsdigita.cms.installer.portlet.Initializer {}
// //////////////////////////////////////////////////////////
//
// Initializer replaced by new initialization system
//
// //////////////////////////////////////////////////////////
// No longer needed, refactored as a sub-initializer of ccm initializer
// (following the new initializer system)
// init com.arsdigita.cms.publishToFile.LegacyInitializer {
// // List of publish destinations for content types
// // Each element is a four-element list in the format
// // '{ "content type", "root directory", "shared storage",
// // "url stub" }'.
// // "Content type" is the object type of the content type.
// // "Root directory" must be a path to a writable directory, relative
// // to the file-system root.
// // (pboy): "Root directory here is relative to application base!
// // "Shared storage" must be _true_ if the root
// // directory is shared NFS storage, _false_ otherwise. "URL stub"
// // must be the path component of the URL from which the live server
// // will serve from this directory.
// destination = {
// { "com.arsdigita.cms.ContentItem",
// "p2fs",
// false,
// "/p2fs" },
// // (pboy): starting with webapps refers to the CCM_HOME env variable which
// // points to the installation root of the servlet container. This is not
// // used anymore, all specifications are relative to webapplication base.
// // So the following may have to be changed to "packages/content-section/templates"
// // if someone tries to use p2fs
// { "com.arsdigita.cms.Template",
// // "webapps/ROOT/packages/content-section/templates",
// "packages/content-section/templates",
// false,
// "/templates" }
// };
//
// // Class which implements PublishToFileListener used to perform
// // additional actions when publishing or unpublishing to the file system.
// publishListener = "com.arsdigita.cms.publishToFile.PublishToFile";
//
// // Queue management parameters.
//
// // Set startupDelay to 0 to disable the processing of the queue
// // Time (seconds) before starting to monitor the
// // queue after a server start
// startupDelay = 30;
//
// // Time (in seconds) between checking if there are entries in the
// // publishToFile queue.
// // A value <= 0 disables processing the queue on this server.
// pollDelay = 5;
//
// // Time to wait (seconds) before retrying
// // to process a failed entry
// retryDelay = 120;
//
// // Number of queue entries to process at once.
// blockSize = 40;
// // Number of times a failed queue entry will be
// // reprocessed. If processing has failed more than
// // that number of times, the entry will be
// // ignored.
// maximumFailCount = 10;
//
// // Method used to select entries for processing.
// // 'QueuedOrder'-in queued order.
// // 'GroupByParent'-group entries according to parent when selecting items
// // (allows optimizations if a listener task required for all elements in a folder
// // can be done only once for the folder).
// blockSelectMethod = "GroupByParent";
// }
// No longer needed, refactored as a sub-initializer of ccm initializer
// (following the new initializer system)
//
// init com.arsdigita.cms.lifecycle.LegacyInitializer {
// // How long do we wait (in seconds) after system startup
// // before we start processing lifecycles?
// delay = 60;
// // How often (in seconds) does the system look for pending
// // items to make live and live items to expire
// frequency = 600;
// }
// This is no longer needed. Item adapters are now set via standard
// initializers. Legacy initializer is still available if you need
// to register multiple adapter files.
//init com.arsdigita.domain.installer.DomainObjectTraversalInitializer {
// adapters = {
// "/WEB-INF/resources/cms-item-adapters.xml"
// };
//
//}
// This is no longer needed.
// Initializer com.arsdigita.cms.populate.Initializer no longer part of the
// source code nor exist a package com.arsdigita.cms.populate anymore.
// Had been commented out in rev. 8 (in 2004)
//populates the database with CMS Content Items and
//other, CMS-related data
//<NOTE>
//You should disable the PublishToFile initializers
//while running this population initializer or set its delay
//long enough so that it won't run until this initializer
//has finished. Also, the content items created by this
//initializer won't be live until the lifeCycle initializers
//have completed running on them.
//</NOTE>
// init com.arsdigita.cms.populate.Initializer {
// contentSection = "content";
// //total folders created = numTopLevelFolders * folderDepth
// numTopLevelFolders = 3;
// folderDepth = 2;
// numContentItems = 5;
// createContentTypes =
// {"com.arsdigita.cms.populate.CreateArticle",
// "com.arsdigita.cms.populate.CreateTextArticle",
// "com.arsdigita.cms.populate.CreateMultiPartArticle",
// "com.arsdigita.cms.populate.CreateTextMultiPartArticle"
// };
// numUsers = 10;
// }
// This is mot needed for a longtime.
// It has been commented out since revision 473 (Aug. 2005) or earlier
// Had been active in initial aplaws checkin (at rev. 8 about 2004)
// Modified in r473 as a svn:merge of 319-431
//init com.arsdigita.cms.installer.SectionInitializer {
// // Name of the content section (used to form URL)
// name = "forms";
@ -360,64 +443,3 @@ init com.arsdigita.formbuilder.installer.Initializer {
// maxAlerts = 5;
//
//}
//Used when running CMS in conjunction with a Portal
init com.arsdigita.cms.installer.portlet.Initializer {}
//populates the database with CMS Content Items and
//other, CMS-related data
//<NOTE>
//You should disable the PublishToFile initializers
//while running this population initializer or set its delay
//long enough so that it won't run until this initializer
//has finished. Also, the content items created by this
//initializer won't be live until the lifeCycle initializers
//have completed running on them.
//</NOTE>
// init com.arsdigita.cms.populate.Initializer {
// contentSection = "content";
// //total folders created = numTopLevelFolders * folderDepth
// numTopLevelFolders = 3;
// folderDepth = 2;
// numContentItems = 5;
// createContentTypes =
// {"com.arsdigita.cms.populate.CreateArticle",
// "com.arsdigita.cms.populate.CreateTextArticle",
// "com.arsdigita.cms.populate.CreateMultiPartArticle",
// "com.arsdigita.cms.populate.CreateTextMultiPartArticle"
// };
// numUsers = 10;
// }
// //////////////////////////////////////////////////////////
//
// Initializer replaced by new initialization system
//
// //////////////////////////////////////////////////////////
// No longer needed, refactored as a sub-initializer of ccm initializer
// (following the new initializer system)
//
// init com.arsdigita.cms.lifecycle.LegacyInitializer {
// // How long do we wait (in seconds) after system startup
// // before we start processing lifecycles?
// delay = 60;
// // How often (in seconds) does the system look for pending
// // items to make live and live items to expire
// frequency = 600;
// }
// This is no longer needed. Item adapters are now set via standard
// initializers. Legacy initializer is still available if you need
// to register multiple adapter files.
//init com.arsdigita.domain.installer.DomainObjectTraversalInitializer {
// adapters = {
// "/WEB-INF/resources/cms-item-adapters.xml"
// };
//
//}

View File

@ -172,7 +172,7 @@ s_log.warn ( "Created bundled Item: " + getName() + " " + m_item );
clone.save();
cloneBundle.save();
}
Assert.assertNotNull(clone);
Assert.exists(clone);
return clone;
}
}

View File

@ -202,7 +202,7 @@ public class ContentItemHelper {
save();
}
Assert.assertNotNull(m_item);
Assert.exists(m_item);
s_log.debug ( "Successfully created content item");
return m_item;
}
@ -242,15 +242,15 @@ public class ContentItemHelper {
throw new UncheckedWrapperException (e);
}
Assert.assertNotNull ( l_item );
Assert.exists ( l_item );
return l_item;
}
/* Only call this method after create() has been called. */
public void set(String methodName, String argClass, String value) {
Assert.assertNotNull(m_item);
Assert.assertNotNull(m_contentTypeClass);
Assert.exists(m_item);
Assert.exists(m_contentTypeClass);
if (methodName != null ) {
s_log.debug("setting property with : " + methodName );
}
@ -267,7 +267,7 @@ public class ContentItemHelper {
if (methodName != null || argClass != null
|| value != null ) {
try {
Assert.assertNotNull(argClass);
Assert.exists(argClass);
Class[] args = {Class.forName(argClass)};
s_log.debug("npe2?");
Method method = m_contentTypeClass.getMethod(methodName, args);
@ -319,7 +319,7 @@ public class ContentItemHelper {
* Look for ContentItems with the same name
*/
protected ContentItem getContentItemByName(String name, Folder parent) {
Assert.assertNotNull(parent);
Assert.exists(parent);
// Also check that there aren't any duplicates
ContentItem item = null;
ItemCollection items = parent.getItems();
@ -349,7 +349,7 @@ public class ContentItemHelper {
}
protected ContentItem cloneItem(int count, Folder parent, boolean save) {
Assert.assertNotNull(m_item);
Assert.exists(m_item);
final String name = m_item.getName() + "_" + count;
return cloneItem(name, parent, save);
@ -366,7 +366,7 @@ public class ContentItemHelper {
if (save) {
clone.save();
}
Assert.assertNotNull(clone);
Assert.exists(clone);
return clone;
}
@ -394,7 +394,7 @@ public class ContentItemHelper {
* the ContentItem and the parameter <code>count</code></P>
*/
public String cloneName ( int count ) {
Assert.assertNotNull(m_item);
Assert.exists(m_item);
return m_item.getName() + "_" + count;
}
}

View File

@ -36,7 +36,7 @@ public class Duration {
* @pre minutes != null
*/
public static String formatDuration(Integer minutes) {
Assert.assertNotNull(minutes, "minutes");
Assert.exists(minutes, "minutes");
return formatDuration(minutes.intValue());
}
@ -105,7 +105,7 @@ public class Duration {
}
private static Integer[] copyArray(int[] from) {
Assert.assertNotNull(from, "from");
Assert.exists(from, "from");
Integer[] to = new Integer[from.length];
for (int ii=0; ii<from.length; ii++) {
to[ii] = new Integer(from[ii]);

View File

@ -51,7 +51,7 @@ public class PublishLifecycleListener implements LifecycleListener {
final ContentItem item = getContentItem(event.getOID());
if (Assert.isEnabled()) {
Assert.falsity(item instanceof ContentBundle,
Assert.isFalse(item instanceof ContentBundle,
"Content bundles cannot be published");
}
@ -66,7 +66,7 @@ public class PublishLifecycleListener implements LifecycleListener {
pending = master.getPublicVersion();
if (Assert.isEnabled()) {
Assert.equal(ContentItem.PENDING, pending.getVersion());
Assert.isEqual(ContentItem.PENDING, pending.getVersion());
}
} else {
// Item is already live or is pending.
@ -74,8 +74,8 @@ public class PublishLifecycleListener implements LifecycleListener {
pending = item;
master = pending.getDraftVersion();
Assert.unequal(master, pending);
Assert.equal(ContentItem.DRAFT, master.getVersion());
Assert.isNotEqual(master, pending);
Assert.isEqual(ContentItem.DRAFT, master.getVersion());
}
master.promotePendingVersion(pending);

View File

@ -42,7 +42,7 @@ class HttpHTMLProvider
private final int m_timeout;
HttpHTMLProvider(final int timeout) {
Assert.truth(timeout > 0, "Timeout must be > than 0.");
Assert.isTrue(timeout > 0, "Timeout must be > than 0.");
m_timeout = timeout;
}

View File

@ -117,7 +117,7 @@ class LinkScanner {
private TagRef[] m_tags;
public LinkScanner(String html) {
Assert.assertNotNull(html);
Assert.exists(html);
m_content = html;
m_tags = parse();
}

View File

@ -181,7 +181,7 @@ public class PublishToFile implements PublishToFileListener {
public static URL getSource(final String path) {
if (Assert.isEnabled()) {
Assert.exists(path, String.class);
Assert.truth(path.startsWith("/"), "Path starts with '/'");
Assert.isTrue(path.startsWith("/"), "Path starts with '/'");
}
final WebConfig config = Web.getConfig();
@ -279,7 +279,7 @@ public class PublishToFile implements PublishToFileListener {
s_log.warn( "Item to publish no longer exists. ID = " + qe.getItemId() );
return false;
}
Assert.assertTrue( !(item instanceof ContentBundle) );
Assert.isTrue( !(item instanceof ContentBundle) );
if ( item instanceof Template ) {
Template template = (Template) item;
@ -298,7 +298,7 @@ public class PublishToFile implements PublishToFileListener {
// 'destination' for the Template object type, so we must
// strip it off here, otherwise it gets double appended
String templateRoot = ContentSection.getConfig().getTemplateRoot();
Assert.truth(fileName.startsWith(templateRoot),
Assert.isTrue(fileName.startsWith(templateRoot),
"filename starts with templateRoot");
PublishedFile f = PublishedFile.loadOrCreate(
@ -575,7 +575,7 @@ public class PublishToFile implements PublishToFileListener {
* publish asset (such as an image) to file system.
*/
private void writeAsset(Asset asset, PublishedFile f) {
Assert.assertTrue(ContentItem.LIVE.equals(asset.getVersion()));
Assert.isTrue(ContentItem.LIVE.equals(asset.getVersion()));
File fsf = f.getFile();
try {
@ -603,7 +603,7 @@ public class PublishToFile implements PublishToFileListener {
} else {
itemPath = Utilities.getItemLocation(target);
}
Assert.truth(itemPath.startsWith("/"), "item path starts with /");
Assert.isTrue(itemPath.startsWith("/"), "item path starts with /");
DestinationStub stub = PublishToFile.getDestination(target.getSpecificObjectType());
String stubURL = stub.getURLStub();

View File

@ -147,7 +147,7 @@ class PublishedFile extends DomainObject {
File path = new File(fileName).getParentFile();
File p = f.getParentFile();
do {
Assert.assertTrue(p.isDirectory());
Assert.isTrue(p.isDirectory());
DataCollection coll = SessionManager.getSession()
.retrieve(BASE_DATA_OBJECT_TYPE);
coll.addEqualsFilter(HOST + "." + Host.ID, host.getID());
@ -177,10 +177,10 @@ class PublishedFile extends DomainObject {
public static PublishedFile create(ContentItem item,
String fileName,
Host host) {
Assert.truth(item != null, "item is not null");
Assert.truth(item.isLive(), "item is live");
Assert.truth(fileName != null, "fileName is not null");
Assert.truth(host != null, "host is not null");
Assert.isTrue(item != null, "item is not null");
Assert.isTrue(item.isLive(), "item is live");
Assert.isTrue(fileName != null, "fileName is not null");
Assert.isTrue(host != null, "host is not null");
if (s_log.isDebugEnabled()) {
s_log.debug("creating published file with item " + item.getOID() +
@ -209,10 +209,10 @@ class PublishedFile extends DomainObject {
static PublishedFile loadOrCreate(ContentItem item,
String fileName,
Host host) {
Assert.truth(item != null, "item is not null");
Assert.truth(item.isLive(), "item is live");
Assert.truth(fileName != null, "fileName is not null");
Assert.truth(host != null, "host is not null");
Assert.isTrue(item != null, "item is not null");
Assert.isTrue(item.isLive(), "item is live");
Assert.isTrue(fileName != null, "fileName is not null");
Assert.isTrue(host != null, "host is not null");
PublishedFile f = findByFileName(fileName, host);
if (f == null) {

View File

@ -190,7 +190,7 @@ public class QueueEntry extends DomainObject {
ContentItem result = Utilities.getContentItemOrNull(getItemId());
// FIXME: We need to exempt move tasks from the ContainerItem
// assertion, since moves can have anything as the item [lutter]
Assert.assertTrue(TASK_MOVE.equals(getTask())
Assert.isTrue(TASK_MOVE.equals(getTask())
|| ! (result instanceof ContentBundle),
"The item for a task must not be a ContentBundle");
return result;
@ -221,7 +221,7 @@ public class QueueEntry extends DomainObject {
*/
public ContentItem getParent() {
ContentItem result = Utilities.getContentItemOrNull(getParentId());
Assert.assertTrue(result == null || (result instanceof ContentBundle) );
Assert.isTrue(result == null || (result instanceof ContentBundle) );
return result;
}

View File

@ -84,7 +84,7 @@ public class Utilities {
***/
static String getItemURL(ContentItem item) {
Assert.assertNotNull(item);
Assert.exists(item);
ContentSection section = item.getContentSection();
ContentItem working = item.getWorkingVersion();
@ -127,7 +127,7 @@ public class Utilities {
*/
public static boolean moveItem( Folder dstFolder, Folder srcFolder, ContentItem item ) {
if (Assert.isEnabled()) {
Assert.assertTrue(item != null && srcFolder != null && dstFolder != null);
Assert.isTrue(item != null && srcFolder != null && dstFolder != null);
}
final Host host = Host.retrieve(Web.getConfig().getHost());
@ -136,7 +136,7 @@ public class Utilities {
// into PublishedFile [lutter]
String dst = validateLocation(dstFolder, true);
if ( item instanceof ContentBundle ) {
Assert.assertTrue(!Folder.INDEX.equals(item.getName()), "don't pass ContentBundle as Index Item, better to pass Folder");
Assert.isTrue(!Folder.INDEX.equals(item.getName()), "don't pass ContentBundle as Index Item, better to pass Folder");
moveBundle((ContentBundle)item, dst, host);
} else {
String path = item.getPath();
@ -144,9 +144,9 @@ public class Utilities {
return false;
ContentSection section = item.getContentSection();
Assert.assertNotNull(section);
Assert.exists(section);
path = PublishToFile.stripSourceBase(section.getURL() + path);
Assert.assertTrue(path != null && path.length() > 0);
Assert.isTrue(path != null && path.length() > 0);
File root = PublishToFile.getDestination(item.getSpecificObjectType()).getFile();
String src = new File(root, path).getAbsolutePath();
@ -183,7 +183,7 @@ public class Utilities {
private static void moveItem(ContentItem item,
String dstPath,
Host host) {
Assert.assertTrue(ContentItem.LIVE.equals(item.getVersion()), "ContentItem item = " + item + " is not a live version");
Assert.isTrue(ContentItem.LIVE.equals(item.getVersion()), "ContentItem item = " + item + " is not a live version");
String docRoot = PublishToFile.getDestination(item.getSpecificObjectType()).getFile().getAbsolutePath();
DataQuery query = SessionManager.getSession().retrieveQuery("com.arsdigita.cms.publishToFile.getRelatedFiles");
@ -191,7 +191,7 @@ public class Utilities {
query.setParameter("hostId", host.getID());
while ( query.next() ) {
String fileName = (String)query.get("fileName");
Assert.assertNotNull(fileName);
Assert.exists(fileName);
fileName = docRoot + fileName;
String cmd = "/bin/mv -f " + fileName + " " + dstPath;
// s_log.debug("Moving item: source " + fileName + ", destination " + dstPath);
@ -211,7 +211,7 @@ public class Utilities {
Folder srcFolder,
Folder dstFolder,
Host host) {
Assert.assertTrue(ContentItem.LIVE.equals(item.getVersion()) &&
Assert.isTrue(ContentItem.LIVE.equals(item.getVersion()) &&
ContentItem.LIVE.equals(srcFolder.getVersion()) &&
ContentItem.LIVE.equals(dstFolder.getVersion()) );
@ -273,7 +273,7 @@ public class Utilities {
* @return validated folder path if successed, othervise returns empty string
*/
private static String validateLocation(Folder folder, boolean makeNew) {
Assert.assertNotNull(folder);
Assert.exists(folder);
String fullPath = getItemFullPath(folder);
try {
File file = new File(fullPath);
@ -308,9 +308,9 @@ public class Utilities {
if (path == null || path.equals("")) return;
ContentSection section = item.getContentSection();
Assert.assertNotNull(section);
Assert.exists(section);
path = PublishToFile.stripSourceBase(section.getURL() + path);
Assert.assertTrue(path != null && path.length() > 0);
Assert.isTrue(path != null && path.length() > 0);
path = '/' + path;
DataOperation operation = SessionManager.getSession().
@ -337,12 +337,12 @@ public class Utilities {
* @return Full path of an items on FS
*/
public static String getItemFullPath(ContentItem item) {
Assert.assertNotNull(item);
Assert.exists(item);
File root = PublishToFile.getDestination(item.getSpecificObjectType()).getFile();
String location = getItemLocation(item);
Assert.assertNotNull(location);
Assert.assertTrue(location.startsWith("/"));
Assert.exists(location);
Assert.isTrue(location.startsWith("/"));
return new File(root, location).getAbsolutePath();
}
@ -375,7 +375,7 @@ public class Utilities {
* @return The corresponding content item.
***/
public static ContentItem getContentItem(BigDecimal itemID) {
Assert.assertNotNull(itemID, "You passed null as Item ID");
Assert.exists(itemID, "You passed null as Item ID");
ContentItem item;
OID oid = new OID(ContentItem.BASE_DATA_OBJECT_TYPE, itemID);
try {
@ -477,8 +477,8 @@ public class Utilities {
*/
// FIXME: This should be done in the MoveItemCommand [lutter]
public static void updateContentSection(ContentItem item, ContentSection newSection) {
Assert.assertNotNull(item);
Assert.assertNotNull(newSection);
Assert.exists(item);
Assert.exists(newSection);
ContentSection oldSection = item.getContentSection();

View File

@ -77,7 +77,7 @@ public class ArticleImageDisplay extends ImageDisplay {
*/
protected Article getArticle(PageState state) {
Article article = (Article) m_article.getSelectedObject(state);
Assert.assertNotNull(article, "Article");
Assert.exists(article, "Article");
return article;
}

View File

@ -153,7 +153,7 @@ public abstract class BaseForm extends Form
final int maxLength,
final boolean isRequired) {
super(new TrimmedStringParameter(key));
Assert.truth(maxLength > 0, "Max length cannot be negative");
Assert.isTrue(maxLength > 0, "Max length cannot be negative");
if (isRequired) {
addValidationListener(NotNullValidationListener.DEFAULT);

View File

@ -166,7 +166,7 @@ public class BrowsePane extends LayoutPanel implements Resettable {
final PageState state = e.getPageState();
if (Assert.isEnabled()) {
Assert.truth(m_model.isSelected(state));
Assert.isTrue(m_model.isSelected(state));
}
final Folder root = CMS.getContext().getContentSection

View File

@ -311,7 +311,7 @@ public class ContentItemPage extends CMSPage implements ActionListener {
public ContentSection getContentSection(HttpServletRequest request) {
// Resets all content sections associations.
ContentSection section = super.getContentSection(request);
Assert.assertNotNull(section);
Assert.exists(section);
return section;
}

View File

@ -132,7 +132,7 @@ public class ContentPageTable extends DataTable {
* {@link ContentItem#DRAFT} or {@link ContentItem#LIVE}
*/
public void setContext(String context) {
Assert.assertNotLocked(this);
Assert.isUnlocked(this);
m_context = context;
}
@ -144,7 +144,7 @@ public class ContentPageTable extends DataTable {
* will be shown
*/
public void setContentType(ContentType c) {
Assert.assertNotLocked(this);
Assert.isUnlocked(this);
m_type = c;
}

View File

@ -383,7 +383,7 @@ public class ContentSectionPage extends CMSPage implements ActionListener {
public ContentSection getContentSection(HttpServletRequest request) {
// Resets all content sections associations.
ContentSection section = super.getContentSection(request);
Assert.assertNotNull(section);
Assert.exists(section);
return section;
}

View File

@ -104,7 +104,7 @@ public class DefaultImageBrowserModelBuilder extends LockableImpl
* {@link ContentItem#DRAFT} or {@link ContentItem#LIVE}
*/
public void setContext(String context) {
Assert.assertNotLocked(this);
Assert.isUnlocked(this);
m_context = context;
}

View File

@ -144,7 +144,7 @@ public class DomainObjectRenderer extends SimpleContainer {
* the generated XML will be.
*/
public void setDepth(int depth) {
Assert.assertNotLocked(this);
Assert.isUnlocked(this);
m_depth = depth;
}
@ -160,7 +160,7 @@ public class DomainObjectRenderer extends SimpleContainer {
* @pre model != null
*/
public void setSelectionModel(DomainObjectSelectionModel model) {
Assert.assertNotLocked(this);
Assert.isUnlocked(this);
m_model = model;
}

View File

@ -329,7 +329,7 @@ public class FlatItemList extends SegmentedPanel
private void showHideSegments(PageState state) {
SecurityManager sm = Utilities.getSecurityManager(state);
Folder folder = m_folder.getFolder(state);
Assert.assertNotNull(folder);
Assert.exists(folder);
// MP: This should be checked on the current folder instead of just
// the content section.

View File

@ -111,7 +111,7 @@ public class ImageDisplay extends SimpleComponent {
protected ImageAsset getImageAsset(PageState state) {
ImageAsset image = (ImageAsset) m_item.getSelectedObject(state);
Assert.assertNotNull(image, "Image asset");
Assert.exists(image, "Image asset");
return image;
}

View File

@ -58,7 +58,7 @@ public class PartySearchForm extends BaseForm {
public final void register(final Page page) {
super.register(page);
Assert.assertTrue(page.stateContains(this));
Assert.isTrue(page.stateContains(this));
}
public TextField getSearchWidget() {

View File

@ -72,7 +72,7 @@ public class SecurityPropertyEditor extends PropertyEditor {
/**
* Construct a new, empty <code>PropertyEditor</code>. The {@link
* #setDisplayComponent(Component)} method must be called before this
* component is locked.
* component is isLocked.
*/
public SecurityPropertyEditor() {
this(null);
@ -130,10 +130,10 @@ public class SecurityPropertyEditor extends PropertyEditor {
* @pre access.getComponent() == m_forms.get(key)
*/
public void setComponentAccess(String key, ComponentAccess access) {
Assert.assertNotLocked(this);
Assert.isUnlocked(this);
Component c = getComponent(key);
Assert.assertNotNull(c, "the specified component");
Assert.assertTrue(access.getComponent().equals(c),
Assert.exists(c, "the specified component");
Assert.isTrue(access.getComponent().equals(c),
"The specified component does not match the component that" +
" id already in the PropertyEditor");
m_accessChecks.put(key, access);

View File

@ -108,7 +108,7 @@ public abstract class SortableList extends List {
item.addAttribute("configure", "true");
}
String key = m.getKey();
Assert.assertNotNull(key);
Assert.exists(key);
// Converting both keys to String for comparison
// since ListModel.getKey returns a String

View File

@ -416,7 +416,7 @@ public class TasksPanel extends CMSContainer {
protected BigDecimal getRootFolderID(PageState s) {
ContentSection sec = (ContentSection) m_sectionSel.getSelectedObject(s);
Assert.assertNotNull(sec);
Assert.exists(sec);
User user = Web.getContext().getUser();
if ( user != null ) {
@ -656,7 +656,7 @@ public class TasksPanel extends CMSContainer {
if (taskType.equals(CMSTaskType.DEPLOY) ) {
tabNumber = ContentItemPage.PUBLISHING_TAB;
} else {
// see if item is locked; if not, lock
// see if item is isLocked; if not, lock
if ( !task.isLocked() ) {
task.lock(user);
}

View File

@ -416,13 +416,13 @@ public class ArticleImage extends SimpleContainer implements AuthoringStepCompon
private ImageAsset getImageAsset(PageState state) {
ImageAsset image = (ImageAsset) m_assetsWithImage.getSelectedObject(state);
Assert.assertNotNull(image, "Image asset");
Assert.exists(image, "Image asset");
return image;
}
private Article getArticle(PageState state) {
Article article = (Article) m_articleWithImage.getSelectedObject(state);
Assert.assertNotNull(article, "Article");
Assert.exists(article, "Article");
return article;
}

View File

@ -236,8 +236,8 @@ public class AuthoringKitWizard extends LayoutPanel implements Resettable {
final AuthoringStepCollection steps = m_kit.getSteps();
if (Assert.isAssertEnabled()) {
Assert.assertTrue(!steps.isEmpty(),
if (Assert.isEnabled()) {
Assert.isTrue(!steps.isEmpty(),
"The authoring kit for " + type.getID() + " " +
"(java class " + type.getClassName() + ") " +
"has no steps.");

View File

@ -110,7 +110,7 @@ public abstract class BasicPageForm extends BasicItemForm {
* ItemSelectionModel
*/
public ContentPage initBasicWidgets(FormSectionEvent e) {
Assert.assertNotNull(getItemSelectionModel());
Assert.exists(getItemSelectionModel());
FormData data = e.getFormData();
PageState state = e.getPageState();
@ -142,7 +142,7 @@ public abstract class BasicPageForm extends BasicItemForm {
* process listener
*/
public ContentPage processBasicWidgets(FormSectionEvent e) {
Assert.assertNotNull(getItemSelectionModel());
Assert.exists(getItemSelectionModel());
FormData data = e.getFormData();
PageState state = e.getPageState();
@ -176,7 +176,7 @@ public abstract class BasicPageForm extends BasicItemForm {
throws FormProcessException {
ItemSelectionModel m = getItemSelectionModel();
Assert.assertNotNull(m);
Assert.exists(m);
ContentPage item = null;

View File

@ -82,7 +82,7 @@ public class ItemCategoryStep extends SimpleContainer
m_extensionForms = extension.getForm();
int nSummaries = m_extensionSummaries.length;
int nForms= m_extensionForms.length;
Assert.truth(nSummaries==nForms, "invalid CategoryStep extension");
Assert.isTrue(nSummaries==nForms, "invalid CategoryStep extension");
m_extensionsCount = nForms;
for (int i=0;i<m_extensionsCount;i++) {
m_extensionSummaries[i].addCompletionListener(new ExtensionListener(i));

View File

@ -130,7 +130,7 @@ public class PageCreate extends BasicPageForm
// Validate: ensure name uniqueness
public void validate(FormSectionEvent e) throws FormProcessException {
Folder f = m_parent.getFolder(e.getPageState());
Assert.assertNotNull(f);
Assert.exists(f);
validateNameUniqueness(f, e);
}

View File

@ -391,7 +391,7 @@ public class PageCreateDynamic extends FormSection
*/
public void validate(FormSectionEvent e) throws FormProcessException {
Folder f = m_parent.getFolder(e.getPageState());
Assert.assertNotNull(f);
Assert.exists(f);
validateNameUniqueness(f, e);
}

View File

@ -141,7 +141,7 @@ public class PageEdit extends SimpleEditStep {
ContentItem item =
(ContentItem) getItemSelectionModel().getSelectedObject(state);
Assert.assertNotNull(item);
Assert.exists(item);
String newName = (String) data.get(BasicPageForm.NAME);
String oldName = item.getName();

View File

@ -82,11 +82,10 @@ import org.apache.log4j.Logger;
*
* @author Xixi D'Moon (xdmoon@arsdigita.com)
* @version $Revision: #21 $ $DateTime: 2004/08/17 23:15:09 $
* @version $Id: PageEditDynamic.java 287 2005-02-22 00:29:02Z sskracic $
*/
public class PageEditDynamic extends SecurityPropertyEditor {
public static final String versionId = "$Id: PageEditDynamic.java 287 2005-02-22 00:29:02Z sskracic $ by $Author: sskracic $, $DateTime: 2004/08/17 23:15:09 $";
private static Logger s_log =
Logger.getLogger(PageEditDynamic.class.getName());
@ -588,7 +587,7 @@ public class PageEditDynamic extends SecurityPropertyEditor {
ContentItem item =
(ContentItem) this.getItemSelectionModel().getSelectedObject(state);
Assert.assertNotNull(item);
Assert.exists(item);
if (m_isPrimaryStep) {
String newName = (String) data.get(BasicPageForm.NAME);

View File

@ -29,11 +29,10 @@ import com.arsdigita.toolbox.ui.DomainObjectPropertySheet;
*
* @author Xixi D'Moon (xdmoon@arsdigita.com)
* @version $Revision: #6 $ $DateTime: 2004/08/17 23:15:09 $
* @version $Id: SecondaryPageEditDynamic.java 287 2005-02-22 00:29:02Z sskracic $
*/
public class SecondaryPageEditDynamic extends PageEditDynamic {
public static final String versionId = "$Id: SecondaryPageEditDynamic.java 287 2005-02-22 00:29:02Z sskracic $ by $Author: sskracic $, $DateTime: 2004/08/17 23:15:09 $";
/**
* Construct a new SecondaryPageEditDynamic component

View File

@ -121,7 +121,7 @@ public class TextPageBody extends TextAssetBody {
*/
protected void updateTextAsset(PageState s, TextAsset a) {
TextPage t = getTextPage(s);
Assert.assertNotNull(t);
Assert.exists(t);
// no need - cg. Text doesn't need a security context,
// and ownership of text is recorded in text_pages
@ -154,7 +154,7 @@ public class TextPageBody extends TextAssetBody {
TextPage t = (TextPage)
((ItemSelectionModel)getSingleSelectionModel())
.getSelectedObject(s);
Assert.assertNotNull(t);
Assert.exists(t);
return t.getTextAsset();
}
};

View File

@ -80,7 +80,7 @@ public class KitInfo extends CMSContainer {
* Sets the m_authoringKit RequestLocal variable.
*/
private void initializeAuthoringKit(PageState state) {
Assert.assertTrue(m_types.isSelected(state));
Assert.isTrue(m_types.isSelected(state));
BigDecimal typeId = new BigDecimal(m_types.getSelectedKey(state).toString());
ContentType type = new ContentType(typeId);
@ -137,7 +137,7 @@ public class KitInfo extends CMSContainer {
private boolean m_locked;
public TableModel makeModel(final Table t, final PageState s) {
Assert.assertTrue(m_types.isSelected(s));
Assert.isTrue(m_types.isSelected(s));
return new TableModel() {

View File

@ -71,7 +71,7 @@ final class CategoryAddForm extends BaseCategoryForm {
final String url = (String) m_url.getValue(state);
final String isAbstract = (String) m_isAbstract.getValue(state);
Assert.assertNotNull(parent, "Category parent");
Assert.exists(parent, "Category parent");
if (s_log.isDebugEnabled()) {
s_log.debug("Using parent category " + parent + " to " +

View File

@ -114,7 +114,7 @@ public class CategoryItemsBrowser extends Grid {
* {@link com.arsdigita.cms.ContentItem#DRAFT} or {@link com.arsdigita.cms.ContentItem#LIVE}
*/
public void setContext(String context) {
Assert.assertNotLocked(this);
Assert.isUnlocked(this);
m_context = context;
}
@ -167,7 +167,7 @@ public class CategoryItemsBrowser extends Grid {
DomainObject d = DomainObjectFactory.newInstance((DataObject)value);
Assert.assertTrue(d instanceof ContentPage);
Assert.isTrue(d instanceof ContentPage);
ContentPage p = (ContentPage)d;
CMSContainer box = new CMSContainer();

View File

@ -204,7 +204,7 @@ public class IndexItemSelectionForm extends CMSForm {
*/
protected Category getCategory(PageState state) {
Category category = m_category.getCategory(state);
Assert.assertNotNull(category);
Assert.exists(category);
return category;
}

View File

@ -104,7 +104,7 @@ public class OrderedCategorizedObjectsList extends CategorizedObjectsList {
item.addAttribute("configure", "true");
String key = m.getKey();
Assert.assertNotNull(key);
Assert.exists(key);
// Converting both keys to String for comparison
// since ListModel.getKey returns a String

View File

@ -186,7 +186,7 @@ public class FolderBrowser extends Table {
setEmptyView(new Label(globalize("cms.ui.folder.no_items")));
Assert.assertNotNull( m_currentFolder.getStateParameter() );
Assert.exists( m_currentFolder.getStateParameter() );
}
public void register(Page p) {
@ -209,7 +209,7 @@ public class FolderBrowser extends Table {
private void showHideFolderActions(PageState state) {
SecurityManager sm = Utilities.getSecurityManager(state);
Folder folder = (Folder) m_currentFolder.getSelectedObject(state);
Assert.assertNotNull(folder);
Assert.exists(folder);
boolean canDelete =
sm.canAccess(state.getRequest(), SecurityManager.DELETE_ITEM, folder);

View File

@ -70,7 +70,7 @@ public abstract class FolderForm extends BasicItemForm{
*/
public void validate(FormSectionEvent e) throws FormProcessException {
Folder folder = (Folder) m_currentFolder.getSelectedObject(e.getPageState());
Assert.assertNotNull(folder);
Assert.exists(folder);
validateNameUniqueness(folder, e);
}

View File

@ -296,7 +296,7 @@ public class FolderItemPane extends SegmentedPanel
private void showHideSegments(PageState state) {
SecurityManager sm = Utilities.getSecurityManager(state);
Folder folder = (Folder) m_folderSel.getSelectedObject(state);
Assert.assertNotNull(folder);
Assert.exists(folder);
// MP: This should be checked on the current folder instead of just
// the content section.

View File

@ -204,7 +204,7 @@ public class FolderManipulator extends SimpleContainer
}
final ContentItem newItem = item.copy(target, true);
Assert.equal(target, newItem.getParent());
Assert.isEqual(target, newItem.getParent());
}
}

View File

@ -36,7 +36,7 @@ public abstract class ContentItemRequestLocal extends RequestLocal {
public final ContentItem getContentItem(final PageState state) {
final ContentItem item = (ContentItem) get(state);
Assert.assertNotNull(item, "ContentItem item");
Assert.exists(item, "ContentItem item");
return item;
}

View File

@ -328,7 +328,7 @@ public class Summary extends CMSContainer {
*/
protected ContentItem getContentItem(PageState state) {
ContentItem item = (ContentItem) m_item.getSelectedObject(state);
Assert.assertNotNull(item);
Assert.exists(item);
return item;
}

View File

@ -389,7 +389,7 @@ class ItemLifecycleSelectForm extends BaseForm {
final BigDecimal defID = (BigDecimal) m_cycleSelect.getValue
(state);
Assert.assertNotNull(defID);
Assert.exists(defID);
final LifecycleDefinition cycleDef = new LifecycleDefinition
(defID);

View File

@ -70,7 +70,7 @@ class PhaseTableModelBuilder extends LockableImpl
}
public final Object getElementAt(int column) {
Assert.assertNotNull(m_phase, "PhaseDefinition m_phase");
Assert.exists(m_phase, "PhaseDefinition m_phase");
switch (column) {
case 0:

View File

@ -64,7 +64,7 @@ public class ObjectAddAdmin extends UserAddForm {
}
protected DataQuery makeQuery(PageState s) {
Assert.truth(m_object.isSelected(s));
Assert.isTrue(m_object.isSelected(s));
DataQuery query = SessionManager.getSession().retrieveQuery
("com.arsdigita.cms.objectAdminUserSearch");
@ -96,7 +96,7 @@ public class ObjectAddAdmin extends UserAddForm {
public void process(FormSectionEvent event) throws FormProcessException {
FormData data = event.getFormData();
PageState state = event.getPageState();
Assert.truth(m_object.isSelected(state));
Assert.isTrue(m_object.isSelected(state));
SecurityManager sm = Utilities.getSecurityManager(state);
boolean isAdmin =

View File

@ -73,7 +73,7 @@ class RoleAdminAddForm extends UserAddForm {
}
protected DataQuery makeQuery(PageState s) {
Assert.truth(m_roles.isSelected(s));
Assert.isTrue(m_roles.isSelected(s));
Session session = SessionManager.getSession();
@ -107,7 +107,7 @@ class RoleAdminAddForm extends UserAddForm {
public void process(FormSectionEvent event) throws FormProcessException {
FormData data = event.getFormData();
PageState state = event.getPageState();
Assert.truth(m_roles.isSelected(state));
Assert.isTrue(m_roles.isSelected(state));
String[] users = (String[]) data.get("users");
if ( users != null ) {

View File

@ -71,7 +71,7 @@ class RolePartyAddForm extends PartyAddForm {
}
protected DataQuery makeQuery(PageState s) {
Assert.truth(m_roles.isSelected(s));
Assert.isTrue(m_roles.isSelected(s));
Session session = SessionManager.getSession();
@ -107,7 +107,7 @@ class RolePartyAddForm extends PartyAddForm {
public void process(FormSectionEvent event) throws FormProcessException {
FormData data = event.getFormData();
PageState state = event.getPageState();
Assert.truth(m_roles.isSelected(state));
Assert.isTrue(m_roles.isSelected(state));
String[] parties = (String[]) data.get("parties");
s_log.debug("PARTIES = " + parties);

View File

@ -32,7 +32,7 @@ public abstract class RoleRequestLocal extends RequestLocal {
public final Role getRole(final PageState state) {
final Role role = (Role) get(state);
Assert.assertNotNull(role, "Role role");
Assert.exists(role, "Role role");
return role;
}

View File

@ -131,7 +131,7 @@ public class PartyInfo extends SimpleContainer {
* @pre ( state != null )
*/
protected BigDecimal getPartyId(PageState state) {
Assert.truth(m_parties.isSelected(state));
Assert.isTrue(m_parties.isSelected(state));
String partyId = (String) m_parties.getSelectedKey(state);
return new BigDecimal(partyId);
}

View File

@ -132,7 +132,7 @@ public class CategoryTemplates extends CMSContainer {
PageState s = e.getPageState();
Label targetLabel = (Label)e.getTarget();
Category category = m_category.getCategory(s);
Assert.assertNotNull(category, "category");
Assert.exists(category, "category");
targetLabel.setLabel("Assign a template to " + category.getName());
}
});
@ -254,11 +254,11 @@ public class CategoryTemplates extends CMSContainer {
*/
protected TemplateCollection getTemplateCollection(PageState s) {
ContentSection sec = ContentSectionDispatcher.getContentSection(s.getRequest());
Assert.assertNotNull(sec, "content section");
Assert.exists(sec, "content section");
/*
ContentItem item = m_category.getSelectedItem(s);
Assert.assertNotNull(item, "item");
Assert.exists(item, "item");
*/
ContentType type = getContentType(s);
@ -277,7 +277,7 @@ public class CategoryTemplates extends CMSContainer {
*/
protected ContentType getContentType(PageState s) {
ContentType type = (ContentType)m_type.getSelectedObject(s);
Assert.assertNotNull(type, "content type");
Assert.exists(type, "content type");
return type;
}

View File

@ -90,7 +90,7 @@ public class ItemTemplates extends SecurityPropertyEditor {
PageState s = e.getPageState();
Label targetLabel = (Label)e.getTarget();
ContentPage item = (ContentPage)m_itemModel.getSelectedItem(s);
Assert.assertNotNull(item, "item");
Assert.exists(item, "item");
targetLabel.setLabel( (String) GlobalizationUtil.globalize("cms.ui.templates.assign_a_template_to").localize() + item.getTitle());
}
});
@ -190,10 +190,10 @@ public class ItemTemplates extends SecurityPropertyEditor {
ContentSection sec = CMS.getContext().getContentSection();
ContentItem item = m_itemModel.getSelectedItem(s);
Assert.assertNotNull(item, "item");
Assert.exists(item, "item");
ContentType type = item.getContentType();
Assert.assertNotNull(type, "content type");
Assert.exists(type, "content type");
MimeType mimeType = getMimeType(s);
TemplateCollection c =
@ -215,7 +215,7 @@ public class ItemTemplates extends SecurityPropertyEditor {
*/
protected String getUseContext(PageState s) {
String c = (String)m_contextModel.getSelectedKey(s);
Assert.assertNotNull(c, "use context");
Assert.exists(c, "use context");
return ItemTemplatesListing.getUseContextFromKey(c);
}
@ -229,7 +229,7 @@ public class ItemTemplates extends SecurityPropertyEditor {
*/
public void assignTemplate(PageState s, Template t) {
ContentItem item = m_itemModel.getSelectedItem(s);
Assert.assertNotNull(item, "item");
Assert.exists(item, "item");
TemplateManagerFactory.getInstance()
.addTemplate(item, t, getUseContext(s));

View File

@ -299,7 +299,7 @@ public abstract class ItemTemplatesListing extends TemplatesListing {
ContentSection sec = CMS.getContext().getContentSection();
ContentItem item = m_itemSel.getSelectedItem(state);
Assert.assertNotNull(item, "item");
Assert.exists(item, "item");
ItemResolver res = sec.getItemResolver();
String url = res.generateItemURL(state, item, sec,

View File

@ -152,7 +152,7 @@ public class TemplateEdit extends SimpleEditStep {
public Template getTemplate(PageState state) {
Template t =
(Template) getItemSelectionModel().getSelectedObject(state);
Assert.assertNotNull(t);
Assert.exists(t);
return t;
}
}

View File

@ -165,8 +165,8 @@ abstract class TemplatesListing extends DataTable {
* The "remove" column will contain the current template as the value.
*/
protected final void addRemoveColumn() {
Assert.assertNotLocked(this);
Assert.assertTrue(m_removeCol == null,
Assert.isUnlocked(this);
Assert.isTrue(m_removeCol == null,
"The \"remove\" column already exists");
m_removeCol = addColumn("Remove", TemplateCollection.TEMPLATE, false,

View File

@ -88,7 +88,7 @@ public class AddContentItemElement extends ElementAddForm {
(BigDecimal) m_itemTypeSelect.getValue(state);
ContentType itemType = null;
Assert.assertNotNull(itemTypeID, "itemTypeID");
Assert.exists(itemTypeID, "itemTypeID");
try {
itemType = new ContentType(itemTypeID);
} catch (DataObjectNotFoundException ex) {

View File

@ -216,7 +216,7 @@ public abstract class ElementAddForm extends CMSForm {
protected ContentType getContentType(PageState state) {
ContentType t = (ContentType)m_types.getSelectedObject(state);
Assert.assertNotNull(t, "content type");
Assert.exists(t, "content type");
return t;
}

View File

@ -112,7 +112,7 @@ public class DefaultTableCellRenderer extends LockableImpl
* @pre ! isLocked()
*/
public void setActive(boolean v) {
Assert.assertNotLocked(this);
Assert.isUnlocked(this);
m_active = v;
}

View File

@ -32,7 +32,7 @@ public abstract class TaskRequestLocal extends RequestLocal {
public final CMSTask getTask(final PageState state) {
final CMSTask task = (CMSTask) get(state);
Assert.assertNotNull(task, "CMSTask task");
Assert.exists(task, "CMSTask task");
return task;
}

View File

@ -69,7 +69,7 @@ public class LanguageUtil {
/** Get the comma separated list of all supported languages */
public static String getSupportedLanguages() {
Assert.assertNotNull(s_languages , "supported languages not set");
Assert.exists(s_languages , "supported languages not set");
return s_languages;
}

View File

@ -252,7 +252,7 @@ public class CMSTask extends UserTask {
protected Message generateMessage(String operation, Party sender) {
ContentItem item = getItem();
Assert.assertNotNull(item, "item associated with this CMSTask");
Assert.exists(item, "item associated with this CMSTask");
String authoringURL = getAuthoringURL(item);
String fullURL = getTaskType().getURLGenerator(operation, item).generateURL(item.getID(), getID());

View File

@ -70,7 +70,7 @@ public class UnfinishedTaskNotifier extends TimerTask {
int notificationInterval,
int maxNotifications) {
super();
Assert.assertNotNull(section, "the ContentSection to send notifications for");
Assert.exists(section, "the ContentSection to send notifications for");
m_sectionID = section.getID();
m_unfinishedInterval = (long) unfinishedInterval * 60 * 60 * 1000;
m_notificationInterval = (long) notificationInterval * 60 * 60 * 1000;

View File

@ -29,9 +29,9 @@ import java.util.Date;
*
* @author Joseph Bank
* @version 1.0
* @version $Id: Audited.java 287 2005-02-22 00:29:02Z sskracic $
**/
public interface Audited {
public static final String versionId = "$Id: Audited.java 287 2005-02-22 00:29:02Z sskracic $";
/**
* Gets the user who created the object. May be null.

View File

@ -39,12 +39,11 @@ import java.util.Date;
*
* @author Joseph Bank
* @version 1.0
* @version $Id: AuditedACSObject.java 287 2005-02-22 00:29:02Z sskracic $
*/
public abstract class AuditedACSObject extends ACSObject implements Audited {
public static final String versionId = "$Id: AuditedACSObject.java 287 2005-02-22 00:29:02Z sskracic $ by $Author: sskracic $, $DateTime: 2004/08/16 18:10:38 $";
/**
* Audit trail.
*/

View File

@ -35,11 +35,11 @@ import org.apache.log4j.Logger;
*
* @author Joseph Bank
* @version 1.0
* @version $Id: AuditingObserver.java 287 2005-02-22 00:29:02Z sskracic $
*/
public class AuditingObserver implements DomainObjectObserver {
public static final Logger s_log = Logger.getLogger(AuditingObserver.class);
public static final String versionId = "$Id: AuditingObserver.java 287 2005-02-22 00:29:02Z sskracic $ by $Author: sskracic $, $DateTime: 2004/08/16 18:10:38 $";
private BasicAuditTrail m_audit_trail;
private AuditingSaveInfo m_save_info = null;

Some files were not shown because too many files have changed in this diff Show More