Weitere Assoziation (GenericOrganizationalUnit <-> GenericOrganizationalUnit, Ticket #1114) umgestellt (Sprachunhängigkeit), sowie Publizierenvorgang für diese Assoziation optimiert.
git-svn-id: https://svn.libreccm.org/ccm/trunk@1566 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
07dd42dc28
commit
d6839274b0
|
|
@ -75,15 +75,15 @@ association {
|
||||||
//Used build hierarchies of organizational units
|
//Used build hierarchies of organizational units
|
||||||
association {
|
association {
|
||||||
|
|
||||||
GenericOrganizationalUnit[0..n] superiorOrgaunits = join cms_organizationalunits.organizationalunit_id
|
GenericOrganizationalUnitBundle[0..n] superiorOrgaunits = join cms_orgaunit_bundles.bundle_id
|
||||||
to cms_organizationalunits_hierarchy_map.subordinate_orgaunit_id,
|
to cms_organizationalunits_hierarchy_map.subordinate_orgaunit_id,
|
||||||
join cms_organizationalunits_hierarchy_map.superior_orgaunit_id
|
join cms_organizationalunits_hierarchy_map.superior_orgaunit_id
|
||||||
to cms_organizationalunits.organizationalunit_id;
|
to cms_orgaunit_bundles.bundle_id;
|
||||||
|
|
||||||
GenericOrganizationalUnit[0..n] subordinateOrgaunits = join cms_organizationalunits.organizationalunit_id
|
GenericOrganizationalUnitBundle[0..n] subordinateOrgaunits = join cms_orgaunit_bundles.bundle_id
|
||||||
to cms_organizationalunits_hierarchy_map.superior_orgaunit_id,
|
to cms_organizationalunits_hierarchy_map.superior_orgaunit_id,
|
||||||
join cms_organizationalunits_hierarchy_map.subordinate_orgaunit_id
|
join cms_organizationalunits_hierarchy_map.subordinate_orgaunit_id
|
||||||
to cms_organizationalunits.organizationalunit_id;
|
to cms_orgaunit_bundles.bundle_id;
|
||||||
|
|
||||||
//Additonal attributes for the assoication
|
//Additonal attributes for the assoication
|
||||||
//Optional string for *internal* data
|
//Optional string for *internal* data
|
||||||
|
|
|
||||||
|
|
@ -172,14 +172,15 @@ public class GenericOrganizationalUnit extends ContentPage {
|
||||||
}
|
}
|
||||||
|
|
||||||
public GenericOrganizationalUnitSuperiorCollection getSuperiorOrgaUnits() {
|
public GenericOrganizationalUnitSuperiorCollection getSuperiorOrgaUnits() {
|
||||||
final DataCollection dataCollection = (DataCollection) get(
|
//final DataCollection dataCollection = (DataCollection) get(
|
||||||
SUPERIOR_ORGAUNITS);
|
// SUPERIOR_ORGAUNITS);
|
||||||
return new GenericOrganizationalUnitSuperiorCollection(dataCollection);
|
//return new GenericOrganizationalUnitSuperiorCollection(dataCollection);
|
||||||
|
return getGenericOrganizationalUnitBundle().getSuperiorOrgaUnits();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addSuperiorOrgaUnit(final GenericOrganizationalUnit orgaunit,
|
public void addSuperiorOrgaUnit(final GenericOrganizationalUnit orgaunit,
|
||||||
final String assocType) {
|
final String assocType) {
|
||||||
Assert.exists(orgaunit, GenericOrganizationalUnit.class);
|
/*Assert.exists(orgaunit, GenericOrganizationalUnit.class);
|
||||||
|
|
||||||
final DataObject link = add(SUPERIOR_ORGAUNITS, orgaunit);
|
final DataObject link = add(SUPERIOR_ORGAUNITS, orgaunit);
|
||||||
link.set(GenericOrganizationalUnitSuperiorCollection.ASSOCTYPE,
|
link.set(GenericOrganizationalUnitSuperiorCollection.ASSOCTYPE,
|
||||||
|
|
@ -190,7 +191,9 @@ public class GenericOrganizationalUnit extends ContentPage {
|
||||||
link.set(
|
link.set(
|
||||||
GenericOrganizationalUnitSubordinateCollection.SUBORDINATE_ORGAUNIT_ORDER,
|
GenericOrganizationalUnitSubordinateCollection.SUBORDINATE_ORGAUNIT_ORDER,
|
||||||
((int) getSubordinateOrgaUnits().size()) + 1);
|
((int) getSubordinateOrgaUnits().size()) + 1);
|
||||||
link.save();
|
link.save();*/
|
||||||
|
getGenericOrganizationalUnitBundle().addSuperiorOrgaUnit(orgaunit,
|
||||||
|
assocType);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addSuperiorOrgaUnit(final GenericOrganizationalUnit orgaunit) {
|
public void addSuperiorOrgaUnit(final GenericOrganizationalUnit orgaunit) {
|
||||||
|
|
@ -199,41 +202,26 @@ public class GenericOrganizationalUnit extends ContentPage {
|
||||||
|
|
||||||
public void removeSuperiorOrgaUnit(
|
public void removeSuperiorOrgaUnit(
|
||||||
final GenericOrganizationalUnit orgaunit) {
|
final GenericOrganizationalUnit orgaunit) {
|
||||||
Assert.exists(orgaunit, GenericOrganizationalUnit.class);
|
//Assert.exists(orgaunit, GenericOrganizationalUnit.class);
|
||||||
remove(SUPERIOR_ORGAUNITS, orgaunit);
|
//remove(SUPERIOR_ORGAUNITS, orgaunit);
|
||||||
|
getGenericOrganizationalUnitBundle().removeSuperiorOrgaUnit(orgaunit);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasSuperiorOrgaUnits() {
|
public boolean hasSuperiorOrgaUnits() {
|
||||||
return !getSuperiorOrgaUnits().isEmpty();
|
//return !getSuperiorOrgaUnits().isEmpty();
|
||||||
|
return getGenericOrganizationalUnitBundle().hasSuperiorOrgaUnits();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets a collection of subordinate organizational units. Note that their
|
|
||||||
* is no authoring step registered for this property. The {@code ccm-cms}
|
|
||||||
* module provides only a form for adding subordinate organizational units
|
|
||||||
* and a table for showing them. Subtypes of
|
|
||||||
* {@code GenericOrganizationalUnit} may add these components to their
|
|
||||||
* authoring steps via a new authoring step which contains the form
|
|
||||||
* and the table. These authoring steps should be registered by using
|
|
||||||
* {@link AuthoringKitWizard#registerAssetStep(java.lang.String, java.lang.Class, com.arsdigita.globalization.GlobalizedMessage, com.arsdigita.globalization.GlobalizedMessage, int) }
|
|
||||||
* in the initalizer of the content type. Some aspects of the form and
|
|
||||||
* table, for example the labels, can be configured using implementations
|
|
||||||
* of two interfaces. Please refer to the documentation of
|
|
||||||
* {@link GenericOrganizationalUnitSubordinateOrgaUnitsTable} and
|
|
||||||
* {@link GenericOrganizationalUnitSubordinateOrgaUnitAddForm}
|
|
||||||
* for more information about customizing the table and the form.
|
|
||||||
*
|
|
||||||
* @return A collection of subordinate organizational units.
|
|
||||||
*/
|
|
||||||
public GenericOrganizationalUnitSubordinateCollection getSubordinateOrgaUnits() {
|
public GenericOrganizationalUnitSubordinateCollection getSubordinateOrgaUnits() {
|
||||||
final DataCollection dataCollection = (DataCollection) get(
|
//final DataCollection dataCollection = (DataCollection) get(
|
||||||
SUBORDINATE_ORGAUNITS);
|
// SUBORDINATE_ORGAUNITS);
|
||||||
return new GenericOrganizationalUnitSubordinateCollection(dataCollection);
|
//return new GenericOrganizationalUnitSubordinateCollection(dataCollection);
|
||||||
|
return getGenericOrganizationalUnitBundle().getSubordinateOrgaUnits();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addSubordinateOrgaUnit(final GenericOrganizationalUnit orgaunit,
|
public void addSubordinateOrgaUnit(final GenericOrganizationalUnit orgaunit,
|
||||||
final String assocType) {
|
final String assocType) {
|
||||||
Assert.exists(orgaunit, GenericOrganizationalUnit.class);
|
/*Assert.exists(orgaunit, GenericOrganizationalUnit.class);
|
||||||
|
|
||||||
final DataObject link = add(SUBORDINATE_ORGAUNITS, orgaunit);
|
final DataObject link = add(SUBORDINATE_ORGAUNITS, orgaunit);
|
||||||
link.set(GenericOrganizationalUnitSubordinateCollection.ASSOCTYPE,
|
link.set(GenericOrganizationalUnitSubordinateCollection.ASSOCTYPE,
|
||||||
|
|
@ -244,7 +232,9 @@ public class GenericOrganizationalUnit extends ContentPage {
|
||||||
link.set(
|
link.set(
|
||||||
GenericOrganizationalUnitSuperiorCollection.SUPERIOR_ORGAUNIT_ORDER,
|
GenericOrganizationalUnitSuperiorCollection.SUPERIOR_ORGAUNIT_ORDER,
|
||||||
((int) getSuperiorOrgaUnits().size()) + 1);
|
((int) getSuperiorOrgaUnits().size()) + 1);
|
||||||
link.save();
|
link.save();*/
|
||||||
|
getGenericOrganizationalUnitBundle().addSubordinateOrgaUnit(orgaunit,
|
||||||
|
assocType);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addSubordinateOrgaUnit(final GenericOrganizationalUnit orgaunit) {
|
public void addSubordinateOrgaUnit(final GenericOrganizationalUnit orgaunit) {
|
||||||
|
|
@ -253,12 +243,14 @@ public class GenericOrganizationalUnit extends ContentPage {
|
||||||
|
|
||||||
public void removeSubordinateOrgaUnit(
|
public void removeSubordinateOrgaUnit(
|
||||||
final GenericOrganizationalUnit orgaunit) {
|
final GenericOrganizationalUnit orgaunit) {
|
||||||
Assert.exists(orgaunit, GenericOrganizationalUnit.class);
|
//Assert.exists(orgaunit, GenericOrganizationalUnit.class);
|
||||||
remove(SUBORDINATE_ORGAUNITS, orgaunit);
|
//remove(SUBORDINATE_ORGAUNITS, orgaunit);
|
||||||
|
getGenericOrganizationalUnitBundle().removeSubordinateOrgaUnit(orgaunit);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean hasSubordinateOrgaUnits() {
|
public boolean hasSubordinateOrgaUnits() {
|
||||||
return !getSubordinateOrgaUnits().isEmpty();
|
//return !getSubordinateOrgaUnits().isEmpty();
|
||||||
|
return getGenericOrganizationalUnitBundle().hasSubordinateOrgaUnits();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,8 @@ public class GenericOrganizationalUnitBundle extends ContentBundle {
|
||||||
public static final String PERSONS = "persons";
|
public static final String PERSONS = "persons";
|
||||||
public static final String ORGAUNITS = "organizationalunits";
|
public static final String ORGAUNITS = "organizationalunits";
|
||||||
public final static String CONTACTS = "contacts";
|
public final static String CONTACTS = "contacts";
|
||||||
|
public final static String SUPERIOR_ORGAUNITS = "superiorOrgaunits";
|
||||||
|
public final static String SUBORDINATE_ORGAUNITS = "subordinateOrgaunits";
|
||||||
|
|
||||||
public GenericOrganizationalUnitBundle(final ContentItem primary) {
|
public GenericOrganizationalUnitBundle(final ContentItem primary) {
|
||||||
super(BASE_DATA_OBJECT_TYPE);
|
super(BASE_DATA_OBJECT_TYPE);
|
||||||
|
|
@ -111,13 +113,109 @@ public class GenericOrganizationalUnitBundle extends ContentBundle {
|
||||||
return !this.getContacts().isEmpty();
|
return !this.getContacts().isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public GenericOrganizationalUnitSuperiorCollection getSuperiorOrgaUnits() {
|
||||||
|
return new GenericOrganizationalUnitSuperiorCollection((DataCollection) get(
|
||||||
|
SUPERIOR_ORGAUNITS));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addSuperiorOrgaUnit(final GenericOrganizationalUnit orgaunit,
|
||||||
|
final String assocType) {
|
||||||
|
Assert.exists(orgaunit, GenericOrganizationalUnit.class);
|
||||||
|
|
||||||
|
final DataObject link =
|
||||||
|
add(SUPERIOR_ORGAUNITS,
|
||||||
|
orgaunit.getGenericOrganizationalUnitBundle());
|
||||||
|
link.set(GenericOrganizationalUnitSuperiorCollection.ASSOCTYPE,
|
||||||
|
assocType);
|
||||||
|
link.set(
|
||||||
|
GenericOrganizationalUnitSuperiorCollection.SUPERIOR_ORGAUNIT_ORDER,
|
||||||
|
(int) getSuperiorOrgaUnits().size());
|
||||||
|
link.set(
|
||||||
|
GenericOrganizationalUnitSubordinateCollection.SUBORDINATE_ORGAUNIT_ORDER,
|
||||||
|
(int) getSubordinateOrgaUnits().size() + 1);
|
||||||
|
|
||||||
|
link.save();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addSuperiorOrgaUnit(final GenericOrganizationalUnit orgaunit) {
|
||||||
|
addSuperiorOrgaUnit(orgaunit, "");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void removeSuperiorOrgaUnit(
|
||||||
|
final GenericOrganizationalUnit orgaunit) {
|
||||||
|
Assert.exists(orgaunit, GenericOrganizationalUnit.class);
|
||||||
|
remove(SUPERIOR_ORGAUNITS, orgaunit.getGenericOrganizationalUnitBundle());
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean hasSuperiorOrgaUnits() {
|
||||||
|
return !getSuperiorOrgaUnits().isEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets a collection of subordinate organizational units. Note that their
|
||||||
|
* is no authoring step registered for this property. The {@code ccm-cms}
|
||||||
|
* module provides only a form for adding subordinate organizational units
|
||||||
|
* and a table for showing them. Subtypes of
|
||||||
|
* {@code GenericOrganizationalUnit} may add these components to their
|
||||||
|
* authoring steps via a new authoring step which contains the form
|
||||||
|
* and the table. These authoring steps should be registered by using
|
||||||
|
* {@link AuthoringKitWizard#registerAssetStep(java.lang.String, java.lang.Class, com.arsdigita.globalization.GlobalizedMessage, com.arsdigita.globalization.GlobalizedMessage, int) }
|
||||||
|
* in the initalizer of the content type. Some aspects of the form and
|
||||||
|
* table, for example the labels, can be configured using implementations
|
||||||
|
* of two interfaces. Please refer to the documentation of
|
||||||
|
* {@link GenericOrganizationalUnitSubordinateOrgaUnitsTable} and
|
||||||
|
* {@link GenericOrganizationalUnitSubordinateOrgaUnitAddForm}
|
||||||
|
* for more information about customizing the table and the form.
|
||||||
|
*
|
||||||
|
* @return A collection of subordinate organizational units.
|
||||||
|
*/
|
||||||
|
public GenericOrganizationalUnitSubordinateCollection getSubordinateOrgaUnits() {
|
||||||
|
final DataCollection dataCollection = (DataCollection) get(
|
||||||
|
SUBORDINATE_ORGAUNITS);
|
||||||
|
return new GenericOrganizationalUnitSubordinateCollection(dataCollection);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addSubordinateOrgaUnit(final GenericOrganizationalUnit orgaunit,
|
||||||
|
final String assocType) {
|
||||||
|
Assert.exists(orgaunit, GenericOrganizationalUnit.class);
|
||||||
|
|
||||||
|
final DataObject link =
|
||||||
|
add(SUBORDINATE_ORGAUNITS,
|
||||||
|
orgaunit.getGenericOrganizationalUnitBundle());
|
||||||
|
link.set(GenericOrganizationalUnitSubordinateCollection.ASSOCTYPE,
|
||||||
|
assocType);
|
||||||
|
link.set(
|
||||||
|
GenericOrganizationalUnitSubordinateCollection.SUBORDINATE_ORGAUNIT_ORDER,
|
||||||
|
(int) getSubordinateOrgaUnits().size());
|
||||||
|
link.set(
|
||||||
|
GenericOrganizationalUnitSuperiorCollection.SUPERIOR_ORGAUNIT_ORDER,
|
||||||
|
((int) getSuperiorOrgaUnits().size()) + 1);
|
||||||
|
link.save();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addSubordinateOrgaUnit(final GenericOrganizationalUnit orgaunit) {
|
||||||
|
addSubordinateOrgaUnit(orgaunit, "");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void removeSubordinateOrgaUnit(
|
||||||
|
final GenericOrganizationalUnit orgaunit) {
|
||||||
|
Assert.exists(orgaunit, GenericOrganizationalUnit.class);
|
||||||
|
remove(SUBORDINATE_ORGAUNITS,
|
||||||
|
orgaunit.getGenericOrganizationalUnitBundle());
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean hasSubordinateOrgaUnits() {
|
||||||
|
return !getSubordinateOrgaUnits().isEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean copyProperty(final CustomCopy source,
|
public boolean copyProperty(final CustomCopy source,
|
||||||
final Property property,
|
final Property property,
|
||||||
final ItemCopier copier) {
|
final ItemCopier copier) {
|
||||||
final String attribute = property.getName();
|
final String attribute = property.getName();
|
||||||
if (copier.getCopyType() == ItemCopier.VERSION_COPY) {
|
if (copier.getCopyType() == ItemCopier.VERSION_COPY) {
|
||||||
final GenericOrganizationalUnitBundle orgaBundle = (GenericOrganizationalUnitBundle) source;
|
final GenericOrganizationalUnitBundle orgaBundle =
|
||||||
|
(GenericOrganizationalUnitBundle) source;
|
||||||
|
|
||||||
if (CONTACTS.equals(attribute)) {
|
if (CONTACTS.equals(attribute)) {
|
||||||
final DataCollection contacts = (DataCollection) orgaBundle.get(
|
final DataCollection contacts = (DataCollection) orgaBundle.get(
|
||||||
|
|
@ -136,6 +234,25 @@ public class GenericOrganizationalUnitBundle extends ContentBundle {
|
||||||
createPersonAssoc(persons);
|
createPersonAssoc(persons);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
} else if (SUPERIOR_ORGAUNITS.equals(attribute)) {
|
||||||
|
final DataCollection superOrgaUnits =
|
||||||
|
(DataCollection) orgaBundle.get(
|
||||||
|
SUPERIOR_ORGAUNITS);
|
||||||
|
|
||||||
|
while (superOrgaUnits.next()) {
|
||||||
|
createSuperiorAssoc(superOrgaUnits);
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
} else if (SUBORDINATE_ORGAUNITS.equals(attribute)) {
|
||||||
|
final DataCollection subOrgaUnits = (DataCollection) orgaBundle.
|
||||||
|
get(SUBORDINATE_ORGAUNITS);
|
||||||
|
|
||||||
|
while (subOrgaUnits.next()) {
|
||||||
|
createSubordinateAssoc(subOrgaUnits);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return super.copyProperty(source, property, copier);
|
return super.copyProperty(source, property, copier);
|
||||||
|
|
@ -146,9 +263,11 @@ public class GenericOrganizationalUnitBundle extends ContentBundle {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createContactAssoc(final DataCollection contacts) {
|
private void createContactAssoc(final DataCollection contacts) {
|
||||||
final GenericContactBundle draftContact = (GenericContactBundle) DomainObjectFactory.
|
final GenericContactBundle draftContact =
|
||||||
|
(GenericContactBundle) DomainObjectFactory.
|
||||||
newInstance(contacts.getDataObject());
|
newInstance(contacts.getDataObject());
|
||||||
final GenericContactBundle liveContact = (GenericContactBundle) draftContact.
|
final GenericContactBundle liveContact =
|
||||||
|
(GenericContactBundle) draftContact.
|
||||||
getLiveVersion();
|
getLiveVersion();
|
||||||
|
|
||||||
if (liveContact != null) {
|
if (liveContact != null) {
|
||||||
|
|
@ -166,9 +285,11 @@ public class GenericOrganizationalUnitBundle extends ContentBundle {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createPersonAssoc(final DataCollection persons) {
|
private void createPersonAssoc(final DataCollection persons) {
|
||||||
final GenericPersonBundle draftPerson = (GenericPersonBundle) DomainObjectFactory.
|
final GenericPersonBundle draftPerson =
|
||||||
|
(GenericPersonBundle) DomainObjectFactory.
|
||||||
newInstance(persons.getDataObject());
|
newInstance(persons.getDataObject());
|
||||||
final GenericPersonBundle livePerson = (GenericPersonBundle) draftPerson.
|
final GenericPersonBundle livePerson =
|
||||||
|
(GenericPersonBundle) draftPerson.
|
||||||
getLiveVersion();
|
getLiveVersion();
|
||||||
|
|
||||||
if (livePerson != null) {
|
if (livePerson != null) {
|
||||||
|
|
@ -183,6 +304,60 @@ public class GenericOrganizationalUnitBundle extends ContentBundle {
|
||||||
|
|
||||||
link.save();
|
link.save();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void createSuperiorAssoc(final DataCollection superOrgaUnits) {
|
||||||
|
final GenericOrganizationalUnitBundle draftOrga =
|
||||||
|
(GenericOrganizationalUnitBundle) DomainObjectFactory.
|
||||||
|
newInstance(superOrgaUnits.getDataObject());
|
||||||
|
final GenericOrganizationalUnitBundle liveOrga =
|
||||||
|
(GenericOrganizationalUnitBundle) draftOrga.
|
||||||
|
getLiveVersion();
|
||||||
|
|
||||||
|
if (liveOrga != null) {
|
||||||
|
final DataObject link = add(SUPERIOR_ORGAUNITS, liveOrga);
|
||||||
|
|
||||||
|
link.set(GenericOrganizationalUnitSuperiorCollection.ASSOCTYPE,
|
||||||
|
superOrgaUnits.get(
|
||||||
|
GenericOrganizationalUnitSuperiorCollection.LINK_ASSOCTYPE));
|
||||||
|
link.set(
|
||||||
|
GenericOrganizationalUnitSuperiorCollection.SUPERIOR_ORGAUNIT_ORDER,
|
||||||
|
superOrgaUnits.get(
|
||||||
|
GenericOrganizationalUnitSuperiorCollection.LINK_SUPERIOR_ORGAUNIT_ORDER));
|
||||||
|
link.set(
|
||||||
|
GenericOrganizationalUnitSubordinateCollection.SUBORDINATE_ORGAUNIT_ORDER,
|
||||||
|
superOrgaUnits.get(
|
||||||
|
GenericOrganizationalUnitSubordinateCollection.LINK_SUBORDINATE_ORGAUNIT_ORDER));
|
||||||
|
|
||||||
|
link.save();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void createSubordinateAssoc(final DataCollection subOrgaUnits) {
|
||||||
|
final GenericOrganizationalUnitBundle draftOrga =
|
||||||
|
(GenericOrganizationalUnitBundle) DomainObjectFactory.
|
||||||
|
newInstance(subOrgaUnits.getDataObject());
|
||||||
|
final GenericOrganizationalUnitBundle liveOrga =
|
||||||
|
(GenericOrganizationalUnitBundle) draftOrga.
|
||||||
|
getLiveVersion();
|
||||||
|
|
||||||
|
if (liveOrga != null) {
|
||||||
|
final DataObject link = add(SUBORDINATE_ORGAUNITS, liveOrga);
|
||||||
|
|
||||||
|
link.set(GenericOrganizationalUnitSubordinateCollection.ASSOCTYPE,
|
||||||
|
subOrgaUnits.get(
|
||||||
|
GenericOrganizationalUnitSubordinateCollection.LINK_ASSOCTYPE));
|
||||||
|
link.set(
|
||||||
|
GenericOrganizationalUnitSubordinateCollection.SUBORDINATE_ORGAUNIT_ORDER,
|
||||||
|
subOrgaUnits.get(
|
||||||
|
GenericOrganizationalUnitSubordinateCollection.LINK_SUBORDINATE_ORGAUNIT_ORDER));
|
||||||
|
link.set(
|
||||||
|
GenericOrganizationalUnitSuperiorCollection.SUPERIOR_ORGAUNIT_ORDER,
|
||||||
|
subOrgaUnits.get(
|
||||||
|
GenericOrganizationalUnitSuperiorCollection.SUPERIOR_ORGAUNIT_ORDER));
|
||||||
|
|
||||||
|
link.save();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.arsdigita.cms.contenttypes;
|
package com.arsdigita.cms.contenttypes;
|
||||||
|
|
||||||
|
import com.arsdigita.cms.ContentBundle;
|
||||||
import com.arsdigita.cms.ContentItem;
|
import com.arsdigita.cms.ContentItem;
|
||||||
import com.arsdigita.cms.ContentPage;
|
import com.arsdigita.cms.ContentPage;
|
||||||
import com.arsdigita.domain.DomainCollection;
|
import com.arsdigita.domain.DomainCollection;
|
||||||
|
|
@ -87,7 +88,7 @@ public class GenericOrganizationalUnitSubordinateCollection extends DomainCollec
|
||||||
next();
|
next();
|
||||||
setSubordinateOrder(currentIndex);
|
setSubordinateOrder(currentIndex);
|
||||||
rewind();
|
rewind();
|
||||||
|
|
||||||
normalizeOrder();
|
normalizeOrder();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -130,7 +131,7 @@ public class GenericOrganizationalUnitSubordinateCollection extends DomainCollec
|
||||||
next();
|
next();
|
||||||
setSubordinateOrder(previousIndex);
|
setSubordinateOrder(previousIndex);
|
||||||
rewind();
|
rewind();
|
||||||
|
|
||||||
normalizeOrder();
|
normalizeOrder();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -145,9 +146,16 @@ public class GenericOrganizationalUnitSubordinateCollection extends DomainCollec
|
||||||
this.rewind();
|
this.rewind();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public GenericOrganizationalUnitBundle getGenericOrganizationalUnitBundle() {
|
||||||
|
return (GenericOrganizationalUnitBundle) DomainObjectFactory.newInstance(
|
||||||
|
m_dataCollection.getDataObject());
|
||||||
|
}
|
||||||
|
|
||||||
public GenericOrganizationalUnit getGenericOrganizationalUnit() {
|
public GenericOrganizationalUnit getGenericOrganizationalUnit() {
|
||||||
return (GenericOrganizationalUnit) DomainObjectFactory.newInstance(m_dataCollection.
|
final ContentBundle bundle = (ContentBundle) DomainObjectFactory.
|
||||||
getDataObject());
|
newInstance(m_dataCollection.getDataObject());
|
||||||
|
|
||||||
|
return (GenericOrganizationalUnit) bundle.getPrimaryInstance();
|
||||||
}
|
}
|
||||||
|
|
||||||
public BigDecimal getId() {
|
public BigDecimal getId() {
|
||||||
|
|
@ -163,10 +171,10 @@ public class GenericOrganizationalUnitSubordinateCollection extends DomainCollec
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getTitle() {
|
public String getTitle() {
|
||||||
return (String) m_dataCollection.get(ContentPage.TITLE);
|
return getGenericOrganizationalUnit().getTitle();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getAddendum() {
|
public String getAddendum() {
|
||||||
return (String) m_dataCollection.get(GenericOrganizationalUnit.ADDENDUM);
|
return getGenericOrganizationalUnit().getAddendum();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.arsdigita.cms.contenttypes;
|
package com.arsdigita.cms.contenttypes;
|
||||||
|
|
||||||
|
import com.arsdigita.cms.ContentBundle;
|
||||||
import com.arsdigita.cms.ContentItem;
|
import com.arsdigita.cms.ContentItem;
|
||||||
import com.arsdigita.cms.ContentPage;
|
import com.arsdigita.cms.ContentPage;
|
||||||
import com.arsdigita.domain.DomainCollection;
|
import com.arsdigita.domain.DomainCollection;
|
||||||
|
|
@ -83,7 +84,7 @@ public class GenericOrganizationalUnitSuperiorCollection extends DomainCollectio
|
||||||
next();
|
next();
|
||||||
setSuperiorOrder(currentIndex);
|
setSuperiorOrder(currentIndex);
|
||||||
rewind();
|
rewind();
|
||||||
|
|
||||||
normalizeOrder();
|
normalizeOrder();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -126,11 +127,11 @@ public class GenericOrganizationalUnitSuperiorCollection extends DomainCollectio
|
||||||
next();
|
next();
|
||||||
setSuperiorOrder(previousIndex);
|
setSuperiorOrder(previousIndex);
|
||||||
rewind();
|
rewind();
|
||||||
|
|
||||||
normalizeOrder();
|
normalizeOrder();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void normalizeOrder() {
|
private void normalizeOrder() {
|
||||||
this.rewind();
|
this.rewind();
|
||||||
|
|
||||||
int i = 1;
|
int i = 1;
|
||||||
|
|
@ -141,9 +142,15 @@ public class GenericOrganizationalUnitSuperiorCollection extends DomainCollectio
|
||||||
this.rewind();
|
this.rewind();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public GenericOrganizationalUnitBundle getGenericOrganizationalUnitBundle() {
|
||||||
|
return (GenericOrganizationalUnitBundle) DomainObjectFactory.newInstance(
|
||||||
|
m_dataCollection.getDataObject());
|
||||||
|
}
|
||||||
|
|
||||||
public GenericOrganizationalUnit getGenericOrganizationalUnit() {
|
public GenericOrganizationalUnit getGenericOrganizationalUnit() {
|
||||||
return (GenericOrganizationalUnit) DomainObjectFactory.newInstance(m_dataCollection.
|
final ContentBundle bundle = (ContentBundle) DomainObjectFactory.
|
||||||
getDataObject());
|
newInstance(m_dataCollection.getDataObject());
|
||||||
|
return (GenericOrganizationalUnit) bundle.getPrimaryInstance();
|
||||||
}
|
}
|
||||||
|
|
||||||
public OID getOID() {
|
public OID getOID() {
|
||||||
|
|
@ -155,10 +162,10 @@ public class GenericOrganizationalUnitSuperiorCollection extends DomainCollectio
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getTitle() {
|
public String getTitle() {
|
||||||
return (String) m_dataCollection.get(ContentPage.TITLE);
|
return getGenericOrganizationalUnit().getTitle();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getAddendum() {
|
public String getAddendum() {
|
||||||
return (String) m_dataCollection.get(GenericOrganizationalUnit.ADDENDUM);
|
return getGenericOrganizationalUnit().getAddendum();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import com.arsdigita.bebop.FormData;
|
||||||
import com.arsdigita.bebop.FormProcessException;
|
import com.arsdigita.bebop.FormProcessException;
|
||||||
import com.arsdigita.bebop.PageState;
|
import com.arsdigita.bebop.PageState;
|
||||||
import com.arsdigita.bebop.event.FormSectionEvent;
|
import com.arsdigita.bebop.event.FormSectionEvent;
|
||||||
|
import com.arsdigita.cms.ContentItem;
|
||||||
import com.arsdigita.cms.ContentPage;
|
import com.arsdigita.cms.ContentPage;
|
||||||
import com.arsdigita.cms.ContentSection;
|
import com.arsdigita.cms.ContentSection;
|
||||||
import com.arsdigita.cms.Folder;
|
import com.arsdigita.cms.Folder;
|
||||||
|
|
@ -40,8 +41,8 @@ public class GenericOrganizationalUnitCreate extends PageCreate {
|
||||||
item.setLaunchDate((Date) data.get(LAUNCH_DATE));
|
item.setLaunchDate((Date) data.get(LAUNCH_DATE));
|
||||||
}
|
}
|
||||||
|
|
||||||
final GenericOrganizationalUnitBundle bundle = new GenericOrganizationalUnitBundle(
|
final GenericOrganizationalUnitBundle bundle = createBundle(item);
|
||||||
item);
|
//new GenericOrganizationalUnitBundle(item);
|
||||||
bundle.setParent(folder);
|
bundle.setParent(folder);
|
||||||
bundle.setContentSection(section);
|
bundle.setContentSection(section);
|
||||||
bundle.save();
|
bundle.save();
|
||||||
|
|
@ -51,4 +52,9 @@ public class GenericOrganizationalUnitCreate extends PageCreate {
|
||||||
m_parent.editItem(state, item);
|
m_parent.editItem(state, item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected GenericOrganizationalUnitBundle createBundle(
|
||||||
|
final ContentItem primary) {
|
||||||
|
return new GenericOrganizationalUnitBundle(primary);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ import com.arsdigita.cms.CMS;
|
||||||
import com.arsdigita.cms.ContentSection;
|
import com.arsdigita.cms.ContentSection;
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
import com.arsdigita.cms.contenttypes.GenericOrganizationalUnit;
|
import com.arsdigita.cms.contenttypes.GenericOrganizationalUnit;
|
||||||
|
import com.arsdigita.cms.contenttypes.GenericOrganizationalUnitBundle;
|
||||||
import com.arsdigita.cms.contenttypes.GenericOrganizationalUnitSuperiorCollection;
|
import com.arsdigita.cms.contenttypes.GenericOrganizationalUnitSuperiorCollection;
|
||||||
import com.arsdigita.cms.dispatcher.ItemResolver;
|
import com.arsdigita.cms.dispatcher.ItemResolver;
|
||||||
import com.arsdigita.cms.dispatcher.Utilities;
|
import com.arsdigita.cms.dispatcher.Utilities;
|
||||||
|
|
@ -170,11 +171,12 @@ public class GenericOrganizationalUnitSuperiorOrgaUnitsTable extends Table {
|
||||||
final Object key,
|
final Object key,
|
||||||
final int row,
|
final int row,
|
||||||
final int column) {
|
final int column) {
|
||||||
final com.arsdigita.cms.SecurityManager securityManager = Utilities.
|
final com.arsdigita.cms.SecurityManager securityManager = CMS.
|
||||||
getSecurityManager(state);
|
getSecurityManager(state);
|
||||||
final GenericOrganizationalUnit superiorOrgaUnit =
|
final GenericOrganizationalUnitBundle superiorOrgaUnitBundle =
|
||||||
(GenericOrganizationalUnit) DomainObjectFactory.
|
(GenericOrganizationalUnitBundle) DomainObjectFactory.
|
||||||
newInstance((OID) key);
|
newInstance((OID) key);
|
||||||
|
final GenericOrganizationalUnit superiorOrgaUnit = (GenericOrganizationalUnit) superiorOrgaUnitBundle.getPrimaryInstance();
|
||||||
|
|
||||||
final boolean canEdit = securityManager.canAccess(
|
final boolean canEdit = securityManager.canAccess(
|
||||||
state.getRequest(),
|
state.getRequest(),
|
||||||
|
|
@ -186,7 +188,7 @@ public class GenericOrganizationalUnitSuperiorOrgaUnitsTable extends Table {
|
||||||
getContentSection();
|
getContentSection();
|
||||||
final ItemResolver resolver = section.getItemResolver();
|
final ItemResolver resolver = section.getItemResolver();
|
||||||
final Link link = new Link(
|
final Link link = new Link(
|
||||||
String.format("%s (%s)",
|
String.format("%s",
|
||||||
value.toString(),
|
value.toString(),
|
||||||
superiorOrgaUnit.getLanguage()),
|
superiorOrgaUnit.getLanguage()),
|
||||||
resolver.generateItemURL(state,
|
resolver.generateItemURL(state,
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,10 @@ object type SciDepartment extends GenericOrganizationalUnit {
|
||||||
reference key ( ct_sci_departments.department_id );
|
reference key ( ct_sci_departments.department_id );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
object type SciDepartmentBundle extends GenericOrganizationalUnitBundle {
|
||||||
|
reference key (ct_sci_department_bundles.bundle_id);
|
||||||
|
}
|
||||||
|
|
||||||
query getIdsOfContactsOfSciDepartment {
|
query getIdsOfContactsOfSciDepartment {
|
||||||
BigDecimal contactId;
|
BigDecimal contactId;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
objectType="com.arsdigita.cms.contenttypes.SciDepartment"
|
objectType="com.arsdigita.cms.contenttypes.SciDepartment"
|
||||||
classname="com.arsdigita.cms.contenttypes.SciDepartment">
|
classname="com.arsdigita.cms.contenttypes.SciDepartment">
|
||||||
|
|
||||||
<ctd:authoring-kit createComponent="com.arsdigita.cms.contenttypes.ui.GenericOrganizationalUnitCreate">
|
<ctd:authoring-kit createComponent="com.arsdigita.cms.contenttypes.ui.SciDepartmentCreate">
|
||||||
|
|
||||||
<ctd:authoring-step
|
<ctd:authoring-step
|
||||||
labelKey="sciorganization.ui.department_properties.title"
|
labelKey="sciorganization.ui.department_properties.title"
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,48 @@
|
||||||
|
package com.arsdigita.cms.contenttypes;
|
||||||
|
|
||||||
|
import com.arsdigita.cms.ContentItem;
|
||||||
|
import com.arsdigita.domain.DataObjectNotFoundException;
|
||||||
|
import com.arsdigita.persistence.DataObject;
|
||||||
|
import com.arsdigita.persistence.OID;
|
||||||
|
import com.arsdigita.util.Assert;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Jens Pelzetter
|
||||||
|
* @version $Id$
|
||||||
|
*/
|
||||||
|
public class SciDepartmentBundle extends GenericOrganizationalUnitBundle {
|
||||||
|
|
||||||
|
public static final String BASE_DATA_OBJECT_TYPE =
|
||||||
|
"com.arsdigita.cms.contenttypes.SciDepartmentBundle";
|
||||||
|
|
||||||
|
public SciDepartmentBundle(final ContentItem primary) {
|
||||||
|
super(BASE_DATA_OBJECT_TYPE);
|
||||||
|
|
||||||
|
Assert.exists(primary, ContentItem.class);
|
||||||
|
|
||||||
|
setDefaultLanguage(primary.getLanguage());
|
||||||
|
setContentType(primary.getContentType());
|
||||||
|
addInstance(primary);
|
||||||
|
|
||||||
|
super.setName(primary.getName());
|
||||||
|
}
|
||||||
|
|
||||||
|
public SciDepartmentBundle(final OID oid) throws DataObjectNotFoundException {
|
||||||
|
super(oid);
|
||||||
|
}
|
||||||
|
|
||||||
|
public SciDepartmentBundle(final BigDecimal id) throws
|
||||||
|
DataObjectNotFoundException {
|
||||||
|
super(new OID(BASE_DATA_OBJECT_TYPE, id));
|
||||||
|
}
|
||||||
|
|
||||||
|
public SciDepartmentBundle(final DataObject dobj) {
|
||||||
|
super(dobj);
|
||||||
|
}
|
||||||
|
|
||||||
|
public SciDepartmentBundle(final String type) {
|
||||||
|
super(type);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,26 @@
|
||||||
|
package com.arsdigita.cms.contenttypes.ui;
|
||||||
|
|
||||||
|
import com.arsdigita.cms.ContentItem;
|
||||||
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
|
import com.arsdigita.cms.contenttypes.GenericOrganizationalUnitBundle;
|
||||||
|
import com.arsdigita.cms.contenttypes.SciDepartmentBundle;
|
||||||
|
import com.arsdigita.cms.ui.authoring.CreationSelector;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Jens Pelzetter
|
||||||
|
* @version $Id$
|
||||||
|
*/
|
||||||
|
public class SciDepartmentCreate extends GenericOrganizationalUnitCreate {
|
||||||
|
|
||||||
|
public SciDepartmentCreate(final ItemSelectionModel itemModel,
|
||||||
|
final CreationSelector parent) {
|
||||||
|
super(itemModel, parent);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected GenericOrganizationalUnitBundle createBundle(
|
||||||
|
final ContentItem primary) {
|
||||||
|
return new SciDepartmentBundle(primary);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -133,7 +133,7 @@ public class SciDepartmentProjectsStep extends SimpleEditStep {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getContentType() {
|
public String getContentType() {
|
||||||
return "com.arsdigita.cms.contenttypes.SciProject";
|
return "com.arsdigita.cms.contenttypes.SciProjectBundle";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -139,7 +139,7 @@ public class SciDepartmentSubDepartmentsStep extends SimpleEditStep {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getContentType() {
|
public String getContentType() {
|
||||||
return "com.arsdigita.cms.contenttypes.SciDepartment";
|
return "com.arsdigita.cms.contenttypes.SciDepartmentBundle";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -141,7 +141,7 @@ public class SciDepartmentSuperDepartmentsStep extends SimpleEditStep {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getContentType() {
|
public String getContentType() {
|
||||||
return "com.arsdigita.cms.contenttypes.SciDepartment";
|
return "com.arsdigita.cms.contenttypes.SciDepartmentBundle";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -128,7 +128,7 @@ public class SciProjectDepartmentsStep extends SimpleEditStep {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getContentType() {
|
public String getContentType() {
|
||||||
return "com.arsdigita.cms.contenttypes.SciDepartment";
|
return "com.arsdigita.cms.contenttypes.SciDepartmentBundle";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,10 @@ object type SciInstitute extends GenericOrganizationalUnit {
|
||||||
reference key ( ct_sci_institutes.institute_id );
|
reference key ( ct_sci_institutes.institute_id );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
object type SciInstituteBundle extends GenericOrganizationalUnitBundle {
|
||||||
|
reference key (ct_sci_institute_bundles.bundle_id);
|
||||||
|
}
|
||||||
|
|
||||||
query getIdsOfContactsOfSciInstitute {
|
query getIdsOfContactsOfSciInstitute {
|
||||||
BigDecimal contactId;
|
BigDecimal contactId;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
objectType="com.arsdigita.cms.contenttypes.SciInstitute"
|
objectType="com.arsdigita.cms.contenttypes.SciInstitute"
|
||||||
classname="com.arsdigita.cms.contenttypes.SciInstitute">
|
classname="com.arsdigita.cms.contenttypes.SciInstitute">
|
||||||
|
|
||||||
<ctd:authoring-kit createComponent="com.arsdigita.cms.contenttypes.ui.GenericOrganizationalUnitCreate">
|
<ctd:authoring-kit createComponent="com.arsdigita.cms.contenttypes.ui.SciInstituteCreate">
|
||||||
|
|
||||||
<ctd:authoring-step
|
<ctd:authoring-step
|
||||||
labelKey="sciorganization.ui.institute_properties.title"
|
labelKey="sciorganization.ui.institute_properties.title"
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,47 @@
|
||||||
|
package com.arsdigita.cms.contenttypes;
|
||||||
|
|
||||||
|
import com.arsdigita.cms.ContentItem;
|
||||||
|
import com.arsdigita.domain.DataObjectNotFoundException;
|
||||||
|
import com.arsdigita.persistence.DataObject;
|
||||||
|
import com.arsdigita.persistence.OID;
|
||||||
|
import com.arsdigita.util.Assert;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Jens Pelzetter
|
||||||
|
* @version $Id$
|
||||||
|
*/
|
||||||
|
public class SciInstituteBundle extends GenericOrganizationalUnitBundle {
|
||||||
|
|
||||||
|
public static final String BASE_DATA_OBJECT_TYPE =
|
||||||
|
"com.arsdigita.cms.contenttypes.SciInstituteBundle";
|
||||||
|
|
||||||
|
public SciInstituteBundle(final ContentItem primary) {
|
||||||
|
super(BASE_DATA_OBJECT_TYPE);
|
||||||
|
|
||||||
|
Assert.exists(primary, ContentItem.class);
|
||||||
|
|
||||||
|
setDefaultLanguage(primary.getLanguage());
|
||||||
|
setContentType(primary.getContentType());
|
||||||
|
addInstance(primary);
|
||||||
|
|
||||||
|
super.setName(primary.getName());
|
||||||
|
}
|
||||||
|
|
||||||
|
public SciInstituteBundle(final OID oid) throws DataObjectNotFoundException {
|
||||||
|
super(oid);
|
||||||
|
}
|
||||||
|
|
||||||
|
public SciInstituteBundle(final BigDecimal id) throws DataObjectNotFoundException {
|
||||||
|
super(new OID(BASE_DATA_OBJECT_TYPE, id));
|
||||||
|
}
|
||||||
|
|
||||||
|
public SciInstituteBundle(final DataObject dobj) {
|
||||||
|
super(dobj);
|
||||||
|
}
|
||||||
|
|
||||||
|
public SciInstituteBundle(final String type) {
|
||||||
|
super(type);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -144,7 +144,7 @@ public class SciDepartmentInstitutesStep extends SimpleEditStep {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getContentType() {
|
public String getContentType() {
|
||||||
return "com.arsdigita.cms.contenttypes.SciInstitute";
|
return "com.arsdigita.cms.contenttypes.SciInstituteBundle";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,26 @@
|
||||||
|
package com.arsdigita.cms.contenttypes.ui;
|
||||||
|
|
||||||
|
import com.arsdigita.cms.ContentItem;
|
||||||
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
|
import com.arsdigita.cms.contenttypes.GenericOrganizationalUnitBundle;
|
||||||
|
import com.arsdigita.cms.contenttypes.SciInstituteBundle;
|
||||||
|
import com.arsdigita.cms.ui.authoring.CreationSelector;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Jens Pelzetter
|
||||||
|
* @version $Id$
|
||||||
|
*/
|
||||||
|
public class SciInstituteCreate extends GenericOrganizationalUnitCreate {
|
||||||
|
|
||||||
|
public SciInstituteCreate(final ItemSelectionModel itemModel,
|
||||||
|
final CreationSelector parent) {
|
||||||
|
super(itemModel, parent);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected GenericOrganizationalUnitBundle createBundle(final ContentItem primary) {
|
||||||
|
return new SciInstituteBundle(primary);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -139,7 +139,7 @@ public class SciInstituteDepartmentsStep extends SimpleEditStep {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getContentType() {
|
public String getContentType() {
|
||||||
return "com.arsdigita.cms.contenttypes.SciDepartment";
|
return "com.arsdigita.cms.contenttypes.SciDepartmentBundle";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,10 @@ object type SciProject extends GenericOrganizationalUnit {
|
||||||
String[0..1] fundingVolume = ct_sci_projects.funding_volume VARCHAR(2000);
|
String[0..1] fundingVolume = ct_sci_projects.funding_volume VARCHAR(2000);
|
||||||
|
|
||||||
reference key ( ct_sci_projects.project_id );
|
reference key ( ct_sci_projects.project_id );
|
||||||
|
}
|
||||||
|
|
||||||
|
object type SciProjectBundle extends GenericOrganizationalUnitBundle {
|
||||||
|
reference key (ct_sci_project_bundles.bundle_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
query getIdsOfProjectsOfOrgaUnit {
|
query getIdsOfProjectsOfOrgaUnit {
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,49 @@
|
||||||
|
package com.arsdigita.cms.contenttypes;
|
||||||
|
|
||||||
|
import com.arsdigita.cms.ContentItem;
|
||||||
|
import com.arsdigita.domain.DataObjectNotFoundException;
|
||||||
|
import com.arsdigita.persistence.DataObject;
|
||||||
|
import com.arsdigita.persistence.OID;
|
||||||
|
import com.arsdigita.util.Assert;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Jens Pelzetter
|
||||||
|
* @version $Id$
|
||||||
|
*/
|
||||||
|
public class SciProjectBundle extends GenericOrganizationalUnitBundle {
|
||||||
|
|
||||||
|
public static final String BASE_DATA_OBJECT_TYPE =
|
||||||
|
"com.arsdigita.cms.contenttypes.SciProjectBundle";
|
||||||
|
|
||||||
|
public SciProjectBundle(final ContentItem primary) {
|
||||||
|
super(BASE_DATA_OBJECT_TYPE);
|
||||||
|
|
||||||
|
Assert.exists(primary, ContentItem.class);
|
||||||
|
|
||||||
|
setDefaultLanguage(primary.getLanguage());
|
||||||
|
setContentType(primary.getContentType());
|
||||||
|
addInstance(primary);
|
||||||
|
|
||||||
|
super.setName(primary.getName());
|
||||||
|
}
|
||||||
|
|
||||||
|
public SciProjectBundle(final OID oid)
|
||||||
|
throws DataObjectNotFoundException {
|
||||||
|
super(oid);
|
||||||
|
}
|
||||||
|
|
||||||
|
public SciProjectBundle(final BigDecimal id)
|
||||||
|
throws DataObjectNotFoundException {
|
||||||
|
super(new OID(BASE_DATA_OBJECT_TYPE, id));
|
||||||
|
}
|
||||||
|
|
||||||
|
public SciProjectBundle(final DataObject dobj) {
|
||||||
|
super(dobj);
|
||||||
|
}
|
||||||
|
|
||||||
|
public SciProjectBundle(final String type) {
|
||||||
|
super(type);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,26 @@
|
||||||
|
package com.arsdigita.cms.contenttypes.ui;
|
||||||
|
|
||||||
|
import com.arsdigita.cms.ContentItem;
|
||||||
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
|
import com.arsdigita.cms.contenttypes.GenericOrganizationalUnitBundle;
|
||||||
|
import com.arsdigita.cms.contenttypes.SciProjectBundle;
|
||||||
|
import com.arsdigita.cms.ui.authoring.CreationSelector;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Jens Pelzetter
|
||||||
|
* @version $Id$
|
||||||
|
*/
|
||||||
|
public class SciProjectCreate extends GenericOrganizationalUnitCreate {
|
||||||
|
|
||||||
|
public SciProjectCreate(final ItemSelectionModel itemModel,
|
||||||
|
final CreationSelector parent) {
|
||||||
|
super(itemModel, parent);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected GenericOrganizationalUnitBundle createBundle(
|
||||||
|
final ContentItem primary) {
|
||||||
|
return new SciProjectBundle(primary);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -130,7 +130,7 @@ public class SciProjectSubProjectsStep extends SimpleEditStep {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getContentType() {
|
public String getContentType() {
|
||||||
return "com.arsdigita.cms.contenttypes.SciProject";
|
return "com.arsdigita.cms.contenttypes.SciProjectBundle";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -123,7 +123,7 @@ public class SciProjectSuperProjectsStep extends SimpleEditStep {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getContentType() {
|
public String getContentType() {
|
||||||
return "com.arsdigita.cms.contenttypes.SciProject";
|
return "com.arsdigita.cms.contenttypes.SciProjectBundle";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue