diff --git a/ccm-cms-types-project/application.xml b/ccm-cms-types-project/application.xml new file mode 100644 index 000000000..3ca3bc735 --- /dev/null +++ b/ccm-cms-types-project/application.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + The Project Content Type for OpenCCM. + + diff --git a/ccm-cms-types-project/build/ccm-cms-types-project-6.6.0-pdl.jar b/ccm-cms-types-project/build/ccm-cms-types-project-6.6.0-pdl.jar new file mode 100644 index 000000000..0259b3221 Binary files /dev/null and b/ccm-cms-types-project/build/ccm-cms-types-project-6.6.0-pdl.jar differ diff --git a/ccm-cms-types-project/build/ccm-cms-types-project-6.6.0-sql.jar b/ccm-cms-types-project/build/ccm-cms-types-project-6.6.0-sql.jar new file mode 100644 index 000000000..18ea10e9c Binary files /dev/null and b/ccm-cms-types-project/build/ccm-cms-types-project-6.6.0-sql.jar differ diff --git a/ccm-cms-types-project/build/classes/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Project.xml b/ccm-cms-types-project/build/classes/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Project.xml new file mode 100644 index 000000000..591cc43f3 --- /dev/null +++ b/ccm-cms-types-project/build/classes/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Project.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/ccm-cms-types-project/build/classes/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/Project.xml b/ccm-cms-types-project/build/classes/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/Project.xml new file mode 100644 index 000000000..a84d8fa10 --- /dev/null +++ b/ccm-cms-types-project/build/classes/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/Project.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/ccm-cms-types-project/build/classes/ccm-cms-types-project.config b/ccm-cms-types-project/build/classes/ccm-cms-types-project.config new file mode 100644 index 000000000..42372609b --- /dev/null +++ b/ccm-cms-types-project/build/classes/ccm-cms-types-project.config @@ -0,0 +1,4 @@ + + + + diff --git a/ccm-cms-types-project/build/classes/ccm-cms-types-project.load b/ccm-cms-types-project/build/classes/ccm-cms-types-project.load new file mode 100644 index 000000000..40ed693fd --- /dev/null +++ b/ccm-cms-types-project/build/classes/ccm-cms-types-project.load @@ -0,0 +1,16 @@ + + + +
+
+ + + +
+ + + + + + + diff --git a/ccm-cms-types-project/build/classes/ccm-cms-types-project.pdl.mf b/ccm-cms-types-project/build/classes/ccm-cms-types-project.pdl.mf new file mode 100644 index 000000000..8fd095726 --- /dev/null +++ b/ccm-cms-types-project/build/classes/ccm-cms-types-project.pdl.mf @@ -0,0 +1 @@ +com/arsdigita/content-types/Project.pdl \ No newline at end of file diff --git a/ccm-cms-types-project/build/classes/ccm-cms-types-project.web.mf b/ccm-cms-types-project/build/classes/ccm-cms-types-project.web.mf new file mode 100644 index 000000000..7b681db2e --- /dev/null +++ b/ccm-cms-types-project/build/classes/ccm-cms-types-project.web.mf @@ -0,0 +1 @@ +static/content-types/com/arsdigita/cms/contenttypes/Project.xsl \ No newline at end of file diff --git a/ccm-cms-types-project/build/classes/com/arsdigita/cms/contenttypes/Project.class b/ccm-cms-types-project/build/classes/com/arsdigita/cms/contenttypes/Project.class new file mode 100644 index 000000000..01bbd370b Binary files /dev/null and b/ccm-cms-types-project/build/classes/com/arsdigita/cms/contenttypes/Project.class differ diff --git a/ccm-cms-types-project/build/classes/com/arsdigita/cms/contenttypes/ProjectInitializer.class b/ccm-cms-types-project/build/classes/com/arsdigita/cms/contenttypes/ProjectInitializer.class new file mode 100644 index 000000000..5596a26ed Binary files /dev/null and b/ccm-cms-types-project/build/classes/com/arsdigita/cms/contenttypes/ProjectInitializer.class differ diff --git a/ccm-cms-types-project/build/classes/com/arsdigita/cms/contenttypes/ProjectLoader.class b/ccm-cms-types-project/build/classes/com/arsdigita/cms/contenttypes/ProjectLoader.class new file mode 100644 index 000000000..54324110e Binary files /dev/null and b/ccm-cms-types-project/build/classes/com/arsdigita/cms/contenttypes/ProjectLoader.class differ diff --git a/ccm-cms-types-project/build/classes/com/arsdigita/cms/contenttypes/ui/ProjectAddChildForm.class b/ccm-cms-types-project/build/classes/com/arsdigita/cms/contenttypes/ui/ProjectAddChildForm.class new file mode 100644 index 000000000..1cbac1641 Binary files /dev/null and b/ccm-cms-types-project/build/classes/com/arsdigita/cms/contenttypes/ui/ProjectAddChildForm.class differ diff --git a/ccm-cms-types-project/build/classes/com/arsdigita/cms/contenttypes/ui/ProjectChildrenPropertiesStep.class b/ccm-cms-types-project/build/classes/com/arsdigita/cms/contenttypes/ui/ProjectChildrenPropertiesStep.class new file mode 100644 index 000000000..e5fb23cec Binary files /dev/null and b/ccm-cms-types-project/build/classes/com/arsdigita/cms/contenttypes/ui/ProjectChildrenPropertiesStep.class differ diff --git a/ccm-cms-types-project/build/sql/.ddl-timestamp b/ccm-cms-types-project/build/sql/.ddl-timestamp new file mode 100644 index 000000000..837e1cf71 --- /dev/null +++ b/ccm-cms-types-project/build/sql/.ddl-timestamp @@ -0,0 +1 @@ +ddl-timestamp \ No newline at end of file diff --git a/ccm-cms-types-project/build/sql/ccm-cms-types-project/ddl/oracle-se/create.sql b/ccm-cms-types-project/build/sql/ccm-cms-types-project/ddl/oracle-se/create.sql new file mode 100644 index 000000000..59bdcef2f --- /dev/null +++ b/ccm-cms-types-project/build/sql/ccm-cms-types-project/ddl/oracle-se/create.sql @@ -0,0 +1 @@ +@ ddl/oracle-se/table-ct_projects-auto.sql diff --git a/ccm-cms-types-project/build/sql/ccm-cms-types-project/ddl/oracle-se/deferred.sql b/ccm-cms-types-project/build/sql/ccm-cms-types-project/ddl/oracle-se/deferred.sql new file mode 100644 index 000000000..366bfdba5 --- /dev/null +++ b/ccm-cms-types-project/build/sql/ccm-cms-types-project/ddl/oracle-se/deferred.sql @@ -0,0 +1,3 @@ +alter table ct_projects add + constraint ct_projects_project_id_f_5k900 foreign key (project_id) + references cms_organizationalunit(organizationalunit_id); diff --git a/ccm-cms-types-project/build/sql/ccm-cms-types-project/ddl/oracle-se/drop-constraints.sql b/ccm-cms-types-project/build/sql/ccm-cms-types-project/ddl/oracle-se/drop-constraints.sql new file mode 100644 index 000000000..fdbb9c52b --- /dev/null +++ b/ccm-cms-types-project/build/sql/ccm-cms-types-project/ddl/oracle-se/drop-constraints.sql @@ -0,0 +1,2 @@ +alter table ct_projects + drop constraint ct_projects_project_id_f_5k900; diff --git a/ccm-cms-types-project/build/sql/ccm-cms-types-project/ddl/oracle-se/drop-tables.sql b/ccm-cms-types-project/build/sql/ccm-cms-types-project/ddl/oracle-se/drop-tables.sql new file mode 100644 index 000000000..e83440d44 --- /dev/null +++ b/ccm-cms-types-project/build/sql/ccm-cms-types-project/ddl/oracle-se/drop-tables.sql @@ -0,0 +1 @@ +drop table ct_projects; diff --git a/ccm-cms-types-project/build/sql/ccm-cms-types-project/ddl/oracle-se/table-ct_projects-auto.sql b/ccm-cms-types-project/build/sql/ccm-cms-types-project/ddl/oracle-se/table-ct_projects-auto.sql new file mode 100644 index 000000000..ba908ba20 --- /dev/null +++ b/ccm-cms-types-project/build/sql/ccm-cms-types-project/ddl/oracle-se/table-ct_projects-auto.sql @@ -0,0 +1,6 @@ +create table ct_projects ( + project_id INTEGER not null + constraint ct_projects_project_id_p_temz1 + primary key + -- referential constraint for project_id deferred due to circular dependencies +); diff --git a/ccm-cms-types-project/build/sql/ccm-cms-types-project/ddl/postgres/create.sql b/ccm-cms-types-project/build/sql/ccm-cms-types-project/ddl/postgres/create.sql new file mode 100644 index 000000000..6b2d646fe --- /dev/null +++ b/ccm-cms-types-project/build/sql/ccm-cms-types-project/ddl/postgres/create.sql @@ -0,0 +1 @@ +\i ddl/postgres/table-ct_projects-auto.sql diff --git a/ccm-cms-types-project/build/sql/ccm-cms-types-project/ddl/postgres/deferred.sql b/ccm-cms-types-project/build/sql/ccm-cms-types-project/ddl/postgres/deferred.sql new file mode 100644 index 000000000..366bfdba5 --- /dev/null +++ b/ccm-cms-types-project/build/sql/ccm-cms-types-project/ddl/postgres/deferred.sql @@ -0,0 +1,3 @@ +alter table ct_projects add + constraint ct_projects_project_id_f_5k900 foreign key (project_id) + references cms_organizationalunit(organizationalunit_id); diff --git a/ccm-cms-types-project/build/sql/ccm-cms-types-project/ddl/postgres/drop-constraints.sql b/ccm-cms-types-project/build/sql/ccm-cms-types-project/ddl/postgres/drop-constraints.sql new file mode 100644 index 000000000..24542a1f6 --- /dev/null +++ b/ccm-cms-types-project/build/sql/ccm-cms-types-project/ddl/postgres/drop-constraints.sql @@ -0,0 +1,2 @@ +alter table ct_projects + drop constraint ct_projects_project_id_f_5k900 RESTRICT; diff --git a/ccm-cms-types-project/build/sql/ccm-cms-types-project/ddl/postgres/drop-tables.sql b/ccm-cms-types-project/build/sql/ccm-cms-types-project/ddl/postgres/drop-tables.sql new file mode 100644 index 000000000..e83440d44 --- /dev/null +++ b/ccm-cms-types-project/build/sql/ccm-cms-types-project/ddl/postgres/drop-tables.sql @@ -0,0 +1 @@ +drop table ct_projects; diff --git a/ccm-cms-types-project/build/sql/ccm-cms-types-project/ddl/postgres/table-ct_projects-auto.sql b/ccm-cms-types-project/build/sql/ccm-cms-types-project/ddl/postgres/table-ct_projects-auto.sql new file mode 100644 index 000000000..ba908ba20 --- /dev/null +++ b/ccm-cms-types-project/build/sql/ccm-cms-types-project/ddl/postgres/table-ct_projects-auto.sql @@ -0,0 +1,6 @@ +create table ct_projects ( + project_id INTEGER not null + constraint ct_projects_project_id_p_temz1 + primary key + -- referential constraint for project_id deferred due to circular dependencies +); diff --git a/ccm-cms-types-project/build/sql/ccm-cms-types-project/postgres-create.sql b/ccm-cms-types-project/build/sql/ccm-cms-types-project/postgres-create.sql new file mode 100644 index 000000000..a733590e2 --- /dev/null +++ b/ccm-cms-types-project/build/sql/ccm-cms-types-project/postgres-create.sql @@ -0,0 +1,3 @@ +begin; +\i ddl/postgres/create.sql +end; \ No newline at end of file diff --git a/ccm-cms-types-project/pdl/com/arsdigita/content-types/Project.pdl b/ccm-cms-types-project/pdl/com/arsdigita/content-types/Project.pdl new file mode 100644 index 000000000..2f51074d1 --- /dev/null +++ b/ccm-cms-types-project/pdl/com/arsdigita/content-types/Project.pdl @@ -0,0 +1,8 @@ +model com.arsdigita.cms.contenttypes; + +import com.arsdigita.kernel.ACSObject; +import com.arsdigita.cms.*; + +object type Project extends GenericOrganizationalUnit { + reference key ( ct_projects.project_id ); +} diff --git a/ccm-cms-types-project/sql/ccm-cms-types-project/postgres-create.sql b/ccm-cms-types-project/sql/ccm-cms-types-project/postgres-create.sql new file mode 100644 index 000000000..a733590e2 --- /dev/null +++ b/ccm-cms-types-project/sql/ccm-cms-types-project/postgres-create.sql @@ -0,0 +1,3 @@ +begin; +\i ddl/postgres/create.sql +end; \ No newline at end of file diff --git a/ccm-cms-types-project/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Project.xml b/ccm-cms-types-project/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Project.xml new file mode 100644 index 000000000..591cc43f3 --- /dev/null +++ b/ccm-cms-types-project/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Project.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/ccm-cms-types-project/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/Project.xml b/ccm-cms-types-project/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/Project.xml new file mode 100644 index 000000000..a84d8fa10 --- /dev/null +++ b/ccm-cms-types-project/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/Project.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/ccm-cms-types-project/src/ccm-cms-types-project.config b/ccm-cms-types-project/src/ccm-cms-types-project.config new file mode 100644 index 000000000..42372609b --- /dev/null +++ b/ccm-cms-types-project/src/ccm-cms-types-project.config @@ -0,0 +1,4 @@ + + + + diff --git a/ccm-cms-types-project/src/ccm-cms-types-project.load b/ccm-cms-types-project/src/ccm-cms-types-project.load new file mode 100644 index 000000000..40ed693fd --- /dev/null +++ b/ccm-cms-types-project/src/ccm-cms-types-project.load @@ -0,0 +1,16 @@ + + +
+
+
+ + + +
+ + + + + + + diff --git a/ccm-cms-types-project/src/com/arsdigita/cms/contenttypes/Project.java b/ccm-cms-types-project/src/com/arsdigita/cms/contenttypes/Project.java new file mode 100644 index 000000000..ca23e7243 --- /dev/null +++ b/ccm-cms-types-project/src/com/arsdigita/cms/contenttypes/Project.java @@ -0,0 +1,36 @@ +package com.arsdigita.cms.contenttypes; + +import com.arsdigita.domain.DataObjectNotFoundException; +import com.arsdigita.persistence.DataObject; +import com.arsdigita.persistence.OID; +import java.math.BigDecimal; + +/** + * + * @author Jens Pelzetter + */ +public class Project extends GenericOrganizationalUnit{ + + public static final String BASE_DATA_OBJECT_TYPE = "com.arsdigita.cms.contenttypes.Project"; + + public Project() { + super(BASE_DATA_OBJECT_TYPE); + } + + public Project(BigDecimal id ) throws DataObjectNotFoundException{ + this(new OID(BASE_DATA_OBJECT_TYPE, id)); + } + + public Project(OID oid) { + super(oid); + } + + public Project(DataObject obj) { + super(obj); + } + + public Project(String type) { + super(type); + } + +} diff --git a/ccm-cms-types-project/src/com/arsdigita/cms/contenttypes/ProjectInitializer.java b/ccm-cms-types-project/src/com/arsdigita/cms/contenttypes/ProjectInitializer.java new file mode 100644 index 000000000..3d015f26c --- /dev/null +++ b/ccm-cms-types-project/src/com/arsdigita/cms/contenttypes/ProjectInitializer.java @@ -0,0 +1,29 @@ +package com.arsdigita.cms.contenttypes; + +import org.apache.log4j.Logger; + +/** + * + * @author Jens Pelzetter + */ +public class ProjectInitializer extends ContentTypeInitializer { + + private static final Logger s_log = Logger.getLogger( + ProjectInitializer.class); + + public ProjectInitializer() { + super("ccm-cms-types-project.pdl.mf", Project.BASE_DATA_OBJECT_TYPE); + } + + @Override + public String[] getStylesheets() { + return new String[]{ + "/static/content-types/com/arsdigita/cms/contenttypes/Project.xsl" + }; + } + + @Override + public String getTraversalXML() { + return "/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/Project.xml"; + } +} diff --git a/ccm-cms-types-project/src/com/arsdigita/cms/contenttypes/ProjectLoader.java b/ccm-cms-types-project/src/com/arsdigita/cms/contenttypes/ProjectLoader.java new file mode 100644 index 000000000..5bb121ee8 --- /dev/null +++ b/ccm-cms-types-project/src/com/arsdigita/cms/contenttypes/ProjectLoader.java @@ -0,0 +1,22 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package com.arsdigita.cms.contenttypes; + +/** + * + * @author Jens Pelzetter + */ +public class ProjectLoader extends AbstractContentTypeLoader { + + private static final String[] TYPES = { + "/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Project.xml" + }; + + public String[] getTypes() { + return TYPES; + } + +} diff --git a/ccm-cms-types-project/src/com/arsdigita/cms/contenttypes/ui/ProjectAddChildForm.java b/ccm-cms-types-project/src/com/arsdigita/cms/contenttypes/ui/ProjectAddChildForm.java new file mode 100644 index 000000000..ebad665de --- /dev/null +++ b/ccm-cms-types-project/src/com/arsdigita/cms/contenttypes/ui/ProjectAddChildForm.java @@ -0,0 +1,73 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ + +package com.arsdigita.cms.contenttypes.ui; + +import com.arsdigita.bebop.FormData; +import com.arsdigita.bebop.FormProcessException; +import com.arsdigita.bebop.Label; +import com.arsdigita.bebop.PageState; +import com.arsdigita.bebop.SaveCancelSection; +import com.arsdigita.bebop.event.FormSectionEvent; +import com.arsdigita.cms.ContentType; +import com.arsdigita.cms.ItemSelectionModel; +import com.arsdigita.cms.contenttypes.GenericOrganizationalUnit; +import com.arsdigita.cms.contenttypes.Project; +import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil; +import com.arsdigita.cms.ui.ItemSearchWidget; +import com.arsdigita.cms.ui.authoring.BasicItemForm; +import org.apache.log4j.Logger; + +/** + * + * @author Jens Pelzetter + */ +public class ProjectAddChildForm extends BasicItemForm{ + + private static final Logger s_log = Logger.getLogger(ProjectAddChildForm.class); + private ProjectChildrenPropertiesStep m_step; + private ItemSearchWidget m_itemSearch; + private SaveCancelSection m_saveCancelSection; + private final String ITEM_SEARCH = "projectChild"; + private ItemSelectionModel m_itemModel; + + public ProjectAddChildForm(ItemSelectionModel itemModel) { + super("ChildAddForm", itemModel); + } + + @Override + protected void addWidgets() { + add(new Label((String) ContenttypesGlobalizationUtil.globalize( + "cms.contenttypes.ui.genericorgaunit.select_child").localize())); + this.m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType. + findByAssociatedObjectType( + Project.BASE_DATA_OBJECT_TYPE)); + add(this.m_itemSearch); + } + + @Override + public void init(FormSectionEvent fse) throws FormProcessException { + FormData data = fse.getFormData(); + PageState state = fse.getPageState(); + + setVisible(state, true); + } + + @Override + public void process(FormSectionEvent fse) throws FormProcessException { + FormData data = fse.getFormData(); + PageState state = fse.getPageState(); + GenericOrganizationalUnit parent = (GenericOrganizationalUnit) getItemSelectionModel(). + getSelectedObject(state); + + if (!(this.getSaveCancelSection().getCancelButton().isSelected(state))) { + parent.addOrgaUnitChildren((GenericOrganizationalUnit) data.get( + ITEM_SEARCH)); + } + + init(fse); + } + +} diff --git a/ccm-cms-types-project/src/com/arsdigita/cms/contenttypes/ui/ProjectChildrenPropertiesStep.java b/ccm-cms-types-project/src/com/arsdigita/cms/contenttypes/ui/ProjectChildrenPropertiesStep.java new file mode 100644 index 000000000..51bc4bea3 --- /dev/null +++ b/ccm-cms-types-project/src/com/arsdigita/cms/contenttypes/ui/ProjectChildrenPropertiesStep.java @@ -0,0 +1,47 @@ +/* + * To change this template, choose Tools | Templates + * and open the template in the editor. + */ +package com.arsdigita.cms.contenttypes.ui; + +import com.arsdigita.cms.ItemSelectionModel; +import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil; +import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; +import com.arsdigita.cms.ui.authoring.BasicItemForm; +import com.arsdigita.cms.ui.authoring.SimpleEditStep; +import com.arsdigita.cms.ui.authoring.WorkflowLockedComponentAccess; +import org.apache.log4j.Logger; + +/** + * + * @author Jens Pelzetter + */ +public class ProjectChildrenPropertiesStep extends SimpleEditStep { + + private final static Logger s_log = Logger.getLogger( + ProjectChildrenPropertiesStep.class); + private String ADD_CHILD_SHEET_NAME = "addChild"; + + public ProjectChildrenPropertiesStep(ItemSelectionModel itemModel, + AuthoringKitWizard parent) { + this(itemModel, parent, null); + } + + public ProjectChildrenPropertiesStep( + ItemSelectionModel itemModel, + AuthoringKitWizard parent, + String prefix) { + super(itemModel, parent, prefix); + + BasicItemForm addChildSheet = new ProjectAddChildForm(itemModel); + add(ADD_CHILD_SHEET_NAME, + (String) ContenttypesGlobalizationUtil.globalize( + "cms.contenttypes.ui.genericorgaunit.add_child").localize(), + new WorkflowLockedComponentAccess(addChildSheet, itemModel), + addChildSheet.getSaveCancelSection().getCancelButton()); + + GenericOrganizationalUnitChildTable childrenTable = new GenericOrganizationalUnitChildTable( + itemModel); + setDisplayComponent(childrenTable); + } +} diff --git a/ccm-cms-types-project/web/static/content-types/com/arsdigita/cms/contenttypes/Project.xsl b/ccm-cms-types-project/web/static/content-types/com/arsdigita/cms/contenttypes/Project.xsl new file mode 100644 index 000000000..18cf5d5a7 --- /dev/null +++ b/ccm-cms-types-project/web/static/content-types/com/arsdigita/cms/contenttypes/Project.xsl @@ -0,0 +1,19 @@ + +]> + + + + +

+
+ + +

+
+ +
\ No newline at end of file