Organization/Project content types: most recent versions of the code
git-svn-id: https://svn.libreccm.org/ccm/trunk@488 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
7d6da64ae5
commit
327319609e
|
|
@ -7,7 +7,7 @@
|
||||||
<ccm:dependencies>
|
<ccm:dependencies>
|
||||||
<ccm:requires name="ccm-core" version="6.6.0" relation="ge"/>
|
<ccm:requires name="ccm-core" version="6.6.0" relation="ge"/>
|
||||||
<ccm:requires name="ccm-cms" version="6.6.0" relation="ge"/>
|
<ccm:requires name="ccm-cms" version="6.6.0" relation="ge"/>
|
||||||
<ccm:requires name="ccm-cms-types-organization"/>
|
<ccm:requires name="ccm-cms-types-project" version="6.6.0" relation="ge"/>
|
||||||
</ccm:dependencies>
|
</ccm:dependencies>
|
||||||
<ccm:directories>
|
<ccm:directories>
|
||||||
<ccm:directory name="pdl"/>
|
<ccm:directory name="pdl"/>
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,6 @@ model com.arsdigita.cms.contenttypes;
|
||||||
import com.arsdigita.kernel.ACSObject;
|
import com.arsdigita.kernel.ACSObject;
|
||||||
import com.arsdigita.cms.*;
|
import com.arsdigita.cms.*;
|
||||||
|
|
||||||
object type Department extends Organization {
|
object type Department extends GenericOrganizationalUnit {
|
||||||
reference key ( ct_departments.department_id );
|
reference key ( ct_departments.department_id );
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<ctd:content-types xmlns:ctd="http://xmlns.redhat.com/cms/content-types"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://xmlns.redhat.com/cms/content-types content-types.xsd">
|
||||||
|
|
||||||
|
<!-- Is internal will be set the yes when testing is finished. -->
|
||||||
|
<ctd:content-type
|
||||||
|
label="Department"
|
||||||
|
description="A content type of Department."
|
||||||
|
objectType="com.arsdigita.cms.contenttypes.Department"
|
||||||
|
classname="com.arsdigita.cms.contenttypes.Department">
|
||||||
|
|
||||||
|
<ctd:authoring-kit createComponent="com.arsdigita.cms.ui.authoring.PageCreate">
|
||||||
|
|
||||||
|
<ctd:authoring-step
|
||||||
|
labelKey="cms.contenttypes.department.basic_properties.title"
|
||||||
|
labelBundle="cms.contenttypes.cms.ui.CMSResources"
|
||||||
|
descriptionKey="cms.contenttypes.department.basic_properties.description"
|
||||||
|
descriptionBundle="com.arsdigita.cms.ui.CMSResources"
|
||||||
|
component="com.arsdigita.cms.contenttypes.ui.DepartmentPropertiesStep"
|
||||||
|
ordering="1"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<ctd:include href="/WEB-INF/content-types/assign-categories-step.xml"/>
|
||||||
|
</ctd:authoring-kit>
|
||||||
|
|
||||||
|
</ctd:content-type>
|
||||||
|
|
||||||
|
</ctd:content-types>
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<xrd:adapters
|
||||||
|
xmlns:xrd="http://xmlns.redhat.com/schemas/waf/xml-renderer-rules"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://rhea.redhat.com/schemas/waf/xml-renderer-rules xml-renderer-rules.xsd">
|
||||||
|
<!--
|
||||||
|
Extend adapter for ContentItemPanel to also output the associated objects.
|
||||||
|
The default properties for BaseContact are left as is and are inherited from ContentPage
|
||||||
|
-->
|
||||||
|
<xrd:context name="com.arsdigita.cms.dispatcher.SimpleXMLGenerator">
|
||||||
|
<xrd:adapter objectType="com.arsdigita.cms.contenttypes.Department" extends="com.arsdigita.cms.ContentPage">
|
||||||
|
<xrd:associations rule="include">
|
||||||
|
<xrd:property name="/object/contacts"/>
|
||||||
|
</xrd:associations>
|
||||||
|
</xrd:adapter>
|
||||||
|
</xrd:context>
|
||||||
|
</xrd:adapters>
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<registry>
|
||||||
|
<!-- <config class="com.arsdigita.cms.contenttypes.DepartmentConfig" storage="ccm-cms-types-department/department.properties"/> -->
|
||||||
|
</registry>
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
<load>
|
||||||
|
<requires>
|
||||||
|
<table name="inits"/>
|
||||||
|
<table name="acs_objects"/>
|
||||||
|
<table name="cms_items"/>
|
||||||
|
<!--<table name="cms_organizationalunits"/>-->
|
||||||
|
<initializer class="com.arsdigita.cms.Initializer"/>
|
||||||
|
</requires>
|
||||||
|
<provides>
|
||||||
|
<table name="ct_departemts"/>
|
||||||
|
<initializer class="com.arsdigita.cms.contenttypes.DepartmentInitializer"/>
|
||||||
|
</provides>
|
||||||
|
<scripts>
|
||||||
|
<schema directory="ccm-cms-types-department"/>
|
||||||
|
<data class="com.arsdigita.cms.contenttypes.DepartmentLoader"/>
|
||||||
|
</scripts>
|
||||||
|
</load>
|
||||||
|
|
@ -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 Department extends GenericOrganizationalUnit {
|
||||||
|
|
||||||
|
public static final String BASE_DATA_OBJECT_TYPE =
|
||||||
|
"com.arsdigita.cms.contenttypes.Department";
|
||||||
|
|
||||||
|
public Department() {
|
||||||
|
super(BASE_DATA_OBJECT_TYPE);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Department(BigDecimal id) throws DataObjectNotFoundException {
|
||||||
|
this(new OID(BASE_DATA_OBJECT_TYPE, id));
|
||||||
|
}
|
||||||
|
|
||||||
|
public Department(OID oid) {
|
||||||
|
super(oid);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Department(DataObject obj) {
|
||||||
|
super(obj);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Department(String type) {
|
||||||
|
super(type);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,29 @@
|
||||||
|
package com.arsdigita.cms.contenttypes;
|
||||||
|
|
||||||
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Jens Pelzetter
|
||||||
|
*/
|
||||||
|
public class DepartmentInitializer extends ContentTypeInitializer {
|
||||||
|
|
||||||
|
private static final Logger s_log = Logger.getLogger(DepartmentInitializer.class);
|
||||||
|
|
||||||
|
public DepartmentInitializer() {
|
||||||
|
super("ccm-cms-types-department.pdl.mf", Department.BASE_DATA_OBJECT_TYPE);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String[] getStylesheets() {
|
||||||
|
return new String[] {
|
||||||
|
"/static/content-types/com/arsdigita/cms/contenttypes/Department.xsl"
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getTraversalXML() {
|
||||||
|
return "/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/Department.xml";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
package com.arsdigita.cms.contenttypes;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Jens Pelzetter
|
||||||
|
*/
|
||||||
|
public class DepartmentLoader extends AbstractContentTypeLoader {
|
||||||
|
|
||||||
|
private static final String[] TYPES = {
|
||||||
|
"/WEB-INF/content-types/com/arsdigita/cms/contenttypes/Department.xml"
|
||||||
|
};
|
||||||
|
|
||||||
|
public String[] getTypes() {
|
||||||
|
return TYPES;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,26 @@
|
||||||
|
/*
|
||||||
|
* 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.Project;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Jens Pelzetter
|
||||||
|
*/
|
||||||
|
public class DepartmentProjectAddForm
|
||||||
|
extends GenericOrganizationalUnitChildAddForm {
|
||||||
|
|
||||||
|
public DepartmentProjectAddForm(ItemSelectionModel itemModel) {
|
||||||
|
super("ProjectAddForm", itemModel);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected String getChildDataObjectType() {
|
||||||
|
return Project.BASE_DATA_OBJECT_TYPE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,49 @@
|
||||||
|
/*
|
||||||
|
* 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.workflow.WorkflowLockedComponentAccess;
|
||||||
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Jens Pelzetter
|
||||||
|
*/
|
||||||
|
public class DepartmentProjectPropertiesStep extends SimpleEditStep {
|
||||||
|
|
||||||
|
private static final Logger s_log =
|
||||||
|
Logger.getLogger(DepartmentProjectPropertiesStep.class);
|
||||||
|
private static String ADD_CHILD_SHEET_NAME = "addProject";
|
||||||
|
|
||||||
|
public DepartmentProjectPropertiesStep(
|
||||||
|
ItemSelectionModel itemModel,
|
||||||
|
AuthoringKitWizard parent) {
|
||||||
|
this(itemModel, parent, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public DepartmentProjectPropertiesStep(
|
||||||
|
ItemSelectionModel itemModel,
|
||||||
|
AuthoringKitWizard parent,
|
||||||
|
String prefix) {
|
||||||
|
super(itemModel, parent, prefix);
|
||||||
|
|
||||||
|
BasicItemForm addChildSheet = new DepartmentProjectAddForm(itemModel);
|
||||||
|
add(ADD_CHILD_SHEET_NAME,
|
||||||
|
(String) ContenttypesGlobalizationUtil.globalize(
|
||||||
|
"cms.contenttypes.ui.department.add_project").localize(),
|
||||||
|
new WorkflowLockedComponentAccess(addChildSheet, itemModel),
|
||||||
|
addChildSheet.getSaveCancelSection().getCancelButton());
|
||||||
|
|
||||||
|
GenericOrganizationalUnitChildTable childrenTable = new GenericOrganizationalUnitChildTable(
|
||||||
|
itemModel);
|
||||||
|
setDisplayComponent(childrenTable);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,38 @@
|
||||||
|
/*
|
||||||
|
* 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.ui.authoring.AuthoringKitWizard;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Jens Pelzetter
|
||||||
|
*/
|
||||||
|
public class DepartmentPropertiesStep
|
||||||
|
extends GenericOrganizationalUnitPropertiesStep {
|
||||||
|
|
||||||
|
public DepartmentPropertiesStep(ItemSelectionModel itemModel,
|
||||||
|
AuthoringKitWizard parent) {
|
||||||
|
super(itemModel, parent);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void addSteps(ItemSelectionModel itemModel,
|
||||||
|
AuthoringKitWizard parent) {
|
||||||
|
addStep(new GenericOrganizationalUnitContactPropertiesStep(itemModel,
|
||||||
|
parent),
|
||||||
|
"cms.contenttypes.ui.orgaunit.contact");
|
||||||
|
addStep(new DepartmentSubDepartmentPropertiesStep(itemModel,
|
||||||
|
parent),
|
||||||
|
"cms.contenttypes.ui.orgaunit.subdepartments");
|
||||||
|
addStep(new DepartmentProjectPropertiesStep(itemModel,
|
||||||
|
parent),
|
||||||
|
"cms.contenttypes.ui.orgaunit.projects");
|
||||||
|
addStep(new GenericOrganizationalUnitPersonPropertiesStep(itemModel,
|
||||||
|
parent),
|
||||||
|
"cms.contenttypes.ui.orgaunit.persons");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,21 @@
|
||||||
|
package com.arsdigita.cms.contenttypes.ui;
|
||||||
|
|
||||||
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
|
import com.arsdigita.cms.contenttypes.Department;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Jens Pelzetter
|
||||||
|
*/
|
||||||
|
public class DepartmentSubDepartmentAddForm
|
||||||
|
extends GenericOrganizationalUnitChildAddForm {
|
||||||
|
|
||||||
|
public DepartmentSubDepartmentAddForm(ItemSelectionModel itemModel) {
|
||||||
|
super("SubDepartmentAddForm", itemModel);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected String getChildDataObjectType() {
|
||||||
|
return Department.BASE_DATA_OBJECT_TYPE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,42 @@
|
||||||
|
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.workflow.WorkflowLockedComponentAccess;
|
||||||
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Jens Pelzetter
|
||||||
|
*/
|
||||||
|
public class DepartmentSubDepartmentPropertiesStep extends SimpleEditStep {
|
||||||
|
|
||||||
|
private static final Logger s_log = Logger.getLogger(
|
||||||
|
DepartmentSubDepartmentPropertiesStep.class);
|
||||||
|
private static String ADD_CHILD_SHEET_NAME = "addChild";
|
||||||
|
|
||||||
|
public DepartmentSubDepartmentPropertiesStep(ItemSelectionModel itemModel,
|
||||||
|
AuthoringKitWizard parent) {
|
||||||
|
this(itemModel, parent, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public DepartmentSubDepartmentPropertiesStep(ItemSelectionModel itemModel,
|
||||||
|
AuthoringKitWizard parent,
|
||||||
|
String prefix) {
|
||||||
|
super(itemModel, parent, prefix);
|
||||||
|
|
||||||
|
BasicItemForm addChildSheet = new DepartmentSubDepartmentAddForm(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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -8,6 +8,7 @@
|
||||||
<ccm:dependencies>
|
<ccm:dependencies>
|
||||||
<ccm:requires name="ccm-core" version="6.6.0" relation="ge"/>
|
<ccm:requires name="ccm-core" version="6.6.0" relation="ge"/>
|
||||||
<ccm:requires name="ccm-cms" version="6.6.0" relation="ge"/>
|
<ccm:requires name="ccm-cms" version="6.6.0" relation="ge"/>
|
||||||
|
<ccm:requires name="ccm-cms-types-department" version="6.6.0" relation="ge"/>
|
||||||
</ccm:dependencies>
|
</ccm:dependencies>
|
||||||
<ccm:directories>
|
<ccm:directories>
|
||||||
<ccm:directory name="pdl"/>
|
<ccm:directory name="pdl"/>
|
||||||
|
|
|
||||||
|
|
@ -14,33 +14,14 @@
|
||||||
<ctd:authoring-kit createComponent="com.arsdigita.cms.ui.authoring.PageCreate">
|
<ctd:authoring-kit createComponent="com.arsdigita.cms.ui.authoring.PageCreate">
|
||||||
|
|
||||||
<ctd:authoring-step
|
<ctd:authoring-step
|
||||||
labelKey="cms.contenttypes.shared.basic_properties.title"
|
labelKey="cms.contenttypes.organization_properties.title"
|
||||||
labelBundle="cms.contenttypes.cms.ui.CMSResources"
|
labelBundle="cms.contenttypes.cms.ui.CMSResources"
|
||||||
descriptionKey="cms.contenttypes.shared.basic_properties.description"
|
descriptionKey="cms.contenttypes.organization.basic_properties.description"
|
||||||
descriptionBundle="com.arsdigita.cms.ui.CMSResources"
|
descriptionBundle="com.arsdigita.cms.ui.CMSResources"
|
||||||
component="com.arsdigita.cms.contenttypes.ui.GenericOrganizationalUnitPropertiesStep"
|
component="com.arsdigita.cms.contenttypes.ui.OrganizationPropertiesStep"
|
||||||
ordering="1"
|
ordering="1"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<ctd:authoring-step
|
|
||||||
labelKey="genericorgaunit.authoring.contact_properties.title"
|
|
||||||
labelBundle="com.arsdigita.cms.contenttypes.ContenttypesResources"
|
|
||||||
descriptionKey="genericorgaunit.authoring.contact_properties.description"
|
|
||||||
descriptionBundle="com.arsdigita.cms.contenttypes.ContenttypesResources"
|
|
||||||
component="com.arsdigita.cms.contenttypes.ui.GenericOrganizationalUnitContactPropertiesStep"
|
|
||||||
ordering="2"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<ctd:authoring-step
|
|
||||||
labelKey="genericorgaunit.authoring.child_properties.title"
|
|
||||||
labelBundle="com.arsdigita.cms.contenttypes.ContenttypesResources"
|
|
||||||
descriptionKey="genericorgaunit.authoring.child_properties.description"
|
|
||||||
descriptionBundle="com.arsdigita.cms.contenttypes.ContenttypesResources"
|
|
||||||
component="com.arsdigita.cms.contenttypes.ui.OrganizationChildrenPropertiesStep"
|
|
||||||
ordering="3"
|
|
||||||
/>
|
|
||||||
|
|
||||||
|
|
||||||
<ctd:include href="/WEB-INF/content-types/assign-categories-step.xml"/>
|
<ctd:include href="/WEB-INF/content-types/assign-categories-step.xml"/>
|
||||||
</ctd:authoring-kit>
|
</ctd:authoring-kit>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
<table name="inits"/>
|
<table name="inits"/>
|
||||||
<table name="acs_objects"/>
|
<table name="acs_objects"/>
|
||||||
<table name="cms_items"/>
|
<table name="cms_items"/>
|
||||||
|
<!--<table name="cms_organizationalunits"/>-->
|
||||||
<initializer class="com.arsdigita.cms.Initializer"/>
|
<initializer class="com.arsdigita.cms.Initializer"/>
|
||||||
</requires>
|
</requires>
|
||||||
<provides>
|
<provides>
|
||||||
|
|
|
||||||
|
|
@ -1,72 +0,0 @@
|
||||||
/*
|
|
||||||
* 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.Organization;
|
|
||||||
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 OrganizationAddChildForm extends BasicItemForm {
|
|
||||||
|
|
||||||
private static final Logger s_log = Logger.getLogger(
|
|
||||||
OrganizationAddChildForm.class);
|
|
||||||
private OrganizationChildrenPropertiesStep m_step;
|
|
||||||
private ItemSearchWidget m_itemSearch;
|
|
||||||
private SaveCancelSection m_saveCancelSection;
|
|
||||||
private final String ITEM_SEARCH = "orgaunitChild";
|
|
||||||
private ItemSelectionModel m_itemModel;
|
|
||||||
|
|
||||||
public OrganizationAddChildForm(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(
|
|
||||||
Organization.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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -0,0 +1,21 @@
|
||||||
|
package com.arsdigita.cms.contenttypes.ui;
|
||||||
|
|
||||||
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
|
import com.arsdigita.cms.contenttypes.Department;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Jens Pelzetter
|
||||||
|
*/
|
||||||
|
public class OrganizationDepartmentAddForm
|
||||||
|
extends GenericOrganizationalUnitChildAddForm {
|
||||||
|
|
||||||
|
public OrganizationDepartmentAddForm(ItemSelectionModel itemModel) {
|
||||||
|
super("DepartmentAddForm", itemModel);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected String getChildDataObjectType() {
|
||||||
|
return Department.BASE_DATA_OBJECT_TYPE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -14,30 +14,31 @@ import org.apache.log4j.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author jensp
|
* @author Jens Pelzetter
|
||||||
*/
|
*/
|
||||||
public class OrganizationChildrenPropertiesStep extends SimpleEditStep {
|
public class OrganizationDepartmentPropertiesStep extends SimpleEditStep {
|
||||||
|
|
||||||
private static final Logger s_log = Logger.getLogger(OrganizationChildrenPropertiesStep.class);
|
private static final Logger s_log = Logger.getLogger(
|
||||||
private static String ADD_CHILD_SHEET_NAME = "addChild";
|
OrganizationDepartmentPropertiesStep.class);
|
||||||
|
private static String ADD_CHILD_SHEET_NAME = "addDepartment";
|
||||||
|
|
||||||
public OrganizationChildrenPropertiesStep(
|
public OrganizationDepartmentPropertiesStep(
|
||||||
ItemSelectionModel itemModel,
|
ItemSelectionModel itemModel,
|
||||||
AuthoringKitWizard parent) {
|
AuthoringKitWizard parent) {
|
||||||
this(itemModel, parent, null);
|
this(itemModel, parent, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public OrganizationChildrenPropertiesStep(
|
public OrganizationDepartmentPropertiesStep(
|
||||||
ItemSelectionModel itemModel,
|
ItemSelectionModel itemModel,
|
||||||
AuthoringKitWizard parent,
|
AuthoringKitWizard parent,
|
||||||
String prefix) {
|
String prefix) {
|
||||||
super(itemModel, parent, prefix);
|
super(itemModel, parent, prefix);
|
||||||
|
|
||||||
BasicItemForm addChildSheet = new OrganizationAddChildForm(
|
BasicItemForm addChildSheet = new OrganizationDepartmentAddForm(
|
||||||
itemModel);
|
itemModel);
|
||||||
add(ADD_CHILD_SHEET_NAME,
|
add(ADD_CHILD_SHEET_NAME,
|
||||||
(String) ContenttypesGlobalizationUtil.globalize(
|
(String) ContenttypesGlobalizationUtil.globalize(
|
||||||
"cms.contenttypes.ui.genericorgaunit.add_child").localize(),
|
"cms.contenttypes.ui.organization.add_department").localize(),
|
||||||
new WorkflowLockedComponentAccess(addChildSheet, itemModel),
|
new WorkflowLockedComponentAccess(addChildSheet, itemModel),
|
||||||
addChildSheet.getSaveCancelSection().getCancelButton());
|
addChildSheet.getSaveCancelSection().getCancelButton());
|
||||||
|
|
||||||
|
|
@ -0,0 +1,35 @@
|
||||||
|
/*
|
||||||
|
* 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.ui.authoring.AuthoringKitWizard;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Jens Pelzetter
|
||||||
|
*/
|
||||||
|
public class OrganizationPropertiesStep
|
||||||
|
extends GenericOrganizationalUnitPropertiesStep {
|
||||||
|
|
||||||
|
public OrganizationPropertiesStep(ItemSelectionModel itemModel,
|
||||||
|
AuthoringKitWizard parent) {
|
||||||
|
super(itemModel, parent);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void addSteps(ItemSelectionModel itemModel,
|
||||||
|
AuthoringKitWizard parent) {
|
||||||
|
addStep(new GenericOrganizationalUnitContactPropertiesStep(itemModel,
|
||||||
|
parent),
|
||||||
|
"cms.contenttypes.ui.orgaunit.contact");
|
||||||
|
addStep(new OrganizationDepartmentPropertiesStep(itemModel,
|
||||||
|
parent),
|
||||||
|
"cms.contenttypes.ui.orgaunit.departments");
|
||||||
|
addStep(new GenericOrganizationalUnitPersonPropertiesStep(itemModel,
|
||||||
|
parent),
|
||||||
|
"cms.contenttypes.ui.orgaunit.persons");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -4,42 +4,21 @@
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://xmlns.redhat.com/cms/content-types content-types.xsd">
|
xsi:schemaLocation="http://xmlns.redhat.com/cms/content-types content-types.xsd">
|
||||||
|
|
||||||
<!-- Is internal will be set the yes when testing is finished. -->
|
|
||||||
<ctd:content-type
|
<ctd:content-type
|
||||||
label="Project"
|
label="Project"
|
||||||
description="A content type of project."
|
description="The content type Oroject."
|
||||||
objectType="com.arsdigita.cms.contenttypes.Project"
|
objectType="com.arsdigita.cms.contenttypes.Project"
|
||||||
classname="com.arsdigita.cms.contenttypes.Project">
|
classname="com.arsdigita.cms.contenttypes.Project">
|
||||||
|
|
||||||
<ctd:authoring-kit createComponent="com.arsdigita.cms.ui.authoring.PageCreate">
|
<ctd:authoring-kit createComponent="com.arsdigita.cms.ui.authoring.PageCreate">
|
||||||
|
|
||||||
<ctd:authoring-step
|
<ctd:authoring-step
|
||||||
labelKey="cms.contenttypes.shared.basic_properties.title"
|
labelKey="cms.contenttypes.project.basic_properties.title"
|
||||||
labelBundle="cms.contenttypes.cms.ui.CMSResources"
|
labelBundle="cms.contenttypes.cms.ui.CMSResources"
|
||||||
descriptionKey="cms.contenttypes.shared.basic_properties.description"
|
descriptionKey="cms.contenttypes.project.basic_properties.description"
|
||||||
descriptionBundle="com.arsdigita.cms.ui.CMSResources"
|
descriptionBundle="com.arsdigita.cms.ui.CMSResources"
|
||||||
component="com.arsdigita.cms.contenttypes.ui.GenericOrganizationalUnitPropertiesStep"
|
component="com.arsdigita.cms.contenttypes.ui.ProjectPropertiesStep"
|
||||||
ordering="1"
|
ordering="1"/>
|
||||||
/>
|
|
||||||
|
|
||||||
<ctd:authoring-step
|
|
||||||
labelKey="genericorgaunit.authoring.contact_properties.title"
|
|
||||||
labelBundle="com.arsdigita.cms.contenttypes.ContenttypesResources"
|
|
||||||
descriptionKey="genericorgaunit.authoring.contact_properties.description"
|
|
||||||
descriptionBundle="com.arsdigita.cms.contenttypes.ContenttypesResources"
|
|
||||||
component="com.arsdigita.cms.contenttypes.ui.GenericOrganizationalUnitContactPropertiesStep"
|
|
||||||
ordering="2"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<ctd:authoring-step
|
|
||||||
labelKey="genericorgaunit.authoring.child_properties.title"
|
|
||||||
labelBundle="com.arsdigita.cms.contenttypes.ContenttypesResources"
|
|
||||||
descriptionKey="genericorgaunit.authoring.child_properties.description"
|
|
||||||
descriptionBundle="com.arsdigita.cms.contenttypes.ContenttypesResources"
|
|
||||||
component="com.arsdigita.cms.contenttypes.ui.ProjectChildrenPropertiesStep"
|
|
||||||
ordering="3"
|
|
||||||
/>
|
|
||||||
|
|
||||||
|
|
||||||
<ctd:include href="/WEB-INF/content-types/assign-categories-step.xml"/>
|
<ctd:include href="/WEB-INF/content-types/assign-categories-step.xml"/>
|
||||||
</ctd:authoring-kit>
|
</ctd:authoring-kit>
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
<table name="inits"/>
|
<table name="inits"/>
|
||||||
<table name="acs_objects"/>
|
<table name="acs_objects"/>
|
||||||
<table name="cms_items"/>
|
<table name="cms_items"/>
|
||||||
|
<!--<table name="cms_organizationalunits"/>-->
|
||||||
<initializer class="com.arsdigita.cms.Initializer"/>
|
<initializer class="com.arsdigita.cms.Initializer"/>
|
||||||
</requires>
|
</requires>
|
||||||
<provides>
|
<provides>
|
||||||
|
|
|
||||||
|
|
@ -1,73 +0,0 @@
|
||||||
/*
|
|
||||||
* 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);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -0,0 +1,21 @@
|
||||||
|
package com.arsdigita.cms.contenttypes.ui;
|
||||||
|
|
||||||
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
|
import com.arsdigita.cms.contenttypes.Project;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Jens Pelzetter
|
||||||
|
*/
|
||||||
|
public class ProjectSubprojectAddForm
|
||||||
|
extends GenericOrganizationalUnitChildAddForm {
|
||||||
|
|
||||||
|
public ProjectSubprojectAddForm(ItemSelectionModel itemModel) {
|
||||||
|
super("SubprojectAddForm", itemModel);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected String getChildDataObjectType() {
|
||||||
|
return Project.BASE_DATA_OBJECT_TYPE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -16,24 +16,24 @@ import org.apache.log4j.Logger;
|
||||||
*
|
*
|
||||||
* @author Jens Pelzetter
|
* @author Jens Pelzetter
|
||||||
*/
|
*/
|
||||||
public class ProjectChildrenPropertiesStep extends SimpleEditStep {
|
public class ProjectSubprojectPropertiesStep extends SimpleEditStep {
|
||||||
|
|
||||||
private final static Logger s_log = Logger.getLogger(
|
private final static Logger s_log = Logger.getLogger(
|
||||||
ProjectChildrenPropertiesStep.class);
|
ProjectSubprojectPropertiesStep.class);
|
||||||
private String ADD_CHILD_SHEET_NAME = "addChild";
|
private String ADD_CHILD_SHEET_NAME = "addChild";
|
||||||
|
|
||||||
public ProjectChildrenPropertiesStep(ItemSelectionModel itemModel,
|
public ProjectSubprojectPropertiesStep(ItemSelectionModel itemModel,
|
||||||
AuthoringKitWizard parent) {
|
AuthoringKitWizard parent) {
|
||||||
this(itemModel, parent, null);
|
this(itemModel, parent, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ProjectChildrenPropertiesStep(
|
public ProjectSubprojectPropertiesStep(
|
||||||
ItemSelectionModel itemModel,
|
ItemSelectionModel itemModel,
|
||||||
AuthoringKitWizard parent,
|
AuthoringKitWizard parent,
|
||||||
String prefix) {
|
String prefix) {
|
||||||
super(itemModel, parent, prefix);
|
super(itemModel, parent, prefix);
|
||||||
|
|
||||||
BasicItemForm addChildSheet = new ProjectAddChildForm(itemModel);
|
BasicItemForm addChildSheet = new ProjectSubprojectAddForm(itemModel);
|
||||||
add(ADD_CHILD_SHEET_NAME,
|
add(ADD_CHILD_SHEET_NAME,
|
||||||
(String) ContenttypesGlobalizationUtil.globalize(
|
(String) ContenttypesGlobalizationUtil.globalize(
|
||||||
"cms.contenttypes.ui.genericorgaunit.add_child").localize(),
|
"cms.contenttypes.ui.genericorgaunit.add_child").localize(),
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#Tue Jul 20 17:23:53 CEST 2010
|
#Wed Jul 21 09:20:24 CEST 2010
|
||||||
eclipse.preferences.version=1
|
eclipse.preferences.version=1
|
||||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
|
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
|
||||||
|
|
@ -37,7 +37,7 @@ org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
|
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
|
||||||
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
|
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
|
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
|
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
|
||||||
org.eclipse.jdt.core.compiler.problem.nullReference=ignore
|
org.eclipse.jdt.core.compiler.problem.nullReference=ignore
|
||||||
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
|
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.parameterAssignment=warning
|
org.eclipse.jdt.core.compiler.problem.parameterAssignment=warning
|
||||||
|
|
@ -56,7 +56,7 @@ org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
|
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
|
||||||
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
|
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
|
||||||
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
|
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore
|
||||||
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=warning
|
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
|
||||||
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
|
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
|
||||||
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
|
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
|
||||||
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
|
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
|
||||||
|
|
|
||||||
|
|
@ -23,34 +23,6 @@
|
||||||
ordering="1"
|
ordering="1"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<ctd:authoring-step
|
|
||||||
labelKey="genericorgaunit.authoring.contact_properties.title"
|
|
||||||
labelBundle="com.arsdigita.cms.contenttypes.ContenttypesResources"
|
|
||||||
descriptionKey="genericorgaunit.authoring.contact_properties.description"
|
|
||||||
descriptionBundle="com.arsdigita.cms.contenttypes.ContenttypesResources"
|
|
||||||
component="com.arsdigita.cms.contenttypes.ui.GenericOrganizationalUnitContactPropertiesStep"
|
|
||||||
ordering="2"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<ctd:authoring-step
|
|
||||||
labelKey="genericorgaunit.authoring.child_properties.title"
|
|
||||||
labelBundle="com.arsdigita.cms.contenttypes.ContenttypesResources"
|
|
||||||
descriptionKey="genericorgaunit.authoring.child_properties.description"
|
|
||||||
descriptionBundle="com.arsdigita.cms.contenttypes.ContenttypesResources"
|
|
||||||
component="com.arsdigita.cms.contenttypes.ui.GenericOrganizationalUnitChildrenPropertiesStep"
|
|
||||||
ordering="3"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<ctd:authoring-step
|
|
||||||
labelKey="genericorgaunit.authoring.persons_properties.title"
|
|
||||||
labelBundle="com.arsdigita.cms.contenttypes.ContenttypesResources"
|
|
||||||
descriptionKey="genericorgaunit.authoring.persons_properties.description"
|
|
||||||
descriptionBundle="com.arsdigita.cms.contenttypes.ContenttypesResources"
|
|
||||||
component="com.arsdigita.cms.contenttypes.ui.GenericOrganizationalPersonPropertiesStep"
|
|
||||||
ordering="4"
|
|
||||||
/>
|
|
||||||
|
|
||||||
|
|
||||||
<ctd:include href="/WEB-INF/content-types/assign-categories-step.xml"/>
|
<ctd:include href="/WEB-INF/content-types/assign-categories-step.xml"/>
|
||||||
</ctd:authoring-kit>
|
</ctd:authoring-kit>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,11 @@ import java.math.BigDecimal;
|
||||||
* This class provides a base type for building content types which represent organizations,
|
* This class provides a base type for building content types which represent organizations,
|
||||||
* departments, projects etc.
|
* departments, projects etc.
|
||||||
*
|
*
|
||||||
|
* An item of this content type can be linked with several other content types:
|
||||||
|
* - Contact (0..n)
|
||||||
|
* - Person (0..n)
|
||||||
|
* - GenericOrganizationalUnit (0..n) to build organizations structures.
|
||||||
|
*
|
||||||
* @author Jens Pelzetter
|
* @author Jens Pelzetter
|
||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
@ -67,21 +72,6 @@ public class GenericOrganizationalUnit extends ContentPage {
|
||||||
super(type);
|
super(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*@Override
|
|
||||||
public void beforeSave() {
|
|
||||||
super.beforeSave();
|
|
||||||
|
|
||||||
Assert.exists(getContentType(), ContentType.class);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
/*public String getOrgaUnitName() {
|
|
||||||
return (String) get(ORGAUNIT_NAME);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setOrgaUnitName(String orgaUnitName) {
|
|
||||||
set(ORGAUNIT_NAME, orgaUnitName);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
public String getAddendum() {
|
public String getAddendum() {
|
||||||
return (String) get(ADDENDUM);
|
return (String) get(ADDENDUM);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,20 @@
|
||||||
/*
|
/*
|
||||||
* To change this template, choose Tools | Templates
|
* Copyright (c) 2010 Jens Pelzetter, for the Center of Social Politics of the University of Bremen
|
||||||
* and open the template in the editor.
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public License
|
||||||
|
* as published by the Free Software Foundation; either version 2.1 of
|
||||||
|
* the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
package com.arsdigita.cms.contenttypes;
|
package com.arsdigita.cms.contenttypes;
|
||||||
|
|
||||||
|
|
@ -9,22 +23,23 @@ import com.arsdigita.persistence.DataCollection;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Collection class for the childs of a GenericOrganizationalUnit.
|
||||||
*
|
*
|
||||||
* @author jensp
|
* @author Jens Pelzetter
|
||||||
*/
|
*/
|
||||||
public class GenericOrganizationalUnitChildrenCollection extends DomainCollection {
|
public class GenericOrganizationalUnitChildrenCollection extends DomainCollection {
|
||||||
|
|
||||||
public static final String ORDER = "link.contact_order asc";
|
public static final String ORDER = "map_order asc";
|
||||||
public static final String CHILDREN_ORDER = "link.children_order";
|
//public static final String CHILDREN_ORDER = "link.children_order";
|
||||||
|
|
||||||
public GenericOrganizationalUnitChildrenCollection(DataCollection dataCollection) {
|
public GenericOrganizationalUnitChildrenCollection(DataCollection dataCollection) {
|
||||||
super(dataCollection);
|
super(dataCollection);
|
||||||
|
|
||||||
m_dataCollection.addOrder(ORDER);
|
//m_dataCollection.addOrder(ORDER);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getChildrenOrder() {
|
public String getChildrenOrder() {
|
||||||
String retVal = ((BigDecimal) m_dataCollection.get(CHILDREN_ORDER)).toString();
|
String retVal = ((BigDecimal) m_dataCollection.get(ORDER)).toString();
|
||||||
|
|
||||||
if (retVal == null || retVal.isEmpty()) {
|
if (retVal == null || retVal.isEmpty()) {
|
||||||
retVal = String.valueOf(this.getPosition());
|
retVal = String.valueOf(this.getPosition());
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,20 @@
|
||||||
/*
|
/*
|
||||||
* To change this template, choose Tools | Templates
|
* Copyright (c) 2010 Jens Pelzetter, for the Center of Social Politics of the University of Bremen
|
||||||
* and open the template in the editor.
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public License
|
||||||
|
* as published by the Free Software Foundation; either version 2.1 of
|
||||||
|
* the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
package com.arsdigita.cms.contenttypes;
|
package com.arsdigita.cms.contenttypes;
|
||||||
|
|
||||||
|
|
@ -9,8 +23,9 @@ import com.arsdigita.persistence.DataCollection;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Collection class for the GenericOrganizationalUnit -> Contact relation.
|
||||||
*
|
*
|
||||||
* @author jensp
|
* @author Jens Pelzetter
|
||||||
*/
|
*/
|
||||||
public class GenericOrganizationalUnitContactCollection extends DomainCollection {
|
public class GenericOrganizationalUnitContactCollection extends DomainCollection {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,21 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2010 Jens Pelzetter, for the Center of Social Politics of the University of Bremen
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public License
|
||||||
|
* as published by the Free Software Foundation; either version 2.1 of
|
||||||
|
* the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
*
|
||||||
|
*/
|
||||||
package com.arsdigita.cms.contenttypes;
|
package com.arsdigita.cms.contenttypes;
|
||||||
|
|
||||||
import com.arsdigita.domain.DomainCollection;
|
import com.arsdigita.domain.DomainCollection;
|
||||||
|
|
@ -5,6 +23,7 @@ import com.arsdigita.persistence.DataCollection;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Collection class for the GenericOrganizationalUnit -> Person relation.
|
||||||
*
|
*
|
||||||
* @author Jens Pelzetter
|
* @author Jens Pelzetter
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,22 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2010 Jens Pelzetter,
|
||||||
|
* for the Center of Social Politics of the University of Bremen
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public License
|
||||||
|
* as published by the Free Software Foundation; either version 2.1 of
|
||||||
|
* the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
*
|
||||||
|
*/
|
||||||
package com.arsdigita.cms.contenttypes.ui;
|
package com.arsdigita.cms.contenttypes.ui;
|
||||||
|
|
||||||
import com.arsdigita.bebop.FormData;
|
import com.arsdigita.bebop.FormData;
|
||||||
|
|
@ -15,21 +34,28 @@ import com.arsdigita.cms.ui.authoring.BasicItemForm;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Form for adding a child to an organization. To change the type of childs
|
||||||
|
* allowed, overwrite the {@link getChildDataObjectType()} method.
|
||||||
*
|
*
|
||||||
* @author Jens Pelzetter
|
* @author Jens Pelzetter
|
||||||
*/
|
*/
|
||||||
public class GenericOrganizationalUnitAddChildForm extends BasicItemForm {
|
public class GenericOrganizationalUnitChildAddForm extends BasicItemForm {
|
||||||
|
|
||||||
private static final Logger s_log = Logger.getLogger(
|
private static final Logger s_log = Logger.getLogger(
|
||||||
GenericOrganizationalUnitChildAddForm.class);
|
GenericOrganizationalUnitChildAddForm.class);
|
||||||
private GenericOrganizationalUnitChildrenPropertiesStep m_step;
|
private GenericOrganizationalUnitChildrenPropertiesStep m_step;
|
||||||
private ItemSearchWidget m_itemSGenericOrganizationalUnitAddChildFormearch;
|
private ItemSearchWidget m_itemSearch;
|
||||||
private SaveCancelSection m_saveCancelSection;
|
private SaveCancelSection m_saveCancelSection;
|
||||||
private final String ITEM_SEARCH = "orgaunitChild";
|
private final String ITEM_SEARCH = "orgaunitChild";
|
||||||
private ItemSelectionModel m_itemModel;
|
private ItemSelectionModel m_itemModel;
|
||||||
|
|
||||||
public GenericOrganizationalUnitChildAddForm(ItemSelectionModel itemModel) {
|
public GenericOrganizationalUnitChildAddForm(ItemSelectionModel itemModel) {
|
||||||
super("ChildAddForm", itemModel);
|
this("ChildAddForm", itemModel);
|
||||||
|
}
|
||||||
|
|
||||||
|
public GenericOrganizationalUnitChildAddForm(String formName,
|
||||||
|
ItemSelectionModel itemModel) {
|
||||||
|
super(formName, itemModel);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -38,7 +64,7 @@ public class GenericOrganizationalUnitAddChildForm extends BasicItemForm {
|
||||||
"cms.contenttypes.ui.genericorgaunit.select_child").localize()));
|
"cms.contenttypes.ui.genericorgaunit.select_child").localize()));
|
||||||
this.m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.
|
this.m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.
|
||||||
findByAssociatedObjectType(
|
findByAssociatedObjectType(
|
||||||
GenericOrganizationalUnit.BASE_DATA_OBJECT_TYPE));
|
getChildDataObjectType()));
|
||||||
add(this.m_itemSearch);
|
add(this.m_itemSearch);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -64,4 +90,12 @@ public class GenericOrganizationalUnitAddChildForm extends BasicItemForm {
|
||||||
|
|
||||||
init(fse);
|
init(fse);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @return The BASE_DATA_OBJECT_TYPE of the childs allowed.
|
||||||
|
*/
|
||||||
|
protected String getChildDataObjectType() {
|
||||||
|
return GenericOrganizationalUnit.BASE_DATA_OBJECT_TYPE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,21 @@
|
||||||
/*
|
/*
|
||||||
* To change this template, choose Tools | Templates
|
* Copyright (c) 2010 Jens Pelzetter,
|
||||||
* and open the template in the editor.
|
* for the Center of Social Politics of the University of Bremen
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public License
|
||||||
|
* as published by the Free Software Foundation; either version 2.1 of
|
||||||
|
* the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
package com.arsdigita.cms.contenttypes.ui;
|
package com.arsdigita.cms.contenttypes.ui;
|
||||||
|
|
||||||
|
|
@ -26,6 +41,7 @@ import com.arsdigita.util.LockableImpl;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Table for showing the childs of an organization.
|
||||||
*
|
*
|
||||||
* @author Jens Pelzetter
|
* @author Jens Pelzetter
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,22 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2010 Jens Pelzetter,
|
||||||
|
* for the Center of Social Politics of the University of Bremen
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public License
|
||||||
|
* as published by the Free Software Foundation; either version 2.1 of
|
||||||
|
* the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
*
|
||||||
|
*/
|
||||||
package com.arsdigita.cms.contenttypes.ui;
|
package com.arsdigita.cms.contenttypes.ui;
|
||||||
|
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
|
|
@ -8,8 +27,9 @@ import com.arsdigita.cms.ui.authoring.SimpleEditStep;
|
||||||
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
|
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Step for editing the childs of an organization (other organizations).
|
||||||
*
|
*
|
||||||
* @author jensp
|
* @author Jens Pelzetter
|
||||||
*/
|
*/
|
||||||
public class GenericOrganizationalUnitChildrenPropertiesStep extends SimpleEditStep {
|
public class GenericOrganizationalUnitChildrenPropertiesStep extends SimpleEditStep {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,21 @@
|
||||||
/*
|
/*
|
||||||
* To change this template, choose Tools | Templates
|
* Copyright (c) 2010 Jens Pelzetter,
|
||||||
* and open the template in the editor.
|
* for the Center of Social Politics of the University of Bremen
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public License
|
||||||
|
* as published by the Free Software Foundation; either version 2.1 of
|
||||||
|
* the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
package com.arsdigita.cms.contenttypes.ui;
|
package com.arsdigita.cms.contenttypes.ui;
|
||||||
|
|
||||||
|
|
@ -29,6 +44,7 @@ import com.arsdigita.dispatcher.DispatcherHelper;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Form for addings an related contact to an organization.
|
||||||
*
|
*
|
||||||
* @author Jens Pelzetter
|
* @author Jens Pelzetter
|
||||||
*/
|
*/
|
||||||
|
|
@ -74,6 +90,9 @@ public class GenericOrganizationalUnitContactAddForm extends BasicItemForm {
|
||||||
contactType.addOption(new Option(ct.getKey(), ct.getName()));
|
contactType.addOption(new Option(ct.getKey(), ct.getName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Only for testing
|
||||||
|
contactType.addOption(new Option("commonContact", "Common Contact"));
|
||||||
|
|
||||||
add(contactType);
|
add(contactType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,21 @@
|
||||||
/*
|
/*
|
||||||
* To change this template, choose Tools | Templates
|
* Copyright (c) 2010 Jens Pelzetter,
|
||||||
* and open the template in the editor.
|
* for the Center of Social Politics of the University of Bremen
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public License
|
||||||
|
* as published by the Free Software Foundation; either version 2.1 of
|
||||||
|
* the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
package com.arsdigita.cms.contenttypes.ui;
|
package com.arsdigita.cms.contenttypes.ui;
|
||||||
|
|
||||||
|
|
@ -12,6 +27,7 @@ import com.arsdigita.cms.ui.authoring.SimpleEditStep;
|
||||||
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
|
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Step for editing the associated contacts.
|
||||||
*
|
*
|
||||||
* @author Jens Pelzetter
|
* @author Jens Pelzetter
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,21 @@
|
||||||
/*
|
/*
|
||||||
* To change this template, choose Tools | Templates
|
* Copyright (c) 2010 Jens Pelzetter,
|
||||||
* and open the template in the editor.
|
* for the Center of Social Politics of the University of Bremen
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public License
|
||||||
|
* as published by the Free Software Foundation; either version 2.1 of
|
||||||
|
* the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
package com.arsdigita.cms.contenttypes.ui;
|
package com.arsdigita.cms.contenttypes.ui;
|
||||||
|
|
||||||
|
|
@ -31,6 +46,7 @@ import java.math.BigDecimal;
|
||||||
import java.math.BigInteger;
|
import java.math.BigInteger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Table for showing the contacts associated with an organization.
|
||||||
*
|
*
|
||||||
* @author Jens Pelzetter
|
* @author Jens Pelzetter
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,21 @@
|
||||||
/*
|
/*
|
||||||
* To change this template, choose Tools | Templates
|
* Copyright (c) 2010 Jens Pelzetter,
|
||||||
* and open the template in the editor.
|
* for the Center of Social Politics of the University of Bremen
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public License
|
||||||
|
* as published by the Free Software Foundation; either version 2.1 of
|
||||||
|
* the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
package com.arsdigita.cms.contenttypes.ui;
|
package com.arsdigita.cms.contenttypes.ui;
|
||||||
|
|
||||||
|
|
@ -20,6 +35,7 @@ import com.arsdigita.cms.ui.authoring.BasicItemForm;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Form for adding related persons the an organization.
|
||||||
*
|
*
|
||||||
* @author Jens Pelzetter
|
* @author Jens Pelzetter
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,22 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2010 Jens Pelzetter,
|
||||||
|
* for the Center of Social Politics of the University of Bremen
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public License
|
||||||
|
* as published by the Free Software Foundation; either version 2.1 of
|
||||||
|
* the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
*
|
||||||
|
*/
|
||||||
package com.arsdigita.cms.contenttypes.ui;
|
package com.arsdigita.cms.contenttypes.ui;
|
||||||
|
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
|
|
@ -8,10 +27,12 @@ import com.arsdigita.cms.ui.authoring.SimpleEditStep;
|
||||||
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
|
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Properties step for editing the persons related to an organization.
|
||||||
*
|
*
|
||||||
* @author Jens Pelzetter
|
* @author Jens Pelzetter
|
||||||
*/
|
*/
|
||||||
public class GenericOrganizationalUnitPersonPropertiesStep extends SimpleEditStep {
|
public class GenericOrganizationalUnitPersonPropertiesStep
|
||||||
|
extends SimpleEditStep {
|
||||||
|
|
||||||
private static final String ADD_PERSON_SHEET_NAME = "addPerson";
|
private static final String ADD_PERSON_SHEET_NAME = "addPerson";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,22 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2010 Jens Pelzetter,
|
||||||
|
* for the Center of Social Politics of the University of Bremen
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public License
|
||||||
|
* as published by the Free Software Foundation; either version 2.1 of
|
||||||
|
* the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
*
|
||||||
|
*/
|
||||||
package com.arsdigita.cms.contenttypes.ui;
|
package com.arsdigita.cms.contenttypes.ui;
|
||||||
|
|
||||||
import com.arsdigita.bebop.Component;
|
import com.arsdigita.bebop.Component;
|
||||||
|
|
@ -23,6 +42,7 @@ import com.arsdigita.util.LockableImpl;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Table for showing the persons associated with an organization.
|
||||||
*
|
*
|
||||||
* @author Jens Pelzetter
|
* @author Jens Pelzetter
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
* To change this template, choose Tools | Templates
|
* To change this template, choose Tools | Templates
|
||||||
* and open the template in the editor.
|
* and open the template in the editor.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.arsdigita.cms.contenttypes.ui;
|
package com.arsdigita.cms.contenttypes.ui;
|
||||||
|
|
||||||
import com.arsdigita.bebop.Component;
|
import com.arsdigita.bebop.Component;
|
||||||
|
|
@ -24,55 +23,45 @@ import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil;
|
||||||
import java.text.DateFormat;
|
import java.text.DateFormat;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* PropertiesStep for GenericOrganizationalUnits. This properties step uses an
|
||||||
|
* SegmentedPanel to show all relevant data of an organization. To change the
|
||||||
|
* steps shown, extend this class, and overwrite the {@link addSteps()} method.
|
||||||
*
|
*
|
||||||
* @author Jens Pelzetter
|
* @author Jens Pelzetter
|
||||||
*/
|
*/
|
||||||
public class GenericOrganizationalUnitPropertiesStep extends SimpleEditStep {
|
public class GenericOrganizationalUnitPropertiesStep extends SimpleEditStep {
|
||||||
|
|
||||||
public static final String EDIT_SHEET_NAME = "edit";
|
public static final String EDIT_SHEET_NAME = "edit";
|
||||||
|
private SegmentedPanel segmentedPanel;
|
||||||
|
|
||||||
public GenericOrganizationalUnitPropertiesStep(ItemSelectionModel itemModel,
|
public GenericOrganizationalUnitPropertiesStep(ItemSelectionModel itemModel,
|
||||||
AuthoringKitWizard parent) {
|
AuthoringKitWizard parent) {
|
||||||
super(itemModel, parent);
|
super(itemModel, parent);
|
||||||
|
|
||||||
SegmentedPanel segmentedPanel = new SegmentedPanel();
|
segmentedPanel = new SegmentedPanel();
|
||||||
|
|
||||||
setDefaultEditKey(EDIT_SHEET_NAME);
|
setDefaultEditKey(EDIT_SHEET_NAME);
|
||||||
|
|
||||||
SimpleEditStep basicProperties = new SimpleEditStep(itemModel,
|
addBasicProperties(itemModel, parent);
|
||||||
parent,
|
addSteps(itemModel, parent);
|
||||||
EDIT_SHEET_NAME);
|
|
||||||
|
|
||||||
BasicPageForm editBasicSheet =
|
|
||||||
new GenericOrganizationalUnitPropertyForm(itemModel, this);
|
|
||||||
basicProperties.add(EDIT_SHEET_NAME,
|
|
||||||
(String) ContenttypesGlobalizationUtil
|
|
||||||
.globalize("cms.contenttypes.ui.genericorgaunit.edit_basic_properties").localize(),
|
|
||||||
new WorkflowLockedComponentAccess(editBasicSheet, itemModel),
|
|
||||||
editBasicSheet.getSaveCancelSection().getCancelButton());
|
|
||||||
|
|
||||||
basicProperties.setDisplayComponent(getGenericOrganizationalUnitPropertySheet(itemModel));
|
|
||||||
|
|
||||||
segmentedPanel.addSegment(
|
|
||||||
new Label((String) ContenttypesGlobalizationUtil
|
|
||||||
.globalize("cms.contenttypes.ui.genericorganunit.basic_properties").localize()),
|
|
||||||
basicProperties);
|
|
||||||
|
|
||||||
setDisplayComponent(segmentedPanel);
|
setDisplayComponent(segmentedPanel);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Component
|
public static Component getGenericOrganizationalUnitPropertySheet(
|
||||||
getGenericOrganizationalUnitPropertySheet(
|
|
||||||
ItemSelectionModel itemModel) {
|
ItemSelectionModel itemModel) {
|
||||||
DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(itemModel);
|
DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(
|
||||||
|
itemModel);
|
||||||
|
|
||||||
sheet.add(ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.genericorganunit.name"),
|
sheet.add(ContenttypesGlobalizationUtil.globalize(
|
||||||
|
"cms.contenttypes.ui.genericorganunit.name"),
|
||||||
GenericOrganizationalUnit.NAME);
|
GenericOrganizationalUnit.NAME);
|
||||||
sheet.add(ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.genericorganunit.addendum"),
|
sheet.add(ContenttypesGlobalizationUtil.globalize(
|
||||||
|
"cms.contenttypes.ui.genericorganunit.addendum"),
|
||||||
GenericOrganizationalUnit.ADDENDUM);
|
GenericOrganizationalUnit.ADDENDUM);
|
||||||
|
|
||||||
if (!ContentSection.getConfig().getHideLaunchDate()) {
|
if (!ContentSection.getConfig().getHideLaunchDate()) {
|
||||||
sheet.add((String) ContenttypesGlobalizationUtil.globalize("cms.ui.authoring.page_launch_date").localize(),
|
sheet.add((String) ContenttypesGlobalizationUtil.globalize(
|
||||||
|
"cms.ui.authoring.page_launch_date").localize(),
|
||||||
ContentPage.LAUNCH_DATE,
|
ContentPage.LAUNCH_DATE,
|
||||||
new DomainObjectPropertySheet.AttributeFormatter() {
|
new DomainObjectPropertySheet.AttributeFormatter() {
|
||||||
|
|
||||||
|
|
@ -81,9 +70,11 @@ public class GenericOrganizationalUnitPropertiesStep extends SimpleEditStep {
|
||||||
PageState state) {
|
PageState state) {
|
||||||
ContentPage page = (ContentPage) item;
|
ContentPage page = (ContentPage) item;
|
||||||
if (page.getLaunchDate() != null) {
|
if (page.getLaunchDate() != null) {
|
||||||
return DateFormat.getDateInstance(DateFormat.LONG).format(page.getLaunchDate());
|
return DateFormat.getDateInstance(DateFormat.LONG).
|
||||||
|
format(page.getLaunchDate());
|
||||||
} else {
|
} else {
|
||||||
return (String) ContenttypesGlobalizationUtil.globalize("cms.ui.unknown").localize();
|
return (String) ContenttypesGlobalizationUtil.globalize(
|
||||||
|
"cms.ui.unknown").localize();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -91,4 +82,63 @@ public class GenericOrganizationalUnitPropertiesStep extends SimpleEditStep {
|
||||||
|
|
||||||
return sheet;
|
return sheet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void addBasicProperties(ItemSelectionModel itemModel,
|
||||||
|
AuthoringKitWizard parent) {
|
||||||
|
SimpleEditStep basicProperties = new SimpleEditStep(itemModel,
|
||||||
|
parent,
|
||||||
|
EDIT_SHEET_NAME);
|
||||||
|
|
||||||
|
BasicPageForm editBasicSheet =
|
||||||
|
new GenericOrganizationalUnitPropertyForm(itemModel, this);
|
||||||
|
basicProperties.add(EDIT_SHEET_NAME,
|
||||||
|
(String) ContenttypesGlobalizationUtil.globalize(
|
||||||
|
"cms.contenttypes.ui.genericorgaunit.edit_basic_properties").
|
||||||
|
localize(),
|
||||||
|
new WorkflowLockedComponentAccess(editBasicSheet,
|
||||||
|
itemModel),
|
||||||
|
editBasicSheet.getSaveCancelSection().
|
||||||
|
getCancelButton());
|
||||||
|
|
||||||
|
basicProperties.setDisplayComponent(getGenericOrganizationalUnitPropertySheet(
|
||||||
|
itemModel));
|
||||||
|
|
||||||
|
segmentedPanel.addSegment(
|
||||||
|
new Label((String) ContenttypesGlobalizationUtil.globalize(
|
||||||
|
"cms.contenttypes.ui.genericorganunit.basic_properties").
|
||||||
|
localize()),
|
||||||
|
basicProperties);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method adds the steps for editing the relations of an organization.
|
||||||
|
* To change the steps, overwrite this method.
|
||||||
|
*
|
||||||
|
* @param itemModel
|
||||||
|
* @param parent
|
||||||
|
*/
|
||||||
|
protected void addSteps(ItemSelectionModel itemModel,
|
||||||
|
AuthoringKitWizard parent) {
|
||||||
|
addStep(new GenericOrganizationalUnitContactPropertiesStep(itemModel,
|
||||||
|
parent),
|
||||||
|
"cms.contenttypes.ui.orgaunit.contact");
|
||||||
|
addStep(new GenericOrganizationalUnitChildrenPropertiesStep(itemModel,
|
||||||
|
parent),
|
||||||
|
"cms.contenttypes.ui.orgaunit.contact");
|
||||||
|
addStep(new GenericOrganizationalUnitPersonPropertiesStep(itemModel,
|
||||||
|
parent),
|
||||||
|
"cms.contenttypes.ui.orgaunit.persons");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Helper method for editing a step.
|
||||||
|
*
|
||||||
|
* @param step
|
||||||
|
* @param labelKey
|
||||||
|
*/
|
||||||
|
protected void addStep(SimpleEditStep step, String labelKey) {
|
||||||
|
segmentedPanel.addSegment(new Label((String) ContenttypesGlobalizationUtil.
|
||||||
|
globalize(labelKey).localize()),
|
||||||
|
step);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,21 @@
|
||||||
/*
|
/*
|
||||||
* To change this template, choose Tools | Templates
|
* Copyright (c) 2010 Jens Pelzetter,
|
||||||
* and open the template in the editor.
|
for the Center of Social Politics of the University of Bremen
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Lesser General Public License
|
||||||
|
* as published by the Free Software Foundation; either version 2.1 of
|
||||||
|
* the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public
|
||||||
|
* License along with this library; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
package com.arsdigita.cms.contenttypes.ui;
|
package com.arsdigita.cms.contenttypes.ui;
|
||||||
|
|
||||||
|
|
@ -12,7 +27,6 @@ import com.arsdigita.bebop.event.FormProcessListener;
|
||||||
import com.arsdigita.bebop.event.FormSectionEvent;
|
import com.arsdigita.bebop.event.FormSectionEvent;
|
||||||
import com.arsdigita.bebop.event.FormSubmissionListener;
|
import com.arsdigita.bebop.event.FormSubmissionListener;
|
||||||
import com.arsdigita.bebop.form.TextField;
|
import com.arsdigita.bebop.form.TextField;
|
||||||
import com.arsdigita.bebop.parameters.DateParameter;
|
|
||||||
import com.arsdigita.bebop.parameters.ParameterModel;
|
import com.arsdigita.bebop.parameters.ParameterModel;
|
||||||
import com.arsdigita.bebop.parameters.StringParameter;
|
import com.arsdigita.bebop.parameters.StringParameter;
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
|
|
@ -22,6 +36,7 @@ import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Form for editing the basic properties of an GenericOrganizationalUnit.
|
||||||
*
|
*
|
||||||
* @author Jens Pelzetter
|
* @author Jens Pelzetter
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue