2. Versuch. Warum hat er das letzte Mal nicht eingecheckt?

* Angepaßte CreatePage, so daß die neuen Elemente nicht direkt bei der Erstellung abgefragt werden
* AddElement wurde so angepaßt, daß man nur optionale Elemente anlegen kann
* Mist.remove funktionsfähig gemacht
* ObjectType um remove-Methode erweiterert


Jetzt sollte der UDCT soweit funktionsfähig sein, daß er verwendbar wird. Es lassen sich neue Elemente ablegen und löschen. Es lassen sich neue CT anlegen und löschen.

git-svn-id: https://svn.libreccm.org/ccm/trunk@346 8810af33-2d31-482b-a856-94f89814c4df
master
quasi 2010-02-14 07:24:23 +00:00
parent 0443d8b1dc
commit a66e71d2a0
2 changed files with 34 additions and 32 deletions

View File

@ -216,7 +216,10 @@ public class PageCreateDynamic extends FormSection
if (m_parentComponent != null ) {
super.add(m_parentComponent);
addWidgets();
// Quasimodo BEGIN
// see comment for the addWidget method
// addWidgets();
// Quasimodo END
getSaveCancelSection().getSaveButton().setButtonLabel("Create");
//Form internalForm = getForm();
@ -240,6 +243,12 @@ public class PageCreateDynamic extends FormSection
* the persistent widgets stored in the persistent form
* associated with this content item
*/
/* Quasimodo BEGIN
* disabled to get an ordinary create step. This method will ask
* for ALL additional fields of a UDCT regardless if it is mandatory or not.
* So, to prevent this I have modified the UDCT-Widgets to allway be optional
* as the hardcoded content types and this method becomes obsolete.
protected void addWidgets() {
PersistentForm pForm = null;
try {
@ -317,7 +326,8 @@ public class PageCreateDynamic extends FormSection
}
add(thisSection, ColumnPanel.FULL_WIDTH);
}
* Quasimodo END
*/
/**
* @return the item selection model used in this form

View File

@ -28,11 +28,9 @@ import java.util.HashMap;
* @author Rafael H. Schloming <rhs@mit.edu>
* @version $Revision: #7 $ $Date: 2004/08/16 $
**/
class Mist extends AbstractList {
public final static String versionId = "$Id: Mist.java 738 2005-09-01 12:36:52Z sskracic $ by $Author: sskracic $, $DateTime: 2004/08/16 18:10:38 $";
private Object m_parent = null;
private ArrayList m_children = new ArrayList();
private HashMap m_childrenMap = new HashMap();
@ -43,21 +41,18 @@ class Mist extends AbstractList {
private Object check(Object o) {
if (o == null) {
throw new IllegalArgumentException
("null child");
throw new IllegalArgumentException("null child");
}
if (!(o instanceof Element)) {
throw new IllegalArgumentException
("not an element");
throw new IllegalArgumentException("not an element");
}
Element child = (Element) o;
Object key = child.getElementKey();
if (key == null) {
throw new IllegalArgumentException
("null key");
throw new IllegalArgumentException("null key");
}
return key;
@ -68,13 +63,11 @@ class Mist extends AbstractList {
Element child = (Element) o;
if (child.getParent() != null) {
throw new IllegalArgumentException
("child is already contained");
throw new IllegalArgumentException("child is already contained");
}
if (m_childrenMap.containsKey(key)) {
throw new IllegalArgumentException
("duplicate key: " + key);
throw new IllegalArgumentException("duplicate key: " + key);
}
m_children.add(index, child);
@ -112,9 +105,9 @@ class Mist extends AbstractList {
// Qusimodo: END
if (!this.containsKey(key)) {
throw new IllegalArgumentException
("child does not belong to this parent");
throw new IllegalArgumentException("child does not belong to this parent");
}
m_children.remove(o);
m_childrenMap.remove(key);
child.setParent(null);
@ -140,5 +133,4 @@ class Mist extends AbstractList {
public String toString() {
return m_children.toString();
}
}