Entfernen deprecated methods, Formatierungen, Dokumentation.
git-svn-id: https://svn.libreccm.org/ccm/trunk@362 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
f73c6e8984
commit
c0422a394b
|
|
@ -248,32 +248,32 @@ public class Inet4AddressRange
|
||||||
String addrStr = inetAddressToString (addr);
|
String addrStr = inetAddressToString (addr);
|
||||||
String addr2Str = inetAddressToString (addr2);
|
String addr2Str = inetAddressToString (addr2);
|
||||||
System.out.println ("addr = " + addrStr + "; addr2 = " + addr2Str);
|
System.out.println ("addr = " + addrStr + "; addr2 = " + addr2Str);
|
||||||
Assert.truth (addrStr.equals (addr2Str));
|
Assert.isTrue (addrStr.equals (addr2Str));
|
||||||
|
|
||||||
// Test makeNetmask.
|
// Test makeNetmask.
|
||||||
addr = makeNetmask (0);
|
addr = makeNetmask (0);
|
||||||
System.out.println ("makeNetmask(0) = " + addr);
|
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);
|
addr = makeNetmask (8);
|
||||||
System.out.println ("makeNetmask(8) = " + addr);
|
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);
|
addr = makeNetmask (16);
|
||||||
System.out.println ("makeNetmask(16) = " + addr);
|
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);
|
addr = makeNetmask (24);
|
||||||
System.out.println ("makeNetmask(24) = " + addr);
|
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);
|
addr = makeNetmask (28);
|
||||||
System.out.println ("makeNetmask(28) = " + addr);
|
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);
|
addr = makeNetmask (32);
|
||||||
System.out.println ("makeNetmask(32) = " + addr);
|
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.
|
// Test getByName.
|
||||||
Inet4AddressRange range
|
Inet4AddressRange range
|
||||||
|
|
@ -284,7 +284,7 @@ public class Inet4AddressRange
|
||||||
= Inet4AddressRange.getByName ("192.168.0.0/255.255.0.0");
|
= Inet4AddressRange.getByName ("192.168.0.0/255.255.0.0");
|
||||||
System.out.println ("range = " + range.toString ());
|
System.out.println ("range = " + range.toString ());
|
||||||
// Test equals.
|
// Test equals.
|
||||||
Assert.truth (range.equals (range2));
|
Assert.isTrue (range.equals (range2));
|
||||||
|
|
||||||
range = Inet4AddressRange.getByName ("192.168.0.99");
|
range = Inet4AddressRange.getByName ("192.168.0.99");
|
||||||
System.out.println ("range = " + range.toString ());
|
System.out.println ("range = " + range.toString ());
|
||||||
|
|
@ -292,19 +292,19 @@ public class Inet4AddressRange
|
||||||
// Test inRange.
|
// Test inRange.
|
||||||
range = Inet4AddressRange.getByName ("192.168.0.0/16");
|
range = Inet4AddressRange.getByName ("192.168.0.0/16");
|
||||||
addr = InetAddress.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.0/24");
|
range = Inet4AddressRange.getByName ("192.168.0.0/24");
|
||||||
addr = InetAddress.getByName ("192.168.2.99");
|
addr = InetAddress.getByName ("192.168.2.99");
|
||||||
Assert.truth (! range.inRange (addr));
|
Assert.isTrue (! range.inRange (addr));
|
||||||
|
|
||||||
range = Inet4AddressRange.getByName ("192.168.0.99");
|
range = Inet4AddressRange.getByName ("192.168.0.99");
|
||||||
addr = InetAddress.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");
|
range = Inet4AddressRange.getByName ("192.168.0.99");
|
||||||
addr = InetAddress.getByName ("192.168.3.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.");
|
System.out.println ("All test completed OK.");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,7 @@ public class UserCSVEntry {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static synchronized UserCSVEntry nextEntry() {
|
public static synchronized UserCSVEntry nextEntry() {
|
||||||
Assert.truth(hasMore(), "has more entries");
|
Assert.isTrue(hasMore(), "has more entries");
|
||||||
|
|
||||||
UserCSVEntry entry = new UserCSVEntry();
|
UserCSVEntry entry = new UserCSVEntry();
|
||||||
s_log.debug("Starting entry");
|
s_log.debug("Starting entry");
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,7 @@ public class Bookmark extends ACSObject {
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public static Bookmark retrieveBookmark(BigDecimal bmrkID) {
|
public static Bookmark retrieveBookmark(BigDecimal bmrkID) {
|
||||||
Assert.assertNotNull(bmrkID);
|
Assert.exists(bmrkID);
|
||||||
|
|
||||||
return Bookmark.retrieveBookmark(new OID(BASE_DATA_OBJECT_TYPE, bmrkID));
|
return Bookmark.retrieveBookmark(new OID(BASE_DATA_OBJECT_TYPE, bmrkID));
|
||||||
}
|
}
|
||||||
|
|
@ -87,7 +87,7 @@ public class Bookmark extends ACSObject {
|
||||||
* @pre dataObject != null
|
* @pre dataObject != null
|
||||||
*/
|
*/
|
||||||
public static Bookmark retrieveBookmark(DataObject dataObject) {
|
public static Bookmark retrieveBookmark(DataObject dataObject) {
|
||||||
Assert.assertNotNull(dataObject);
|
Assert.exists(dataObject);
|
||||||
|
|
||||||
return new Bookmark(dataObject);
|
return new Bookmark(dataObject);
|
||||||
}
|
}
|
||||||
|
|
@ -99,7 +99,7 @@ public class Bookmark extends ACSObject {
|
||||||
* @pre oid != null
|
* @pre oid != null
|
||||||
*/
|
*/
|
||||||
public static Bookmark retrieveBookmark(OID oid) {
|
public static Bookmark retrieveBookmark(OID oid) {
|
||||||
Assert.assertNotNull(oid);
|
Assert.exists(oid);
|
||||||
|
|
||||||
DataObject dataObject = SessionManager.getSession().retrieve(oid);
|
DataObject dataObject = SessionManager.getSession().retrieve(oid);
|
||||||
|
|
||||||
|
|
@ -143,7 +143,7 @@ public class Bookmark extends ACSObject {
|
||||||
public String getName() {
|
public String getName() {
|
||||||
String name = (String)get("bookmark_name");
|
String name = (String)get("bookmark_name");
|
||||||
|
|
||||||
Assert.assertNotNull(name);
|
Assert.exists(name);
|
||||||
|
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
@ -155,7 +155,7 @@ public class Bookmark extends ACSObject {
|
||||||
public String getURL() {
|
public String getURL() {
|
||||||
String url = (String)get("bookmark_url");
|
String url = (String)get("bookmark_url");
|
||||||
|
|
||||||
Assert.assertNotNull(url);
|
Assert.exists(url);
|
||||||
|
|
||||||
return url;
|
return url;
|
||||||
}
|
}
|
||||||
|
|
@ -167,7 +167,7 @@ public class Bookmark extends ACSObject {
|
||||||
public String getDescription() {
|
public String getDescription() {
|
||||||
String description = (String)get("bookmark_desc");
|
String description = (String)get("bookmark_desc");
|
||||||
|
|
||||||
Assert.assertNotNull(description);
|
Assert.exists(description);
|
||||||
|
|
||||||
return description;
|
return description;
|
||||||
}
|
}
|
||||||
|
|
@ -242,7 +242,7 @@ public class Bookmark extends ACSObject {
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public void setName(String name) {
|
public void setName(String name) {
|
||||||
Assert.assertNotNull(name);
|
Assert.exists(name);
|
||||||
|
|
||||||
set("bookmark_name", name);
|
set("bookmark_name", name);
|
||||||
}
|
}
|
||||||
|
|
@ -252,7 +252,7 @@ public class Bookmark extends ACSObject {
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public void setURL(String url) {
|
public void setURL(String url) {
|
||||||
Assert.assertNotNull(url);
|
Assert.exists(url);
|
||||||
|
|
||||||
if(url.startsWith("http://"))
|
if(url.startsWith("http://"))
|
||||||
set("bookmark_url", url);
|
set("bookmark_url", url);
|
||||||
|
|
@ -277,7 +277,7 @@ public class Bookmark extends ACSObject {
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public void setDescription(String desc) {
|
public void setDescription(String desc) {
|
||||||
//Assert.assertNotNull(desc);
|
//Assert.exists(desc);
|
||||||
|
|
||||||
set("bookmark_desc",desc);
|
set("bookmark_desc",desc);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ public class BookmarkCollection extends DomainCollection {
|
||||||
public BigDecimal getID() {
|
public BigDecimal getID() {
|
||||||
BigDecimal id = (BigDecimal)m_dataCollection.get("id");
|
BigDecimal id = (BigDecimal)m_dataCollection.get("id");
|
||||||
|
|
||||||
Assert.assertNotNull(id);
|
Assert.exists(id);
|
||||||
|
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
@ -51,7 +51,7 @@ public class BookmarkCollection extends DomainCollection {
|
||||||
public DomainObject getDomainObject() {
|
public DomainObject getDomainObject() {
|
||||||
DomainObject domainObject = getBookmark();
|
DomainObject domainObject = getBookmark();
|
||||||
|
|
||||||
Assert.assertNotNull(domainObject);
|
Assert.exists(domainObject);
|
||||||
|
|
||||||
return domainObject;
|
return domainObject;
|
||||||
}
|
}
|
||||||
|
|
@ -67,7 +67,7 @@ public class BookmarkCollection extends DomainCollection {
|
||||||
|
|
||||||
Bookmark bookmark = Bookmark.retrieveBookmark(dataObject);
|
Bookmark bookmark = Bookmark.retrieveBookmark(dataObject);
|
||||||
|
|
||||||
Assert.assertNotNull(bookmark);
|
Assert.exists(bookmark);
|
||||||
|
|
||||||
return bookmark;
|
return bookmark;
|
||||||
}
|
}
|
||||||
|
|
@ -81,7 +81,7 @@ public class BookmarkCollection extends DomainCollection {
|
||||||
public String getName() {
|
public String getName() {
|
||||||
String name = (String)m_dataCollection.get("bookmark_name");
|
String name = (String)m_dataCollection.get("bookmark_name");
|
||||||
|
|
||||||
Assert.assertNotNull(name);
|
Assert.exists(name);
|
||||||
|
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
@ -95,7 +95,7 @@ public class BookmarkCollection extends DomainCollection {
|
||||||
public String getURL() {
|
public String getURL() {
|
||||||
String url = (String)m_dataCollection.get("bookmark_url");
|
String url = (String)m_dataCollection.get("bookmark_url");
|
||||||
|
|
||||||
Assert.assertNotNull(url);
|
Assert.exists(url);
|
||||||
|
|
||||||
return url;
|
return url;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -146,7 +146,7 @@ public class BookmarkBasePage extends Page {
|
||||||
Application application = Application.getCurrentApplication
|
Application application = Application.getCurrentApplication
|
||||||
(pageState.getRequest());
|
(pageState.getRequest());
|
||||||
|
|
||||||
Assert.assertNotNull(application, "application");
|
Assert.exists(application, "application");
|
||||||
|
|
||||||
targetLabel.setLabel
|
targetLabel.setLabel
|
||||||
(application.getTitle() + " Administration");
|
(application.getTitle() + " Administration");
|
||||||
|
|
@ -287,7 +287,7 @@ public class BookmarkBasePage extends Page {
|
||||||
* @param pc the component to be added
|
* @param pc the component to be added
|
||||||
*/
|
*/
|
||||||
public void add(Component pc) {
|
public void add(Component pc) {
|
||||||
Assert.assertNotLocked(this);
|
Assert.isUnlocked(this);
|
||||||
m_body.add(pc);
|
m_body.add(pc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -319,7 +319,7 @@ public class BookmarkBasePage extends Page {
|
||||||
Application app = Application.getCurrentApplication
|
Application app = Application.getCurrentApplication
|
||||||
(pageState.getRequest());
|
(pageState.getRequest());
|
||||||
|
|
||||||
Assert.assertNotNull(app, "Application app");
|
Assert.exists(app, "Application app");
|
||||||
|
|
||||||
link.setChild(new Label(app.getTitle()));
|
link.setChild(new Label(app.getTitle()));
|
||||||
link.setTarget(app.getPrimaryURL());
|
link.setTarget(app.getPrimaryURL());
|
||||||
|
|
@ -338,7 +338,7 @@ public class BookmarkBasePage extends Page {
|
||||||
Application app = Application.getCurrentApplication
|
Application app = Application.getCurrentApplication
|
||||||
(pageState.getRequest());
|
(pageState.getRequest());
|
||||||
|
|
||||||
Assert.assertNotNull(app, "Application app");
|
Assert.exists(app, "Application app");
|
||||||
|
|
||||||
Application parent = app.getParentApplication();
|
Application parent = app.getParentApplication();
|
||||||
|
|
||||||
|
|
@ -359,7 +359,7 @@ public class BookmarkBasePage extends Page {
|
||||||
Application app = Application.getCurrentApplication
|
Application app = Application.getCurrentApplication
|
||||||
(pageState.getRequest());
|
(pageState.getRequest());
|
||||||
|
|
||||||
Assert.assertNotNull(app, "Application app");
|
Assert.exists(app, "Application app");
|
||||||
|
|
||||||
label.setLabel(app.getTitle());
|
label.setLabel(app.getTitle());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -109,10 +109,12 @@ public class BookmarkEditPane extends DynamicListWizard {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public BookmarkEditPane()
|
/**
|
||||||
{
|
* Constructor
|
||||||
super("Current Bookmarks",
|
*
|
||||||
new ListModelBuilder() {
|
*/
|
||||||
|
public BookmarkEditPane() {
|
||||||
|
super("Current Bookmarks", new ListModelBuilder() {
|
||||||
public ListModel makeModel(List l, PageState ps) {
|
public ListModel makeModel(List l, PageState ps) {
|
||||||
return new BmrkListModel(ps);
|
return new BmrkListModel(ps);
|
||||||
}
|
}
|
||||||
|
|
@ -120,15 +122,15 @@ public class BookmarkEditPane extends DynamicListWizard {
|
||||||
public boolean isLocked() { return true; }
|
public boolean isLocked() { return true; }
|
||||||
},
|
},
|
||||||
"Add a new Bookmark",
|
"Add a new Bookmark",
|
||||||
new Label(GlobalizationUtil.globalize("bookmarks.ui.select_a_bookmark_for_editing")));
|
new Label(GlobalizationUtil.globalize(
|
||||||
|
"bookmarks.ui.select_a_bookmark_for_editing")));
|
||||||
|
|
||||||
final DynamicListWizard dlw = this;
|
final DynamicListWizard dlw = this;
|
||||||
|
|
||||||
m_prtlRL = new RequestLocal()
|
m_prtlRL = new RequestLocal() {
|
||||||
{
|
protected Object initialValue(PageState ps) {
|
||||||
protected Object initialValue(PageState ps)
|
return (BookmarkApplication)Application.getCurrentApplication(
|
||||||
{
|
ps.getRequest());
|
||||||
return (BookmarkApplication)Application.getCurrentApplication(ps.getRequest());
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -137,7 +139,8 @@ public class BookmarkEditPane extends DynamicListWizard {
|
||||||
// FORM FOR ADDING NEW Bookmarks
|
// FORM FOR ADDING NEW Bookmarks
|
||||||
Form addForm = new Form("addBookmark", new GridPanel(2));
|
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");
|
final TextField newBmrkName = new TextField("name");
|
||||||
newBmrkName.getParameterModel().addParameterListener
|
newBmrkName.getParameterModel().addParameterListener
|
||||||
|
|
@ -205,7 +208,7 @@ public class BookmarkEditPane extends DynamicListWizard {
|
||||||
newBmrk.save();
|
newBmrk.save();
|
||||||
}}.run();
|
}}.run();
|
||||||
|
|
||||||
dlw.getList()
|
dlw.getListOfComponents()
|
||||||
.getSelectionModel()
|
.getSelectionModel()
|
||||||
.setSelectedKey(ps, newBmrk.getID().toString());
|
.setSelectedKey(ps, newBmrk.getID().toString());
|
||||||
}
|
}
|
||||||
|
|
@ -222,7 +225,9 @@ public class BookmarkEditPane extends DynamicListWizard {
|
||||||
|
|
||||||
m_mainDisplay.add(m_editBmrkForm);
|
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.setClassAttr("actionLink");
|
||||||
deleteLink.addActionListener(new DeleteLinkListener());
|
deleteLink.addActionListener(new DeleteLinkListener());
|
||||||
|
|
@ -247,7 +252,8 @@ public class BookmarkEditPane extends DynamicListWizard {
|
||||||
public Component getComponent(List list, PageState state,
|
public Component getComponent(List list, PageState state,
|
||||||
Object value, String key, int index, boolean isSelected) {
|
Object value, String key, int index, boolean isSelected) {
|
||||||
|
|
||||||
BookmarkApplication app = (BookmarkApplication) Web.getContext().getApplication();
|
BookmarkApplication app = (BookmarkApplication) Web.getContext()
|
||||||
|
.getApplication();
|
||||||
BookmarkCollection bColl = app.getBookmarks();
|
BookmarkCollection bColl = app.getBookmarks();
|
||||||
final long size = bColl.size();
|
final long size = bColl.size();
|
||||||
bColl.close();
|
bColl.close();
|
||||||
|
|
@ -339,24 +345,34 @@ public class BookmarkEditPane extends DynamicListWizard {
|
||||||
public EditBookmarkForm(GridPanel gp)
|
public EditBookmarkForm(GridPanel gp)
|
||||||
{
|
{
|
||||||
super("editbookmarkform",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(" ");
|
blank = new Label(" ");
|
||||||
instruction1 = new Label(GlobalizationUtil.globalize("bookmarks.ui.bookmark_name"));
|
instruction1 = new Label(GlobalizationUtil.globalize(
|
||||||
instruction2 = new Label(GlobalizationUtil.globalize("bookmarks.ui.bookmark_url"));
|
"bookmarks.ui.bookmark_name"));
|
||||||
instruction3 = new Label(GlobalizationUtil.globalize("bookmarks.ui.bookmark_description"));
|
instruction2 = new Label(GlobalizationUtil.globalize(
|
||||||
|
"bookmarks.ui.bookmark_url"));
|
||||||
|
instruction3 = new Label(GlobalizationUtil.globalize(
|
||||||
|
"bookmarks.ui.bookmark_description"));
|
||||||
blank1 = new Label("");
|
blank1 = new Label("");
|
||||||
blank2 = new Label("");
|
blank2 = new Label("");
|
||||||
blank3 = new Label("");
|
blank3 = new Label("");
|
||||||
blank4 = new Label("");
|
blank4 = new Label("");
|
||||||
creationDateLabel = new Label(GlobalizationUtil.globalize("bookmarks.ui.creation_date"));
|
creationDateLabel = new Label(GlobalizationUtil.globalize(
|
||||||
modDateLabel = new Label(GlobalizationUtil.globalize("bookmarks.ui.last_modified_date"));
|
"bookmarks.ui.creation_date"));
|
||||||
authorLabel = new Label(GlobalizationUtil.globalize("bookmarks.ui.created_by"));
|
modDateLabel = new Label(GlobalizationUtil.globalize(
|
||||||
visitsLabel = new Label(GlobalizationUtil.globalize("bookmarks.ui.number_of_visits"));
|
"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 = new TextField("BookmarkName");
|
||||||
bookmarkName.setDefaultValue("");
|
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 = new RadioGroup("newWin");
|
||||||
newWindow.addOption(new Option("true", "Yes"));
|
newWindow.addOption(new Option("true", "Yes"));
|
||||||
newWindow.addOption(new Option("false", "No"));
|
newWindow.addOption(new Option("false", "No"));
|
||||||
|
|
@ -364,10 +380,9 @@ public class BookmarkEditPane extends DynamicListWizard {
|
||||||
newWindow.addPrintListener( new PrintListener() {
|
newWindow.addPrintListener( new PrintListener() {
|
||||||
public void prepare(PrintEvent e) {
|
public void prepare(PrintEvent e) {
|
||||||
PageState s = e.getPageState();
|
PageState s = e.getPageState();
|
||||||
if(getSelectionModel().isSelected(s))
|
if(getSelectionModel().isSelected(s)) {
|
||||||
{
|
BigDecimal bd = new BigDecimal((String)
|
||||||
BigDecimal bd =
|
getSelectionModel().getSelectedKey(s));
|
||||||
new BigDecimal((String) getSelectionModel().getSelectedKey(s));
|
|
||||||
Bookmark bmrk = Bookmark.retrieveBookmark(bd);
|
Bookmark bmrk = Bookmark.retrieveBookmark(bd);
|
||||||
RadioGroup group = (RadioGroup)e.getTarget();
|
RadioGroup group = (RadioGroup)e.getTarget();
|
||||||
group.setValue(s,String.valueOf(bmrk.getNewWindow()));
|
group.setValue(s,String.valueOf(bmrk.getNewWindow()));
|
||||||
|
|
@ -378,15 +393,12 @@ public class BookmarkEditPane extends DynamicListWizard {
|
||||||
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
bookmarkName.addPrintListener( new PrintListener()
|
bookmarkName.addPrintListener( new PrintListener() {
|
||||||
{
|
public void prepare(PrintEvent e) {
|
||||||
public void prepare(PrintEvent e)
|
|
||||||
{
|
|
||||||
PageState s = e.getPageState();
|
PageState s = e.getPageState();
|
||||||
if(getSelectionModel().isSelected(s))
|
if(getSelectionModel().isSelected(s)) {
|
||||||
{
|
BigDecimal bd = new BigDecimal((String)
|
||||||
BigDecimal bd =
|
getSelectionModel().getSelectedKey(s));
|
||||||
new BigDecimal((String) getSelectionModel().getSelectedKey(s));
|
|
||||||
Bookmark bmrk = Bookmark.retrieveBookmark(bd);
|
Bookmark bmrk = Bookmark.retrieveBookmark(bd);
|
||||||
TextField tf = (TextField)e.getTarget();
|
TextField tf = (TextField)e.getTarget();
|
||||||
tf.setValue(s,bmrk.getName());
|
tf.setValue(s,bmrk.getName());
|
||||||
|
|
@ -397,7 +409,8 @@ public class BookmarkEditPane extends DynamicListWizard {
|
||||||
|
|
||||||
bookmarkURL = new TextField("BookmarkURL");
|
bookmarkURL = new TextField("BookmarkURL");
|
||||||
bookmarkURL.setDefaultValue("");
|
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 {
|
try {
|
||||||
|
|
|
||||||
|
|
@ -129,7 +129,7 @@ public class FileAttachment extends FileAsset {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setFileOwner(ContentItem fileOwner) {
|
public void setFileOwner(ContentItem fileOwner) {
|
||||||
Assert.assertNotNull(fileOwner);
|
Assert.exists(fileOwner);
|
||||||
this.setMaster(fileOwner);
|
this.setMaster(fileOwner);
|
||||||
setAssociation(FILE_OWNER, fileOwner);
|
setAssociation(FILE_OWNER, fileOwner);
|
||||||
|
|
||||||
|
|
@ -227,11 +227,11 @@ public class FileAttachment extends FileAsset {
|
||||||
*/
|
*/
|
||||||
public void swapKeys(boolean swapNext) {
|
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");
|
"object that is new");
|
||||||
|
|
||||||
ContentItem fileOwner = getFileOwner();
|
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();
|
Integer currentKey = getFileOrder();
|
||||||
// if the current item is not already ordered, alphabetize
|
// if the current item is not already ordered, alphabetize
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ public class RelatedLinkTableModelBuilder
|
||||||
* @return The DataCollection of RelatedLinks
|
* @return The DataCollection of RelatedLinks
|
||||||
*/
|
*/
|
||||||
public DataCollection getLinks(PageState s) {
|
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);
|
ContentItem item = m_itemModel.getSelectedItem(s);
|
||||||
s_log.debug("Getting related links for " + item.getName());
|
s_log.debug("Getting related links for " + item.getName());
|
||||||
return RelatedLink.getRelatedLinks(item);
|
return RelatedLink.getRelatedLinks(item);
|
||||||
|
|
|
||||||
|
|
@ -107,7 +107,7 @@ public class AddContactPropertiesStep extends ResettableContainer {
|
||||||
protected Object initialValue(PageState s) {
|
protected Object initialValue(PageState s) {
|
||||||
ContentItem item = (ContentItem) ((ItemSelectionModel) getSingleSelectionModel())
|
ContentItem item = (ContentItem) ((ItemSelectionModel) getSingleSelectionModel())
|
||||||
.getSelectedObject(s);
|
.getSelectedObject(s);
|
||||||
Assert.assertNotNull(item);
|
Assert.exists(item);
|
||||||
return Contact.getContactForItem(item);
|
return Contact.getContactForItem(item);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,7 @@ public class FormSectionWrapper extends PersistentComponent
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setFormSectionItem(FormSectionItem item) {
|
public void setFormSectionItem(FormSectionItem item) {
|
||||||
Assert.truth(ContentItem.DRAFT.equals(item.getVersion()),
|
Assert.isTrue(ContentItem.DRAFT.equals(item.getVersion()),
|
||||||
"item is draft");
|
"item is draft");
|
||||||
|
|
||||||
setAssociation(FORM_SECTION_ITEM, item);
|
setAssociation(FORM_SECTION_ITEM, item);
|
||||||
|
|
|
||||||
|
|
@ -135,7 +135,7 @@ public class ArticleImageAssociation extends ContentItem {
|
||||||
*/
|
*/
|
||||||
public static boolean imageHasAssociation
|
public static boolean imageHasAssociation
|
||||||
(ImageAsset image) {
|
(ImageAsset image) {
|
||||||
Assert.assertNotNull(image);
|
Assert.exists(image);
|
||||||
boolean returnValue = imageHasDirectAssociation(image.getID());
|
boolean returnValue = imageHasDirectAssociation(image.getID());
|
||||||
if (!returnValue) {
|
if (!returnValue) {
|
||||||
if (!image.getVersion().equals(ContentItem.DRAFT)) {
|
if (!image.getVersion().equals(ContentItem.DRAFT)) {
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,7 @@ public final class CMSContext {
|
||||||
*/
|
*/
|
||||||
public final ContentSection getContentSection() {
|
public final ContentSection getContentSection() {
|
||||||
// removing this which is not true when viewing category pages
|
// removing this which is not true when viewing category pages
|
||||||
//Assert.assertNotNull(m_section, "section");
|
//Assert.exists(m_section, "section");
|
||||||
return m_section;
|
return m_section;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -119,7 +119,7 @@ public final class CMSContext {
|
||||||
*/
|
*/
|
||||||
public final ContentItem getContentItem() {
|
public final ContentItem getContentItem() {
|
||||||
// removing this which is necessarily true in ContentList
|
// 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) {
|
if (s_log.isDebugEnabled() && m_item == null) {
|
||||||
s_log.debug("Content item is null");
|
s_log.debug("Content item is null");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -136,7 +136,7 @@ public class CategoryTemplateMapping extends TemplateMapping {
|
||||||
* @param sec The ContentSection for which this mapping should be valid.
|
* @param sec The ContentSection for which this mapping should be valid.
|
||||||
**/
|
**/
|
||||||
public final void setContentSection(ContentSection sec) {
|
public final void setContentSection(ContentSection sec) {
|
||||||
Assert.assertNotNull(sec);
|
Assert.exists(sec);
|
||||||
setAssociation(SECTION, sec);
|
setAssociation(SECTION, sec);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -158,7 +158,7 @@ public class CategoryTemplateMapping extends TemplateMapping {
|
||||||
* @param cat The Category for which this mapping should be valid.
|
* @param cat The Category for which this mapping should be valid.
|
||||||
**/
|
**/
|
||||||
public void setCategory(Category cat) {
|
public void setCategory(Category cat) {
|
||||||
Assert.assertNotNull(cat);
|
Assert.exists(cat);
|
||||||
setAssociation(CATEGORY, cat);
|
setAssociation(CATEGORY, cat);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -192,7 +192,7 @@ public class CategoryTemplateMapping extends TemplateMapping {
|
||||||
* @param t The ContentType for which this mapping should be valid.
|
* @param t The ContentType for which this mapping should be valid.
|
||||||
**/
|
**/
|
||||||
public void setContentType(ContentType t) {
|
public void setContentType(ContentType t) {
|
||||||
Assert.assertNotNull(t);
|
Assert.exists(t);
|
||||||
setAssociation(CONTENT_TYPE, 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.
|
* @param b whether the template is the default within its context.
|
||||||
*/
|
*/
|
||||||
public void setDefault(Boolean b) {
|
public void setDefault(Boolean b) {
|
||||||
Assert.assertNotNull(b);
|
Assert.exists(b);
|
||||||
set(IS_DEFAULT, b);
|
set(IS_DEFAULT, b);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -237,7 +237,7 @@ public class CategoryTemplateMapping extends TemplateMapping {
|
||||||
c.addEqualsFilter(TEMPLATE + "." + ACSObject.ID, template.getID());
|
c.addEqualsFilter(TEMPLATE + "." + ACSObject.ID, template.getID());
|
||||||
if(!c.next()) return null;
|
if(!c.next()) return null;
|
||||||
CategoryTemplateMapping m = (CategoryTemplateMapping)c.getDomainObject();
|
CategoryTemplateMapping m = (CategoryTemplateMapping)c.getDomainObject();
|
||||||
Assert.assertTrue(!c.next());
|
Assert.isTrue(!c.next());
|
||||||
c.close();
|
c.close();
|
||||||
return m;
|
return m;
|
||||||
}
|
}
|
||||||
|
|
@ -260,7 +260,7 @@ public class CategoryTemplateMapping extends TemplateMapping {
|
||||||
if(!c.next()) return null;
|
if(!c.next()) return null;
|
||||||
CategoryTemplateMapping m = (CategoryTemplateMapping)c.getDomainObject();
|
CategoryTemplateMapping m = (CategoryTemplateMapping)c.getDomainObject();
|
||||||
// FIXME: There HAS to be a better way to enforce uniqueness here...
|
// FIXME: There HAS to be a better way to enforce uniqueness here...
|
||||||
Assert.assertTrue(!c.next());
|
Assert.isTrue(!c.next());
|
||||||
c.close();
|
c.close();
|
||||||
return m.getTemplate();
|
return m.getTemplate();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -197,7 +197,7 @@ public class ContentBundle extends ContentItem {
|
||||||
public final void setDefaultLanguage(final String language) {
|
public final void setDefaultLanguage(final String language) {
|
||||||
if (Assert.isEnabled()) {
|
if (Assert.isEnabled()) {
|
||||||
Assert.exists(language, String.class);
|
Assert.exists(language, String.class);
|
||||||
Assert.truth(language.length() == 2,
|
Assert.isTrue(language.length() == 2,
|
||||||
language + " is not an ISO639 language code");
|
language + " is not an ISO639 language code");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -224,7 +224,7 @@ public class ContentBundle extends ContentItem {
|
||||||
|
|
||||||
if (Assert.isEnabled()) {
|
if (Assert.isEnabled()) {
|
||||||
Assert.exists(instance, ContentItem.class);
|
Assert.exists(instance, ContentItem.class);
|
||||||
Assert.falsity(hasInstance(instance.getLanguage()),
|
Assert.isFalse(hasInstance(instance.getLanguage()),
|
||||||
"The bundle already contains an instance " +
|
"The bundle already contains an instance " +
|
||||||
"for the language " + instance.getLanguage());
|
"for the language " + instance.getLanguage());
|
||||||
}
|
}
|
||||||
|
|
@ -233,7 +233,7 @@ public class ContentBundle extends ContentItem {
|
||||||
instance.setContentSection(getContentSection());
|
instance.setContentSection(getContentSection());
|
||||||
|
|
||||||
if (Assert.isEnabled()) {
|
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) {
|
public void removeInstance(final ContentItem instance) {
|
||||||
if (Assert.isEnabled()) {
|
if (Assert.isEnabled()) {
|
||||||
Assert.exists(instance, ContentItem.class);
|
Assert.exists(instance, ContentItem.class);
|
||||||
Assert.equal(this, instance.getParent());
|
Assert.isEqual(this, instance.getParent());
|
||||||
Assert.unequal(instance, getPrimaryInstance());
|
Assert.isNotEqual(instance, getPrimaryInstance());
|
||||||
}
|
}
|
||||||
|
|
||||||
instance.setParent(null);
|
instance.setParent(null);
|
||||||
|
|
||||||
if (Assert.isEnabled()) {
|
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) {
|
public final ContentItem getInstance(final String language) {
|
||||||
if (Assert.isEnabled()) {
|
if (Assert.isEnabled()) {
|
||||||
Assert.exists(language, String.class);
|
Assert.exists(language, String.class);
|
||||||
Assert.truth(language.length() == 2,
|
Assert.isTrue(language.length() == 2,
|
||||||
language + " does not look like a valid language " +
|
language + " does not look like a valid language " +
|
||||||
"code");
|
"code");
|
||||||
}
|
}
|
||||||
|
|
@ -315,7 +315,7 @@ public class ContentBundle extends ContentItem {
|
||||||
final DataObject data = instances.getDataObject();
|
final DataObject data = instances.getDataObject();
|
||||||
|
|
||||||
if (Assert.isEnabled()) {
|
if (Assert.isEnabled()) {
|
||||||
//Assert.falsity(instances.next(),
|
//Assert.isFalse(instances.next(),
|
||||||
// "There is more than one instance with the " +
|
// "There is more than one instance with the " +
|
||||||
// "same language");
|
// "same language");
|
||||||
}
|
}
|
||||||
|
|
@ -357,7 +357,7 @@ public class ContentBundle extends ContentItem {
|
||||||
public final boolean hasInstance(final String language) {
|
public final boolean hasInstance(final String language) {
|
||||||
if (Assert.isEnabled()) {
|
if (Assert.isEnabled()) {
|
||||||
Assert.exists(language, String.class);
|
Assert.exists(language, String.class);
|
||||||
Assert.truth(language.length() == 2,
|
Assert.isTrue(language.length() == 2,
|
||||||
language + " is not an ISO639 language code");
|
language + " is not an ISO639 language code");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -390,7 +390,7 @@ public class ContentBundle extends ContentItem {
|
||||||
items.close();
|
items.close();
|
||||||
|
|
||||||
if (Assert.isEnabled()) {
|
if (Assert.isEnabled()) {
|
||||||
Assert.truth(!list.isEmpty() || getInstances().isEmpty());
|
Assert.isTrue(!list.isEmpty() || getInstances().isEmpty());
|
||||||
}
|
}
|
||||||
|
|
||||||
return list;
|
return list;
|
||||||
|
|
@ -407,7 +407,7 @@ public class ContentBundle extends ContentItem {
|
||||||
* @pre locales != null
|
* @pre locales != null
|
||||||
*/
|
*/
|
||||||
public ContentItem negotiate(Locale[] locales) {
|
public ContentItem negotiate(Locale[] locales) {
|
||||||
Assert.assertNotNull(locales);
|
Assert.exists(locales);
|
||||||
DataAssociationCursor instancesCursor = instances();
|
DataAssociationCursor instancesCursor = instances();
|
||||||
DataObject dataObject = null;
|
DataObject dataObject = null;
|
||||||
int bestMatch = 0;
|
int bestMatch = 0;
|
||||||
|
|
@ -462,7 +462,7 @@ public class ContentBundle extends ContentItem {
|
||||||
* @pre locales != null
|
* @pre locales != null
|
||||||
*/
|
*/
|
||||||
public ContentItem negotiate(Enumeration locales) {
|
public ContentItem negotiate(Enumeration locales) {
|
||||||
Assert.assertNotNull(locales);
|
Assert.exists(locales);
|
||||||
/* copy "locales" enumeration, since we have to iterate
|
/* copy "locales" enumeration, since we have to iterate
|
||||||
* over it several times
|
* over it several times
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -1054,7 +1054,7 @@ public class ContentItem extends VersionedACSObject implements CustomCopy {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Assert.isEnabled()) {
|
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 " +
|
"Item version " + version + " must be null or " +
|
||||||
"the live version");
|
"the live version");
|
||||||
}
|
}
|
||||||
|
|
@ -1195,7 +1195,7 @@ public class ContentItem extends VersionedACSObject implements CustomCopy {
|
||||||
|
|
||||||
if (Assert.isEnabled()) {
|
if (Assert.isEnabled()) {
|
||||||
Assert.exists(pending, ContentItem.class);
|
Assert.exists(pending, ContentItem.class);
|
||||||
Assert.truth(PENDING.equals(pending.getVersion()) ||
|
Assert.isTrue(PENDING.equals(pending.getVersion()) ||
|
||||||
LIVE.equals(pending.getVersion()),
|
LIVE.equals(pending.getVersion()),
|
||||||
"The new pending item must be pending or live; " +
|
"The new pending item must be pending or live; " +
|
||||||
"instead it is " + pending.getVersion());
|
"instead it is " + pending.getVersion());
|
||||||
|
|
@ -1273,7 +1273,7 @@ public class ContentItem extends VersionedACSObject implements CustomCopy {
|
||||||
applyTag( "Republished" );
|
applyTag( "Republished" );
|
||||||
Versions.suspendVersioning();
|
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();
|
Lifecycle cycle = getLifecycle();
|
||||||
Assert.exists( cycle, Lifecycle.class );
|
Assert.exists( cycle, Lifecycle.class );
|
||||||
|
|
@ -1936,21 +1936,21 @@ public class ContentItem extends VersionedACSObject implements CustomCopy {
|
||||||
* Assert that this item is a draft version
|
* Assert that this item is a draft version
|
||||||
*/
|
*/
|
||||||
public final void assertDraft() {
|
public final void assertDraft() {
|
||||||
Assert.equal(DRAFT, getVersion());
|
Assert.isEqual(DRAFT, getVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Assert that this item is a pending version
|
* Assert that this item is a pending version
|
||||||
*/
|
*/
|
||||||
public final void assertPending() {
|
public final void assertPending() {
|
||||||
Assert.equal(PENDING, getVersion());
|
Assert.isEqual(PENDING, getVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Assert that this item is a live version
|
* Assert that this item is a live version
|
||||||
*/
|
*/
|
||||||
public final void assertLive() {
|
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
|
* @deprecated with no replacement
|
||||||
*/
|
*/
|
||||||
public final void assertMaster() {
|
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() {
|
ContentItem get() {
|
||||||
Assert.truth(m_cached);
|
Assert.isTrue(m_cached);
|
||||||
|
|
||||||
return m_version;
|
return m_version;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -243,7 +243,7 @@ public class ContentSection extends Application {
|
||||||
*/
|
*/
|
||||||
// public PackageInstance getPackageInstance() {
|
// public PackageInstance getPackageInstance() {
|
||||||
// DataObject pkg = (DataObject) get(PACKAGE);
|
// DataObject pkg = (DataObject) get(PACKAGE);
|
||||||
// Assert.assertNotNull(pkg, "package instance");
|
// Assert.exists(pkg, "package instance");
|
||||||
// return new PackageInstance(pkg);
|
// return new PackageInstance(pkg);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
@ -254,7 +254,7 @@ public class ContentSection extends Application {
|
||||||
* @pre ( pkg != null )
|
* @pre ( pkg != null )
|
||||||
*/
|
*/
|
||||||
// protected void setPackageInstance(PackageInstance pkg) {
|
// protected void setPackageInstance(PackageInstance pkg) {
|
||||||
// Assert.assertNotNull(pkg, "package instance");
|
// Assert.exists(pkg, "package instance");
|
||||||
// setAssociation(PACKAGE, pkg);
|
// setAssociation(PACKAGE, pkg);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
@ -309,8 +309,8 @@ public class ContentSection extends Application {
|
||||||
// public final String getPath() {
|
// public final String getPath() {
|
||||||
// final String path = getSiteNode().getURL();
|
// final String path = getSiteNode().getURL();
|
||||||
//
|
//
|
||||||
// if (Assert.isAssertEnabled()) {
|
// if (Assert.isEnabled()) {
|
||||||
// Assert.assertTrue(path.endsWith("/"));
|
// Assert.isTrue(path.endsWith("/"));
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// return path.substring(0, path.length() - 1);
|
// return path.substring(0, path.length() - 1);
|
||||||
|
|
@ -328,7 +328,7 @@ public class ContentSection extends Application {
|
||||||
*/
|
*/
|
||||||
public Folder getRootFolder() {
|
public Folder getRootFolder() {
|
||||||
DataObject folder = (DataObject) get(ROOT_FOLDER);
|
DataObject folder = (DataObject) get(ROOT_FOLDER);
|
||||||
Assert.assertNotNull(folder, "root folder");
|
Assert.exists(folder, "root folder");
|
||||||
return new Folder(folder);
|
return new Folder(folder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -338,7 +338,7 @@ public class ContentSection extends Application {
|
||||||
* @param root The root folder
|
* @param root The root folder
|
||||||
*/
|
*/
|
||||||
public void setRootFolder(Folder root) {
|
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.
|
// Update the content section of the old and new root folders.
|
||||||
// This is necessary because the content section is used to determine
|
// This is necessary because the content section is used to determine
|
||||||
|
|
@ -397,7 +397,7 @@ public class ContentSection extends Application {
|
||||||
public Category getRootCategory() {
|
public Category getRootCategory() {
|
||||||
Category category = Category.getRootForObject(this);
|
Category category = Category.getRootForObject(this);
|
||||||
|
|
||||||
Assert.assertNotNull(category, "root category");
|
Assert.exists(category, "root category");
|
||||||
|
|
||||||
return category;
|
return category;
|
||||||
}
|
}
|
||||||
|
|
@ -411,7 +411,7 @@ public class ContentSection extends Application {
|
||||||
* @pre ( root != null )
|
* @pre ( root != null )
|
||||||
*/
|
*/
|
||||||
public void setRootCategory(Category root) {
|
public void setRootCategory(Category root) {
|
||||||
Assert.assertNotNull(root, "root category");
|
Assert.exists(root, "root category");
|
||||||
Category.setRootForObject(this, root);
|
Category.setRootForObject(this, root);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -423,7 +423,7 @@ public class ContentSection extends Application {
|
||||||
*/
|
*/
|
||||||
public Group getStaffGroup() {
|
public Group getStaffGroup() {
|
||||||
DataObject group = (DataObject) get(STAFF_GROUP);
|
DataObject group = (DataObject) get(STAFF_GROUP);
|
||||||
Assert.assertNotNull(group, "staff group");
|
Assert.exists(group, "staff group");
|
||||||
return new Group(group);
|
return new Group(group);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -434,7 +434,7 @@ public class ContentSection extends Application {
|
||||||
* @pre ( group != null )
|
* @pre ( group != null )
|
||||||
*/
|
*/
|
||||||
public void setStaffGroup(Group group) {
|
public void setStaffGroup(Group group) {
|
||||||
Assert.assertNotNull(group, "staff group");
|
Assert.exists(group, "staff group");
|
||||||
setAssociation(STAFF_GROUP, group);
|
setAssociation(STAFF_GROUP, group);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -446,7 +446,7 @@ public class ContentSection extends Application {
|
||||||
*/
|
*/
|
||||||
public Group getViewersGroup() {
|
public Group getViewersGroup() {
|
||||||
DataObject group = (DataObject) get(VIEWERS_GROUP);
|
DataObject group = (DataObject) get(VIEWERS_GROUP);
|
||||||
Assert.assertNotNull(group, "viewers group");
|
Assert.exists(group, "viewers group");
|
||||||
return new Group(group);
|
return new Group(group);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -457,7 +457,7 @@ public class ContentSection extends Application {
|
||||||
* @pre ( group != null )
|
* @pre ( group != null )
|
||||||
*/
|
*/
|
||||||
public void setViewersGroup(Group group) {
|
public void setViewersGroup(Group group) {
|
||||||
Assert.assertNotNull(group, "viewers group");
|
Assert.exists(group, "viewers group");
|
||||||
setAssociation(VIEWERS_GROUP, group);
|
setAssociation(VIEWERS_GROUP, group);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -469,7 +469,7 @@ public class ContentSection extends Application {
|
||||||
*/
|
*/
|
||||||
public String getPageResolverClass() {
|
public String getPageResolverClass() {
|
||||||
String prc = (String) get(PAGE_RESOLVER_CLASS);
|
String prc = (String) get(PAGE_RESOLVER_CLASS);
|
||||||
Assert.assertNotNull(prc, "Page Resolver class");
|
Assert.exists(prc, "Page Resolver class");
|
||||||
return prc;
|
return prc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -526,7 +526,7 @@ public class ContentSection extends Application {
|
||||||
*/
|
*/
|
||||||
public String getItemResolverClass() {
|
public String getItemResolverClass() {
|
||||||
String irc = (String) get(ITEM_RESOLVER_CLASS);
|
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);
|
s_log.debug("Content Item Resolver Class is " + irc);
|
||||||
return irc;
|
return irc;
|
||||||
}
|
}
|
||||||
|
|
@ -573,7 +573,7 @@ public class ContentSection extends Application {
|
||||||
*/
|
*/
|
||||||
public String getTemplateResolverClass() {
|
public String getTemplateResolverClass() {
|
||||||
String trc = (String) get(TEMPLATE_RESOLVER_CLASS);
|
String trc = (String) get(TEMPLATE_RESOLVER_CLASS);
|
||||||
Assert.assertNotNull(trc, "Template Resolver class");
|
Assert.exists(trc, "Template Resolver class");
|
||||||
return trc;
|
return trc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -618,7 +618,7 @@ public class ContentSection extends Application {
|
||||||
*/
|
*/
|
||||||
public String getXMLGeneratorClass() {
|
public String getXMLGeneratorClass() {
|
||||||
String xgc = (String) get(XML_GENERATOR_CLASS);
|
String xgc = (String) get(XML_GENERATOR_CLASS);
|
||||||
Assert.assertNotNull(xgc, "XML Generator class");
|
Assert.exists(xgc, "XML Generator class");
|
||||||
return xgc;
|
return xgc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -240,7 +240,7 @@ public class Folder extends ContentItem {
|
||||||
|
|
||||||
DataQueryDataCollectionAdapter adapter = new DataQueryDataCollectionAdapter(ITEMS_QUERY, ITEM);
|
DataQueryDataCollectionAdapter adapter = new DataQueryDataCollectionAdapter(ITEMS_QUERY, ITEM);
|
||||||
adapter.setParameter(PARENT, getID());
|
adapter.setParameter(PARENT, getID());
|
||||||
Assert.unequal(PENDING, getVersion());
|
Assert.isNotEqual(PENDING, getVersion());
|
||||||
adapter.setParameter(VERSION, getVersion());
|
adapter.setParameter(VERSION, getVersion());
|
||||||
|
|
||||||
return new ItemCollection(adapter, bSort);
|
return new ItemCollection(adapter, bSort);
|
||||||
|
|
@ -268,7 +268,7 @@ public class Folder extends ContentItem {
|
||||||
(PRIMARY_INSTANCES_QUERY);
|
(PRIMARY_INSTANCES_QUERY);
|
||||||
query.setParameter(PARENT, getID());
|
query.setParameter(PARENT, getID());
|
||||||
|
|
||||||
Assert.unequal(PENDING, getVersion());
|
Assert.isNotEqual(PENDING, getVersion());
|
||||||
|
|
||||||
query.setParameter(VERSION, getVersion());
|
query.setParameter(VERSION, getVersion());
|
||||||
|
|
||||||
|
|
@ -431,7 +431,7 @@ public class Folder extends ContentItem {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void removePendingVersion(final ContentItem version) {
|
public void removePendingVersion(final ContentItem version) {
|
||||||
Assert.unequal(PENDING, version.getVersion());
|
Assert.isNotEqual(PENDING, version.getVersion());
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -136,7 +136,7 @@ public class ItemTemplateMapping extends TemplateMapping {
|
||||||
if(!c.next()) return null;
|
if(!c.next()) return null;
|
||||||
ItemTemplateMapping m = (ItemTemplateMapping)c.getDomainObject();
|
ItemTemplateMapping m = (ItemTemplateMapping)c.getDomainObject();
|
||||||
// FIXME: There HAS to be a better way to enforce uniqueness here...
|
// FIXME: There HAS to be a better way to enforce uniqueness here...
|
||||||
Assert.assertTrue(!c.next());
|
Assert.isTrue(!c.next());
|
||||||
c.close();
|
c.close();
|
||||||
return m;
|
return m;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -262,7 +262,7 @@ class PublishedLink extends DomainObject {
|
||||||
if (target != null) {
|
if (target != null) {
|
||||||
ObjectType ot = src.getObjectType();
|
ObjectType ot = src.getObjectType();
|
||||||
Property prop = ot.getProperty(propertyName);
|
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()) {
|
if (prop.isCollection()) {
|
||||||
DataAssociation da = (DataAssociation) src.get(propertyName);
|
DataAssociation da = (DataAssociation) src.get(propertyName);
|
||||||
da.add(target);
|
da.add(target);
|
||||||
|
|
|
||||||
|
|
@ -86,7 +86,7 @@ public class SectionTemplateMapping extends TemplateMapping {
|
||||||
}
|
}
|
||||||
|
|
||||||
public final void setContentSection(ContentSection sec) {
|
public final void setContentSection(ContentSection sec) {
|
||||||
Assert.assertNotNull(sec);
|
Assert.exists(sec);
|
||||||
setAssociation(SECTION, sec);
|
setAssociation(SECTION, sec);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -100,7 +100,7 @@ public class SectionTemplateMapping extends TemplateMapping {
|
||||||
}
|
}
|
||||||
|
|
||||||
public final void setContentType(ContentType t) {
|
public final void setContentType(ContentType t) {
|
||||||
Assert.assertNotNull(t);
|
Assert.exists(t);
|
||||||
setAssociation(CONTENT_TYPE, t);
|
setAssociation(CONTENT_TYPE, t);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -117,7 +117,7 @@ public class SectionTemplateMapping extends TemplateMapping {
|
||||||
* context
|
* context
|
||||||
*/
|
*/
|
||||||
public void setDefault(Boolean b) {
|
public void setDefault(Boolean b) {
|
||||||
Assert.assertNotNull(b);
|
Assert.exists(b);
|
||||||
set(IS_DEFAULT, b);
|
set(IS_DEFAULT, b);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -148,7 +148,7 @@ public class SectionTemplateMapping extends TemplateMapping {
|
||||||
}
|
}
|
||||||
if(!c.next()) return null;
|
if(!c.next()) return null;
|
||||||
SectionTemplateMapping m = (SectionTemplateMapping)c.getDomainObject();
|
SectionTemplateMapping m = (SectionTemplateMapping)c.getDomainObject();
|
||||||
Assert.assertTrue(!c.next());
|
Assert.isTrue(!c.next());
|
||||||
c.close();
|
c.close();
|
||||||
return m;
|
return m;
|
||||||
}
|
}
|
||||||
|
|
@ -169,7 +169,7 @@ public class SectionTemplateMapping extends TemplateMapping {
|
||||||
if(!c.next()) return null;
|
if(!c.next()) return null;
|
||||||
SectionTemplateMapping m = (SectionTemplateMapping)c.getDomainObject();
|
SectionTemplateMapping m = (SectionTemplateMapping)c.getDomainObject();
|
||||||
// FIXME: There HAS to be a better way to enforce uniqueness here...
|
// FIXME: There HAS to be a better way to enforce uniqueness here...
|
||||||
Assert.assertTrue(!c.next());
|
Assert.isTrue(!c.next());
|
||||||
c.close();
|
c.close();
|
||||||
return m.getTemplate();
|
return m.getTemplate();
|
||||||
}
|
}
|
||||||
|
|
@ -187,7 +187,7 @@ public class SectionTemplateMapping extends TemplateMapping {
|
||||||
if(!c.next()) return null;
|
if(!c.next()) return null;
|
||||||
SectionTemplateMapping m = (SectionTemplateMapping)c.getDomainObject();
|
SectionTemplateMapping m = (SectionTemplateMapping)c.getDomainObject();
|
||||||
// FIXME: There HAS to be a better way to enforce uniqueness here...
|
// FIXME: There HAS to be a better way to enforce uniqueness here...
|
||||||
Assert.assertTrue(!c.next());
|
Assert.isTrue(!c.next());
|
||||||
c.close();
|
c.close();
|
||||||
return m.getTemplate();
|
return m.getTemplate();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -459,7 +459,7 @@ public class SecurityManager implements Security, SecurityConstants {
|
||||||
*/
|
*/
|
||||||
private boolean hasPermission(Party party, String privilege) {
|
private boolean hasPermission(Party party, String privilege) {
|
||||||
PrivilegeDescriptor pd = PrivilegeDescriptor.get(privilege);
|
PrivilegeDescriptor pd = PrivilegeDescriptor.get(privilege);
|
||||||
Assert.assertNotNull(pd, "PrivilegeDescriptor.get(\"" + privilege + "\")");
|
Assert.exists(pd, "PrivilegeDescriptor.get(\"" + privilege + "\")");
|
||||||
return hasPermission(party, pd);
|
return hasPermission(party, pd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -477,7 +477,7 @@ public class SecurityManager implements Security, SecurityConstants {
|
||||||
private boolean hasPermission(Party party, String privilege,
|
private boolean hasPermission(Party party, String privilege,
|
||||||
ContentItem item) {
|
ContentItem item) {
|
||||||
PrivilegeDescriptor pd = PrivilegeDescriptor.get(privilege);
|
PrivilegeDescriptor pd = PrivilegeDescriptor.get(privilege);
|
||||||
Assert.assertNotNull(pd, "PrivilegeDescriptor.get(\"" + privilege + "\")");
|
Assert.exists(pd, "PrivilegeDescriptor.get(\"" + privilege + "\")");
|
||||||
return hasPermission(party, pd, item);
|
return hasPermission(party, pd, item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -487,7 +487,7 @@ public class SecurityManager implements Security, SecurityConstants {
|
||||||
*/
|
*/
|
||||||
private boolean hasPermission(Party party, PrivilegeDescriptor pd,
|
private boolean hasPermission(Party party, PrivilegeDescriptor pd,
|
||||||
ContentItem item) {
|
ContentItem item) {
|
||||||
Assert.assertNotNull(pd, "PrivilegeDescriptor");
|
Assert.exists(pd, "PrivilegeDescriptor");
|
||||||
PermissionDescriptor perm = new PermissionDescriptor(pd, item, party);
|
PermissionDescriptor perm = new PermissionDescriptor(pd, item, party);
|
||||||
return (PermissionService.checkPermission(perm));
|
return (PermissionService.checkPermission(perm));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -158,7 +158,7 @@ public class StandalonePage extends ContentPage {
|
||||||
*/
|
*/
|
||||||
public void setLive(ContentItem version) {
|
public void setLive(ContentItem version) {
|
||||||
Template t = getTemplate();
|
Template t = getTemplate();
|
||||||
Assert.assertNotNull(t);
|
Assert.exists(t);
|
||||||
if(version != null)
|
if(version != null)
|
||||||
t.createLiveVersion();
|
t.createLiveVersion();
|
||||||
super.setLive(version);
|
super.setLive(version);
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,7 @@ public abstract class TemplateMapping extends ACSObject {
|
||||||
* Set the new template for this mapping
|
* Set the new template for this mapping
|
||||||
*/
|
*/
|
||||||
public void setTemplate(Template t) {
|
public void setTemplate(Template t) {
|
||||||
Assert.assertNotNull(t);
|
Assert.exists(t);
|
||||||
setAssociation(TEMPLATE, t);
|
setAssociation(TEMPLATE, t);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -112,7 +112,7 @@ public abstract class TemplateMapping extends ACSObject {
|
||||||
* Set the use context for this mapping
|
* Set the use context for this mapping
|
||||||
*/
|
*/
|
||||||
public void setUseContext(String context) {
|
public void setUseContext(String context) {
|
||||||
Assert.assertNotNull(context);
|
Assert.exists(context);
|
||||||
set(USE_CONTEXT, context);
|
set(USE_CONTEXT, context);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -88,15 +88,15 @@ class VersionCopier extends ObjectCopier {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Assert.isEnabled()) {
|
if (Assert.isEnabled()) {
|
||||||
//Assert.falsity(item instanceof ContentBundle);
|
//Assert.isFalse(item instanceof ContentBundle);
|
||||||
//Assert.falsity(item instanceof Folder);
|
//Assert.isFalse(item instanceof Folder);
|
||||||
Assert.falsity(m_once);
|
Assert.isFalse(m_once);
|
||||||
m_once = true;
|
m_once = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_topLevelSourceOID = item.getOID();
|
m_topLevelSourceOID = item.getOID();
|
||||||
final ContentItem version = createVersion(item);
|
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");
|
// "CopyItem should be called only once for a given copier instance");
|
||||||
|
|
||||||
if (m_lifecycle != null) {
|
if (m_lifecycle != null) {
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,7 @@ public class ContentGroupAssociation extends ContentItem {
|
||||||
* Sets the content item for this association
|
* Sets the content item for this association
|
||||||
*/
|
*/
|
||||||
public void setContentItem(ContentItem item) {
|
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);
|
set(CONTENT_ITEM, item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -107,7 +107,7 @@ public class ContentGroupAssociation extends ContentItem {
|
||||||
* @pre group != null
|
* @pre group != null
|
||||||
*/
|
*/
|
||||||
protected void setContentGroup(ContentGroup group) {
|
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);
|
set(CONTENT_GROUP, group);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -180,11 +180,11 @@ public class ContentGroupAssociation extends ContentItem {
|
||||||
methodName = "swapWithPrevious";
|
methodName = "swapWithPrevious";
|
||||||
}
|
}
|
||||||
|
|
||||||
Assert.assertTrue(!isNew(), methodName + " cannot be called on an " +
|
Assert.isTrue(!isNew(), methodName + " cannot be called on an " +
|
||||||
"object that is new");
|
"object that is new");
|
||||||
|
|
||||||
Integer currentKey = (Integer)get(SORT_KEY);
|
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 " +
|
"called on an object that is not currently in the " +
|
||||||
"list");
|
"list");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -165,7 +165,7 @@ public class Link extends ACSObject {
|
||||||
* Link.INTERNAL_LINK
|
* Link.INTERNAL_LINK
|
||||||
*/
|
*/
|
||||||
public void setTargetType(String type) {
|
public void setTargetType(String type) {
|
||||||
Assert.assertTrue(type != null &&
|
Assert.isTrue(type != null &&
|
||||||
(type.equals(EXTERNAL_LINK)||type.equals(INTERNAL_LINK)));
|
(type.equals(EXTERNAL_LINK)||type.equals(INTERNAL_LINK)));
|
||||||
set(TARGET_TYPE, type);
|
set(TARGET_TYPE, type);
|
||||||
}
|
}
|
||||||
|
|
@ -276,7 +276,7 @@ public class Link extends ACSObject {
|
||||||
* @param order the link order
|
* @param order the link order
|
||||||
*/
|
*/
|
||||||
public void setOrder(Integer order) {
|
public void setOrder(Integer order) {
|
||||||
Assert.assertNotNull(order);
|
Assert.exists(order);
|
||||||
set(ORDER, order);
|
set(ORDER, order);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -433,7 +433,7 @@ public class Link extends ACSObject {
|
||||||
methodName = "swapWithPrevious";
|
methodName = "swapWithPrevious";
|
||||||
}
|
}
|
||||||
|
|
||||||
Assert.assertTrue(!isNew(), methodName + " cannot be called on an " +
|
Assert.isTrue(!isNew(), methodName + " cannot be called on an " +
|
||||||
"object that is new");
|
"object that is new");
|
||||||
|
|
||||||
Integer currentKey = (Integer)get(ORDER);
|
Integer currentKey = (Integer)get(ORDER);
|
||||||
|
|
@ -444,7 +444,7 @@ public class Link extends ACSObject {
|
||||||
alphabetize();
|
alphabetize();
|
||||||
return;
|
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 " +
|
"called on an object that is not currently in the " +
|
||||||
"list");
|
"list");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -111,7 +111,7 @@ public class LinkDisplayTable extends LinkTable {
|
||||||
|
|
||||||
private Link getLink(TableActionEvent e) {
|
private Link getLink(TableActionEvent e) {
|
||||||
String id = (String)e.getRowKey();
|
String id = (String)e.getRowKey();
|
||||||
Assert.assertNotNull(id);
|
Assert.exists(id);
|
||||||
Link link;
|
Link link;
|
||||||
try {
|
try {
|
||||||
link = new Link(new BigDecimal(id));
|
link = new Link(new BigDecimal(id));
|
||||||
|
|
|
||||||
|
|
@ -99,7 +99,7 @@ public class ContentItemDispatcher implements Dispatcher {
|
||||||
final ContentSection section =
|
final ContentSection section =
|
||||||
(ContentSection) Web.getContext().getApplication();
|
(ContentSection) Web.getContext().getApplication();
|
||||||
|
|
||||||
Assert.assertNotNull(item);
|
Assert.exists(item);
|
||||||
|
|
||||||
//get the item's template
|
//get the item's template
|
||||||
final String sTemplateURL = getTemplatePath(item, request, actx);
|
final String sTemplateURL = getTemplatePath(item, request, actx);
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,7 @@ public class ContentSectionDispatcher implements Dispatcher {
|
||||||
// Fetch the current site node from the request context;
|
// Fetch the current site node from the request context;
|
||||||
SiteNode sn = actx.getSiteNode();
|
SiteNode sn = actx.getSiteNode();
|
||||||
ContentSection section = ContentSection.getSectionFromNode(sn);
|
ContentSection section = ContentSection.getSectionFromNode(sn);
|
||||||
Assert.assertNotNull(section);
|
Assert.exists(section);
|
||||||
|
|
||||||
request.setAttribute(CONTENT_SECTION, section);
|
request.setAttribute(CONTENT_SECTION, section);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ public class MasterPage extends CMSPage {
|
||||||
public ContentSection getContentSection(HttpServletRequest request) {
|
public ContentSection getContentSection(HttpServletRequest request) {
|
||||||
// Resets all content sections associations.
|
// Resets all content sections associations.
|
||||||
ContentSection section = super.getContentSection(request);
|
ContentSection section = super.getContentSection(request);
|
||||||
Assert.assertNotNull(section);
|
Assert.exists(section);
|
||||||
return section;
|
return section;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -114,7 +114,7 @@ public class MultilingualItemResolver extends AbstractItemResolver implements It
|
||||||
|
|
||||||
// We allow for returning null, so the root folder may
|
// We allow for returning null, so the root folder may
|
||||||
// not be live.
|
// not be live.
|
||||||
//Assert.assertTrue(rootFolder.isLive(),
|
//Assert.isTrue(rootFolder.isLive(),
|
||||||
// "live context - root folder of secion must be live");
|
// "live context - root folder of secion must be live");
|
||||||
|
|
||||||
// If the context is 'live', we need the live item.
|
// If the context is 'live', we need the live item.
|
||||||
|
|
@ -659,7 +659,7 @@ public class MultilingualItemResolver extends AbstractItemResolver implements It
|
||||||
|
|
||||||
pos++; // skip the "="
|
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);
|
int i = item_id.indexOf(SEPARATOR);
|
||||||
item_id = item_id.substring(pos, Math.min(i, item_id.length() -1));
|
item_id = item_id.substring(pos, Math.min(i, item_id.length() -1));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ public abstract class ResourceHandlerImpl implements ResourceHandler {
|
||||||
public ContentSection getContentSection(HttpServletRequest request) {
|
public ContentSection getContentSection(HttpServletRequest request) {
|
||||||
// resets all content sections associations
|
// resets all content sections associations
|
||||||
ContentSection section = CMSDispatcher.getContentSection(request);
|
ContentSection section = CMSDispatcher.getContentSection(request);
|
||||||
Assert.assertNotNull(section);
|
Assert.exists(section);
|
||||||
return section;
|
return section;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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 {
|
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
|
// - Parameter waf.pagemap.login_redirect=content/content-center-redirect.jsp
|
||||||
// in integrations.properties of the respective bundle
|
// in integrations.properties of the respective bundle
|
||||||
// - registerDomain(navigationKey, "/content/", null); in ldn.aplaws.Loader
|
// - registerDomain(navigationKey, "/content/", null); in ldn.aplaws.Loader
|
||||||
name = "content";
|
//-- name = "content";
|
||||||
|
name = "intern";
|
||||||
|
|
||||||
// List of roles to create. First field is role name,
|
// List of roles to create. First field is role name,
|
||||||
// second is the description, third is a list of
|
// 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
|
// The types are registered when the content-section is created. Later
|
||||||
// modifications have no effect.
|
// modifications have no effect.
|
||||||
|
|
||||||
|
//-- types = {
|
||||||
|
//-- };
|
||||||
types = {
|
types = {
|
||||||
|
"com.arsdigita.cms.contenttypes.Address",
|
||||||
|
"com.arsdigita.cms.contenttypes.Article",
|
||||||
|
"com.arsdigita.cms.contenttypes.Contact"
|
||||||
};
|
};
|
||||||
|
|
||||||
// Category tree to load
|
// Category tree to load
|
||||||
categories = { "/WEB-INF/resources/article-categories.xml", "/WEB-INF/resources/navigation-categories.xml" };
|
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
|
// 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
|
// When to generate email alerts: by default, generate email alerts
|
||||||
// on enable, finish, and rollback (happens on rejection)
|
// 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 {
|
//init com.arsdigita.cms.installer.SectionInitializer {
|
||||||
// // Name of the content section (used to form URL)
|
// // Name of the content section (used to form URL)
|
||||||
// name = "forms";
|
// name = "forms";
|
||||||
|
|
@ -360,64 +443,3 @@ init com.arsdigita.formbuilder.installer.Initializer {
|
||||||
// maxAlerts = 5;
|
// 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"
|
|
||||||
// };
|
|
||||||
//
|
|
||||||
//}
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -172,7 +172,7 @@ s_log.warn ( "Created bundled Item: " + getName() + " " + m_item );
|
||||||
clone.save();
|
clone.save();
|
||||||
cloneBundle.save();
|
cloneBundle.save();
|
||||||
}
|
}
|
||||||
Assert.assertNotNull(clone);
|
Assert.exists(clone);
|
||||||
return clone;
|
return clone;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -202,7 +202,7 @@ public class ContentItemHelper {
|
||||||
save();
|
save();
|
||||||
}
|
}
|
||||||
|
|
||||||
Assert.assertNotNull(m_item);
|
Assert.exists(m_item);
|
||||||
s_log.debug ( "Successfully created content item");
|
s_log.debug ( "Successfully created content item");
|
||||||
return m_item;
|
return m_item;
|
||||||
}
|
}
|
||||||
|
|
@ -242,15 +242,15 @@ public class ContentItemHelper {
|
||||||
throw new UncheckedWrapperException (e);
|
throw new UncheckedWrapperException (e);
|
||||||
}
|
}
|
||||||
|
|
||||||
Assert.assertNotNull ( l_item );
|
Assert.exists ( l_item );
|
||||||
return l_item;
|
return l_item;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Only call this method after create() has been called. */
|
/* Only call this method after create() has been called. */
|
||||||
public void set(String methodName, String argClass, String value) {
|
public void set(String methodName, String argClass, String value) {
|
||||||
Assert.assertNotNull(m_item);
|
Assert.exists(m_item);
|
||||||
Assert.assertNotNull(m_contentTypeClass);
|
Assert.exists(m_contentTypeClass);
|
||||||
if (methodName != null ) {
|
if (methodName != null ) {
|
||||||
s_log.debug("setting property with : " + methodName );
|
s_log.debug("setting property with : " + methodName );
|
||||||
}
|
}
|
||||||
|
|
@ -267,7 +267,7 @@ public class ContentItemHelper {
|
||||||
if (methodName != null || argClass != null
|
if (methodName != null || argClass != null
|
||||||
|| value != null ) {
|
|| value != null ) {
|
||||||
try {
|
try {
|
||||||
Assert.assertNotNull(argClass);
|
Assert.exists(argClass);
|
||||||
Class[] args = {Class.forName(argClass)};
|
Class[] args = {Class.forName(argClass)};
|
||||||
s_log.debug("npe2?");
|
s_log.debug("npe2?");
|
||||||
Method method = m_contentTypeClass.getMethod(methodName, args);
|
Method method = m_contentTypeClass.getMethod(methodName, args);
|
||||||
|
|
@ -319,7 +319,7 @@ public class ContentItemHelper {
|
||||||
* Look for ContentItems with the same name
|
* Look for ContentItems with the same name
|
||||||
*/
|
*/
|
||||||
protected ContentItem getContentItemByName(String name, Folder parent) {
|
protected ContentItem getContentItemByName(String name, Folder parent) {
|
||||||
Assert.assertNotNull(parent);
|
Assert.exists(parent);
|
||||||
// Also check that there aren't any duplicates
|
// Also check that there aren't any duplicates
|
||||||
ContentItem item = null;
|
ContentItem item = null;
|
||||||
ItemCollection items = parent.getItems();
|
ItemCollection items = parent.getItems();
|
||||||
|
|
@ -349,7 +349,7 @@ public class ContentItemHelper {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected ContentItem cloneItem(int count, Folder parent, boolean save) {
|
protected ContentItem cloneItem(int count, Folder parent, boolean save) {
|
||||||
Assert.assertNotNull(m_item);
|
Assert.exists(m_item);
|
||||||
final String name = m_item.getName() + "_" + count;
|
final String name = m_item.getName() + "_" + count;
|
||||||
|
|
||||||
return cloneItem(name, parent, save);
|
return cloneItem(name, parent, save);
|
||||||
|
|
@ -366,7 +366,7 @@ public class ContentItemHelper {
|
||||||
if (save) {
|
if (save) {
|
||||||
clone.save();
|
clone.save();
|
||||||
}
|
}
|
||||||
Assert.assertNotNull(clone);
|
Assert.exists(clone);
|
||||||
return clone;
|
return clone;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -394,7 +394,7 @@ public class ContentItemHelper {
|
||||||
* the ContentItem and the parameter <code>count</code></P>
|
* the ContentItem and the parameter <code>count</code></P>
|
||||||
*/
|
*/
|
||||||
public String cloneName ( int count ) {
|
public String cloneName ( int count ) {
|
||||||
Assert.assertNotNull(m_item);
|
Assert.exists(m_item);
|
||||||
return m_item.getName() + "_" + count;
|
return m_item.getName() + "_" + count;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ public class Duration {
|
||||||
* @pre minutes != null
|
* @pre minutes != null
|
||||||
*/
|
*/
|
||||||
public static String formatDuration(Integer minutes) {
|
public static String formatDuration(Integer minutes) {
|
||||||
Assert.assertNotNull(minutes, "minutes");
|
Assert.exists(minutes, "minutes");
|
||||||
return formatDuration(minutes.intValue());
|
return formatDuration(minutes.intValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -105,7 +105,7 @@ public class Duration {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Integer[] copyArray(int[] from) {
|
private static Integer[] copyArray(int[] from) {
|
||||||
Assert.assertNotNull(from, "from");
|
Assert.exists(from, "from");
|
||||||
Integer[] to = new Integer[from.length];
|
Integer[] to = new Integer[from.length];
|
||||||
for (int ii=0; ii<from.length; ii++) {
|
for (int ii=0; ii<from.length; ii++) {
|
||||||
to[ii] = new Integer(from[ii]);
|
to[ii] = new Integer(from[ii]);
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ public class PublishLifecycleListener implements LifecycleListener {
|
||||||
final ContentItem item = getContentItem(event.getOID());
|
final ContentItem item = getContentItem(event.getOID());
|
||||||
|
|
||||||
if (Assert.isEnabled()) {
|
if (Assert.isEnabled()) {
|
||||||
Assert.falsity(item instanceof ContentBundle,
|
Assert.isFalse(item instanceof ContentBundle,
|
||||||
"Content bundles cannot be published");
|
"Content bundles cannot be published");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -66,7 +66,7 @@ public class PublishLifecycleListener implements LifecycleListener {
|
||||||
pending = master.getPublicVersion();
|
pending = master.getPublicVersion();
|
||||||
|
|
||||||
if (Assert.isEnabled()) {
|
if (Assert.isEnabled()) {
|
||||||
Assert.equal(ContentItem.PENDING, pending.getVersion());
|
Assert.isEqual(ContentItem.PENDING, pending.getVersion());
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Item is already live or is pending.
|
// Item is already live or is pending.
|
||||||
|
|
@ -74,8 +74,8 @@ public class PublishLifecycleListener implements LifecycleListener {
|
||||||
pending = item;
|
pending = item;
|
||||||
master = pending.getDraftVersion();
|
master = pending.getDraftVersion();
|
||||||
|
|
||||||
Assert.unequal(master, pending);
|
Assert.isNotEqual(master, pending);
|
||||||
Assert.equal(ContentItem.DRAFT, master.getVersion());
|
Assert.isEqual(ContentItem.DRAFT, master.getVersion());
|
||||||
}
|
}
|
||||||
|
|
||||||
master.promotePendingVersion(pending);
|
master.promotePendingVersion(pending);
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ class HttpHTMLProvider
|
||||||
private final int m_timeout;
|
private final int m_timeout;
|
||||||
|
|
||||||
HttpHTMLProvider(final int 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;
|
m_timeout = timeout;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -117,7 +117,7 @@ class LinkScanner {
|
||||||
private TagRef[] m_tags;
|
private TagRef[] m_tags;
|
||||||
|
|
||||||
public LinkScanner(String html) {
|
public LinkScanner(String html) {
|
||||||
Assert.assertNotNull(html);
|
Assert.exists(html);
|
||||||
m_content = html;
|
m_content = html;
|
||||||
m_tags = parse();
|
m_tags = parse();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -181,7 +181,7 @@ public class PublishToFile implements PublishToFileListener {
|
||||||
public static URL getSource(final String path) {
|
public static URL getSource(final String path) {
|
||||||
if (Assert.isEnabled()) {
|
if (Assert.isEnabled()) {
|
||||||
Assert.exists(path, String.class);
|
Assert.exists(path, String.class);
|
||||||
Assert.truth(path.startsWith("/"), "Path starts with '/'");
|
Assert.isTrue(path.startsWith("/"), "Path starts with '/'");
|
||||||
}
|
}
|
||||||
|
|
||||||
final WebConfig config = Web.getConfig();
|
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() );
|
s_log.warn( "Item to publish no longer exists. ID = " + qe.getItemId() );
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
Assert.assertTrue( !(item instanceof ContentBundle) );
|
Assert.isTrue( !(item instanceof ContentBundle) );
|
||||||
|
|
||||||
if ( item instanceof Template ) {
|
if ( item instanceof Template ) {
|
||||||
Template template = (Template) item;
|
Template template = (Template) item;
|
||||||
|
|
@ -298,7 +298,7 @@ public class PublishToFile implements PublishToFileListener {
|
||||||
// 'destination' for the Template object type, so we must
|
// 'destination' for the Template object type, so we must
|
||||||
// strip it off here, otherwise it gets double appended
|
// strip it off here, otherwise it gets double appended
|
||||||
String templateRoot = ContentSection.getConfig().getTemplateRoot();
|
String templateRoot = ContentSection.getConfig().getTemplateRoot();
|
||||||
Assert.truth(fileName.startsWith(templateRoot),
|
Assert.isTrue(fileName.startsWith(templateRoot),
|
||||||
"filename starts with templateRoot");
|
"filename starts with templateRoot");
|
||||||
|
|
||||||
PublishedFile f = PublishedFile.loadOrCreate(
|
PublishedFile f = PublishedFile.loadOrCreate(
|
||||||
|
|
@ -575,7 +575,7 @@ public class PublishToFile implements PublishToFileListener {
|
||||||
* publish asset (such as an image) to file system.
|
* publish asset (such as an image) to file system.
|
||||||
*/
|
*/
|
||||||
private void writeAsset(Asset asset, PublishedFile f) {
|
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();
|
File fsf = f.getFile();
|
||||||
try {
|
try {
|
||||||
|
|
@ -603,7 +603,7 @@ public class PublishToFile implements PublishToFileListener {
|
||||||
} else {
|
} else {
|
||||||
itemPath = Utilities.getItemLocation(target);
|
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());
|
DestinationStub stub = PublishToFile.getDestination(target.getSpecificObjectType());
|
||||||
String stubURL = stub.getURLStub();
|
String stubURL = stub.getURLStub();
|
||||||
|
|
|
||||||
|
|
@ -147,7 +147,7 @@ class PublishedFile extends DomainObject {
|
||||||
File path = new File(fileName).getParentFile();
|
File path = new File(fileName).getParentFile();
|
||||||
File p = f.getParentFile();
|
File p = f.getParentFile();
|
||||||
do {
|
do {
|
||||||
Assert.assertTrue(p.isDirectory());
|
Assert.isTrue(p.isDirectory());
|
||||||
DataCollection coll = SessionManager.getSession()
|
DataCollection coll = SessionManager.getSession()
|
||||||
.retrieve(BASE_DATA_OBJECT_TYPE);
|
.retrieve(BASE_DATA_OBJECT_TYPE);
|
||||||
coll.addEqualsFilter(HOST + "." + Host.ID, host.getID());
|
coll.addEqualsFilter(HOST + "." + Host.ID, host.getID());
|
||||||
|
|
@ -177,10 +177,10 @@ class PublishedFile extends DomainObject {
|
||||||
public static PublishedFile create(ContentItem item,
|
public static PublishedFile create(ContentItem item,
|
||||||
String fileName,
|
String fileName,
|
||||||
Host host) {
|
Host host) {
|
||||||
Assert.truth(item != null, "item is not null");
|
Assert.isTrue(item != null, "item is not null");
|
||||||
Assert.truth(item.isLive(), "item is live");
|
Assert.isTrue(item.isLive(), "item is live");
|
||||||
Assert.truth(fileName != null, "fileName is not null");
|
Assert.isTrue(fileName != null, "fileName is not null");
|
||||||
Assert.truth(host != null, "host is not null");
|
Assert.isTrue(host != null, "host is not null");
|
||||||
|
|
||||||
if (s_log.isDebugEnabled()) {
|
if (s_log.isDebugEnabled()) {
|
||||||
s_log.debug("creating published file with item " + item.getOID() +
|
s_log.debug("creating published file with item " + item.getOID() +
|
||||||
|
|
@ -209,10 +209,10 @@ class PublishedFile extends DomainObject {
|
||||||
static PublishedFile loadOrCreate(ContentItem item,
|
static PublishedFile loadOrCreate(ContentItem item,
|
||||||
String fileName,
|
String fileName,
|
||||||
Host host) {
|
Host host) {
|
||||||
Assert.truth(item != null, "item is not null");
|
Assert.isTrue(item != null, "item is not null");
|
||||||
Assert.truth(item.isLive(), "item is live");
|
Assert.isTrue(item.isLive(), "item is live");
|
||||||
Assert.truth(fileName != null, "fileName is not null");
|
Assert.isTrue(fileName != null, "fileName is not null");
|
||||||
Assert.truth(host != null, "host is not null");
|
Assert.isTrue(host != null, "host is not null");
|
||||||
|
|
||||||
PublishedFile f = findByFileName(fileName, host);
|
PublishedFile f = findByFileName(fileName, host);
|
||||||
if (f == null) {
|
if (f == null) {
|
||||||
|
|
|
||||||
|
|
@ -190,7 +190,7 @@ public class QueueEntry extends DomainObject {
|
||||||
ContentItem result = Utilities.getContentItemOrNull(getItemId());
|
ContentItem result = Utilities.getContentItemOrNull(getItemId());
|
||||||
// FIXME: We need to exempt move tasks from the ContainerItem
|
// FIXME: We need to exempt move tasks from the ContainerItem
|
||||||
// assertion, since moves can have anything as the item [lutter]
|
// 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),
|
|| ! (result instanceof ContentBundle),
|
||||||
"The item for a task must not be a ContentBundle");
|
"The item for a task must not be a ContentBundle");
|
||||||
return result;
|
return result;
|
||||||
|
|
@ -221,7 +221,7 @@ public class QueueEntry extends DomainObject {
|
||||||
*/
|
*/
|
||||||
public ContentItem getParent() {
|
public ContentItem getParent() {
|
||||||
ContentItem result = Utilities.getContentItemOrNull(getParentId());
|
ContentItem result = Utilities.getContentItemOrNull(getParentId());
|
||||||
Assert.assertTrue(result == null || (result instanceof ContentBundle) );
|
Assert.isTrue(result == null || (result instanceof ContentBundle) );
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -84,7 +84,7 @@ public class Utilities {
|
||||||
***/
|
***/
|
||||||
|
|
||||||
static String getItemURL(ContentItem item) {
|
static String getItemURL(ContentItem item) {
|
||||||
Assert.assertNotNull(item);
|
Assert.exists(item);
|
||||||
|
|
||||||
ContentSection section = item.getContentSection();
|
ContentSection section = item.getContentSection();
|
||||||
ContentItem working = item.getWorkingVersion();
|
ContentItem working = item.getWorkingVersion();
|
||||||
|
|
@ -127,7 +127,7 @@ public class Utilities {
|
||||||
*/
|
*/
|
||||||
public static boolean moveItem( Folder dstFolder, Folder srcFolder, ContentItem item ) {
|
public static boolean moveItem( Folder dstFolder, Folder srcFolder, ContentItem item ) {
|
||||||
if (Assert.isEnabled()) {
|
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());
|
final Host host = Host.retrieve(Web.getConfig().getHost());
|
||||||
|
|
@ -136,7 +136,7 @@ public class Utilities {
|
||||||
// into PublishedFile [lutter]
|
// into PublishedFile [lutter]
|
||||||
String dst = validateLocation(dstFolder, true);
|
String dst = validateLocation(dstFolder, true);
|
||||||
if ( item instanceof ContentBundle ) {
|
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);
|
moveBundle((ContentBundle)item, dst, host);
|
||||||
} else {
|
} else {
|
||||||
String path = item.getPath();
|
String path = item.getPath();
|
||||||
|
|
@ -144,9 +144,9 @@ public class Utilities {
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
ContentSection section = item.getContentSection();
|
ContentSection section = item.getContentSection();
|
||||||
Assert.assertNotNull(section);
|
Assert.exists(section);
|
||||||
path = PublishToFile.stripSourceBase(section.getURL() + path);
|
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();
|
File root = PublishToFile.getDestination(item.getSpecificObjectType()).getFile();
|
||||||
String src = new File(root, path).getAbsolutePath();
|
String src = new File(root, path).getAbsolutePath();
|
||||||
|
|
@ -183,7 +183,7 @@ public class Utilities {
|
||||||
private static void moveItem(ContentItem item,
|
private static void moveItem(ContentItem item,
|
||||||
String dstPath,
|
String dstPath,
|
||||||
Host host) {
|
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();
|
String docRoot = PublishToFile.getDestination(item.getSpecificObjectType()).getFile().getAbsolutePath();
|
||||||
|
|
||||||
DataQuery query = SessionManager.getSession().retrieveQuery("com.arsdigita.cms.publishToFile.getRelatedFiles");
|
DataQuery query = SessionManager.getSession().retrieveQuery("com.arsdigita.cms.publishToFile.getRelatedFiles");
|
||||||
|
|
@ -191,7 +191,7 @@ public class Utilities {
|
||||||
query.setParameter("hostId", host.getID());
|
query.setParameter("hostId", host.getID());
|
||||||
while ( query.next() ) {
|
while ( query.next() ) {
|
||||||
String fileName = (String)query.get("fileName");
|
String fileName = (String)query.get("fileName");
|
||||||
Assert.assertNotNull(fileName);
|
Assert.exists(fileName);
|
||||||
fileName = docRoot + fileName;
|
fileName = docRoot + fileName;
|
||||||
String cmd = "/bin/mv -f " + fileName + " " + dstPath;
|
String cmd = "/bin/mv -f " + fileName + " " + dstPath;
|
||||||
// s_log.debug("Moving item: source " + fileName + ", destination " + dstPath);
|
// s_log.debug("Moving item: source " + fileName + ", destination " + dstPath);
|
||||||
|
|
@ -211,7 +211,7 @@ public class Utilities {
|
||||||
Folder srcFolder,
|
Folder srcFolder,
|
||||||
Folder dstFolder,
|
Folder dstFolder,
|
||||||
Host host) {
|
Host host) {
|
||||||
Assert.assertTrue(ContentItem.LIVE.equals(item.getVersion()) &&
|
Assert.isTrue(ContentItem.LIVE.equals(item.getVersion()) &&
|
||||||
ContentItem.LIVE.equals(srcFolder.getVersion()) &&
|
ContentItem.LIVE.equals(srcFolder.getVersion()) &&
|
||||||
ContentItem.LIVE.equals(dstFolder.getVersion()) );
|
ContentItem.LIVE.equals(dstFolder.getVersion()) );
|
||||||
|
|
||||||
|
|
@ -273,7 +273,7 @@ public class Utilities {
|
||||||
* @return validated folder path if successed, othervise returns empty string
|
* @return validated folder path if successed, othervise returns empty string
|
||||||
*/
|
*/
|
||||||
private static String validateLocation(Folder folder, boolean makeNew) {
|
private static String validateLocation(Folder folder, boolean makeNew) {
|
||||||
Assert.assertNotNull(folder);
|
Assert.exists(folder);
|
||||||
String fullPath = getItemFullPath(folder);
|
String fullPath = getItemFullPath(folder);
|
||||||
try {
|
try {
|
||||||
File file = new File(fullPath);
|
File file = new File(fullPath);
|
||||||
|
|
@ -308,9 +308,9 @@ public class Utilities {
|
||||||
if (path == null || path.equals("")) return;
|
if (path == null || path.equals("")) return;
|
||||||
|
|
||||||
ContentSection section = item.getContentSection();
|
ContentSection section = item.getContentSection();
|
||||||
Assert.assertNotNull(section);
|
Assert.exists(section);
|
||||||
path = PublishToFile.stripSourceBase(section.getURL() + path);
|
path = PublishToFile.stripSourceBase(section.getURL() + path);
|
||||||
Assert.assertTrue(path != null && path.length() > 0);
|
Assert.isTrue(path != null && path.length() > 0);
|
||||||
path = '/' + path;
|
path = '/' + path;
|
||||||
|
|
||||||
DataOperation operation = SessionManager.getSession().
|
DataOperation operation = SessionManager.getSession().
|
||||||
|
|
@ -337,12 +337,12 @@ public class Utilities {
|
||||||
* @return Full path of an items on FS
|
* @return Full path of an items on FS
|
||||||
*/
|
*/
|
||||||
public static String getItemFullPath(ContentItem item) {
|
public static String getItemFullPath(ContentItem item) {
|
||||||
Assert.assertNotNull(item);
|
Assert.exists(item);
|
||||||
File root = PublishToFile.getDestination(item.getSpecificObjectType()).getFile();
|
File root = PublishToFile.getDestination(item.getSpecificObjectType()).getFile();
|
||||||
String location = getItemLocation(item);
|
String location = getItemLocation(item);
|
||||||
|
|
||||||
Assert.assertNotNull(location);
|
Assert.exists(location);
|
||||||
Assert.assertTrue(location.startsWith("/"));
|
Assert.isTrue(location.startsWith("/"));
|
||||||
|
|
||||||
return new File(root, location).getAbsolutePath();
|
return new File(root, location).getAbsolutePath();
|
||||||
}
|
}
|
||||||
|
|
@ -375,7 +375,7 @@ public class Utilities {
|
||||||
* @return The corresponding content item.
|
* @return The corresponding content item.
|
||||||
***/
|
***/
|
||||||
public static ContentItem getContentItem(BigDecimal itemID) {
|
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;
|
ContentItem item;
|
||||||
OID oid = new OID(ContentItem.BASE_DATA_OBJECT_TYPE, itemID);
|
OID oid = new OID(ContentItem.BASE_DATA_OBJECT_TYPE, itemID);
|
||||||
try {
|
try {
|
||||||
|
|
@ -477,8 +477,8 @@ public class Utilities {
|
||||||
*/
|
*/
|
||||||
// FIXME: This should be done in the MoveItemCommand [lutter]
|
// FIXME: This should be done in the MoveItemCommand [lutter]
|
||||||
public static void updateContentSection(ContentItem item, ContentSection newSection) {
|
public static void updateContentSection(ContentItem item, ContentSection newSection) {
|
||||||
Assert.assertNotNull(item);
|
Assert.exists(item);
|
||||||
Assert.assertNotNull(newSection);
|
Assert.exists(newSection);
|
||||||
|
|
||||||
ContentSection oldSection = item.getContentSection();
|
ContentSection oldSection = item.getContentSection();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,7 @@ public class ArticleImageDisplay extends ImageDisplay {
|
||||||
*/
|
*/
|
||||||
protected Article getArticle(PageState state) {
|
protected Article getArticle(PageState state) {
|
||||||
Article article = (Article) m_article.getSelectedObject(state);
|
Article article = (Article) m_article.getSelectedObject(state);
|
||||||
Assert.assertNotNull(article, "Article");
|
Assert.exists(article, "Article");
|
||||||
return article;
|
return article;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -153,7 +153,7 @@ public abstract class BaseForm extends Form
|
||||||
final int maxLength,
|
final int maxLength,
|
||||||
final boolean isRequired) {
|
final boolean isRequired) {
|
||||||
super(new TrimmedStringParameter(key));
|
super(new TrimmedStringParameter(key));
|
||||||
Assert.truth(maxLength > 0, "Max length cannot be negative");
|
Assert.isTrue(maxLength > 0, "Max length cannot be negative");
|
||||||
|
|
||||||
if (isRequired) {
|
if (isRequired) {
|
||||||
addValidationListener(NotNullValidationListener.DEFAULT);
|
addValidationListener(NotNullValidationListener.DEFAULT);
|
||||||
|
|
|
||||||
|
|
@ -166,7 +166,7 @@ public class BrowsePane extends LayoutPanel implements Resettable {
|
||||||
final PageState state = e.getPageState();
|
final PageState state = e.getPageState();
|
||||||
|
|
||||||
if (Assert.isEnabled()) {
|
if (Assert.isEnabled()) {
|
||||||
Assert.truth(m_model.isSelected(state));
|
Assert.isTrue(m_model.isSelected(state));
|
||||||
}
|
}
|
||||||
|
|
||||||
final Folder root = CMS.getContext().getContentSection
|
final Folder root = CMS.getContext().getContentSection
|
||||||
|
|
|
||||||
|
|
@ -311,7 +311,7 @@ public class ContentItemPage extends CMSPage implements ActionListener {
|
||||||
public ContentSection getContentSection(HttpServletRequest request) {
|
public ContentSection getContentSection(HttpServletRequest request) {
|
||||||
// Resets all content sections associations.
|
// Resets all content sections associations.
|
||||||
ContentSection section = super.getContentSection(request);
|
ContentSection section = super.getContentSection(request);
|
||||||
Assert.assertNotNull(section);
|
Assert.exists(section);
|
||||||
return section;
|
return section;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -132,7 +132,7 @@ public class ContentPageTable extends DataTable {
|
||||||
* {@link ContentItem#DRAFT} or {@link ContentItem#LIVE}
|
* {@link ContentItem#DRAFT} or {@link ContentItem#LIVE}
|
||||||
*/
|
*/
|
||||||
public void setContext(String context) {
|
public void setContext(String context) {
|
||||||
Assert.assertNotLocked(this);
|
Assert.isUnlocked(this);
|
||||||
m_context = context;
|
m_context = context;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -144,7 +144,7 @@ public class ContentPageTable extends DataTable {
|
||||||
* will be shown
|
* will be shown
|
||||||
*/
|
*/
|
||||||
public void setContentType(ContentType c) {
|
public void setContentType(ContentType c) {
|
||||||
Assert.assertNotLocked(this);
|
Assert.isUnlocked(this);
|
||||||
m_type = c;
|
m_type = c;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -383,7 +383,7 @@ public class ContentSectionPage extends CMSPage implements ActionListener {
|
||||||
public ContentSection getContentSection(HttpServletRequest request) {
|
public ContentSection getContentSection(HttpServletRequest request) {
|
||||||
// Resets all content sections associations.
|
// Resets all content sections associations.
|
||||||
ContentSection section = super.getContentSection(request);
|
ContentSection section = super.getContentSection(request);
|
||||||
Assert.assertNotNull(section);
|
Assert.exists(section);
|
||||||
return section;
|
return section;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -104,7 +104,7 @@ public class DefaultImageBrowserModelBuilder extends LockableImpl
|
||||||
* {@link ContentItem#DRAFT} or {@link ContentItem#LIVE}
|
* {@link ContentItem#DRAFT} or {@link ContentItem#LIVE}
|
||||||
*/
|
*/
|
||||||
public void setContext(String context) {
|
public void setContext(String context) {
|
||||||
Assert.assertNotLocked(this);
|
Assert.isUnlocked(this);
|
||||||
m_context = context;
|
m_context = context;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -144,7 +144,7 @@ public class DomainObjectRenderer extends SimpleContainer {
|
||||||
* the generated XML will be.
|
* the generated XML will be.
|
||||||
*/
|
*/
|
||||||
public void setDepth(int depth) {
|
public void setDepth(int depth) {
|
||||||
Assert.assertNotLocked(this);
|
Assert.isUnlocked(this);
|
||||||
m_depth = depth;
|
m_depth = depth;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -160,7 +160,7 @@ public class DomainObjectRenderer extends SimpleContainer {
|
||||||
* @pre model != null
|
* @pre model != null
|
||||||
*/
|
*/
|
||||||
public void setSelectionModel(DomainObjectSelectionModel model) {
|
public void setSelectionModel(DomainObjectSelectionModel model) {
|
||||||
Assert.assertNotLocked(this);
|
Assert.isUnlocked(this);
|
||||||
m_model = model;
|
m_model = model;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -329,7 +329,7 @@ public class FlatItemList extends SegmentedPanel
|
||||||
private void showHideSegments(PageState state) {
|
private void showHideSegments(PageState state) {
|
||||||
SecurityManager sm = Utilities.getSecurityManager(state);
|
SecurityManager sm = Utilities.getSecurityManager(state);
|
||||||
Folder folder = m_folder.getFolder(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
|
// MP: This should be checked on the current folder instead of just
|
||||||
// the content section.
|
// the content section.
|
||||||
|
|
|
||||||
|
|
@ -111,7 +111,7 @@ public class ImageDisplay extends SimpleComponent {
|
||||||
|
|
||||||
protected ImageAsset getImageAsset(PageState state) {
|
protected ImageAsset getImageAsset(PageState state) {
|
||||||
ImageAsset image = (ImageAsset) m_item.getSelectedObject(state);
|
ImageAsset image = (ImageAsset) m_item.getSelectedObject(state);
|
||||||
Assert.assertNotNull(image, "Image asset");
|
Assert.exists(image, "Image asset");
|
||||||
return image;
|
return image;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -58,7 +58,7 @@ public class PartySearchForm extends BaseForm {
|
||||||
public final void register(final Page page) {
|
public final void register(final Page page) {
|
||||||
super.register(page);
|
super.register(page);
|
||||||
|
|
||||||
Assert.assertTrue(page.stateContains(this));
|
Assert.isTrue(page.stateContains(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
public TextField getSearchWidget() {
|
public TextField getSearchWidget() {
|
||||||
|
|
|
||||||
|
|
@ -72,7 +72,7 @@ public class SecurityPropertyEditor extends PropertyEditor {
|
||||||
/**
|
/**
|
||||||
* Construct a new, empty <code>PropertyEditor</code>. The {@link
|
* Construct a new, empty <code>PropertyEditor</code>. The {@link
|
||||||
* #setDisplayComponent(Component)} method must be called before this
|
* #setDisplayComponent(Component)} method must be called before this
|
||||||
* component is locked.
|
* component is isLocked.
|
||||||
*/
|
*/
|
||||||
public SecurityPropertyEditor() {
|
public SecurityPropertyEditor() {
|
||||||
this(null);
|
this(null);
|
||||||
|
|
@ -130,10 +130,10 @@ public class SecurityPropertyEditor extends PropertyEditor {
|
||||||
* @pre access.getComponent() == m_forms.get(key)
|
* @pre access.getComponent() == m_forms.get(key)
|
||||||
*/
|
*/
|
||||||
public void setComponentAccess(String key, ComponentAccess access) {
|
public void setComponentAccess(String key, ComponentAccess access) {
|
||||||
Assert.assertNotLocked(this);
|
Assert.isUnlocked(this);
|
||||||
Component c = getComponent(key);
|
Component c = getComponent(key);
|
||||||
Assert.assertNotNull(c, "the specified component");
|
Assert.exists(c, "the specified component");
|
||||||
Assert.assertTrue(access.getComponent().equals(c),
|
Assert.isTrue(access.getComponent().equals(c),
|
||||||
"The specified component does not match the component that" +
|
"The specified component does not match the component that" +
|
||||||
" id already in the PropertyEditor");
|
" id already in the PropertyEditor");
|
||||||
m_accessChecks.put(key, access);
|
m_accessChecks.put(key, access);
|
||||||
|
|
|
||||||
|
|
@ -108,7 +108,7 @@ public abstract class SortableList extends List {
|
||||||
item.addAttribute("configure", "true");
|
item.addAttribute("configure", "true");
|
||||||
}
|
}
|
||||||
String key = m.getKey();
|
String key = m.getKey();
|
||||||
Assert.assertNotNull(key);
|
Assert.exists(key);
|
||||||
|
|
||||||
// Converting both keys to String for comparison
|
// Converting both keys to String for comparison
|
||||||
// since ListModel.getKey returns a String
|
// since ListModel.getKey returns a String
|
||||||
|
|
|
||||||
|
|
@ -416,7 +416,7 @@ public class TasksPanel extends CMSContainer {
|
||||||
|
|
||||||
protected BigDecimal getRootFolderID(PageState s) {
|
protected BigDecimal getRootFolderID(PageState s) {
|
||||||
ContentSection sec = (ContentSection) m_sectionSel.getSelectedObject(s);
|
ContentSection sec = (ContentSection) m_sectionSel.getSelectedObject(s);
|
||||||
Assert.assertNotNull(sec);
|
Assert.exists(sec);
|
||||||
|
|
||||||
User user = Web.getContext().getUser();
|
User user = Web.getContext().getUser();
|
||||||
if ( user != null ) {
|
if ( user != null ) {
|
||||||
|
|
@ -656,7 +656,7 @@ public class TasksPanel extends CMSContainer {
|
||||||
if (taskType.equals(CMSTaskType.DEPLOY) ) {
|
if (taskType.equals(CMSTaskType.DEPLOY) ) {
|
||||||
tabNumber = ContentItemPage.PUBLISHING_TAB;
|
tabNumber = ContentItemPage.PUBLISHING_TAB;
|
||||||
} else {
|
} else {
|
||||||
// see if item is locked; if not, lock
|
// see if item is isLocked; if not, lock
|
||||||
if ( !task.isLocked() ) {
|
if ( !task.isLocked() ) {
|
||||||
task.lock(user);
|
task.lock(user);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -416,13 +416,13 @@ public class ArticleImage extends SimpleContainer implements AuthoringStepCompon
|
||||||
|
|
||||||
private ImageAsset getImageAsset(PageState state) {
|
private ImageAsset getImageAsset(PageState state) {
|
||||||
ImageAsset image = (ImageAsset) m_assetsWithImage.getSelectedObject(state);
|
ImageAsset image = (ImageAsset) m_assetsWithImage.getSelectedObject(state);
|
||||||
Assert.assertNotNull(image, "Image asset");
|
Assert.exists(image, "Image asset");
|
||||||
return image;
|
return image;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Article getArticle(PageState state) {
|
private Article getArticle(PageState state) {
|
||||||
Article article = (Article) m_articleWithImage.getSelectedObject(state);
|
Article article = (Article) m_articleWithImage.getSelectedObject(state);
|
||||||
Assert.assertNotNull(article, "Article");
|
Assert.exists(article, "Article");
|
||||||
return article;
|
return article;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -236,8 +236,8 @@ public class AuthoringKitWizard extends LayoutPanel implements Resettable {
|
||||||
|
|
||||||
final AuthoringStepCollection steps = m_kit.getSteps();
|
final AuthoringStepCollection steps = m_kit.getSteps();
|
||||||
|
|
||||||
if (Assert.isAssertEnabled()) {
|
if (Assert.isEnabled()) {
|
||||||
Assert.assertTrue(!steps.isEmpty(),
|
Assert.isTrue(!steps.isEmpty(),
|
||||||
"The authoring kit for " + type.getID() + " " +
|
"The authoring kit for " + type.getID() + " " +
|
||||||
"(java class " + type.getClassName() + ") " +
|
"(java class " + type.getClassName() + ") " +
|
||||||
"has no steps.");
|
"has no steps.");
|
||||||
|
|
|
||||||
|
|
@ -110,7 +110,7 @@ public abstract class BasicPageForm extends BasicItemForm {
|
||||||
* ItemSelectionModel
|
* ItemSelectionModel
|
||||||
*/
|
*/
|
||||||
public ContentPage initBasicWidgets(FormSectionEvent e) {
|
public ContentPage initBasicWidgets(FormSectionEvent e) {
|
||||||
Assert.assertNotNull(getItemSelectionModel());
|
Assert.exists(getItemSelectionModel());
|
||||||
|
|
||||||
FormData data = e.getFormData();
|
FormData data = e.getFormData();
|
||||||
PageState state = e.getPageState();
|
PageState state = e.getPageState();
|
||||||
|
|
@ -142,7 +142,7 @@ public abstract class BasicPageForm extends BasicItemForm {
|
||||||
* process listener
|
* process listener
|
||||||
*/
|
*/
|
||||||
public ContentPage processBasicWidgets(FormSectionEvent e) {
|
public ContentPage processBasicWidgets(FormSectionEvent e) {
|
||||||
Assert.assertNotNull(getItemSelectionModel());
|
Assert.exists(getItemSelectionModel());
|
||||||
|
|
||||||
FormData data = e.getFormData();
|
FormData data = e.getFormData();
|
||||||
PageState state = e.getPageState();
|
PageState state = e.getPageState();
|
||||||
|
|
@ -176,7 +176,7 @@ public abstract class BasicPageForm extends BasicItemForm {
|
||||||
throws FormProcessException {
|
throws FormProcessException {
|
||||||
|
|
||||||
ItemSelectionModel m = getItemSelectionModel();
|
ItemSelectionModel m = getItemSelectionModel();
|
||||||
Assert.assertNotNull(m);
|
Assert.exists(m);
|
||||||
|
|
||||||
ContentPage item = null;
|
ContentPage item = null;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,7 @@ public class ItemCategoryStep extends SimpleContainer
|
||||||
m_extensionForms = extension.getForm();
|
m_extensionForms = extension.getForm();
|
||||||
int nSummaries = m_extensionSummaries.length;
|
int nSummaries = m_extensionSummaries.length;
|
||||||
int nForms= m_extensionForms.length;
|
int nForms= m_extensionForms.length;
|
||||||
Assert.truth(nSummaries==nForms, "invalid CategoryStep extension");
|
Assert.isTrue(nSummaries==nForms, "invalid CategoryStep extension");
|
||||||
m_extensionsCount = nForms;
|
m_extensionsCount = nForms;
|
||||||
for (int i=0;i<m_extensionsCount;i++) {
|
for (int i=0;i<m_extensionsCount;i++) {
|
||||||
m_extensionSummaries[i].addCompletionListener(new ExtensionListener(i));
|
m_extensionSummaries[i].addCompletionListener(new ExtensionListener(i));
|
||||||
|
|
|
||||||
|
|
@ -130,7 +130,7 @@ public class PageCreate extends BasicPageForm
|
||||||
// Validate: ensure name uniqueness
|
// Validate: ensure name uniqueness
|
||||||
public void validate(FormSectionEvent e) throws FormProcessException {
|
public void validate(FormSectionEvent e) throws FormProcessException {
|
||||||
Folder f = m_parent.getFolder(e.getPageState());
|
Folder f = m_parent.getFolder(e.getPageState());
|
||||||
Assert.assertNotNull(f);
|
Assert.exists(f);
|
||||||
validateNameUniqueness(f, e);
|
validateNameUniqueness(f, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -391,7 +391,7 @@ public class PageCreateDynamic extends FormSection
|
||||||
*/
|
*/
|
||||||
public void validate(FormSectionEvent e) throws FormProcessException {
|
public void validate(FormSectionEvent e) throws FormProcessException {
|
||||||
Folder f = m_parent.getFolder(e.getPageState());
|
Folder f = m_parent.getFolder(e.getPageState());
|
||||||
Assert.assertNotNull(f);
|
Assert.exists(f);
|
||||||
validateNameUniqueness(f, e);
|
validateNameUniqueness(f, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -141,7 +141,7 @@ public class PageEdit extends SimpleEditStep {
|
||||||
|
|
||||||
ContentItem item =
|
ContentItem item =
|
||||||
(ContentItem) getItemSelectionModel().getSelectedObject(state);
|
(ContentItem) getItemSelectionModel().getSelectedObject(state);
|
||||||
Assert.assertNotNull(item);
|
Assert.exists(item);
|
||||||
|
|
||||||
String newName = (String) data.get(BasicPageForm.NAME);
|
String newName = (String) data.get(BasicPageForm.NAME);
|
||||||
String oldName = item.getName();
|
String oldName = item.getName();
|
||||||
|
|
|
||||||
|
|
@ -82,11 +82,10 @@ import org.apache.log4j.Logger;
|
||||||
*
|
*
|
||||||
* @author Xixi D'Moon (xdmoon@arsdigita.com)
|
* @author Xixi D'Moon (xdmoon@arsdigita.com)
|
||||||
* @version $Revision: #21 $ $DateTime: 2004/08/17 23:15:09 $
|
* @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 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 =
|
private static Logger s_log =
|
||||||
Logger.getLogger(PageEditDynamic.class.getName());
|
Logger.getLogger(PageEditDynamic.class.getName());
|
||||||
|
|
||||||
|
|
@ -588,7 +587,7 @@ public class PageEditDynamic extends SecurityPropertyEditor {
|
||||||
|
|
||||||
ContentItem item =
|
ContentItem item =
|
||||||
(ContentItem) this.getItemSelectionModel().getSelectedObject(state);
|
(ContentItem) this.getItemSelectionModel().getSelectedObject(state);
|
||||||
Assert.assertNotNull(item);
|
Assert.exists(item);
|
||||||
|
|
||||||
if (m_isPrimaryStep) {
|
if (m_isPrimaryStep) {
|
||||||
String newName = (String) data.get(BasicPageForm.NAME);
|
String newName = (String) data.get(BasicPageForm.NAME);
|
||||||
|
|
|
||||||
|
|
@ -29,11 +29,10 @@ import com.arsdigita.toolbox.ui.DomainObjectPropertySheet;
|
||||||
*
|
*
|
||||||
* @author Xixi D'Moon (xdmoon@arsdigita.com)
|
* @author Xixi D'Moon (xdmoon@arsdigita.com)
|
||||||
* @version $Revision: #6 $ $DateTime: 2004/08/17 23:15:09 $
|
* @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 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
|
* Construct a new SecondaryPageEditDynamic component
|
||||||
|
|
|
||||||
|
|
@ -121,7 +121,7 @@ public class TextPageBody extends TextAssetBody {
|
||||||
*/
|
*/
|
||||||
protected void updateTextAsset(PageState s, TextAsset a) {
|
protected void updateTextAsset(PageState s, TextAsset a) {
|
||||||
TextPage t = getTextPage(s);
|
TextPage t = getTextPage(s);
|
||||||
Assert.assertNotNull(t);
|
Assert.exists(t);
|
||||||
// no need - cg. Text doesn't need a security context,
|
// no need - cg. Text doesn't need a security context,
|
||||||
// and ownership of text is recorded in text_pages
|
// and ownership of text is recorded in text_pages
|
||||||
|
|
||||||
|
|
@ -154,7 +154,7 @@ public class TextPageBody extends TextAssetBody {
|
||||||
TextPage t = (TextPage)
|
TextPage t = (TextPage)
|
||||||
((ItemSelectionModel)getSingleSelectionModel())
|
((ItemSelectionModel)getSingleSelectionModel())
|
||||||
.getSelectedObject(s);
|
.getSelectedObject(s);
|
||||||
Assert.assertNotNull(t);
|
Assert.exists(t);
|
||||||
return t.getTextAsset();
|
return t.getTextAsset();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,7 @@ public class KitInfo extends CMSContainer {
|
||||||
* Sets the m_authoringKit RequestLocal variable.
|
* Sets the m_authoringKit RequestLocal variable.
|
||||||
*/
|
*/
|
||||||
private void initializeAuthoringKit(PageState state) {
|
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());
|
BigDecimal typeId = new BigDecimal(m_types.getSelectedKey(state).toString());
|
||||||
ContentType type = new ContentType(typeId);
|
ContentType type = new ContentType(typeId);
|
||||||
|
|
@ -137,7 +137,7 @@ public class KitInfo extends CMSContainer {
|
||||||
private boolean m_locked;
|
private boolean m_locked;
|
||||||
|
|
||||||
public TableModel makeModel(final Table t, final PageState s) {
|
public TableModel makeModel(final Table t, final PageState s) {
|
||||||
Assert.assertTrue(m_types.isSelected(s));
|
Assert.isTrue(m_types.isSelected(s));
|
||||||
|
|
||||||
return new TableModel() {
|
return new TableModel() {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@ final class CategoryAddForm extends BaseCategoryForm {
|
||||||
final String url = (String) m_url.getValue(state);
|
final String url = (String) m_url.getValue(state);
|
||||||
final String isAbstract = (String) m_isAbstract.getValue(state);
|
final String isAbstract = (String) m_isAbstract.getValue(state);
|
||||||
|
|
||||||
Assert.assertNotNull(parent, "Category parent");
|
Assert.exists(parent, "Category parent");
|
||||||
|
|
||||||
if (s_log.isDebugEnabled()) {
|
if (s_log.isDebugEnabled()) {
|
||||||
s_log.debug("Using parent category " + parent + " to " +
|
s_log.debug("Using parent category " + parent + " to " +
|
||||||
|
|
|
||||||
|
|
@ -114,7 +114,7 @@ public class CategoryItemsBrowser extends Grid {
|
||||||
* {@link com.arsdigita.cms.ContentItem#DRAFT} or {@link com.arsdigita.cms.ContentItem#LIVE}
|
* {@link com.arsdigita.cms.ContentItem#DRAFT} or {@link com.arsdigita.cms.ContentItem#LIVE}
|
||||||
*/
|
*/
|
||||||
public void setContext(String context) {
|
public void setContext(String context) {
|
||||||
Assert.assertNotLocked(this);
|
Assert.isUnlocked(this);
|
||||||
m_context = context;
|
m_context = context;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -167,7 +167,7 @@ public class CategoryItemsBrowser extends Grid {
|
||||||
|
|
||||||
DomainObject d = DomainObjectFactory.newInstance((DataObject)value);
|
DomainObject d = DomainObjectFactory.newInstance((DataObject)value);
|
||||||
|
|
||||||
Assert.assertTrue(d instanceof ContentPage);
|
Assert.isTrue(d instanceof ContentPage);
|
||||||
ContentPage p = (ContentPage)d;
|
ContentPage p = (ContentPage)d;
|
||||||
|
|
||||||
CMSContainer box = new CMSContainer();
|
CMSContainer box = new CMSContainer();
|
||||||
|
|
|
||||||
|
|
@ -204,7 +204,7 @@ public class IndexItemSelectionForm extends CMSForm {
|
||||||
*/
|
*/
|
||||||
protected Category getCategory(PageState state) {
|
protected Category getCategory(PageState state) {
|
||||||
Category category = m_category.getCategory(state);
|
Category category = m_category.getCategory(state);
|
||||||
Assert.assertNotNull(category);
|
Assert.exists(category);
|
||||||
return category;
|
return category;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -104,7 +104,7 @@ public class OrderedCategorizedObjectsList extends CategorizedObjectsList {
|
||||||
item.addAttribute("configure", "true");
|
item.addAttribute("configure", "true");
|
||||||
|
|
||||||
String key = m.getKey();
|
String key = m.getKey();
|
||||||
Assert.assertNotNull(key);
|
Assert.exists(key);
|
||||||
|
|
||||||
// Converting both keys to String for comparison
|
// Converting both keys to String for comparison
|
||||||
// since ListModel.getKey returns a String
|
// since ListModel.getKey returns a String
|
||||||
|
|
|
||||||
|
|
@ -186,7 +186,7 @@ public class FolderBrowser extends Table {
|
||||||
|
|
||||||
setEmptyView(new Label(globalize("cms.ui.folder.no_items")));
|
setEmptyView(new Label(globalize("cms.ui.folder.no_items")));
|
||||||
|
|
||||||
Assert.assertNotNull( m_currentFolder.getStateParameter() );
|
Assert.exists( m_currentFolder.getStateParameter() );
|
||||||
}
|
}
|
||||||
|
|
||||||
public void register(Page p) {
|
public void register(Page p) {
|
||||||
|
|
@ -209,7 +209,7 @@ public class FolderBrowser extends Table {
|
||||||
private void showHideFolderActions(PageState state) {
|
private void showHideFolderActions(PageState state) {
|
||||||
SecurityManager sm = Utilities.getSecurityManager(state);
|
SecurityManager sm = Utilities.getSecurityManager(state);
|
||||||
Folder folder = (Folder) m_currentFolder.getSelectedObject(state);
|
Folder folder = (Folder) m_currentFolder.getSelectedObject(state);
|
||||||
Assert.assertNotNull(folder);
|
Assert.exists(folder);
|
||||||
|
|
||||||
boolean canDelete =
|
boolean canDelete =
|
||||||
sm.canAccess(state.getRequest(), SecurityManager.DELETE_ITEM, folder);
|
sm.canAccess(state.getRequest(), SecurityManager.DELETE_ITEM, folder);
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@ public abstract class FolderForm extends BasicItemForm{
|
||||||
*/
|
*/
|
||||||
public void validate(FormSectionEvent e) throws FormProcessException {
|
public void validate(FormSectionEvent e) throws FormProcessException {
|
||||||
Folder folder = (Folder) m_currentFolder.getSelectedObject(e.getPageState());
|
Folder folder = (Folder) m_currentFolder.getSelectedObject(e.getPageState());
|
||||||
Assert.assertNotNull(folder);
|
Assert.exists(folder);
|
||||||
validateNameUniqueness(folder, e);
|
validateNameUniqueness(folder, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -296,7 +296,7 @@ public class FolderItemPane extends SegmentedPanel
|
||||||
private void showHideSegments(PageState state) {
|
private void showHideSegments(PageState state) {
|
||||||
SecurityManager sm = Utilities.getSecurityManager(state);
|
SecurityManager sm = Utilities.getSecurityManager(state);
|
||||||
Folder folder = (Folder) m_folderSel.getSelectedObject(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
|
// MP: This should be checked on the current folder instead of just
|
||||||
// the content section.
|
// the content section.
|
||||||
|
|
|
||||||
|
|
@ -204,7 +204,7 @@ public class FolderManipulator extends SimpleContainer
|
||||||
}
|
}
|
||||||
|
|
||||||
final ContentItem newItem = item.copy(target, true);
|
final ContentItem newItem = item.copy(target, true);
|
||||||
Assert.equal(target, newItem.getParent());
|
Assert.isEqual(target, newItem.getParent());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ public abstract class ContentItemRequestLocal extends RequestLocal {
|
||||||
public final ContentItem getContentItem(final PageState state) {
|
public final ContentItem getContentItem(final PageState state) {
|
||||||
final ContentItem item = (ContentItem) get(state);
|
final ContentItem item = (ContentItem) get(state);
|
||||||
|
|
||||||
Assert.assertNotNull(item, "ContentItem item");
|
Assert.exists(item, "ContentItem item");
|
||||||
|
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -328,7 +328,7 @@ public class Summary extends CMSContainer {
|
||||||
*/
|
*/
|
||||||
protected ContentItem getContentItem(PageState state) {
|
protected ContentItem getContentItem(PageState state) {
|
||||||
ContentItem item = (ContentItem) m_item.getSelectedObject(state);
|
ContentItem item = (ContentItem) m_item.getSelectedObject(state);
|
||||||
Assert.assertNotNull(item);
|
Assert.exists(item);
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -389,7 +389,7 @@ class ItemLifecycleSelectForm extends BaseForm {
|
||||||
|
|
||||||
final BigDecimal defID = (BigDecimal) m_cycleSelect.getValue
|
final BigDecimal defID = (BigDecimal) m_cycleSelect.getValue
|
||||||
(state);
|
(state);
|
||||||
Assert.assertNotNull(defID);
|
Assert.exists(defID);
|
||||||
final LifecycleDefinition cycleDef = new LifecycleDefinition
|
final LifecycleDefinition cycleDef = new LifecycleDefinition
|
||||||
(defID);
|
(defID);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@ class PhaseTableModelBuilder extends LockableImpl
|
||||||
}
|
}
|
||||||
|
|
||||||
public final Object getElementAt(int column) {
|
public final Object getElementAt(int column) {
|
||||||
Assert.assertNotNull(m_phase, "PhaseDefinition m_phase");
|
Assert.exists(m_phase, "PhaseDefinition m_phase");
|
||||||
|
|
||||||
switch (column) {
|
switch (column) {
|
||||||
case 0:
|
case 0:
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ public class ObjectAddAdmin extends UserAddForm {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected DataQuery makeQuery(PageState s) {
|
protected DataQuery makeQuery(PageState s) {
|
||||||
Assert.truth(m_object.isSelected(s));
|
Assert.isTrue(m_object.isSelected(s));
|
||||||
|
|
||||||
DataQuery query = SessionManager.getSession().retrieveQuery
|
DataQuery query = SessionManager.getSession().retrieveQuery
|
||||||
("com.arsdigita.cms.objectAdminUserSearch");
|
("com.arsdigita.cms.objectAdminUserSearch");
|
||||||
|
|
@ -96,7 +96,7 @@ public class ObjectAddAdmin extends UserAddForm {
|
||||||
public void process(FormSectionEvent event) throws FormProcessException {
|
public void process(FormSectionEvent event) throws FormProcessException {
|
||||||
FormData data = event.getFormData();
|
FormData data = event.getFormData();
|
||||||
PageState state = event.getPageState();
|
PageState state = event.getPageState();
|
||||||
Assert.truth(m_object.isSelected(state));
|
Assert.isTrue(m_object.isSelected(state));
|
||||||
|
|
||||||
SecurityManager sm = Utilities.getSecurityManager(state);
|
SecurityManager sm = Utilities.getSecurityManager(state);
|
||||||
boolean isAdmin =
|
boolean isAdmin =
|
||||||
|
|
|
||||||
|
|
@ -73,7 +73,7 @@ class RoleAdminAddForm extends UserAddForm {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected DataQuery makeQuery(PageState s) {
|
protected DataQuery makeQuery(PageState s) {
|
||||||
Assert.truth(m_roles.isSelected(s));
|
Assert.isTrue(m_roles.isSelected(s));
|
||||||
|
|
||||||
Session session = SessionManager.getSession();
|
Session session = SessionManager.getSession();
|
||||||
|
|
||||||
|
|
@ -107,7 +107,7 @@ class RoleAdminAddForm extends UserAddForm {
|
||||||
public void process(FormSectionEvent event) throws FormProcessException {
|
public void process(FormSectionEvent event) throws FormProcessException {
|
||||||
FormData data = event.getFormData();
|
FormData data = event.getFormData();
|
||||||
PageState state = event.getPageState();
|
PageState state = event.getPageState();
|
||||||
Assert.truth(m_roles.isSelected(state));
|
Assert.isTrue(m_roles.isSelected(state));
|
||||||
|
|
||||||
String[] users = (String[]) data.get("users");
|
String[] users = (String[]) data.get("users");
|
||||||
if ( users != null ) {
|
if ( users != null ) {
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,7 @@ class RolePartyAddForm extends PartyAddForm {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected DataQuery makeQuery(PageState s) {
|
protected DataQuery makeQuery(PageState s) {
|
||||||
Assert.truth(m_roles.isSelected(s));
|
Assert.isTrue(m_roles.isSelected(s));
|
||||||
|
|
||||||
Session session = SessionManager.getSession();
|
Session session = SessionManager.getSession();
|
||||||
|
|
||||||
|
|
@ -107,7 +107,7 @@ class RolePartyAddForm extends PartyAddForm {
|
||||||
public void process(FormSectionEvent event) throws FormProcessException {
|
public void process(FormSectionEvent event) throws FormProcessException {
|
||||||
FormData data = event.getFormData();
|
FormData data = event.getFormData();
|
||||||
PageState state = event.getPageState();
|
PageState state = event.getPageState();
|
||||||
Assert.truth(m_roles.isSelected(state));
|
Assert.isTrue(m_roles.isSelected(state));
|
||||||
|
|
||||||
String[] parties = (String[]) data.get("parties");
|
String[] parties = (String[]) data.get("parties");
|
||||||
s_log.debug("PARTIES = " + parties);
|
s_log.debug("PARTIES = " + parties);
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ public abstract class RoleRequestLocal extends RequestLocal {
|
||||||
public final Role getRole(final PageState state) {
|
public final Role getRole(final PageState state) {
|
||||||
final Role role = (Role) get(state);
|
final Role role = (Role) get(state);
|
||||||
|
|
||||||
Assert.assertNotNull(role, "Role role");
|
Assert.exists(role, "Role role");
|
||||||
|
|
||||||
return role;
|
return role;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -131,7 +131,7 @@ public class PartyInfo extends SimpleContainer {
|
||||||
* @pre ( state != null )
|
* @pre ( state != null )
|
||||||
*/
|
*/
|
||||||
protected BigDecimal getPartyId(PageState state) {
|
protected BigDecimal getPartyId(PageState state) {
|
||||||
Assert.truth(m_parties.isSelected(state));
|
Assert.isTrue(m_parties.isSelected(state));
|
||||||
String partyId = (String) m_parties.getSelectedKey(state);
|
String partyId = (String) m_parties.getSelectedKey(state);
|
||||||
return new BigDecimal(partyId);
|
return new BigDecimal(partyId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -132,7 +132,7 @@ public class CategoryTemplates extends CMSContainer {
|
||||||
PageState s = e.getPageState();
|
PageState s = e.getPageState();
|
||||||
Label targetLabel = (Label)e.getTarget();
|
Label targetLabel = (Label)e.getTarget();
|
||||||
Category category = m_category.getCategory(s);
|
Category category = m_category.getCategory(s);
|
||||||
Assert.assertNotNull(category, "category");
|
Assert.exists(category, "category");
|
||||||
targetLabel.setLabel("Assign a template to " + category.getName());
|
targetLabel.setLabel("Assign a template to " + category.getName());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -254,11 +254,11 @@ public class CategoryTemplates extends CMSContainer {
|
||||||
*/
|
*/
|
||||||
protected TemplateCollection getTemplateCollection(PageState s) {
|
protected TemplateCollection getTemplateCollection(PageState s) {
|
||||||
ContentSection sec = ContentSectionDispatcher.getContentSection(s.getRequest());
|
ContentSection sec = ContentSectionDispatcher.getContentSection(s.getRequest());
|
||||||
Assert.assertNotNull(sec, "content section");
|
Assert.exists(sec, "content section");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
ContentItem item = m_category.getSelectedItem(s);
|
ContentItem item = m_category.getSelectedItem(s);
|
||||||
Assert.assertNotNull(item, "item");
|
Assert.exists(item, "item");
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ContentType type = getContentType(s);
|
ContentType type = getContentType(s);
|
||||||
|
|
@ -277,7 +277,7 @@ public class CategoryTemplates extends CMSContainer {
|
||||||
*/
|
*/
|
||||||
protected ContentType getContentType(PageState s) {
|
protected ContentType getContentType(PageState s) {
|
||||||
ContentType type = (ContentType)m_type.getSelectedObject(s);
|
ContentType type = (ContentType)m_type.getSelectedObject(s);
|
||||||
Assert.assertNotNull(type, "content type");
|
Assert.exists(type, "content type");
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -90,7 +90,7 @@ public class ItemTemplates extends SecurityPropertyEditor {
|
||||||
PageState s = e.getPageState();
|
PageState s = e.getPageState();
|
||||||
Label targetLabel = (Label)e.getTarget();
|
Label targetLabel = (Label)e.getTarget();
|
||||||
ContentPage item = (ContentPage)m_itemModel.getSelectedItem(s);
|
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());
|
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();
|
ContentSection sec = CMS.getContext().getContentSection();
|
||||||
|
|
||||||
ContentItem item = m_itemModel.getSelectedItem(s);
|
ContentItem item = m_itemModel.getSelectedItem(s);
|
||||||
Assert.assertNotNull(item, "item");
|
Assert.exists(item, "item");
|
||||||
|
|
||||||
ContentType type = item.getContentType();
|
ContentType type = item.getContentType();
|
||||||
Assert.assertNotNull(type, "content type");
|
Assert.exists(type, "content type");
|
||||||
|
|
||||||
MimeType mimeType = getMimeType(s);
|
MimeType mimeType = getMimeType(s);
|
||||||
TemplateCollection c =
|
TemplateCollection c =
|
||||||
|
|
@ -215,7 +215,7 @@ public class ItemTemplates extends SecurityPropertyEditor {
|
||||||
*/
|
*/
|
||||||
protected String getUseContext(PageState s) {
|
protected String getUseContext(PageState s) {
|
||||||
String c = (String)m_contextModel.getSelectedKey(s);
|
String c = (String)m_contextModel.getSelectedKey(s);
|
||||||
Assert.assertNotNull(c, "use context");
|
Assert.exists(c, "use context");
|
||||||
return ItemTemplatesListing.getUseContextFromKey(c);
|
return ItemTemplatesListing.getUseContextFromKey(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -229,7 +229,7 @@ public class ItemTemplates extends SecurityPropertyEditor {
|
||||||
*/
|
*/
|
||||||
public void assignTemplate(PageState s, Template t) {
|
public void assignTemplate(PageState s, Template t) {
|
||||||
ContentItem item = m_itemModel.getSelectedItem(s);
|
ContentItem item = m_itemModel.getSelectedItem(s);
|
||||||
Assert.assertNotNull(item, "item");
|
Assert.exists(item, "item");
|
||||||
|
|
||||||
TemplateManagerFactory.getInstance()
|
TemplateManagerFactory.getInstance()
|
||||||
.addTemplate(item, t, getUseContext(s));
|
.addTemplate(item, t, getUseContext(s));
|
||||||
|
|
|
||||||
|
|
@ -299,7 +299,7 @@ public abstract class ItemTemplatesListing extends TemplatesListing {
|
||||||
|
|
||||||
ContentSection sec = CMS.getContext().getContentSection();
|
ContentSection sec = CMS.getContext().getContentSection();
|
||||||
ContentItem item = m_itemSel.getSelectedItem(state);
|
ContentItem item = m_itemSel.getSelectedItem(state);
|
||||||
Assert.assertNotNull(item, "item");
|
Assert.exists(item, "item");
|
||||||
|
|
||||||
ItemResolver res = sec.getItemResolver();
|
ItemResolver res = sec.getItemResolver();
|
||||||
String url = res.generateItemURL(state, item, sec,
|
String url = res.generateItemURL(state, item, sec,
|
||||||
|
|
|
||||||
|
|
@ -152,7 +152,7 @@ public class TemplateEdit extends SimpleEditStep {
|
||||||
public Template getTemplate(PageState state) {
|
public Template getTemplate(PageState state) {
|
||||||
Template t =
|
Template t =
|
||||||
(Template) getItemSelectionModel().getSelectedObject(state);
|
(Template) getItemSelectionModel().getSelectedObject(state);
|
||||||
Assert.assertNotNull(t);
|
Assert.exists(t);
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -165,8 +165,8 @@ abstract class TemplatesListing extends DataTable {
|
||||||
* The "remove" column will contain the current template as the value.
|
* The "remove" column will contain the current template as the value.
|
||||||
*/
|
*/
|
||||||
protected final void addRemoveColumn() {
|
protected final void addRemoveColumn() {
|
||||||
Assert.assertNotLocked(this);
|
Assert.isUnlocked(this);
|
||||||
Assert.assertTrue(m_removeCol == null,
|
Assert.isTrue(m_removeCol == null,
|
||||||
"The \"remove\" column already exists");
|
"The \"remove\" column already exists");
|
||||||
|
|
||||||
m_removeCol = addColumn("Remove", TemplateCollection.TEMPLATE, false,
|
m_removeCol = addColumn("Remove", TemplateCollection.TEMPLATE, false,
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,7 @@ public class AddContentItemElement extends ElementAddForm {
|
||||||
(BigDecimal) m_itemTypeSelect.getValue(state);
|
(BigDecimal) m_itemTypeSelect.getValue(state);
|
||||||
|
|
||||||
ContentType itemType = null;
|
ContentType itemType = null;
|
||||||
Assert.assertNotNull(itemTypeID, "itemTypeID");
|
Assert.exists(itemTypeID, "itemTypeID");
|
||||||
try {
|
try {
|
||||||
itemType = new ContentType(itemTypeID);
|
itemType = new ContentType(itemTypeID);
|
||||||
} catch (DataObjectNotFoundException ex) {
|
} catch (DataObjectNotFoundException ex) {
|
||||||
|
|
|
||||||
|
|
@ -216,7 +216,7 @@ public abstract class ElementAddForm extends CMSForm {
|
||||||
protected ContentType getContentType(PageState state) {
|
protected ContentType getContentType(PageState state) {
|
||||||
|
|
||||||
ContentType t = (ContentType)m_types.getSelectedObject(state);
|
ContentType t = (ContentType)m_types.getSelectedObject(state);
|
||||||
Assert.assertNotNull(t, "content type");
|
Assert.exists(t, "content type");
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -112,7 +112,7 @@ public class DefaultTableCellRenderer extends LockableImpl
|
||||||
* @pre ! isLocked()
|
* @pre ! isLocked()
|
||||||
*/
|
*/
|
||||||
public void setActive(boolean v) {
|
public void setActive(boolean v) {
|
||||||
Assert.assertNotLocked(this);
|
Assert.isUnlocked(this);
|
||||||
m_active = v;
|
m_active = v;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ public abstract class TaskRequestLocal extends RequestLocal {
|
||||||
public final CMSTask getTask(final PageState state) {
|
public final CMSTask getTask(final PageState state) {
|
||||||
final CMSTask task = (CMSTask) get(state);
|
final CMSTask task = (CMSTask) get(state);
|
||||||
|
|
||||||
Assert.assertNotNull(task, "CMSTask task");
|
Assert.exists(task, "CMSTask task");
|
||||||
|
|
||||||
return task;
|
return task;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@ public class LanguageUtil {
|
||||||
|
|
||||||
/** Get the comma separated list of all supported languages */
|
/** Get the comma separated list of all supported languages */
|
||||||
public static String getSupportedLanguages() {
|
public static String getSupportedLanguages() {
|
||||||
Assert.assertNotNull(s_languages , "supported languages not set");
|
Assert.exists(s_languages , "supported languages not set");
|
||||||
return s_languages;
|
return s_languages;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -252,7 +252,7 @@ public class CMSTask extends UserTask {
|
||||||
|
|
||||||
protected Message generateMessage(String operation, Party sender) {
|
protected Message generateMessage(String operation, Party sender) {
|
||||||
ContentItem item = getItem();
|
ContentItem item = getItem();
|
||||||
Assert.assertNotNull(item, "item associated with this CMSTask");
|
Assert.exists(item, "item associated with this CMSTask");
|
||||||
|
|
||||||
String authoringURL = getAuthoringURL(item);
|
String authoringURL = getAuthoringURL(item);
|
||||||
String fullURL = getTaskType().getURLGenerator(operation, item).generateURL(item.getID(), getID());
|
String fullURL = getTaskType().getURLGenerator(operation, item).generateURL(item.getID(), getID());
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,7 @@ public class UnfinishedTaskNotifier extends TimerTask {
|
||||||
int notificationInterval,
|
int notificationInterval,
|
||||||
int maxNotifications) {
|
int maxNotifications) {
|
||||||
super();
|
super();
|
||||||
Assert.assertNotNull(section, "the ContentSection to send notifications for");
|
Assert.exists(section, "the ContentSection to send notifications for");
|
||||||
m_sectionID = section.getID();
|
m_sectionID = section.getID();
|
||||||
m_unfinishedInterval = (long) unfinishedInterval * 60 * 60 * 1000;
|
m_unfinishedInterval = (long) unfinishedInterval * 60 * 60 * 1000;
|
||||||
m_notificationInterval = (long) notificationInterval * 60 * 60 * 1000;
|
m_notificationInterval = (long) notificationInterval * 60 * 60 * 1000;
|
||||||
|
|
|
||||||
|
|
@ -29,9 +29,9 @@ import java.util.Date;
|
||||||
*
|
*
|
||||||
* @author Joseph Bank
|
* @author Joseph Bank
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
|
* @version $Id: Audited.java 287 2005-02-22 00:29:02Z sskracic $
|
||||||
**/
|
**/
|
||||||
public interface Audited {
|
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.
|
* Gets the user who created the object. May be null.
|
||||||
|
|
|
||||||
|
|
@ -39,12 +39,11 @@ import java.util.Date;
|
||||||
*
|
*
|
||||||
* @author Joseph Bank
|
* @author Joseph Bank
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
|
* @version $Id: AuditedACSObject.java 287 2005-02-22 00:29:02Z sskracic $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public abstract class AuditedACSObject extends ACSObject implements Audited {
|
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.
|
* Audit trail.
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -35,11 +35,11 @@ import org.apache.log4j.Logger;
|
||||||
*
|
*
|
||||||
* @author Joseph Bank
|
* @author Joseph Bank
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
|
* @version $Id: AuditingObserver.java 287 2005-02-22 00:29:02Z sskracic $
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class AuditingObserver implements DomainObjectObserver {
|
public class AuditingObserver implements DomainObjectObserver {
|
||||||
public static final Logger s_log = Logger.getLogger(AuditingObserver.class);
|
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 BasicAuditTrail m_audit_trail;
|
||||||
private AuditingSaveInfo m_save_info = null;
|
private AuditingSaveInfo m_save_info = null;
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue