Aktueller Stand, GenericOrgnization, ein paar Änderungen in MultipartArticle (überflüssige Casts entfernt)

git-svn-id: https://svn.libreccm.org/ccm/trunk@187 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2009-06-02 09:41:56 +00:00
parent fef0f3cc67
commit 31c97fcda8
6 changed files with 40 additions and 70 deletions

View File

@ -28,51 +28,10 @@ object type GenericOrganization extends ContentPage {
String[0..1] organizationnameaddendum = ct_genericorganizations.organizationnameaddendum VARCHAR(512);
String[0..1] description = ct_genericorganizations.description VARCHAR(2000);
component OrganizationFunction[0..n] functions = join ct_genericorganizations.organization_id to ct_organizationfunctions.function_id;
reference key (ct_genericorganizations.organization_id);
}
object type OrganizationFunction extends ContentItem {
String[1..1] functionname = ct_organizationfunctions.functionname VARCHAR(256);
reference key ( ct_organizationfunctions.function_id );
}
association {
GenericOrganization[0..1] associatedOrganizationForItem =
join cms_items.item_id to genericorganization_content_item_map.item_id,
join genericorganization_content_item_map.organization_id to ct_genericorganizations.organization_id;
ContentItem[0..n] associatedContentItemsForOrganization =
join ct_genericorganizations.organization_id to genericorganization_content_item_map.organization_id,
join genericorganization_content_item_map.item_id to cms_items.item_id;
}
// As mentioned in ccm-cms-types-contact/Contact.pdl (orginal version) an association of the above pattern
// does not work when removing items from the association. Instead of this, an data operation has to be used.
data operation removeGenericOrganizationFromContentItemAssociation {
do {
delete from genericorganization_content_item_map where item_id = :itemID
}
}
data operation removeGenericOrganizationFromAllAssociations {
do {
delete from genericorganization_content_item_map where organization_id = :organizationID;
}
}
query getGenericOrganizationForItem {
BigDecimal genericOrganizationID;
BigDecimal itemID;
do {
select genericorganization_id, item_id from genericorganization_content_item_map where item_id = :itemID
} map {
genericOrganizationID = genericorganization_id;
itemID = item_id;
}
composite GenericOrganization[1..1] orga = join ct_genericorganization_roles.organization_id to ct_genericorganizations.organization_id;
composite OrganizationRole[0..n] roles = join ct_genericorganizations.organization_id to ct_genericorganization_roles.organization_id;
}

View File

@ -63,8 +63,7 @@ public class ArticleSection extends ContentPage {
*
* @param id the id of the object to retrieve
*/
public ArticleSection(BigDecimal id)
throws DataObjectNotFoundException {
public ArticleSection(BigDecimal id) throws DataObjectNotFoundException {
this(new OID(BASE_DATA_OBJECT_TYPE, id));
}
@ -73,8 +72,7 @@ public class ArticleSection extends ContentPage {
*
* @param id the id of the object to retrieve
*/
public ArticleSection(OID id)
throws DataObjectNotFoundException {
public ArticleSection(OID id) throws DataObjectNotFoundException {
super(id);
}

View File

@ -61,8 +61,6 @@ public class MultiPartArticle extends ContentPage {
public static final String ARTICLE = "article";
public static final String SECTION = "section";
private static MultiPartArticleConfig s_config = new MultiPartArticleConfig();
static {
@ -72,6 +70,7 @@ public class MultiPartArticle extends ContentPage {
public static MultiPartArticleConfig getConfig() {
return s_config;
}
/** Default constructor. */
public MultiPartArticle() {
super(BASE_DATA_OBJECT_TYPE);

View File

@ -67,6 +67,7 @@ public class MultiPartArticleCreate extends MultiPartArticleForm
getSaveCancelSection().getSaveButton().setButtonLabel("Create");
}
@Override
protected void addWidgets() {
m_workflowSection = new ApplyWorkflowFormSection();
add(m_workflowSection, ColumnPanel.INSERT);

View File

@ -41,7 +41,9 @@ public class MultiPartArticleEditForm extends MultiPartArticleForm
public MultiPartArticleEditForm(ItemSelectionModel itemModel,
SimpleEditStep step) {
super("MutliPartArticleEditForm", itemModel);
//I assume this was a typo, so I corrected it:
//super("MutliPartArticleEditForm", itemModel);
super("MultiPartArticleEditForm", itemModel);
addSubmissionListener(this);
m_step = step;
}
@ -60,7 +62,7 @@ public class MultiPartArticleEditForm extends MultiPartArticleForm
public void process(FormSectionEvent e) throws FormProcessException {
PageState state = e.getPageState();
MultiPartArticle article = (MultiPartArticle)processBasicWidgets(e);
MultiPartArticle article = processBasicWidgets(e);
m_step.maybeForwardToNextStep(e.getPageState());
}
@ -98,4 +100,5 @@ public class MultiPartArticleEditForm extends MultiPartArticleForm
return (Folder) parent;
}
}

View File

@ -55,8 +55,12 @@ import java.math.BigDecimal;
*/
public class SectionTable extends Table
{
private static final Logger log =
Logger.getLogger(SectionTable.class.getName());
/**
* The class has already a logger (s_log), so I removed this.
* Jens Pelzetter 2009-05-29
*/
/*private static final Logger log =
Logger.getLogger(SectionTable.class.getName());*/
// column headings
public static final String COL_TITLE = "Section";
@ -75,6 +79,7 @@ public class SectionTable extends Table
*
* @param selArticle a selection model that returns the MultiPartArticle
* which holds the sections to display.
* @param moveSection
*/
public SectionTable ( ItemSelectionModel selArticle, ItemSelectionModel moveSection ) {
super();
@ -194,7 +199,12 @@ public class SectionTable extends Table
private ArticleSection m_section;
/** Constructor. */
/** Constructor.
* @param table
* @param state
* @param article
* @param moveSection
*/
public SectionTableModel ( Table table, PageState state,
MultiPartArticle article, ItemSelectionModel moveSection ) {
m_colModel = table.getColumnModel();