Verschiedene Korrekturen und Ergänzungen.

git-svn-id: https://svn.libreccm.org/ccm/trunk@579 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2010-10-17 18:10:58 +00:00
parent 19aa607371
commit 6d1f718384
15 changed files with 141 additions and 80 deletions

View File

@ -2,13 +2,13 @@
* 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; package com.arsdigita.cms;
import com.arsdigita.domain.DomainCollection; import com.arsdigita.domain.DomainCollection;
import com.arsdigita.persistence.DataCollection; import com.arsdigita.persistence.DataCollection;
import com.arsdigita.persistence.Filter; import com.arsdigita.persistence.Filter;
import com.arsdigita.persistence.SessionManager; import com.arsdigita.persistence.SessionManager;
import org.apache.log4j.Logger;
/** /**
* *
@ -16,18 +16,21 @@ import com.arsdigita.persistence.SessionManager;
*/ */
public class RelationAttributeCollection extends DomainCollection { public class RelationAttributeCollection extends DomainCollection {
public static final Logger logger =
Logger.getLogger(
RelationAttributeCollection.class);
public static String ATTRIBUTE = RelationAttribute.ATTRIBUTE; public static String ATTRIBUTE = RelationAttribute.ATTRIBUTE;
public static String KEY = RelationAttribute.KEY; public static String KEY = RelationAttribute.KEY;
public static String LANGUAGE = RelationAttribute.LANGUAGE; public static String LANGUAGE = RelationAttribute.LANGUAGE;
public static String NAME = RelationAttribute.NAME; public static String NAME = RelationAttribute.NAME;
public static String DESCRIPTION = RelationAttribute.DESCRIPTION; public static String DESCRIPTION = RelationAttribute.DESCRIPTION;
private Filter m_attributeFilter = null; private Filter m_attributeFilter = null;
private Filter m_keyFilter = null; private Filter m_keyFilter = null;
private Filter m_languageFilter = null; private Filter m_languageFilter = null;
public RelationAttributeCollection() { public RelationAttributeCollection() {
super(SessionManager.getSession().retrieve(RelationAttribute.BASE_DATA_OBJECT_TYPE)); super(SessionManager.getSession().retrieve(
RelationAttribute.BASE_DATA_OBJECT_TYPE));
} }
public RelationAttributeCollection(String attribute) { public RelationAttributeCollection(String attribute) {
@ -64,7 +67,7 @@ public class RelationAttributeCollection extends DomainCollection {
public boolean removeAttributeFilter(String attribute) { public boolean removeAttributeFilter(String attribute) {
boolean retVal = false; boolean retVal = false;
retVal = this.removeFilter(m_attributeFilter); retVal = this.removeFilter(m_attributeFilter);
if(retVal == true) { if (retVal == true) {
m_attributeFilter = null; m_attributeFilter = null;
} }
return retVal; return retVal;
@ -77,7 +80,7 @@ public class RelationAttributeCollection extends DomainCollection {
public boolean removeKeyFilter(String key) { public boolean removeKeyFilter(String key) {
boolean retVal = false; boolean retVal = false;
retVal = this.removeFilter(m_keyFilter); retVal = this.removeFilter(m_keyFilter);
if(retVal == true) { if (retVal == true) {
m_keyFilter = null; m_keyFilter = null;
} }
return retVal; return retVal;
@ -90,7 +93,7 @@ public class RelationAttributeCollection extends DomainCollection {
public boolean removeLanguageFilter(String language) { public boolean removeLanguageFilter(String language) {
boolean retVal = false; boolean retVal = false;
retVal = this.removeFilter(m_languageFilter); retVal = this.removeFilter(m_languageFilter);
if(retVal == true) { if (retVal == true) {
m_languageFilter = null; m_languageFilter = null;
} }
return retVal; return retVal;
@ -114,8 +117,11 @@ public class RelationAttributeCollection extends DomainCollection {
// Get RelationAttribute in desired language // Get RelationAttribute in desired language
public RelationAttribute getRelationAttribute(String key, String language) { public RelationAttribute getRelationAttribute(String key, String language) {
logger.debug(String.format("this.getKey() = %s", this.getKey()));
logger.debug(String.format("this.language() = %s", this.getLanguage()));
// First, test the current element // First, test the current element
if(this.getKey().equals(key) && this.getLanguage().equals(language)) { if (this.getKey().equals(key) && this.getLanguage().equals(language)) {
return this.getRelationAttribute(); return this.getRelationAttribute();
@ -123,8 +129,9 @@ public class RelationAttributeCollection extends DomainCollection {
// Rewind the collection and search for a matching element // Rewind the collection and search for a matching element
this.rewind(); this.rewind();
while(this.next()) { while (this.next()) {
if(this.getKey().equals(key) && this.getLanguage().equals(language)){ if (this.getKey().equals(key) && this.getLanguage().equals(
language)) {
return this.getRelationAttribute(); return this.getRelationAttribute();
} }
} }
@ -147,12 +154,11 @@ public class RelationAttributeCollection extends DomainCollection {
boolean retVal = false; boolean retVal = false;
this.addLanguageFilter(language); this.addLanguageFilter(language);
if(this.size() > 0) { if (this.size() > 0) {
retVal = true; retVal = true;
} }
this.removeLanguageFilter(language); this.removeLanguageFilter(language);
return retVal; return retVal;
} }
} }

View File

@ -109,3 +109,7 @@ cms.contenttypes.ui.orgaunit.departments=Departments
cms.contenttypes.ui.orgaunit.persons=Persons cms.contenttypes.ui.orgaunit.persons=Persons
cms.contenttypes.ui.genericorgaunit.title=Name cms.contenttypes.ui.genericorgaunit.title=Name
cms.contenttypes.ui.genericorgaunit.addendum=Addendum cms.contenttypes.ui.genericorgaunit.addendum=Addendum
cms.contenttypes.ui.genericorgaunit.select_person=Select person
cms.contenttypes.ui.contact.contactEntry.none=No contact information yet
cms.contenttypes.ui.genericorgaunit.person.role=Role
cms.ui.delete=Remove

View File

@ -112,3 +112,6 @@ cms.contenttypes.ui.orgaunit.departments=Untergeordnete Organizationseinheiten
cms.contenttypes.ui.orgaunit.persons=Personen cms.contenttypes.ui.orgaunit.persons=Personen
cms.contenttypes.ui.genericorgaunit.title=Name cms.contenttypes.ui.genericorgaunit.title=Name
cms.contenttypes.ui.genericorgaunit.addendum=Zusatz cms.contenttypes.ui.genericorgaunit.addendum=Zusatz
cms.contenttypes.ui.genericorgaunit.select_person=Person ausw\u00e4hlen
cms.contenttypes.ui.genericorgaunit.person.role=Rolle
cms.ui.delete=Entfernen

View File

@ -47,7 +47,6 @@ public class GenericOrganizationalUnit extends ContentPage {
public final static String CONTACT_ORDER = "contact_order"; public final static String CONTACT_ORDER = "contact_order";
public final static String PERSONS = "persons"; public final static String PERSONS = "persons";
public final static String ROLE = "role_name"; public final static String ROLE = "role_name";
public final static String PERSON_ORDER = "person_order";
public final static String BASE_DATA_OBJECT_TYPE = public final static String BASE_DATA_OBJECT_TYPE =
"com.arsdigita.cms.contenttypes.GenericOrganizationalUnit"; "com.arsdigita.cms.contenttypes.GenericOrganizationalUnit";
@ -92,7 +91,7 @@ public class GenericOrganizationalUnit extends ContentPage {
DataObject link = add(CONTACTS, contact); DataObject link = add(CONTACTS, contact);
link.set(CONTACT_TYPE, contactType); link.set(CONTACT_TYPE, contactType);
link.set(CONTACT_ORDER, BigDecimal.valueOf(getContacts().size())); link.set(CONTACT_ORDER, Integer.valueOf((int)getContacts().size()));
} }
public void removeContact(GenericContact contact) { public void removeContact(GenericContact contact) {

View File

@ -67,7 +67,8 @@ public class GenericOrganizationalUnitContactAddForm extends BasicItemForm {
protected void addWidgets() { protected void addWidgets() {
add(new Label((String) ContenttypesGlobalizationUtil.globalize( add(new Label((String) ContenttypesGlobalizationUtil.globalize(
"cms.contenttypes.ui.genericorgaunit.select_contact").localize())); "cms.contenttypes.ui.genericorgaunit.select_contact").localize()));
m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.findByAssociatedObjectType(GenericContact.class.getName())); m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.
findByAssociatedObjectType(GenericContact.class.getName()));
add(m_itemSearch); add(m_itemSearch);
add(new Label(ContenttypesGlobalizationUtil.globalize( add(new Label(ContenttypesGlobalizationUtil.globalize(
@ -76,9 +77,11 @@ public class GenericOrganizationalUnitContactAddForm extends BasicItemForm {
GenericOrganizationalUnitContactCollection.CONTACT_TYPE); GenericOrganizationalUnitContactCollection.CONTACT_TYPE);
SingleSelect contactType = new SingleSelect(contactTypeParam); SingleSelect contactType = new SingleSelect(contactTypeParam);
contactType.addValidationListener(new NotNullValidationListener()); contactType.addValidationListener(new NotNullValidationListener());
contactType.addOption(new Option("", new Label((String) ContenttypesGlobalizationUtil.globalize("cms.ui.select_one").localize()))); contactType.addOption(new Option("", new Label((String) ContenttypesGlobalizationUtil.
globalize("cms.ui.select_one").localize())));
GenericContactTypeCollection contacttypes = new GenericContactTypeCollection(); GenericContactTypeCollection contacttypes =
new GenericContactTypeCollection();
contacttypes.addLanguageFilter(DispatcherHelper.getNegotiatedLocale(). contacttypes.addLanguageFilter(DispatcherHelper.getNegotiatedLocale().
getLanguage()); getLanguage());
@ -87,15 +90,11 @@ 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);
} }
@Override @Override
public void init(FormSectionEvent fse) throws FormProcessException { public void init(FormSectionEvent fse) throws FormProcessException {
FormData data = fse.getFormData();
PageState state = fse.getPageState(); PageState state = fse.getPageState();
setVisible(state, true); setVisible(state, true);
@ -108,10 +107,12 @@ public class GenericOrganizationalUnitContactAddForm extends BasicItemForm {
GenericOrganizationalUnit orgaunit = (GenericOrganizationalUnit) getItemSelectionModel(). GenericOrganizationalUnit orgaunit = (GenericOrganizationalUnit) getItemSelectionModel().
getSelectedObject(state); getSelectedObject(state);
if (!(this.getSaveCancelSection().getCancelButton().isSelected(state))) { if (this.getSaveCancelSection().getSaveButton().isSelected(state)) {
orgaunit.addContact((GenericContact) data.get(ITEM_SEARCH), (String) data.get(GenericOrganizationalUnitContactCollection.CONTACT_TYPE)); orgaunit.addContact((GenericContact) data.get(ITEM_SEARCH),
(String) data.get(
GenericOrganizationalUnitContactCollection.CONTACT_TYPE));
} }
init(fse); //init(fse);
} }
} }

View File

@ -126,11 +126,10 @@ public class GenericOrganizationalUnitContactTable extends Table implements
private class GenericOrganizationalUnitTableModel implements TableModel { private class GenericOrganizationalUnitTableModel implements TableModel {
private final int MAX_DESC_LENGTH = 25;
private Table m_table; private Table m_table;
private GenericOrganizationalUnitContactCollection m_contactCollection; private GenericOrganizationalUnitContactCollection m_contactCollection;
private GenericContact m_contact; private GenericContact m_contact;
private GenericContactTypeCollection contacttypes = private GenericContactTypeCollection m_contacttypes =
new GenericContactTypeCollection(); new GenericContactTypeCollection();
private GenericOrganizationalUnitTableModel( private GenericOrganizationalUnitTableModel(
@ -160,12 +159,14 @@ public class GenericOrganizationalUnitContactTable extends Table implements
} }
public Object getElementAt(int columnIndex) { public Object getElementAt(int columnIndex) {
s_log.debug(String.format("contacttypes.size() = %d",
m_contacttypes.size()));
switch (columnIndex) { switch (columnIndex) {
case 0: case 0:
return contacttypes.getRelationAttribute(m_contactCollection. return m_contacttypes.getRelationAttribute(
getContactType(), m_contactCollection.getContactType(),
DispatcherHelper. DispatcherHelper.getNegotiatedLocale().
getNegotiatedLocale().getLanguage()); getLanguage());
case 1: case 1:
return m_contact.getTitle(); return m_contact.getTitle();
case 2: case 2:
@ -316,12 +317,11 @@ public class GenericOrganizationalUnitContactTable extends Table implements
TableColumn column = getColumnModel().get(event.getColumn().intValue()); TableColumn column = getColumnModel().get(event.getColumn().intValue());
if (column.getHeaderKey().toString().equals(TABLE_COL_EDIT)) { if (column.getHeaderKey().toString().equals(TABLE_COL_EDIT)) {
} } else if (column.getHeaderKey().toString().equals(TABLE_COL_DEL)) {
else if(column.getHeaderKey().toString().equals(TABLE_COL_DEL)) {
orgaunit.removeContact(contact); orgaunit.removeContact(contact);
} else if(column.getHeaderKey().toString().equals(TABLE_COL_UP)) { } else if (column.getHeaderKey().toString().equals(TABLE_COL_UP)) {
contacts.swapWithPrevious(contact); contacts.swapWithPrevious(contact);
} else if(column.getHeaderKey().toString().equals(TABLE_COL_DOWN)) { } else if (column.getHeaderKey().toString().equals(TABLE_COL_DOWN)) {
contacts.swapWithNext(contact); contacts.swapWithNext(contact);
} }

View File

@ -39,7 +39,6 @@ import com.arsdigita.cms.contenttypes.GenericOrganizationalUnitPersonCollection;
import com.arsdigita.cms.contenttypes.GenericPerson; import com.arsdigita.cms.contenttypes.GenericPerson;
import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil; import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil;
import com.arsdigita.cms.dispatcher.Utilities; import com.arsdigita.cms.dispatcher.Utilities;
import com.arsdigita.dispatcher.DispatcherHelper;
import com.arsdigita.util.LockableImpl; import com.arsdigita.util.LockableImpl;
import java.math.BigDecimal; import java.math.BigDecimal;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
@ -104,14 +103,14 @@ public class GenericOrganizationalUnitPersonsTable extends Table implements
GenericOrganizationalUnit orgaunit = GenericOrganizationalUnit orgaunit =
(GenericOrganizationalUnit) m_itemModel. (GenericOrganizationalUnit) m_itemModel.
getSelectedObject(state); getSelectedObject(state);
return new GenericOrganizationalUnitTableModel(table, state, return new GenericOrganizationalUnitTableModel(table,
state,
orgaunit); orgaunit);
} }
} }
private class GenericOrganizationalUnitTableModel implements TableModel { private class GenericOrganizationalUnitTableModel implements TableModel {
private final int MAX_DESC_LENGTH = 25;
private Table m_table; private Table m_table;
private GenericOrganizationalUnitPersonCollection m_personsCollection; private GenericOrganizationalUnitPersonCollection m_personsCollection;
private GenericPerson m_person; private GenericPerson m_person;
@ -150,16 +149,13 @@ public class GenericOrganizationalUnitPersonsTable extends Table implements
RelationAttributeCollection role = new RelationAttributeCollection( RelationAttributeCollection role = new RelationAttributeCollection(
getRoleAttributeName(), getRoleAttributeName(),
m_personsCollection.getRoleName()); m_personsCollection.getRoleName());
role.addLanguageFilter(DispatcherHelper.getNegotiatedLocale().
getLanguage());
//return m_personsCollection.getRoleName();
if (role.next()) { if (role.next()) {
return role.getName(); return role.getName();
} else { } else {
return GlobalizationUtil.globalize("cms.ui.unknownRole"); return ContenttypesGlobalizationUtil.globalize("cms.ui.unknownRole");
} }
case 2: case 2:
return GlobalizationUtil.globalize("cms.ui.delete").localize(); return ContenttypesGlobalizationUtil.globalize("cms.ui.delete").localize();
default: default:
return null; return null;
} }

View File

@ -26,6 +26,7 @@ import com.arsdigita.persistence.OID;
import com.arsdigita.util.Assert; import com.arsdigita.util.Assert;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import org.apache.log4j.Logger;
/** /**
* <p> * <p>
@ -78,9 +79,9 @@ public class SciProject extends GenericOrganizationalUnit {
public static final String DEPARTMENTS_ORDER = "department"; public static final String DEPARTMENTS_ORDER = "department";
public static final String BASE_DATA_OBJECT_TYPE = public static final String BASE_DATA_OBJECT_TYPE =
"com.arsdigita.cms.contenttypes.SciProject"; "com.arsdigita.cms.contenttypes.SciProject";
private static final SciOrganizationConfig s_config = private static final SciOrganizationConfig s_config =
new SciOrganizationConfig(); new SciOrganizationConfig();
private static final Logger logger = Logger.getLogger(SciProject.class);
static { static {
s_config.load(); s_config.load();
@ -167,6 +168,8 @@ public class SciProject extends GenericOrganizationalUnit {
public void removeSubProject(SciProject project) { public void removeSubProject(SciProject project) {
Assert.exists(project, SciProject.class); Assert.exists(project, SciProject.class);
logger.debug(String.format("Removing subproject %s",
project.getTitle()));
remove(SUBPROJECTS, project); remove(SUBPROJECTS, project);
} }
@ -228,10 +231,14 @@ public class SciProject extends GenericOrganizationalUnit {
collection = (DataCollection) get(SUPER_PROJECT); collection = (DataCollection) get(SUPER_PROJECT);
if (0 == collection.size()) { if (0 == collection.size()) {
logger.debug(String.format("Project %s has NO super project...",
getTitle()));
return null; return null;
} else { } else {
DataObject dobj; DataObject dobj;
logger.debug(String.format("Project %s has a super project...",
getTitle()));
collection.next(); collection.next();
dobj = collection.getDataObject(); dobj = collection.getDataObject();
@ -243,11 +250,19 @@ public class SciProject extends GenericOrganizationalUnit {
SciProject oldSuperProject; SciProject oldSuperProject;
oldSuperProject = getSuperProject(); oldSuperProject = getSuperProject();
if (oldSuperProject != null) {
logger.debug("Removing old super project...");
remove(SUPER_PROJECT, oldSuperProject); remove(SUPER_PROJECT, oldSuperProject);
}
if (null != superProject) { if (superProject != null) {
Assert.exists(superProject, SciProject.class); Assert.exists(superProject, SciProject.class);
add(SUPER_PROJECT, superProject); logger.debug("Setting new super project...");
DataObject link = add(SUPER_PROJECT, superProject);
link.set(SUBPROJECT_ORDER,
Integer.valueOf((int) superProject.getSubProjects().size()));
link.save();
} }
} }
} }

View File

@ -55,7 +55,7 @@ public class SciMemberPropertiesStep extends SimpleEditStep {
member = (SciMember) obj; member = (SciMember) obj;
if (member.isAssociatedMember()) { if ((member.isAssociatedMember() != null) && member.isAssociatedMember()) {
return (String) SciOrganizationGlobalizationUtil.globalize( return (String) SciOrganizationGlobalizationUtil.globalize(
"sciorganization.ui.member.yes").localize(); "sciorganization.ui.member.yes").localize();
} else { } else {
@ -74,7 +74,7 @@ public class SciMemberPropertiesStep extends SimpleEditStep {
member = (SciMember) obj; member = (SciMember) obj;
if (member.isFormerMember()) { if ((member.isFormerMember() != null) && member.isFormerMember()) {
return (String) SciOrganizationGlobalizationUtil.globalize( return (String) SciOrganizationGlobalizationUtil.globalize(
"sciorganization.ui.member.yes").localize(); "sciorganization.ui.member.yes").localize();
} else { } else {

View File

@ -94,10 +94,11 @@ public class SciMemberPropertyForm
FormData data = fse.getFormData(); FormData data = fse.getFormData();
SciMember member = (SciMember) super.initBasicWidgets(fse); SciMember member = (SciMember) super.initBasicWidgets(fse);
if (member.isAssociatedMember()) { if ((member.isAssociatedMember() != null) &&
member.isAssociatedMember()) {
m_associated.setValue(fse.getPageState(), "assoc"); m_associated.setValue(fse.getPageState(), "assoc");
} }
if (member.isFormerMember()) { if ((member.isFormerMember() != null) && member.isFormerMember()) {
m_former.setValue(fse.getPageState(), "former"); m_former.setValue(fse.getPageState(), "former");
} }
} }

View File

@ -130,3 +130,7 @@ sciorganization.ui.project.organizations=Involved organizations
sciorganization.ui.project.departments=Involved departments sciorganization.ui.project.departments=Involved departments
sciorganization.ui.project.publications=Publications of the project sciorganization.ui.project.publications=Publications of the project
sciorganization.ui.project_description.title=Description sciorganization.ui.project_description.title=Description
sciorganization.ui.project.add_member\ =Add member
sciorganization.ui.project.subproject..confirm_remove=Are you sure to remove this subproject?
sciorganization.ui.project.superproject..confirm_remove=Are you sure to remove the superior project?
sciorganization.ui.project.add_member=Add member

View File

@ -56,7 +56,7 @@ sciorganization.ui.department.subdepartment.confirm_remove=Wollen sie diese Unte
sciorganizations.ui.department.shortdescription=Kurzbeschreibung sciorganizations.ui.department.shortdescription=Kurzbeschreibung
sciorganizations.ui.organization.shortdescription=Kurzbeschreibung sciorganizations.ui.organization.shortdescription=Kurzbeschreibung
sciorganization.ui.department.select_subdepartment=Unterabteilung zum hinzuf\u00fcgen ausw\u00e4hlen sciorganization.ui.department.select_subdepartment=Unterabteilung zum hinzuf\u00fcgen ausw\u00e4hlen
sciorganization.ui.department.add_member=Mitglied ausw\u00e4hlen sciorganization.ui.department.add_member=Mitglied hinzuf\u00fcgen
sciorganizations.ui.project.shortdesc=Kurzbeschreibung sciorganizations.ui.project.shortdesc=Kurzbeschreibung
sciorganization.ui.project.addDepartment=Beteiligte Abteilung hinzuf\u00fcgen sciorganization.ui.project.addDepartment=Beteiligte Abteilung hinzuf\u00fcgen
sciorganization.ui.project.addOrga=Beteiligte Organization hinzuf\u00fcgen sciorganization.ui.project.addOrga=Beteiligte Organization hinzuf\u00fcgen
@ -76,7 +76,7 @@ sciorganization.ui.project.select_department=Abteilung zum hinzuf\u00fcgen ausw\
sciorganization.ui.project.superproject_none=Kein \u00fcbergeordnetes Projekt gefunden sciorganization.ui.project.superproject_none=Kein \u00fcbergeordnetes Projekt gefunden
sciorganization.ui.project.superproject=\u00dcbergeordnetes Projekt sciorganization.ui.project.superproject=\u00dcbergeordnetes Projekt
sciorganization.ui.project.superproject.remove=\u00dcbergeordnetes Projekt entfernen sciorganization.ui.project.superproject.remove=\u00dcbergeordnetes Projekt entfernen
sciorganization.ui.project.superproject.confirm_remove=Wollen sie dieses \u00fcbergeordnete projekt wirklich entfernen? sciorganization.ui.project.superproject.confirm_remove=Wollen sie dieses \u00fcbergeordnete Projekt wirklich entfernen?
sciorganization.ui.department.select_superdepartment=\u00dcbergeordnete Abteilung sciorganization.ui.department.select_superdepartment=\u00dcbergeordnete Abteilung
sciorganization.ui.project.setSuperProject=\u00dcbergeordnetes Projekt setzen sciorganization.ui.project.setSuperProject=\u00dcbergeordnetes Projekt setzen
sciorganization.ui.project.description.upload=Projektbeschreibung hochladen sciorganization.ui.project.description.upload=Projektbeschreibung hochladen
@ -130,3 +130,7 @@ sciorganization.ui.project.organizations=Beteiligte Organisationen
sciorganization.ui.project.departments=Beteiligte Abteilungen sciorganization.ui.project.departments=Beteiligte Abteilungen
sciorganization.ui.project.publications=Publikationen des Projektes sciorganization.ui.project.publications=Publikationen des Projektes
sciorganization.ui.project_description.title=Beschreibung sciorganization.ui.project_description.title=Beschreibung
sciorganization.ui.project.add_member\ =Mitglied hinzuf\u00fcgen
sciorganization.ui.project.subproject..confirm_remove=Sind sie sicher das sie dieses Unterprojekt entfernen wollen?
sciorganization.ui.project.superproject..confirm_remove=Wollen sie dieses \u00fcbergeordnete Projekt wirklich entfernen?
sciorganization.ui.project.add_member=Mitglied hinzuf\u00fcgen

View File

@ -49,11 +49,11 @@ public class SciProjectMemberStep extends SimpleEditStep {
new SciProjectMemberAddForm(itemModel); new SciProjectMemberAddForm(itemModel);
add(ADD_MEMBER_SHEET_NAME, add(ADD_MEMBER_SHEET_NAME,
(String) SciOrganizationGlobalizationUtil.globalize( (String) SciOrganizationGlobalizationUtil.globalize(
"sciorganization.ui.department.add_member").localize(), "sciorganization.ui.project.add_member").localize(),
new WorkflowLockedComponentAccess(addMemberSheet, itemModel), new WorkflowLockedComponentAccess(addMemberSheet, itemModel),
addMemberSheet.getSaveCancelSection().getCancelButton()); addMemberSheet.getSaveCancelSection().getCancelButton());
GenericOrganizationalUnitPersonsTable memberTable = new GenericOrganizationalUnitPersonsTable( SciProjectMemberTable memberTable = new SciProjectMemberTable(
itemModel); itemModel);
setDisplayComponent(memberTable); setDisplayComponent(memberTable);
} }

View File

@ -100,35 +100,41 @@ public class SciProjectPropertiesStep
if (!config.getProjectAddContactHide()) { if (!config.getProjectAddContactHide()) {
addStep(new GenericOrganizationalUnitContactPropertiesStep(itemModel, addStep(new GenericOrganizationalUnitContactPropertiesStep(itemModel,
parent), parent),
SciOrganizationGlobalizationUtil.globalize("sciorganization.ui.project.contacts")); SciOrganizationGlobalizationUtil.globalize(
"sciorganization.ui.project.contacts"));
} }
if (!config.getProjectAddPersonHide()) { if (!config.getProjectAddPersonHide()) {
addStep(new SciProjectMemberStep(itemModel, addStep(new SciProjectMemberStep(itemModel,
parent), parent),
SciOrganizationGlobalizationUtil.globalize("sciorganization.ui.project.members")); SciOrganizationGlobalizationUtil.globalize(
"sciorganization.ui.project.members"));
} }
if (!config.getProjectSetSuperProjectHide()) { if (!config.getProjectSetSuperProjectHide()) {
addStep(new SciProjectSuperProjectStep(itemModel, addStep(new SciProjectSuperProjectStep(itemModel,
parent), parent),
SciOrganizationGlobalizationUtil.globalize("sciorganization.ui.project.superproject")); SciOrganizationGlobalizationUtil.globalize(
"sciorganization.ui.project.superproject"));
} }
if (!config.getProjectAddSubProjectHide()) { if (!config.getProjectAddSubProjectHide()) {
addStep(new SciProjectSubprojectsStep(itemModel, addStep(new SciProjectSubprojectsStep(itemModel,
parent), parent),
SciOrganizationGlobalizationUtil.globalize("sciorganization.ui.project.subprojects")); SciOrganizationGlobalizationUtil.globalize(
"sciorganization.ui.project.subprojects"));
} }
if (!config.getProjectAddOrganizationHide()) { if (!config.getProjectAddOrganizationHide()) {
addStep(new SciProjectOrganizationsStep(itemModel, parent), addStep(new SciProjectOrganizationsStep(itemModel, parent),
SciOrganizationGlobalizationUtil.globalize("sciorganization.ui.project.organizations")); SciOrganizationGlobalizationUtil.globalize(
"sciorganization.ui.project.organizations"));
} }
if (!config.getProjectAddDepartmentHide()) { if (!config.getProjectAddDepartmentHide()) {
addStep(new SciProjectDepartmentsStep(itemModel, parent), addStep(new SciProjectDepartmentsStep(itemModel, parent),
SciOrganizationGlobalizationUtil.globalize( "sciorganization.ui.project.departments")); SciOrganizationGlobalizationUtil.globalize(
"sciorganization.ui.project.departments"));
} }
if ((!config.getProjectMaterialsHide()) if ((!config.getProjectMaterialsHide())

View File

@ -37,6 +37,7 @@ import com.arsdigita.cms.contenttypes.SciProject;
import com.arsdigita.cms.dispatcher.Utilities; import com.arsdigita.cms.dispatcher.Utilities;
import com.arsdigita.util.LockableImpl; import com.arsdigita.util.LockableImpl;
import org.apache.log4j.Logger;
/** /**
* Sheet for showing the superior project of a {@link SciProject}. * Sheet for showing the superior project of a {@link SciProject}.
@ -47,6 +48,8 @@ public class SciProjectSuperProjectSheet
extends Table extends Table
implements TableActionListener { implements TableActionListener {
private static final Logger logger = Logger.getLogger(
SciProjectSuperProjectSheet.class);
private final String TABLE_COL_EDIT = "table_col_edit"; private final String TABLE_COL_EDIT = "table_col_edit";
private final String TABLE_COL_DEL = "table_col_del"; private final String TABLE_COL_DEL = "table_col_del";
private ItemSelectionModel m_itemModel; private ItemSelectionModel m_itemModel;
@ -106,12 +109,21 @@ public class SciProjectSuperProjectSheet
private Table m_table; private Table m_table;
private SciProject m_superProject; private SciProject m_superProject;
private boolean m_done;
public SciProjectSuperProjectSheetModel(Table table, public SciProjectSuperProjectSheetModel(Table table,
PageState state, PageState state,
SciProject project) { SciProject project) {
m_table = table; m_table = table;
m_superProject = project.getSuperProject(); m_superProject = project.getSuperProject();
if (m_superProject == null) {
m_done = false;
} else {
m_done = true;
logger.debug(String.format("Super project to show: %s", m_superProject.
getTitle()));
}
} }
public int getColumnCount() { public int getColumnCount() {
@ -121,11 +133,19 @@ public class SciProjectSuperProjectSheet
public boolean nextRow() { public boolean nextRow() {
boolean ret; boolean ret;
if (null == m_superProject) { /*if (m_superProject == null) {
ret = false; ret = false;
} else { } else {
ret = true; ret = true;
m_superProject = null; m_superProject = null;
}*/
if (m_done) {
logger.debug("Returning true for nextRow()");
ret = true;
m_done = false;
} else {
logger.debug("Returning false for nextRow()");
ret = false;
} }
return ret; return ret;
@ -134,10 +154,12 @@ public class SciProjectSuperProjectSheet
public Object getElementAt(int columnIndex) { public Object getElementAt(int columnIndex) {
switch (columnIndex) { switch (columnIndex) {
case 0: case 0:
logger.debug("returning project title...");
return m_superProject.getTitle(); return m_superProject.getTitle();
case 1: case 1:
return SciOrganizationGlobalizationUtil.globalize( return SciOrganizationGlobalizationUtil.globalize(
"sciorganization.ui.project.superproject.remove"); "sciorganization.ui.project.superproject.remove").
localize();
default: default:
return null; return null;
} }