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-94f89814c4dfmaster
parent
fef0f3cc67
commit
31c97fcda8
|
|
@ -28,51 +28,10 @@ object type GenericOrganization extends ContentPage {
|
||||||
String[0..1] organizationnameaddendum = ct_genericorganizations.organizationnameaddendum VARCHAR(512);
|
String[0..1] organizationnameaddendum = ct_genericorganizations.organizationnameaddendum VARCHAR(512);
|
||||||
String[0..1] description = ct_genericorganizations.description VARCHAR(2000);
|
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);
|
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 {
|
association {
|
||||||
GenericOrganization[0..1] associatedOrganizationForItem =
|
composite GenericOrganization[1..1] orga = join ct_genericorganization_roles.organization_id to ct_genericorganizations.organization_id;
|
||||||
join cms_items.item_id to genericorganization_content_item_map.item_id,
|
composite OrganizationRole[0..n] roles = join ct_genericorganizations.organization_id to ct_genericorganization_roles.organization_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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -63,8 +63,7 @@ public class ArticleSection extends ContentPage {
|
||||||
*
|
*
|
||||||
* @param id the id of the object to retrieve
|
* @param id the id of the object to retrieve
|
||||||
*/
|
*/
|
||||||
public ArticleSection(BigDecimal id)
|
public ArticleSection(BigDecimal id) throws DataObjectNotFoundException {
|
||||||
throws DataObjectNotFoundException {
|
|
||||||
this(new OID(BASE_DATA_OBJECT_TYPE, id));
|
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
|
* @param id the id of the object to retrieve
|
||||||
*/
|
*/
|
||||||
public ArticleSection(OID id)
|
public ArticleSection(OID id) throws DataObjectNotFoundException {
|
||||||
throws DataObjectNotFoundException {
|
|
||||||
super(id);
|
super(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -29,14 +29,14 @@ import com.arsdigita.persistence.OID;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* CMS content type that represents a multi-part article.
|
* CMS content type that represents a multi-part article.
|
||||||
*
|
*
|
||||||
* @author <a href="mailto:dturner@arsdigita.com">Dave Turner</a>
|
* @author <a href="mailto:dturner@arsdigita.com">Dave Turner</a>
|
||||||
* @version $Id: MultiPartArticle.java 1500 2007-03-20 09:25:45Z chrisgilbert23 $
|
* @version $Id: MultiPartArticle.java 1500 2007-03-20 09:25:45Z chrisgilbert23 $
|
||||||
*/
|
*/
|
||||||
public class MultiPartArticle extends ContentPage {
|
public class MultiPartArticle extends ContentPage {
|
||||||
|
|
||||||
|
|
@ -60,18 +60,17 @@ public class MultiPartArticle extends ContentPage {
|
||||||
public static final String RANK = "rank";
|
public static final String RANK = "rank";
|
||||||
public static final String ARTICLE = "article";
|
public static final String ARTICLE = "article";
|
||||||
public static final String SECTION = "section";
|
public static final String SECTION = "section";
|
||||||
|
|
||||||
|
private static MultiPartArticleConfig s_config = new MultiPartArticleConfig();
|
||||||
|
|
||||||
|
static {
|
||||||
|
s_config.load();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static MultiPartArticleConfig getConfig() {
|
||||||
|
return s_config;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private static MultiPartArticleConfig s_config = new MultiPartArticleConfig();
|
|
||||||
|
|
||||||
static {
|
|
||||||
s_config.load();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static MultiPartArticleConfig getConfig() {
|
|
||||||
return s_config;
|
|
||||||
}
|
|
||||||
/** Default constructor. */
|
/** Default constructor. */
|
||||||
public MultiPartArticle() {
|
public MultiPartArticle() {
|
||||||
super(BASE_DATA_OBJECT_TYPE);
|
super(BASE_DATA_OBJECT_TYPE);
|
||||||
|
|
@ -156,7 +155,7 @@ public class MultiPartArticle extends ContentPage {
|
||||||
addSection(section, new Integer(rank));
|
addSection(section, new Integer(rank));
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArticleSectionCollection getSections(boolean asc) {
|
public ArticleSectionCollection getSections(boolean asc) {
|
||||||
DataAssociationCursor dac = ((DataAssociation) get(SECTIONS)).cursor();
|
DataAssociationCursor dac = ((DataAssociation) get(SECTIONS)).cursor();
|
||||||
String direction = asc ? " asc" : " desc";
|
String direction = asc ? " asc" : " desc";
|
||||||
dac.addOrder(RANK + direction);
|
dac.addOrder(RANK + direction);
|
||||||
|
|
@ -290,6 +289,6 @@ public class MultiPartArticle extends ContentPage {
|
||||||
(summary, SUMMARY_LENGTH, true);
|
(summary, SUMMARY_LENGTH, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -67,6 +67,7 @@ public class MultiPartArticleCreate extends MultiPartArticleForm
|
||||||
getSaveCancelSection().getSaveButton().setButtonLabel("Create");
|
getSaveCancelSection().getSaveButton().setButtonLabel("Create");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected void addWidgets() {
|
protected void addWidgets() {
|
||||||
m_workflowSection = new ApplyWorkflowFormSection();
|
m_workflowSection = new ApplyWorkflowFormSection();
|
||||||
add(m_workflowSection, ColumnPanel.INSERT);
|
add(m_workflowSection, ColumnPanel.INSERT);
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,9 @@ public class MultiPartArticleEditForm extends MultiPartArticleForm
|
||||||
|
|
||||||
public MultiPartArticleEditForm(ItemSelectionModel itemModel,
|
public MultiPartArticleEditForm(ItemSelectionModel itemModel,
|
||||||
SimpleEditStep step) {
|
SimpleEditStep step) {
|
||||||
super("MutliPartArticleEditForm", itemModel);
|
//I assume this was a typo, so I corrected it:
|
||||||
|
//super("MutliPartArticleEditForm", itemModel);
|
||||||
|
super("MultiPartArticleEditForm", itemModel);
|
||||||
addSubmissionListener(this);
|
addSubmissionListener(this);
|
||||||
m_step = step;
|
m_step = step;
|
||||||
}
|
}
|
||||||
|
|
@ -60,7 +62,7 @@ public class MultiPartArticleEditForm extends MultiPartArticleForm
|
||||||
|
|
||||||
public void process(FormSectionEvent e) throws FormProcessException {
|
public void process(FormSectionEvent e) throws FormProcessException {
|
||||||
PageState state = e.getPageState();
|
PageState state = e.getPageState();
|
||||||
MultiPartArticle article = (MultiPartArticle)processBasicWidgets(e);
|
MultiPartArticle article = processBasicWidgets(e);
|
||||||
m_step.maybeForwardToNextStep(e.getPageState());
|
m_step.maybeForwardToNextStep(e.getPageState());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -98,4 +100,5 @@ public class MultiPartArticleEditForm extends MultiPartArticleForm
|
||||||
return (Folder) parent;
|
return (Folder) parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -55,8 +55,12 @@ import java.math.BigDecimal;
|
||||||
*/
|
*/
|
||||||
public class SectionTable extends Table
|
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
|
// column headings
|
||||||
public static final String COL_TITLE = "Section";
|
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
|
* @param selArticle a selection model that returns the MultiPartArticle
|
||||||
* which holds the sections to display.
|
* which holds the sections to display.
|
||||||
|
* @param moveSection
|
||||||
*/
|
*/
|
||||||
public SectionTable ( ItemSelectionModel selArticle, ItemSelectionModel moveSection ) {
|
public SectionTable ( ItemSelectionModel selArticle, ItemSelectionModel moveSection ) {
|
||||||
super();
|
super();
|
||||||
|
|
@ -194,7 +199,12 @@ public class SectionTable extends Table
|
||||||
private ArticleSection m_section;
|
private ArticleSection m_section;
|
||||||
|
|
||||||
|
|
||||||
/** Constructor. */
|
/** Constructor.
|
||||||
|
* @param table
|
||||||
|
* @param state
|
||||||
|
* @param article
|
||||||
|
* @param moveSection
|
||||||
|
*/
|
||||||
public SectionTableModel ( Table table, PageState state,
|
public SectionTableModel ( Table table, PageState state,
|
||||||
MultiPartArticle article, ItemSelectionModel moveSection ) {
|
MultiPartArticle article, ItemSelectionModel moveSection ) {
|
||||||
m_colModel = table.getColumnModel();
|
m_colModel = table.getColumnModel();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue