diff --git a/ccm-cms-relationattributeimporter/application.xml b/ccm-cms-relationattributeimporter/application.xml new file mode 100644 index 000000000..cdfdf4b58 --- /dev/null +++ b/ccm-cms-relationattributeimporter/application.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + Tool to import RelationAttributes. + + diff --git a/ccm-cms-relationattributeimporter/src/ccm-cms-relationattributeimporter.config b/ccm-cms-relationattributeimporter/src/ccm-cms-relationattributeimporter.config new file mode 100644 index 000000000..adfdba100 --- /dev/null +++ b/ccm-cms-relationattributeimporter/src/ccm-cms-relationattributeimporter.config @@ -0,0 +1,4 @@ + + + + diff --git a/ccm-cms-relationattributeimporter/src/ccm-cms-relationattributeimporter.load b/ccm-cms-relationattributeimporter/src/ccm-cms-relationattributeimporter.load new file mode 100644 index 000000000..3e6da3ee1 --- /dev/null +++ b/ccm-cms-relationattributeimporter/src/ccm-cms-relationattributeimporter.load @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/ccm-cms-relationattributeimporter/src/com/arsdigita/cms/relationattributeimporter/Initializer.java b/ccm-cms-relationattributeimporter/src/com/arsdigita/cms/relationattributeimporter/Initializer.java new file mode 100644 index 000000000..047290443 --- /dev/null +++ b/ccm-cms-relationattributeimporter/src/com/arsdigita/cms/relationattributeimporter/Initializer.java @@ -0,0 +1,35 @@ +/* + * 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.relationattributeimporter; + +import com.arsdigita.runtime.CompoundInitializer; + +/** + * Initializer for the ccm-cms-relationattributeimporter application. + * + * @author Jens Pelzetter + */ +public class Initializer extends CompoundInitializer { + + public Initializer() { + //Nothing yet. + } + +} diff --git a/ccm-cms-relationattributeimporter/src/com/arsdigita/cms/relationattributeimporter/Loader.java b/ccm-cms-relationattributeimporter/src/com/arsdigita/cms/relationattributeimporter/Loader.java new file mode 100644 index 000000000..2481002f0 --- /dev/null +++ b/ccm-cms-relationattributeimporter/src/com/arsdigita/cms/relationattributeimporter/Loader.java @@ -0,0 +1,36 @@ +/* + * 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.relationattributeimporter; + +import com.arsdigita.loader.PackageLoader; +import com.arsdigita.runtime.ScriptContext; + +/** + * Loader for the ccm-cms-relationattribute application. + * + * @author Jens Pelzetter + */ +public class Loader extends PackageLoader { + + public void run(final ScriptContext ctx) { + //Nothing yet. + } + +} diff --git a/ccm-cms-relationattributeimporter/src/com/arsdigita/cms/relationattributeimporter/RelAttrBean.java b/ccm-cms-relationattributeimporter/src/com/arsdigita/cms/relationattributeimporter/RelAttrBean.java new file mode 100644 index 000000000..41ccb5cf8 --- /dev/null +++ b/ccm-cms-relationattributeimporter/src/com/arsdigita/cms/relationattributeimporter/RelAttrBean.java @@ -0,0 +1,79 @@ +/* + * 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.relationattributeimporter; + +/** + * A bean used to keep the information of {@link RelationAttribute} while + * parsing the XML file. + * + * @author Jens Pelzetter + */ +public class RelAttrBean { + + private String attribute; + private String key; + private String lang; + private String name; + private String description; + + public RelAttrBean() { + } + + public String getAttribute() { + return attribute; + } + + public void setAttribute(String attribute) { + this.attribute = attribute; + } + + public String getKey() { + return key; + } + + public void setKey(String key) { + this.key = key; + } + + public String getLang() { + return lang; + } + + public void setLang(String lang) { + this.lang = lang; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + +} diff --git a/ccm-cms-relationattributeimporter/src/com/arsdigita/cms/relationattributeimporter/RelationAttributeImporter.java b/ccm-cms-relationattributeimporter/src/com/arsdigita/cms/relationattributeimporter/RelationAttributeImporter.java new file mode 100644 index 000000000..6f0e3e1e5 --- /dev/null +++ b/ccm-cms-relationattributeimporter/src/com/arsdigita/cms/relationattributeimporter/RelationAttributeImporter.java @@ -0,0 +1,175 @@ +/* + * 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.relationattributeimporter; + +import com.arsdigita.cms.RelationAttribute; +import com.arsdigita.cms.RelationAttributeInterface; +import com.arsdigita.london.util.Transaction; +import com.arsdigita.packaging.Program; +import java.io.File; +import java.io.IOException; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.parsers.SAXParser; +import javax.xml.parsers.SAXParserFactory; +import org.apache.commons.cli.CommandLine; +import org.xml.sax.SAXException; + +/** + *

+ * A simple import tool for {@link RelationAttribute}s. This tool imports the + * relation attributes from a simple XML file, which looks like this: + *

+ *
+ * <?xml version="1.0"?>
+ * <relationAttributes>
+ *     <relationAttribute>
+ *         <attribute>...</attribute>
+ *         <key>...</key>
+ *         <lang>...</lang>
+ *         <name>...</name>
+ *         <description>...</description>
+ *     </relationAttribute>
+ * </relationAttributes>
+ * 
+ *

+ * The tool can be invoked using the ccm-run command. One parameter, the file + * to import is needed. With tools-ng and ECDC, the line for calling the + * RelationAttributeImporter would like the following: + *

+ *
+ * ant -Dccm.classname="com.arsdigita.cms.relationattributeimporter.RelationAttributeImporter" -Dccm.parameters="/path/to/relation/attribute/file.xml" ccm-ru
+ * 
+ *

+ * You have to add the RelationAttributeImporter to add to your + * environment, of course. + *

+ * + * @author Jens Pelzetter + * @see RelationAttribute + * @see RelationAttributeInterface + */ +public class RelationAttributeImporter extends Program { + + public RelationAttributeImporter() { + super("Relation Attribute Importer", "0.1.0", "FILE"); + } + + public RelationAttributeImporter(boolean startup) { + super("Relation Attribute Importer", "0.1.0", "FILE", startup); + } + + @Override + protected void doRun(CommandLine cmdLine) { + + final String[] args; + File relAttrFile; + SAXParserFactory saxFactory; + SAXParser saxParser = null; + RelationAttributeParser parser; + args = cmdLine.getArgs(); + if (args.length != 1) { + help(System.err); + System.exit(-1); + } + + System.out.printf("Using file %s.", args[0]); + relAttrFile = new File(args[0]); + if (!relAttrFile.exists()) { + System.err.printf("ERROR: File %s does not exist.", args[0]); + System.exit(-1); + } + if (!relAttrFile.isFile()) { + System.err.printf("ERROR: Path %s does not point to a file.", + args[0]); + System.exit(-1); + } + saxFactory = SAXParserFactory.newInstance(); + try { + saxParser = saxFactory.newSAXParser(); + } catch (ParserConfigurationException ex) { + System.err.printf("Error creating SAXParser: %s", ex.getMessage()); + ex.printStackTrace(); + System.exit(-1); + } catch (SAXException ex) { + System.err.printf("Error creating SAXParser: %s", ex.getMessage()); + ex.printStackTrace(); + System.exit(-1); + } + parser = new RelationAttributeParser(); + try { + saxParser.parse(relAttrFile, parser); + } catch (SAXException ex) { + System.err.printf("Error parsing file %s: %s", + args[0], + ex.getMessage()); + ex.printStackTrace(); + System.exit(-1); + } catch (IOException ex) { + System.err.printf("Error parsing file %s: %s", + args[0], ex.getMessage()); + ex.printStackTrace(); + System.exit(-1); + } + + System.out.println( + "Parsed XML file successfully. Creating ACSObjects..."); + for (int i = 0; i < parser.getRelAttrs().size(); i++) { + System.out.printf("%d of %d...", (i + 1), parser.getRelAttrs().size()); + createACSObject(parser.getRelAttrs().get(i), i); + } + } + + /** + * The method creates the {@link RelationAttribute} object from the data + * retrieved from the XML file and stores the object in the database. + * + * @param relAttr + * @param index + */ + private void createACSObject(final RelAttrBean relAttr, int index) { + + /*System.out.printf("\tattribute = %s\n", relAttr.getAttribute()); + System.out.printf("\tkey = %s\n", relAttr.getKey()); + System.out.printf("\tlang = %s\n", relAttr.getLang()); + System.out.printf("\tname = %s\n", relAttr.getName()); + System.out.printf("\tdescription = %s\n", relAttr.getDescription());*/ + + Transaction transaction = new Transaction() { + @Override + public void doRun() { + RelationAttribute attr; + attr = new RelationAttribute(); + attr.setAttribute(relAttr.getAttribute()); + attr.setKey(relAttr.getKey()); + attr.setLanguage(relAttr.getLang()); + attr.setName(relAttr.getName()); + attr.setDescription(relAttr.getDescription()); + System.out.print("Saving..."); + attr.save(); + } + }; + transaction.run(); + System.out.println("Done\n"); + } + + public final static void main(String[] args) { + new RelationAttributeImporter().run(args); + } +} diff --git a/ccm-cms-relationattributeimporter/src/com/arsdigita/cms/relationattributeimporter/RelationAttributeParser.java b/ccm-cms-relationattributeimporter/src/com/arsdigita/cms/relationattributeimporter/RelationAttributeParser.java new file mode 100644 index 000000000..f278a86db --- /dev/null +++ b/ccm-cms-relationattributeimporter/src/com/arsdigita/cms/relationattributeimporter/RelationAttributeParser.java @@ -0,0 +1,176 @@ +/* + * 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.relationattributeimporter; + +import java.util.ArrayList; +import java.util.List; +import org.xml.sax.Attributes; +import org.xml.sax.SAXException; +import org.xml.sax.SAXParseException; +import org.xml.sax.helpers.DefaultHandler; + +/** + * Parser for the XML file. This parser uses the SAX-Parser from the Java + * Standard API. + * + * @author Jens Pelzetter + */ +public class RelationAttributeParser extends DefaultHandler { + + private RelAttrBean currentRelAttr; + /** + * A buffer + */ + private StringBuilder buffer; + private boolean relAttrOpen; + private boolean attrOpen; + private boolean keyOpen; + private boolean langOpen; + private boolean nameOpen; + private boolean descOpen; + private List relAttrs; + + public RelationAttributeParser() { + relAttrs = new ArrayList(); + relAttrOpen = false; + attrOpen = false; + keyOpen = false; + langOpen = false; + nameOpen = false; + descOpen = false; + } + + @Override + public void startDocument() throws SAXException { + System.out.println("Relation attribute document begin..."); + } + + @Override + public void endDocument() throws SAXException { + System.out.println("Relation attribute document end."); + } + + @Override + public void startElement(String uri, + String localName, + String qName, + Attributes attributes) throws SAXException { + System.out.printf("DEBUG: uri = %s\n", uri); + System.out.printf("DEBUG: localName = %s\n", localName); + System.out.printf("DEBUG: qName = %s\n", qName); + buffer = new StringBuilder(); + if ("relationAttributes".equals(qName)) { + //Nothing to do + } else if ("relationAttribute".equals(qName)) { + relAttrOpen = true; + currentRelAttr = new RelAttrBean(); + } else if ("attribute".equals(qName)) { + attrOpen = true; + } else if ("key".equals(qName)) { + keyOpen = true; + } else if ("lang".equals(qName)) { + langOpen = true; + } else if ("name".equals(qName)) { + nameOpen = true; + } else if ("description".equals(qName)) { + descOpen = true; + } else { + System.err.printf( + "Warning: Encountered unexpected element %s. Ignoring.\n", + qName); + } + } + + @Override + public void endElement(String uri, + String localName, + String qName) throws SAXException { + if ("relationAttributes".equals(qName)) { + //Nothing to do + } else if ("relationAttribute".equals(qName)) { + relAttrs.add(currentRelAttr); + currentRelAttr = null; + relAttrOpen = false; + } else if ("attribute".equals(qName)) { + System.out.printf("buffer = %s\n", buffer.toString()); + currentRelAttr.setAttribute(buffer.toString()); + attrOpen = false; + } else if ("key".equals(qName)) { + currentRelAttr.setKey(buffer.toString()); + keyOpen = false; + } else if ("lang".equals(qName)) { + currentRelAttr.setLang(buffer.toString()); + langOpen = false; + } else if ("name".equals(qName)) { + currentRelAttr.setName(buffer.toString()); + nameOpen = false; + } else if ("description".equals(qName)) { + currentRelAttr.setDescription(buffer.toString()); + descOpen = false; + } else { + System.err.printf( + "Warning: Encountered unexpected element %s. Ignoring.\n", + qName); + } + } + + @Override + public void characters(char[] ch, + int start, + int length) throws SAXException { + System.out.printf("Parsing characters %d to %d...\n", start, (start + length)); + for (int i = start; i < (start + length); i++) { + char character; + character = ch[i]; + buffer.append(character); + } + } + + @Override + public void warning(SAXParseException ex) { + System.err.println(saxMsg(ex)); + } + + @Override + public void error(SAXParseException ex) { + System.err.println(saxMsg(ex)); + } + + @Override + public void fatalError(SAXParseException ex) { + System.err.println(saxMsg(ex)); + } + + protected List getRelAttrs() { + return relAttrs; + } + + private String saxMsg(SAXParseException ex) { + String msg; + + msg = String.format( + "SAX parser reported an error at line %d, column %d: %s", + ex.getLineNumber(), + ex.getColumnNumber(), + ex.getMessage()); + + return msg; + } +} diff --git a/ccm-cms/pdl/com/arsdigita/content-types/GenericContact.pdl b/ccm-cms/pdl/com/arsdigita/content-types/GenericContact.pdl index a044c753f..3c5e36fda 100644 --- a/ccm-cms/pdl/com/arsdigita/content-types/GenericContact.pdl +++ b/ccm-cms/pdl/com/arsdigita/content-types/GenericContact.pdl @@ -36,9 +36,9 @@ object type GenericContact extends ContentPage { object type GenericContactEntry extends ContentItem { - String [1..1] key = cms_contactEntries.key VARCHAR(100); - String [0..1] description = cms_contactEntries.description VARCHAR(100); - String [1..1] value = cms_contactEntries.value VARCHAR(100); + String[1..1] key = cms_contactEntries.key VARCHAR(100); + String[0..1] description = cms_contactEntries.description VARCHAR(100); + String[1..1] value = cms_contactEntries.value VARCHAR(100); reference key ( cms_contactEntries.contactentry_id ); diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPersonAddForm.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPersonAddForm.java index 7b95d2a2b..f6a62136e 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPersonAddForm.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPersonAddForm.java @@ -23,7 +23,6 @@ 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.bebop.form.TextField; import com.arsdigita.bebop.parameters.NotNullValidationListener; @@ -37,7 +36,6 @@ import com.arsdigita.cms.contenttypes.GenericPerson; 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; /** * Form for adding related persons the an organization. @@ -46,24 +44,20 @@ import org.apache.log4j.Logger; */ public class GenericOrganizationalUnitPersonAddForm extends BasicItemForm { - private static final Logger s_log = Logger.getLogger( - GenericOrganizationalUnitPersonAddForm.class); private GenericOrganizationalUnitPersonPropertiesStep m_step; private ItemSearchWidget m_itemSearch; - private SaveCancelSection m_saveCancelSection; - private final String ITEM_SEARCH = "orgaunitPerson"; - private ItemSelectionModel m_itemModel; + private final String ITEM_SEARCH = "orgaunitPerson"; public GenericOrganizationalUnitPersonAddForm(ItemSelectionModel itemModel) { - super("PersonAddForm", itemModel); + super("PersonAddForm", itemModel); } - + @Override protected void addWidgets() { add(new Label((String) ContenttypesGlobalizationUtil.globalize( "cms.contenttypes.ui.genericorgaunit.select_person").localize())); this.m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType. - findByAssociatedObjectType(GenericPerson.BASE_DATA_OBJECT_TYPE)); + findByAssociatedObjectType(getPersonType())); add(this.m_itemSearch); add(new Label(ContenttypesGlobalizationUtil.globalize( @@ -74,9 +68,9 @@ public class GenericOrganizationalUnitPersonAddForm extends BasicItemForm { /*SingleSelect roleSelect = new SingleSelect(roleParam); roleSelect.addValidationListener(new NotNullValidationListener()); roleSelect.addOption( - new Option("", - new Label((String) ContenttypesGlobalizationUtil. - globalize("cms.ui.select_one").localize()))); + new Option("", + new Label((String) ContenttypesGlobalizationUtil. + globalize("cms.ui.select_one").localize()))); add(roleSelect);*/ TextField role = new TextField(roleParam); @@ -86,7 +80,6 @@ public class GenericOrganizationalUnitPersonAddForm extends BasicItemForm { @Override public void init(FormSectionEvent fse) { - FormData data = fse.getFormData(); PageState state = fse.getPageState(); setVisible(state, true); @@ -107,4 +100,8 @@ public class GenericOrganizationalUnitPersonAddForm extends BasicItemForm { init(fse); } + + protected String getPersonType() { + return GenericPerson.class.getName(); + } } diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPersonPropertiesStep.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPersonPropertiesStep.java index db53b9141..fb72f6e0d 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPersonPropertiesStep.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPersonPropertiesStep.java @@ -46,17 +46,18 @@ public class GenericOrganizationalUnitPersonPropertiesStep ItemSelectionModel itemModel, AuthoringKitWizard parent, String prefix) { - super(itemModel, parent, prefix); - - BasicItemForm addPersonSheet = new GenericOrganizationalUnitPersonAddForm(itemModel); + super(itemModel, parent, prefix); + + BasicItemForm addPersonSheet = + new GenericOrganizationalUnitPersonAddForm(itemModel); add(ADD_PERSON_SHEET_NAME, - (String) ContenttypesGlobalizationUtil.globalize( + (String) ContenttypesGlobalizationUtil.globalize( "cms.contenttypes.ui.genericorgaunit.add_person").localize(), - new WorkflowLockedComponentAccess(addPersonSheet, itemModel), - addPersonSheet.getSaveCancelSection().getCancelButton()); + new WorkflowLockedComponentAccess(addPersonSheet, itemModel), + addPersonSheet.getSaveCancelSection().getCancelButton()); - GenericOrganizationalUnitPersonsTable personsTable = new GenericOrganizationalUnitPersonsTable(itemModel); + GenericOrganizationalUnitPersonsTable personsTable = new GenericOrganizationalUnitPersonsTable( + itemModel); setDisplayComponent(personsTable); } - } diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonPropertiesStep.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonPropertiesStep.java index c01ed1192..5d3f29d5a 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonPropertiesStep.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericPersonPropertiesStep.java @@ -40,7 +40,8 @@ public class GenericPersonPropertiesStep extends SimpleEditStep { public static final String EDIT_SHEET_NAME = "edit"; - public GenericPersonPropertiesStep(ItemSelectionModel itemModel, AuthoringKitWizard parent) { + public GenericPersonPropertiesStep(ItemSelectionModel itemModel, + AuthoringKitWizard parent) { super(itemModel, parent); /* Use a Segmented Panel for the multiple parts of data */ @@ -49,17 +50,26 @@ public class GenericPersonPropertiesStep extends SimpleEditStep { setDefaultEditKey(EDIT_SHEET_NAME); /* A new SimpleEditStep */ - SimpleEditStep basicProperties = new SimpleEditStep(itemModel, parent, EDIT_SHEET_NAME); + SimpleEditStep basicProperties = new SimpleEditStep(itemModel, parent, + EDIT_SHEET_NAME); /* Create the edit component for this SimpleEditStep and the corresponding link */ - BasicPageForm editBasicSheet = new GenericPersonPropertyForm(itemModel, this); - basicProperties.add(EDIT_SHEET_NAME, (String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.edit_basic_properties").localize(), new WorkflowLockedComponentAccess(editBasicSheet, itemModel), editBasicSheet.getSaveCancelSection().getCancelButton()); + BasicPageForm editBasicSheet = new GenericPersonPropertyForm(itemModel, + this); + basicProperties.add(EDIT_SHEET_NAME, (String) ContenttypesGlobalizationUtil. + globalize("cms.contenttypes.ui.person.edit_basic_properties"). + localize(), new WorkflowLockedComponentAccess(editBasicSheet, + itemModel), editBasicSheet. + getSaveCancelSection().getCancelButton()); /* Set the displayComponent for this step */ - basicProperties.setDisplayComponent(getGenericPersonPropertySheet(itemModel)); + basicProperties.setDisplayComponent(getGenericPersonPropertySheet( + itemModel)); /* Add the SimpleEditStep to the segmented panel */ - segmentedPanel.addSegment(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.basic_properties").localize()), basicProperties); + segmentedPanel.addSegment(new Label((String) ContenttypesGlobalizationUtil. + globalize("cms.contenttypes.ui.person.basic_properties"). + localize()), basicProperties); // GenericPersonContactPropertiesStep contactProperties = new GenericPersonContactPropertiesStep(itemModel, parent); @@ -70,66 +80,87 @@ public class GenericPersonPropertiesStep extends SimpleEditStep { } - public static Component getGenericPersonPropertySheet(ItemSelectionModel itemModel) { - DomainObjectPropertySheet sheet = new DomainObjectPropertySheet(itemModel); + public static Component getGenericPersonPropertySheet( + ItemSelectionModel itemModel) { + DomainObjectPropertySheet sheet = new DomainObjectPropertySheet( + itemModel); - sheet.add((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.surname").localize(), GenericPerson.SURNAME); - sheet.add((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.givenname").localize(), GenericPerson.GIVENNAME); - sheet.add((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.titlepre").localize(), GenericPerson.TITLEPRE); - sheet.add((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.titlepost").localize(), GenericPerson.TITLEPOST); - sheet.add((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.birthdate").localize(), - GenericPerson.BIRTHDATE, - new DomainObjectPropertySheet.AttributeFormatter() { + sheet.add((String) ContenttypesGlobalizationUtil.globalize( + "cms.contenttypes.ui.person.surname").localize(), + GenericPerson.SURNAME); + sheet.add((String) ContenttypesGlobalizationUtil.globalize( + "cms.contenttypes.ui.person.givenname").localize(), + GenericPerson.GIVENNAME); + sheet.add((String) ContenttypesGlobalizationUtil.globalize( + "cms.contenttypes.ui.person.titlepre").localize(), + GenericPerson.TITLEPRE); + sheet.add((String) ContenttypesGlobalizationUtil.globalize( + "cms.contenttypes.ui.person.titlepost").localize(), + GenericPerson.TITLEPOST); + sheet.add((String) ContenttypesGlobalizationUtil.globalize( + "cms.contenttypes.ui.person.birthdate").localize(), + GenericPerson.BIRTHDATE, + new DomainObjectPropertySheet.AttributeFormatter() { - public String format(DomainObject item, - String attribute, - PageState state) { - //ContentPage page = (ContentPage) item; - GenericPerson person = (GenericPerson) item; - if (person.getBirthdate() != null) { - return DateFormat.getDateInstance(DateFormat.LONG).format(person.getBirthdate()); - } else { - return (String) ContenttypesGlobalizationUtil.globalize("cms.ui.unknown").localize(); - } - } - }); + public String format(DomainObject item, + String attribute, + PageState state) { + //ContentPage page = (ContentPage) item; + GenericPerson person = (GenericPerson) item; + if (person.getBirthdate() != null) { + return DateFormat.getDateInstance(DateFormat.LONG).format(person. + getBirthdate()); + } else { + return (String) ContenttypesGlobalizationUtil.globalize( + "cms.ui.unknown").localize(); + } + } + }); - sheet.add((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.gender").localize(), - GenericPerson.GENDER, - new DomainObjectPropertySheet.AttributeFormatter() { + sheet.add((String) ContenttypesGlobalizationUtil.globalize( + "cms.contenttypes.ui.person.gender").localize(), + GenericPerson.GENDER, + new DomainObjectPropertySheet.AttributeFormatter() { - public String format(DomainObject item, - String attribute, - PageState state) { - //ContentPage page = (ContentPage) item; - GenericPerson person = (GenericPerson) item; - if (person.getGender() != null) { - return (String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.gender." + person.getGender().toLowerCase()).localize(); - } else { - return (String) ContenttypesGlobalizationUtil.globalize("cms.ui.unknown").localize(); - } - } - }); + public String format(DomainObject item, + String attribute, + PageState state) { + //ContentPage page = (ContentPage) item; + GenericPerson person = (GenericPerson) item; + if (person.getGender() != null) { + return (String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.gender." + person. + getGender().toLowerCase()).localize(); + } else { + return (String) ContenttypesGlobalizationUtil.globalize( + "cms.ui.unknown").localize(); + } + } + }); if (!ContentSection.getConfig().getHideLaunchDate()) { - sheet.add((String) ContenttypesGlobalizationUtil.globalize("cms.ui.authoring.page_launch_date").localize(), - ContentPage.LAUNCH_DATE, - new DomainObjectPropertySheet.AttributeFormatter() { + sheet.add((String) ContenttypesGlobalizationUtil.globalize( + "cms.ui.authoring.page_launch_date").localize(), + ContentPage.LAUNCH_DATE, + new DomainObjectPropertySheet.AttributeFormatter() { - public String format(DomainObject item, - String attribute, - PageState state) { - ContentPage page = (ContentPage) item; - if (page.getLaunchDate() != null) { - return DateFormat.getDateInstance(DateFormat.LONG).format(page.getLaunchDate()); - } else { - return (String) ContenttypesGlobalizationUtil.globalize("cms.ui.unknown").localize(); - } - } - }); + public String format(DomainObject item, + String attribute, + PageState state) { + ContentPage page = (ContentPage) item; + if (page.getLaunchDate() != null) { + return DateFormat.getDateInstance(DateFormat.LONG). + format(page.getLaunchDate()); + } else { + return (String) ContenttypesGlobalizationUtil.globalize( + "cms.ui.unknown").localize(); + } + } + }); } - sheet.add((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.description").localize(), GenericPerson.DESCRIPTION); + sheet.add((String) ContenttypesGlobalizationUtil.globalize( + "cms.contenttypes.ui.person.description").localize(), + GenericPerson.DESCRIPTION); return sheet; } } diff --git a/ccm-sci-types-organization/pdl/com/arsdigita/content-types/SciMember.pdl b/ccm-sci-types-organization/pdl/com/arsdigita/content-types/SciMember.pdl new file mode 100644 index 000000000..271b78fec --- /dev/null +++ b/ccm-sci-types-organization/pdl/com/arsdigita/content-types/SciMember.pdl @@ -0,0 +1,12 @@ +model com.arsdigita.cms.contenttypes; + +import com.arsdigita.kernel.ACSObject; +import com.arsdigita.cms.*; + +object type SciMember extends GenericPerson { + + Boolean[0..1] formerMember = ct_sciorga_members.formerMember BIT; + Boolean[0..1] associatedMember = ct_sciorga_members.associatedMember BIT; + + reference key ( ct_sciorga_members.member_id ); +} \ No newline at end of file diff --git a/ccm-sci-types-organization/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/SciMember.xml b/ccm-sci-types-organization/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/SciMember.xml new file mode 100644 index 000000000..ba484e2fd --- /dev/null +++ b/ccm-sci-types-organization/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/SciMember.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ccm-sci-types-organization/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/SciMember.xml b/ccm-sci-types-organization/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/SciMember.xml new file mode 100644 index 000000000..73135fef9 --- /dev/null +++ b/ccm-sci-types-organization/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/SciMember.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/ccm-sci-types-organization/src/ccm-sci-types-organization.load b/ccm-sci-types-organization/src/ccm-sci-types-organization.load index 1d1819ca5..6e9c6c1cf 100644 --- a/ccm-sci-types-organization/src/ccm-sci-types-organization.load +++ b/ccm-sci-types-organization/src/ccm-sci-types-organization.load @@ -6,17 +6,20 @@ -
-
-
+
+
+
+
+ + \ No newline at end of file diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciDepartment.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciDepartment.java index e5ed0b84f..bfdede493 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciDepartment.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciDepartment.java @@ -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; import com.arsdigita.domain.DataObjectNotFoundException; @@ -8,13 +27,47 @@ import com.arsdigita.util.Assert; import java.math.BigDecimal; /** + *

+ * A class for representing departments of an organization. Adds two + * associations to {@link GenericOrganizationalUnit}: + *

+ *
    + *
  • Subdepartments
  • + *
  • Projects
  • + *
+ *

+ * The subdepartments association links one instance of this class + * with another. + * The projects association links an department with projects. + *

+ *

+ * Also, there are two additional fields: + *

+ *
    + *
  • shortDescription
  • + *
  • description
  • + *
+ *

+ * shortDescription takes a short text (maximum length 500 characters) + * about the department. For more detailed description, the description + * field can be used. + *

+ *

+ * There is an + * UML digram + * with an overview of the content types and their associations. Please not that + * the diagram show a design sketch and not the actually implemented classes. + *

* * @author Jens Pelzetter + * @see GenericOrganizationalUnit + * @see SciOrganization + * @see SciProject */ public class SciDepartment extends GenericOrganizationalUnit { public static final String DEPARTMENT_SHORT_DESCRIPTION = - "departmentShortDescription"; + "departmentShortDescription"; public static final String DEPARTMENT_DESCRIPTION = "departmentDescription"; public static final String ORGANIZATION = "organization"; public static final String SUPER_DEPARTMENT = "superDepartment"; @@ -72,6 +125,14 @@ public class SciDepartment extends GenericOrganizationalUnit { } public SciDepartment getSuperDepartment() { + /*This is some sort of hack because if we define the + * relation in PDL with a multiplicity of 0..1 for the super department + * part, CCM crashes when trying to publish the item. So we have to + * define both parts of the association with 0..n in PDL. But we don't + * want more than one superior department per department. So we are + * retrieving the data collection and get the first element of it, and + * return this. + */ DataCollection collection; collection = (DataCollection) get(SUPER_DEPARTMENT); @@ -89,6 +150,11 @@ public class SciDepartment extends GenericOrganizationalUnit { } public void setSuperDepartment(SciDepartment department) { + /* Similar hack as in getSuperDepartment() above. Here, we are + * retrieving the data collection, removing the first (and only item) + * and put the new one in it. + * + */ SciDepartment oldSuperDepartment; oldSuperDepartment = getSuperDepartment(); diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciDepartmentInitializer.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciDepartmentInitializer.java index b2fc63890..3d4964595 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciDepartmentInitializer.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciDepartmentInitializer.java @@ -1,8 +1,28 @@ +/* + * 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; import org.apache.log4j.Logger; /** + * Initializer for {@link SciDepartment}. * * @author Jens Pelzetter */ diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciDepartmentLoader.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciDepartmentLoader.java index 2d27f626a..373f342b8 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciDepartmentLoader.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciDepartmentLoader.java @@ -1,6 +1,26 @@ +/* + * 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; /** + * Loader for {@link SciDepartment}. * * @author Jens Pelzetter */ diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciDepartmentProjectsCollection.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciDepartmentProjectsCollection.java index 34917eed3..7008b01a9 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciDepartmentProjectsCollection.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciDepartmentProjectsCollection.java @@ -25,8 +25,11 @@ import com.arsdigita.persistence.DataObject; import org.apache.log4j.Logger; /** + * Special domain collection for the projects of an department. * * @author Jens Pelzetter + * @see SciDepartment + * @see SciProject */ public class SciDepartmentProjectsCollection extends DomainCollection { diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciDepartmentSubDepartmentsCollection.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciDepartmentSubDepartmentsCollection.java index ca922d941..816a7f883 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciDepartmentSubDepartmentsCollection.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciDepartmentSubDepartmentsCollection.java @@ -25,8 +25,10 @@ import com.arsdigita.persistence.DataObject; import org.apache.log4j.Logger; /** + * Special domain collection for the subdepartments of a department. * * @author Jens Pelzetter + * @see SciDepartment */ public class SciDepartmentSubDepartmentsCollection extends DomainCollection { diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciMember.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciMember.java new file mode 100644 index 000000000..7f811fd4c --- /dev/null +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciMember.java @@ -0,0 +1,93 @@ +/* + * 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; + +import com.arsdigita.domain.DataObjectNotFoundException; +import com.arsdigita.persistence.DataObject; +import com.arsdigita.persistence.OID; +import java.math.BigDecimal; + +/** + *

+ * Specialized variant of {@link GenericPerson} for members of scientific + * organizations. Adds two fields to the fields of GenericPerson: + *

+ *
+ *
associatedMember
+ *
Is the member an associated member?
+ *
formerMember
+ *
Is the member a former member?
+ * + * + * @author Jens Pelzetter + */ +public class SciMember extends GenericPerson { + + public static final String ASSOCIATED_MEBER = "associatedMember"; + public static final String FORMER_MEMBER = "formerMember"; + public static final String BASE_DATA_OBJECT_TYPE = + "com.arsdigita.cms.contenttypes.SciMember"; + private static final SciOrganizationConfig s_config = + new SciOrganizationConfig(); + + static { + s_config.load(); + } + + public SciMember() { + this(BASE_DATA_OBJECT_TYPE); + } + + public SciMember(BigDecimal id) throws DataObjectNotFoundException { + this(new OID(BASE_DATA_OBJECT_TYPE, id)); + } + + public SciMember(OID oid) throws DataObjectNotFoundException { + super(oid); + } + + public SciMember(DataObject dobj) { + super(dobj); + } + + public SciMember(String type) { + super(type); + } + + public static SciOrganizationConfig getConfig() { + return s_config; + } + + public Boolean isFormerMember() { + return (Boolean )get(FORMER_MEMBER); + } + + public void setFormerMember(Boolean formerMember) { + set(FORMER_MEMBER, formerMember); + } + + public Boolean isAssociatedMember() { + return (Boolean) get(ASSOCIATED_MEBER); + } + + public void setAssoicatedMember(Boolean associatedMember) { + set(ASSOCIATED_MEBER, associatedMember); + } +} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciMemberInitializer.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciMemberInitializer.java new file mode 100644 index 000000000..ad25ccabd --- /dev/null +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciMemberInitializer.java @@ -0,0 +1,45 @@ +/* + * 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; + +/** + * Initializer for {@link SciMember} + * + * @author Jens Pelzetter + */ +public class SciMemberInitializer extends ContentTypeInitializer { + + public SciMemberInitializer() { + super("empty.pdl.mf", SciMember.BASE_DATA_OBJECT_TYPE); + } + + @Override + public String[] getStylesheets() { + return new String[]{ + "/static/content-types/com/arsdigita/cms/contenttypes/SciMember.xsl" + }; + } + + @Override + public String getTraversalXML() { + return "/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/SciMember.xml"; + + } +} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciMemberLoader.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciMemberLoader.java new file mode 100644 index 000000000..764ec32d9 --- /dev/null +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciMemberLoader.java @@ -0,0 +1,36 @@ +/* + * 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; + +/** + * Loader for {@link SciMember} + * + * @author Jens Pelzetter + */ +public class SciMemberLoader extends AbstractContentTypeLoader { + + private static final String[] TYPES = { + "/WEB-INF/content-types/com/arsdigita/cms/contenttypes/SciMember.xml"}; + + @Override + public String[] getTypes() { + return TYPES; + } +} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciOrganization.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciOrganization.java index fbe26a31a..f363c4b4b 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciOrganization.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciOrganization.java @@ -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; import com.arsdigita.domain.DataObjectNotFoundException; @@ -8,8 +27,36 @@ import com.arsdigita.util.Assert; import java.math.BigDecimal; /** + *

+ * A class for representing departments of an organization. Adds two + * associations to {@link GenericOrganizationalUnit}: + *

+ *
    + *
  • departments
  • + *
  • projects
  • + *
+ *

+ * The departments association is used to link an organization with + * its departments. The project association can be used to link an + * organization with projects. + *

+ *

+ * Also, two fields are added. The shortDescription takes a string + * of 500 characters for a short description of the organization. An detailed + * description of the organization can be put into the description + * field. + *

+ *

+ * There is an + * UML digram + * with an overview of the content types and their associations. Please not that + * the diagram show a design sketch and not the actually implemented classes. + *

* * @author Jens Pelzetter + * @see GenericOrganizationalUnit + * @see SciDepartment + * @see SciProject^ */ public class SciOrganization extends GenericOrganizationalUnit { @@ -50,7 +97,7 @@ public class SciOrganization extends GenericOrganizationalUnit { super(type); } - public static final SciOrganizationConfig getConfig() { + public static SciOrganizationConfig getConfig() { return s_config; } diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciOrganizationConfig.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciOrganizationConfig.java index 330e25218..dff58d5d0 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciOrganizationConfig.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciOrganizationConfig.java @@ -5,6 +5,7 @@ import com.arsdigita.util.parameter.BooleanParameter; import com.arsdigita.util.parameter.Parameter; /** + * Configuration class for the complete ccm-sci-types-organization-module. * * @author Jens Pelzetter */ diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciOrganizationDepartmentsCollection.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciOrganizationDepartmentsCollection.java index e8ad4d32d..fbac5a36f 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciOrganizationDepartmentsCollection.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciOrganizationDepartmentsCollection.java @@ -25,8 +25,11 @@ import com.arsdigita.persistence.DataObject; import org.apache.log4j.Logger; /** + * Special domain collection for the departments of an organization. * * @author Jens Pelzetter + * @see SciOrganization + * @see SciDepartment */ public class SciOrganizationDepartmentsCollection extends DomainCollection { diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciOrganizationInitializer.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciOrganizationInitializer.java index a3ee525f0..be48223c4 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciOrganizationInitializer.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciOrganizationInitializer.java @@ -1,8 +1,28 @@ +/* + * 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; import org.apache.log4j.Logger; /** + * Initalizer for {@link SciOrganization} * * @author Jens Pelzetter */ diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciOrganizationLoader.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciOrganizationLoader.java index 50a82498c..cdacf6bc6 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciOrganizationLoader.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciOrganizationLoader.java @@ -1,6 +1,26 @@ +/* + * 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; /** + * Loader for {@link SciOrganization} * * @author Jens Pelzetter */ @@ -10,6 +30,7 @@ public class SciOrganizationLoader extends AbstractContentTypeLoader { "/WEB-INF/content-types/com/arsdigita/cms/contenttypes/SciOrganization.xml" }; + @Override public String[] getTypes() { return TYPES; } diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciOrganizationProjectsCollection.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciOrganizationProjectsCollection.java index fd61e154d..ea99039f6 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciOrganizationProjectsCollection.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciOrganizationProjectsCollection.java @@ -25,8 +25,11 @@ import com.arsdigita.persistence.DataObject; import org.apache.log4j.Logger; /** + * Special domain collection for the projects of an organization. * * @author Jens Pelzetter + * @see SciOrganization + * @see SciProject */ public class SciOrganizationProjectsCollection extends DomainCollection { diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciProject.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciProject.java index ef770aa98..77c09a966 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciProject.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciProject.java @@ -28,8 +28,39 @@ import java.math.BigDecimal; import java.util.Date; /** + *

+ * The class represents a (scientific) project. It extends + * {@link GenericOrganizationalUnit} and adds a relation for subprojects and + * some fields for additional information: + *

+ *
+ *
projectBegin
+ *
The begin of the project
+ *
projectEnd
+ *
The end of the project
+ *
shortDescription
+ *
A short description (500 characters) of the project
+ *
description
+ *
A description of the project/
+ *
funding
+ *
A text about the funding of the project
+ *
+ *

+ * Also, the class has some methods the access the associations defined by + * {@link SciOrganization} and {@link SciDepartment} with + * SciProject. + *

+ *

+ * There is an + * UML digram + * with an overview of the content types and their associations. Please not that + * the diagram show a design sketch and not the actually implemented classes. + *

* * @author Jens Pelzetter + * @see GenericOrganizationalUnit + * @see SciOrganization + * @see SciDepartment */ public class SciProject extends GenericOrganizationalUnit { diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciProjectDepartmentsCollection.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciProjectDepartmentsCollection.java index 73c2728a5..d681845d4 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciProjectDepartmentsCollection.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciProjectDepartmentsCollection.java @@ -25,6 +25,7 @@ import com.arsdigita.persistence.DataObject; import org.apache.log4j.Logger; /** + * Special domain collection for the departments involved in a project. * * @author Jens Pelzetter */ diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciProjectInitializer.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciProjectInitializer.java index ae6ce707a..55bd79f81 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciProjectInitializer.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciProjectInitializer.java @@ -1,8 +1,28 @@ +/* + * 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; import org.apache.log4j.Logger; /** + * Initializer for {@link SciProject}. * * @author Jens Pelzetter */ diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciProjectLoader.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciProjectLoader.java index afb61f2e5..906072a37 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciProjectLoader.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciProjectLoader.java @@ -1,6 +1,26 @@ +/* + * 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; /** + * Loader for {@link SciProject} * * @author Jens Pelzetter */ diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciProjectOrganizationsCollection.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciProjectOrganizationsCollection.java index 18a64d13e..f1c9509d4 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciProjectOrganizationsCollection.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciProjectOrganizationsCollection.java @@ -25,6 +25,7 @@ import com.arsdigita.persistence.DataObject; import org.apache.log4j.Logger; /** + * Special domain collection for the organization involved in a project. * * @author Jens Pelzetter */ diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciProjectSubProjectsCollection.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciProjectSubProjectsCollection.java index 7711574e0..8bc8bd1d2 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciProjectSubProjectsCollection.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciProjectSubProjectsCollection.java @@ -25,6 +25,7 @@ import com.arsdigita.persistence.DataObject; import org.apache.log4j.Logger; /** + * Special domain collection for the suprojects of a project. * * @author Jens Pelzetter */ diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/doc-files/ccm-sci-types-organization_entities.png b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/doc-files/ccm-sci-types-organization_entities.png new file mode 100644 index 000000000..5ac626f36 Binary files /dev/null and b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/doc-files/ccm-sci-types-organization_entities.png differ diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentDescriptionEditForm.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentDescriptionEditForm.java index 8d4f7399a..edc9a4796 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentDescriptionEditForm.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentDescriptionEditForm.java @@ -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; import com.arsdigita.bebop.FormData; @@ -16,8 +35,10 @@ import com.arsdigita.cms.ui.CMSDHTMLEditor; import com.arsdigita.cms.ui.authoring.BasicItemForm; /** + * Edit form for the description of a SciDepartment. * * @author Jens Pelzetter + * @see SciDepartment */ public class SciDepartmentDescriptionEditForm extends BasicItemForm diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentDescriptionStep.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentDescriptionStep.java index b49dc57c6..9914e3e6d 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentDescriptionStep.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentDescriptionStep.java @@ -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; import com.arsdigita.bebop.Component; @@ -10,8 +29,10 @@ import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; import com.arsdigita.toolbox.ui.DomainObjectPropertySheet; /** + * EditStep for the description of a SciDepartment. * * @author Jens Pelzetter + * @see SciDepartment */ public class SciDepartmentDescriptionStep extends SimpleEditStep { diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentDescriptionUploadForm.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentDescriptionUploadForm.java index 4f4ca3c64..b5fe10dda 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentDescriptionUploadForm.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentDescriptionUploadForm.java @@ -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; import com.arsdigita.bebop.PageState; @@ -6,8 +25,11 @@ import com.arsdigita.cms.contenttypes.SciDepartment; import com.arsdigita.globalization.GlobalizedMessage; /** + * Upload form for the description of a SciDepartment. * * @author Jens Pelzetter + * @see SciDepartment + * @see AbstractTextUploadForm */ public class SciDepartmentDescriptionUploadForm extends AbstractTextUploadForm { diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentMemberAddForm.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentMemberAddForm.java new file mode 100644 index 000000000..08699a116 --- /dev/null +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentMemberAddForm.java @@ -0,0 +1,47 @@ +/* + * 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; + +import com.arsdigita.cms.contenttypes.SciMember; +import com.arsdigita.cms.ItemSelectionModel; +import com.arsdigita.cms.contenttypes.SciDepartment; + +/** + * Form for adding members to a SciDepartment. This form overwrites + * the {@link GenericOrganizationalUnitPersonAddForm#getPersonType()} + * to limit the selectable type for adding to {@link SciMember}. + * + * @author Jens Pelzetter + * @see SciDepartment + * @see SciMember + * @see GenericOrganizationalUnitPersonAddForm + */ +public class SciDepartmentMemberAddForm + extends GenericOrganizationalUnitPersonAddForm { + + public SciDepartmentMemberAddForm(ItemSelectionModel itemModel) { + super(itemModel); + } + + @Override + protected String getPersonType() { + return SciMember.class.getName(); + } +} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentMemberStep.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentMemberStep.java new file mode 100644 index 000000000..8f9ede4ff --- /dev/null +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentMemberStep.java @@ -0,0 +1,59 @@ +/* + * 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; + +import com.arsdigita.cms.ItemSelectionModel; +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; + +/** + * Edit step for adding members to a SciDepartment. + * + * @author Jens Pelzetter + */ +public class SciDepartmentMemberStep extends SimpleEditStep { + + private static final String ADD_MEMBER_SHEET_NAME = "addMember"; + + public SciDepartmentMemberStep(ItemSelectionModel itemModel, + AuthoringKitWizard parent) { + this(itemModel, parent, null); + } + + public SciDepartmentMemberStep(ItemSelectionModel itemModel, + AuthoringKitWizard parent, + String prefix) { + super(itemModel, parent, prefix); + + BasicItemForm addMemberSheet = + new SciDepartmentMemberAddForm(itemModel); + add(ADD_MEMBER_SHEET_NAME, + (String) SciOrganizationGlobalizationUtil.globalize( + "sciorganization.ui.department.add_member").localize(), + new WorkflowLockedComponentAccess(addMemberSheet, itemModel), + addMemberSheet.getSaveCancelSection().getCancelButton()); + + GenericOrganizationalUnitPersonsTable memberTable = new GenericOrganizationalUnitPersonsTable( + itemModel); + setDisplayComponent(memberTable); + } +} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentOrganizationForm.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentOrganizationForm.java index 5dfc355a1..bcef894e5 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentOrganizationForm.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentOrganizationForm.java @@ -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; import com.arsdigita.bebop.FormData; @@ -15,8 +34,11 @@ import com.arsdigita.cms.ui.ItemSearchWidget; import com.arsdigita.cms.ui.authoring.BasicItemForm; /** + * Form for setting the superior organization of an SciDepartment. * * @author Jens Pelzetter + * @see SciDepartment + * @see SciOrganization */ public class SciDepartmentOrganizationForm extends BasicItemForm diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentOrganizationSheet.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentOrganizationSheet.java index ab0b3893d..e95f3fbe5 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentOrganizationSheet.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentOrganizationSheet.java @@ -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; import com.arsdigita.bebop.Component; @@ -20,8 +39,11 @@ import com.arsdigita.cms.dispatcher.Utilities; import com.arsdigita.util.LockableImpl; /** + * Sheet for showing the superior organization of a SciDepartment. * * @author Jens Pelzetter + * @see SciDepartment + * @see SciOrganization */ public class SciDepartmentOrganizationSheet extends Table @@ -117,7 +139,7 @@ public class SciDepartmentOrganizationSheet return m_orga.getTitle(); case 1: return SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.departemnt.organzation.remove"); + "sciorganization.ui.department.organization.remove"); default: return null; } diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentOrganizationStep.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentOrganizationStep.java index 34c6fc27d..1b168b372 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentOrganizationStep.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentOrganizationStep.java @@ -1,14 +1,38 @@ +/* + * 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; import com.arsdigita.cms.ItemSelectionModel; +import com.arsdigita.cms.contenttypes.SciDepartment; +import com.arsdigita.cms.contenttypes.SciOrganization; 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; /** + * Step for setting the superior organization of a SciDepartment. * * @author Jens Pelzetter + * @see SciDepartment + * @see SciOrganization */ public class SciDepartmentOrganizationStep extends SimpleEditStep { diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentProjectAddForm.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentProjectAddForm.java index 983a360b6..27d446570 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentProjectAddForm.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentProjectAddForm.java @@ -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; import com.arsdigita.bebop.FormData; @@ -15,8 +34,11 @@ import com.arsdigita.cms.ui.ItemSearchWidget; import com.arsdigita.cms.ui.authoring.BasicItemForm; /** + * Form for linking an {@link SciDepartment} with a {@link SciProject}. * * @author Jens Pelzetter + * @see SciDepartment + * @see SciProject */ public class SciDepartmentProjectAddForm extends BasicItemForm diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentProjectsStep.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentProjectsStep.java index e6fcba282..4f9b3065e 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentProjectsStep.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentProjectsStep.java @@ -1,14 +1,38 @@ +/* + * 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; import com.arsdigita.cms.ItemSelectionModel; +import com.arsdigita.cms.contenttypes.SciDepartment; +import com.arsdigita.cms.contenttypes.SciProject; 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; /** + * Step for linking {@link SciDepartment}s with {@link SciProject}s. * * @author Jens Pelzetter + * @see SciDepartment + * @see SciProject */ public class SciDepartmentProjectsStep extends SimpleEditStep { diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentProjectsTable.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentProjectsTable.java index 8ba2cd918..756173138 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentProjectsTable.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentProjectsTable.java @@ -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; import java.math.BigDecimal; @@ -23,8 +42,11 @@ import com.arsdigita.cms.dispatcher.Utilities; import com.arsdigita.util.LockableImpl; /** + * Table for showing all {@link SciProject}s linked with a {@link SciDepartment} * * @author Jens Pelzetter + * @see SciDepartment + * @see SciProject */ public class SciDepartmentProjectsTable extends Table diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentPropertiesStep.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentPropertiesStep.java index e0feab095..f2438cd45 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentPropertiesStep.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentPropertiesStep.java @@ -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; import com.arsdigita.bebop.Component; @@ -12,8 +31,10 @@ import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; import com.arsdigita.toolbox.ui.DomainObjectPropertySheet; /** + * Step for editing a {@link SciDepartment}. * * @author Jens Pelzetter + * @see SciDepartment */ public class SciDepartmentPropertiesStep extends GenericOrganizationalUnitPropertiesStep { @@ -71,13 +92,13 @@ public class SciDepartmentPropertiesStep if (!config.getDepartmentAddContactHide()) { addStep(new GenericOrganizationalUnitContactPropertiesStep(itemModel, parent), - "cms.contenttypes.ui.orgaunit.contact"); + "sciorganization.ui.department.contacts"); } if (!config.getDepartmentAddPersonHide()) { - addStep(new GenericOrganizationalUnitPersonPropertiesStep(itemModel, - parent), - "cms.contenttypes.ui.orgaunit.persons"); + addStep(new SciDepartmentMemberStep(itemModel, + parent), + "sciorganization.ui.department.members"); } if (!config.getDepartmentAddSubDepartmentHide()) { diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentPropertyForm.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentPropertyForm.java index 4220fb89e..89b4aa8fc 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentPropertyForm.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentPropertyForm.java @@ -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; import com.arsdigita.bebop.FormData; @@ -13,8 +32,10 @@ import com.arsdigita.cms.ItemSelectionModel; import com.arsdigita.cms.contenttypes.SciDepartment; /** + * Form for editing the basic properties of a {@link SciDepartment}. * * @author Jens Pelzetter + * @see SciDepartment */ public class SciDepartmentPropertyForm extends GenericOrganizationalUnitPropertyForm diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSubDepartmentAddForm.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSubDepartmentAddForm.java index d396a2da6..b5ae2eed7 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSubDepartmentAddForm.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSubDepartmentAddForm.java @@ -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; import com.arsdigita.bebop.FormData; @@ -14,8 +33,10 @@ import com.arsdigita.cms.ui.ItemSearchWidget; import com.arsdigita.cms.ui.authoring.BasicItemForm; /** + * Form for adding subdepartments to a {@link SciDepartment}. * * @author Jens Pelzetter + * @see SciDepartment */ public class SciDepartmentSubDepartmentAddForm extends BasicItemForm diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSubDepartmentsStep.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSubDepartmentsStep.java index 0d97c2547..07e8b62cc 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSubDepartmentsStep.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSubDepartmentsStep.java @@ -1,14 +1,36 @@ +/* + * 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; import com.arsdigita.cms.ItemSelectionModel; +import com.arsdigita.cms.contenttypes.SciDepartment; 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; /** + * Step for adding subdepartments to a {@link SciDepartment}. * * @author Jens Pelzetter + * @see SciDepartment */ public class SciDepartmentSubDepartmentsStep extends SimpleEditStep { @@ -28,7 +50,7 @@ public class SciDepartmentSubDepartmentsStep extends SimpleEditStep { new SciDepartmentSubDepartmentAddForm(itemModel); add(ADD_SUBDEPARTMENT_SHEET_NAME, (String) SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.organization.add_subdepartment").localize(), + "sciorganization.ui.department.add_subdepartment").localize(), new WorkflowLockedComponentAccess(addSubDepartmentSheet, itemModel), addSubDepartmentSheet.getSaveCancelSection().getCancelButton()); diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSubDepartmentsTable.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSubDepartmentsTable.java index be1042d53..2fcd4fc11 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSubDepartmentsTable.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSubDepartmentsTable.java @@ -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; import com.arsdigita.bebop.Component; @@ -21,8 +40,10 @@ import com.arsdigita.util.LockableImpl; import java.math.BigDecimal; /** + * Table for showing the subdepartments of a {@link SciDepartment}. * * @author Jens Pelzetter + * @see SciDepartment */ public class SciDepartmentSubDepartmentsTable extends Table diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSuperDepartmentForm.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSuperDepartmentForm.java index 4e2116190..0855a1924 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSuperDepartmentForm.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSuperDepartmentForm.java @@ -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; import com.arsdigita.bebop.FormData; @@ -14,8 +33,10 @@ import com.arsdigita.cms.ui.ItemSearchWidget; import com.arsdigita.cms.ui.authoring.BasicItemForm; /** + * Form for setting the superior department of a {@link SciDepartment}. * * @author Jens Pelzetter + * @see SciDepartment */ public class SciDepartmentSuperDepartmentForm extends BasicItemForm diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSuperDepartmentSheet.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSuperDepartmentSheet.java index 1c13c7729..3e089b8f8 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSuperDepartmentSheet.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSuperDepartmentSheet.java @@ -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; import com.arsdigita.bebop.Component; @@ -19,8 +38,10 @@ import com.arsdigita.cms.dispatcher.Utilities; import com.arsdigita.util.LockableImpl; /** + * Sheet for showing the superior department of a {@link SciDepartment}. * * @author Jens Pelzetter + * @see SciDepartment */ public class SciDepartmentSuperDepartmentSheet extends Table diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSuperDepartmentStep.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSuperDepartmentStep.java index bc5aa8c8c..cbd532251 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSuperDepartmentStep.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSuperDepartmentStep.java @@ -1,14 +1,36 @@ +/* + * 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; import com.arsdigita.cms.ItemSelectionModel; +import com.arsdigita.cms.contenttypes.SciDepartment; 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; /** + * Step for setting the superior department of a {@link SciDepartment}. * * @author Jens Pelzetter + * @see SciDepartment */ public class SciDepartmentSuperDepartmentStep extends SimpleEditStep { diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciMemberPropertiesStep.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciMemberPropertiesStep.java new file mode 100644 index 000000000..e5d314830 --- /dev/null +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciMemberPropertiesStep.java @@ -0,0 +1,56 @@ +package com.arsdigita.cms.contenttypes.ui; + +import com.arsdigita.bebop.Component; +import com.arsdigita.cms.ItemSelectionModel; +import com.arsdigita.cms.contenttypes.GenericPerson; +import com.arsdigita.cms.contenttypes.SciMember; +import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; +import com.arsdigita.cms.ui.authoring.BasicPageForm; +import com.arsdigita.cms.ui.authoring.SimpleEditStep; +import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; +import com.arsdigita.toolbox.ui.DomainObjectPropertySheet; + +/** + * Step for editing the basic properties of an {@link SciMember}. + * + * @author Jens Pelzetter + * @see SciMember + * @see GenericPerson + */ +public class SciMemberPropertiesStep extends SimpleEditStep { + + public static final String EDIT_SHEET_NAME = "edit"; + + public SciMemberPropertiesStep(ItemSelectionModel itemModel, + AuthoringKitWizard parent) { + super(itemModel, parent); + + BasicPageForm editSheet; + editSheet = new SciMemberPropertyForm(itemModel, this); + add(EDIT_SHEET_NAME, + (String) SciOrganizationGlobalizationUtil.globalize( + "sciorganization.ui.member.edit_basic_properties").localize(), + new WorkflowLockedComponentAccess(editSheet, itemModel), + editSheet.getSaveCancelSection().getCancelButton()); + + setDisplayComponent(getSciMemberPropertySheet(itemModel)); + + } + + public static Component getSciMemberPropertySheet( + ItemSelectionModel itemModel) { + DomainObjectPropertySheet sheet; + + sheet = (DomainObjectPropertySheet) GenericPersonPropertiesStep. + getGenericPersonPropertySheet(itemModel); + + sheet.add(SciOrganizationGlobalizationUtil.globalize( + "sciorganization.ui.member.associatedMember"), + SciMember.ASSOCIATED_MEBER); + sheet.add(SciOrganizationGlobalizationUtil.globalize( + "sciorganization.ui.member.formerMember"), + SciMember.FORMER_MEMBER); + + return sheet; + } +} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciMemberPropertyForm.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciMemberPropertyForm.java new file mode 100644 index 000000000..e02f407bb --- /dev/null +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciMemberPropertyForm.java @@ -0,0 +1,112 @@ +/* + * 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; + +import com.arsdigita.bebop.FormData; +import com.arsdigita.bebop.Label; +import com.arsdigita.bebop.event.FormInitListener; +import com.arsdigita.bebop.event.FormSectionEvent; +import com.arsdigita.bebop.event.FormSubmissionListener; +import com.arsdigita.bebop.form.CheckboxGroup; +import com.arsdigita.bebop.form.Option; +import com.arsdigita.bebop.parameters.ArrayParameter; +import com.arsdigita.bebop.parameters.BooleanParameter; +import com.arsdigita.bebop.parameters.ParameterModel; +import com.arsdigita.cms.ItemSelectionModel; +import com.arsdigita.cms.contenttypes.GenericPerson; +import com.arsdigita.cms.contenttypes.SciMember; + +/** + * Form for editing the basic properties of a {@link SciMember}. This form + * extends the form for editing the basic properties of {@link GenericPerson}. + * + * @author Jens Pelzetter + * @see SciMember + * @see GenericPerson + * @see GenericPersonPropertyForm + */ +public class SciMemberPropertyForm + extends GenericPersonPropertyForm + implements FormInitListener, + FormSubmissionListener { + + private SciMemberPropertiesStep m_step; + + public SciMemberPropertyForm(ItemSelectionModel itemModel) { + this(itemModel, null); + } + + public SciMemberPropertyForm(ItemSelectionModel itemModel, + SciMemberPropertiesStep step) { + super(itemModel); + m_step = step; + } + + @Override + protected void addWidgets() { + super.addWidgets(); + + add(new Label(SciOrganizationGlobalizationUtil.globalize( + "sciorganization.ui.member.associatedMember"))); + ParameterModel isAssociated = new BooleanParameter( + SciMember.ASSOCIATED_MEBER); + ArrayParameter associatedParam = new ArrayParameter(isAssociated); + CheckboxGroup associated = new CheckboxGroup(associatedParam); + associated.addOption(new Option("")); + add(associated); + + add(new Label(SciOrganizationGlobalizationUtil.globalize( + "sciorganization.ui.member.formerMember"))); + ParameterModel isFormer = new BooleanParameter(SciMember.FORMER_MEMBER); + ArrayParameter formerParam = new ArrayParameter(isFormer); + CheckboxGroup former = new CheckboxGroup(formerParam); + former.addOption(new Option("")); + add(former); + } + + @Override + public void init(FormSectionEvent fse) { + super.init(fse); + + FormData data = fse.getFormData(); + SciMember member = (SciMember) super.initBasicWidgets(fse); + + data.put(SciMember.ASSOCIATED_MEBER, member.isAssociatedMember()); + data.put(SciMember.FORMER_MEMBER, member.isFormerMember()); + } + + @Override + public void process(FormSectionEvent fse) { + super.process(fse); + + FormData data = fse.getFormData(); + SciMember member = (SciMember) super.processBasicWidgets(fse); + + if ((member != null) && getSaveCancelSection().getSaveButton(). + isSelected(fse.getPageState())) { + member.setAssoicatedMember((Boolean) data.get(SciMember.ASSOCIATED_MEBER)); + member.setFormerMember((Boolean) data.get(SciMember.FORMER_MEMBER)); + + member.save(); + + init(fse); + } + } +} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationDepartmentAddForm.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationDepartmentAddForm.java index 5f0e5775b..eb3ca9c7c 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationDepartmentAddForm.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationDepartmentAddForm.java @@ -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; import com.arsdigita.bebop.FormData; @@ -15,8 +34,11 @@ import com.arsdigita.cms.ui.ItemSearchWidget; import com.arsdigita.cms.ui.authoring.BasicItemForm; /** + * Form for linking {@link SciOrganization}s with {@link SciDepartment}s. * * @author Jens Pelzetter + * @see SciOrganization + * @see SciDepartment */ public class SciOrganizationDepartmentAddForm extends BasicItemForm diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationDepartmentsStep.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationDepartmentsStep.java index 9aba27c99..9b87f25d9 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationDepartmentsStep.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationDepartmentsStep.java @@ -1,14 +1,38 @@ +/* + * 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; import com.arsdigita.cms.ItemSelectionModel; +import com.arsdigita.cms.contenttypes.SciDepartment; +import com.arsdigita.cms.contenttypes.SciOrganization; 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; /** + * Step for adding {@link SciDepartment}s to a {@link SciOrganization}. * * @author Jens Pelzetter + * @see SciDepartment + * @see SciOrganization */ public class SciOrganizationDepartmentsStep extends SimpleEditStep { diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationDepartmentsTable.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationDepartmentsTable.java index 01768e394..65cbb6b78 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationDepartmentsTable.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationDepartmentsTable.java @@ -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; import com.arsdigita.bebop.Component; @@ -22,8 +41,12 @@ import com.arsdigita.util.LockableImpl; import java.math.BigDecimal; /** + * Table for showing the {@link SciDepartment}s linked to a + * {@link SciOrganization}. * * @author Jens Pelzetter + * @see SciOrganization + * @see SciDepartment */ public class SciOrganizationDepartmentsTable extends Table diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationDescriptionEditForm.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationDescriptionEditForm.java index d3856df59..756017bfd 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationDescriptionEditForm.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationDescriptionEditForm.java @@ -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; import com.arsdigita.bebop.FormData; @@ -16,8 +35,10 @@ import com.arsdigita.cms.ui.CMSDHTMLEditor; import com.arsdigita.cms.ui.authoring.BasicItemForm; /** + * Form for editing the description of a {@link SciOrganization}. * * @author Jens Pelzetter + * @see SciOrganization */ public class SciOrganizationDescriptionEditForm extends BasicItemForm diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationDescriptionStep.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationDescriptionStep.java index 8dd985220..38f97e067 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationDescriptionStep.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationDescriptionStep.java @@ -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; import com.arsdigita.bebop.Component; @@ -10,8 +29,10 @@ import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; import com.arsdigita.toolbox.ui.DomainObjectPropertySheet; /** + * Step for editing the description of a {@link SciOrganization}. * * @author Jens Pelzetter + * @see SciOrganization */ public class SciOrganizationDescriptionStep extends SimpleEditStep { diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationDescriptionUploadForm.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationDescriptionUploadForm.java index 57c3dda23..8c5bc5c5f 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationDescriptionUploadForm.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationDescriptionUploadForm.java @@ -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; import com.arsdigita.bebop.PageState; @@ -6,8 +25,11 @@ import com.arsdigita.cms.contenttypes.SciOrganization; import com.arsdigita.globalization.GlobalizedMessage; /** + * Form for uploading the description of a {@link SciOrganization}. * * @author Jens Pelzetter + * @see SciOrganization + * @see AbstractTextUploadForm */ public class SciOrganizationDescriptionUploadForm extends AbstractTextUploadForm { diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationGlobalizationUtil.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationGlobalizationUtil.java index 7718bffce..ab5f89a26 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationGlobalizationUtil.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationGlobalizationUtil.java @@ -1,14 +1,34 @@ +/* + * 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; import com.arsdigita.globalization.GlobalizedMessage; /** + * GlobalizationUtil for the ccm-sci-types-organization module. * * @author Jens Pelzetter */ public class SciOrganizationGlobalizationUtil { - public static final String BUNDLE_NAME = "com.arsdigita.cms.contenttypes.ui.OrganizationResources"; + public static final String BUNDLE_NAME = "com.arsdigita.cms.contenttypes.ui.SciOrganizationResources"; public static GlobalizedMessage globalize(String key) { return new GlobalizedMessage(key, BUNDLE_NAME); diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationMemberAddForm.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationMemberAddForm.java new file mode 100644 index 000000000..138cfe11f --- /dev/null +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationMemberAddForm.java @@ -0,0 +1,50 @@ +/* + * 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; + +import com.arsdigita.cms.contenttypes.SciMember; +import com.arsdigita.cms.ItemSelectionModel; +import com.arsdigita.cms.contenttypes.GenericPerson; +import com.arsdigita.cms.contenttypes.SciOrganization; + +/** + * Form for linking members with a {@link SciOrganization}. The form overwrites + * the {@link GenericOrganizationalUnitPersonAddForm#getPersonType()} to limit + * the selectable person type to {@link SciMember}. + * + * @author Jens Pelzetter + * @see SciOrganization + * @see SciMember + * @see GenericPerson + * @see GenericOrganizationalUnitPersonAddForm + */ +public class SciOrganizationMemberAddForm + extends GenericOrganizationalUnitPersonAddForm { + + public SciOrganizationMemberAddForm(ItemSelectionModel itemModel) { + super(itemModel); + } + + @Override + protected String getPersonType() { + return SciMember.class.getName(); + } + +} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationMemberStep.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationMemberStep.java new file mode 100644 index 000000000..df6ed775e --- /dev/null +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationMemberStep.java @@ -0,0 +1,66 @@ +/* + * 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; + +import com.arsdigita.cms.ItemSelectionModel; +import com.arsdigita.cms.contenttypes.SciMember; +import com.arsdigita.cms.contenttypes.SciOrganization; +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; + +/** + * Step for adding and removing member form a {@link SciOrganization}. + * + * @author Jens Pelzetter + * @see SciOrganizationMemberAddForm + * @see SciMember + * @see SciOrganization + */ +public class SciOrganizationMemberStep extends SimpleEditStep { + + private static final String ADD_MEMBER_SHEET_NAME = "addMember"; + + public SciOrganizationMemberStep(ItemSelectionModel itemModel, + AuthoringKitWizard parent) { + this(itemModel, parent, null); + } + + public SciOrganizationMemberStep(ItemSelectionModel itemModel, + AuthoringKitWizard parent, + String prefix) { + super(itemModel, parent, prefix); + + BasicItemForm addMemberSheet = + new SciOrganizationMemberAddForm(itemModel); + add(ADD_MEMBER_SHEET_NAME, + (String) SciOrganizationGlobalizationUtil.globalize( + "sciorganization.ui.orgnization.add_member").localize(), + new WorkflowLockedComponentAccess(addMemberSheet, itemModel), + addMemberSheet.getSaveCancelSection().getCancelButton()); + + GenericOrganizationalUnitPersonsTable memberTable = new GenericOrganizationalUnitPersonsTable( + itemModel); + setDisplayComponent(memberTable); + } + + +} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationProjectAddForm.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationProjectAddForm.java index 85c1ad316..1ea63a249 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationProjectAddForm.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationProjectAddForm.java @@ -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; import com.arsdigita.bebop.FormData; @@ -15,8 +34,12 @@ import com.arsdigita.cms.ui.ItemSearchWidget; import com.arsdigita.cms.ui.authoring.BasicItemForm; /** + * Form for linking projects with a {@link SciOrganization}. * * @author Jens Pelzetter + * @see SciOrganizationProjectAddForm + * @see SciOrganization + * @see SciProject */ public class SciOrganizationProjectAddForm extends BasicItemForm diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationProjectsStep.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationProjectsStep.java index 527d54fde..25d1d4c03 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationProjectsStep.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationProjectsStep.java @@ -1,14 +1,40 @@ +/* + * 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; import com.arsdigita.cms.ItemSelectionModel; +import com.arsdigita.cms.contenttypes.SciOrganization; +import com.arsdigita.cms.contenttypes.SciProject; 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; /** + * Step for adding and removing links from a {@link SciOrganization} to a + * {@link SciProject}. * * @author Jens Pelzetter + * @see SciOrganizationProjectAddForm + * @see SciOrganization + * @see SciProject */ public class SciOrganizationProjectsStep extends SimpleEditStep { diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationProjectsTable.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationProjectsTable.java index 8596aa468..75afdf5bd 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationProjectsTable.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationProjectsTable.java @@ -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; import java.math.BigDecimal; @@ -23,8 +42,12 @@ import com.arsdigita.cms.dispatcher.Utilities; import com.arsdigita.util.LockableImpl; /** + * Table for showing the links between a {@link SciOrganization} and + * {@link SciProject}s. * * @author Jens Pelzetter + * @see SciOrganization + * @see SciProject */ public class SciOrganizationProjectsTable extends Table diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationPropertiesStep.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationPropertiesStep.java index 092dde574..501ce0c70 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationPropertiesStep.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationPropertiesStep.java @@ -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; import com.arsdigita.bebop.Label; @@ -10,6 +29,7 @@ import com.arsdigita.cms.ui.authoring.SimpleEditStep; import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; /** + * Step for editing the basic properties of a {@link SciOrganization}. * * @author Jens Pelzetter */ @@ -60,13 +80,13 @@ public class SciOrganizationPropertiesStep if (!config.getOrganizationAddContactHide()) { addStep(new GenericOrganizationalUnitContactPropertiesStep(itemModel, parent), - "cms.contenttypes.ui.orgaunit.contact"); + "sciorganization.ui.organization.contacts"); } if (!config.getOrganizationAddPersonHide()) { - addStep(new GenericOrganizationalUnitPersonPropertiesStep(itemModel, - parent), - "cms.contenttypes.ui.orgaunit.persons"); + addStep(new SciOrganizationMemberStep(itemModel, + parent), + "sciorganization.ui.organization_members"); } if (!config.getOrganizationAddDepartmentHide()) { diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationPropertyForm.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationPropertyForm.java index 536485188..ca514d68a 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationPropertyForm.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationPropertyForm.java @@ -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; import com.arsdigita.bebop.FormData; @@ -14,6 +33,7 @@ import com.arsdigita.cms.ItemSelectionModel; import com.arsdigita.cms.contenttypes.SciOrganization; /** + * Form for editing the basic properties of a {@link SciOrganization}. * * @author Jens Pelzetter */ diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationResources.properties b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationResources.properties new file mode 100644 index 000000000..fbb376739 --- /dev/null +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationResources.properties @@ -0,0 +1,108 @@ +sciorganization.ui.project.subprojects.none=No subprojects found +sciorganization.ui.project.subproject=Subproject +sciorganization.ui.project.subproject.remove=Remove subproject +sciorganization.ui.project.subproject.up=Up +sciorganization.ui.project.subproject.down=Down +sciorganization.ui.project.subproject.confirm_remove=Are you sure to remove this department? +sciorganization.ui.project.select_subproject=Select project to add as subproject +sciorganization.ui.member.edit_basic_properties=Edit basic properties +sciorganization.ui.member.associatedMember=Associated member? +sciorganization.ui.member.formerMember=Former member? +sciorganization.ui.project.edit_desc=Edit description +sciorganization.ui.project.upload_desc=Upload description +sciorganization.ui.project.desc=Project description +sciorganization.ui.project.funding=Funding +sciorganization.ui.organization.add_department=Add department +sciorganization.ui.department.add_project=Add project +sciorganization.ui.organization.add_project=Add project +sciorganization.ui.department.edit_basic_properties=Edit basic properties +sciorganization.ui.department.basic_properties=Basic properties +sciorganization.ui.organization.edit_basic_sheet=Basic properties +sciorganization.ui.organization.basic_properties=Basic properties +sciorganization.ui.project.begin=Start of project +sciorganization.ui.project.end=End of project +sciorganization.ui.project.shortdesc=Short description +sciorganization.ui.project.edit_basic_sheet=Basic properties +sciorganization.ui.project.basic_properties=Basis properties +sciorganization.ui.department.add_subdepartment=Add subdepartment +sciorganization.ui.organization.departments.none=No departments found +sciorganization.ui.organization.department=Department +sciorganization.ui.organization.department.remove=Remove department +sciorganization.ui.organization.department.up=Up +sciorganization.ui.organization.department.down=Down +sciorganization.ui.organization.department.confirm_remove=Are you sure to remove this department? +sciorganization.ui.department.projects.none=No projects found +sciorganization.ui.department.project=Project +sciorganization.ui.department.project.remove=Remove project +sciorganization.ui.department.project.up=Up +sciorganization.ui.department.project.down=Down +sciorganization.ui.department.project.confirm_remove=Are you sure to remove this project? +sciorganization.ui.organization.select_department=Select department to add +sciorganization.ui.organization.projects.none=No projects found +sciorganization.ui.organization.project=Project +sciorganization.ui.organization.project.remove=Remove project +sciorganization.ui.organization.project.up=Up +sciorganization.ui.organization.project.down=Down +sciorganization.ui.organization.project.confirm_remove=Are you sure to remove this project? +sciorganization.ui.project.addSubProject=Add subproject +sciorganization.ui.department.select_project=Select project to add +sciorganization.ui.organization.select_project=Select project to add +sciorganization.ui.department.subdepartments.none=No subdepartments found +sciorganization.ui.department.subdepartment=Subdepartment +sciorganization.ui.department.subdepartment.remove=Remove subdepartment +sciorganization.ui.department.subdepartment.up=Up +sciorganization.ui.department.subdepartment.down=Down +sciorganization.ui.department.subdepartment.confirm_remove=Are you sure to remove this subdepartment? +sciorganizations.ui.department.shortdescription=Short description +sciorganizations.ui.organization.shortdescription=Short description +sciorganization.ui.department.select_subdepartment=Select subdepartment to add +sciorganization.ui.department.add_member=Add member +sciorganizations.ui.project.shortdesc=Short description +sciorganization.ui.project.addDepartment=Add involved department +sciorganization.ui.project.addOrga=Add involved organization +sciorganization.ui.project.departments.none=No involved departments found +sciorganization.ui.project.department=Involved department +sciorganization.ui.project.department.remove=Remove involved department +sciorganization.ui.project.department.up=Up +sciorganization.ui.project.department.down=Down +sciorganization.ui.project.organization.confirm_remove=Are you sure to remove this involved organization? +sciorganization.ui.project.select_organization=Select organization to add +sciorganization.ui.project.organization.none=No involved organizations found +sciorganization.ui.project.organization=Involved organization +sciorganization.ui.project.organization.remove=Remove involved organization +sciorganization.ui.project.organization.up=Up +sciorganization.ui.project.organization.down=Down +sciorganization.ui.project.select_department=Select department to add +sciorganization.ui.project.superproject_none=No superior project found +sciorganization.ui.project.superproject=Superior project +sciorganization.ui.project.superproject.remove=Remove superior project +sciorganization.ui.project.superproject.confirm_remove=Are you sure to remove this superior project? +sciorganization.ui.department.select_superdepartment=Superior department +sciorganization.ui.project.setSuperProject=Set superior project +sciorganization.ui.project.description.upload=Upload project description +sciorganization.ui.project.description.upload.mimetype=Type of file +sciorganization.ui.organization.edit_desc=Edit description +sciorganization.ui.organization.upload_desc=Upload description +sciorganization.ui.organization.desc=Description +sciorganization.ui.organization.description=Description +sciorganization.ui.organization.description.upload=Upload description +sciorganization.ui.organization.description.upload.mimetype=Type of file +sciorganization.ui.project.select_superproject=Select superior project +sciorganization.ui.department.setSuperDepartment=Set superior project +sciorganization.ui.department.superdepartment_none=No superior department found +sciorganization.ui.department.superdepartment=Superior department +sciorganization.ui.department.superdepartment.remove=Remove superior department +sciorganization.ui.department.superdepartment.confirm_remove=Are you sure to remove the superior department? +sciorganization.ui.department.setOrganization=Set organization +sciorganization.ui.department.select_organization=Select organization +sciorganization.ui.department.organization_none=No assigned organization found +sciorganization.ui.department.organization=Organization +sciorganization.ui.department.organization.remove=Remove assigned organization +sciorganization.ui.department.organization.confirm_remove=Are you sure sure to remove to assigned organization? +sciorganization.ui.department.edit_desc=Edit description +sciorganization.ui.department.upload_desc=Upload description +sciorganization.ui.department.desc=Description +sciorganization.ui.department.description=Description +sciorganization.ui.department.description.upload=Upload description +sciorganization.ui.department.description.upload.mimetype=Type of file +sciorganization.ui.orgnization.add_member=Add member diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationResources_de.properties b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationResources_de.properties new file mode 100644 index 000000000..f444fec20 --- /dev/null +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationResources_de.properties @@ -0,0 +1,108 @@ +sciorganization.ui.project.subprojects.none=Keine Unterprojekte gefunden +sciorganization.ui.project.subproject=Unterprojekt +sciorganization.ui.project.subproject.remove=Unterprojekt entfernen +sciorganization.ui.project.subproject.up=Hoch +sciorganization.ui.project.subproject.down=Runter +sciorganization.ui.project.subproject.confirm_remove=Wollen sie dieses Unterprojekt wirklich entfernen? +sciorganization.ui.project.select_subproject=Projekt zum Hinzuf\u00fcgen als Unterprojekt ausw\u00e4hlen +sciorganization.ui.member.edit_basic_properties=Basiseigenschaften bearbeiten +sciorganization.ui.member.associatedMember=Assoziertes Mitglied? +sciorganization.ui.member.formerMember=Ehemaliges Mitglied? +sciorganization.ui.project.edit_desc=Beschreibung bearbeiten +sciorganization.ui.project.upload_desc=Beschreibung hochladen +sciorganization.ui.project.desc=Projektbeschreibung +sciorganization.ui.project.funding=Finanzierung +sciorganization.ui.organization.add_department=Abteilung hinzuf\u00fcgen +sciorganization.ui.department.add_project=Projekt hinzuf\u00fcgen +sciorganization.ui.organization.add_project=Projekt hinzuf\u00fcgen +sciorganization.ui.department.edit_basic_properties=Basiseigenschaften bearbeiten +sciorganization.ui.department.basic_properties=Basiseigenschaften +sciorganization.ui.organization.edit_basic_sheet=Basiseigenschaften +sciorganization.ui.organization.basic_properties=Basiseigenschaften +sciorganization.ui.project.begin=Begin des Projektes +sciorganization.ui.project.end=Ende des Projektes +sciorganization.ui.project.shortdesc=Kurzbeschreibung +sciorganization.ui.project.edit_basic_sheet=Basiseigenschaften +sciorganization.ui.project.basic_properties=Basiseigenschaften +sciorganization.ui.department.add_subdepartment=Unterabteilung hinzuf\u00fcgen +sciorganization.ui.organization.departments.none=Keine Abteilungen gefunden +sciorganization.ui.organization.department=Abteilung +sciorganization.ui.organization.department.remove=Abteilung entfernen +sciorganization.ui.organization.department.up=Hoch +sciorganization.ui.organization.department.down=Runter +sciorganization.ui.organization.department.confirm_remove=Wollen sie diese Abteilung wirklich entfernen? +sciorganization.ui.department.projects.none=Keine Projekte gefunden +sciorganization.ui.department.project=Projekt +sciorganization.ui.department.project.remove=Projekt entfernen +sciorganization.ui.department.project.up=Hoch +sciorganization.ui.department.project.down=Runter +sciorganization.ui.department.project.confirm_remove=Wollen sie dieses Projekt wirklich entfernen? +sciorganization.ui.organization.select_department=Abteilung zum hinzuf\u00fcgen ausw\u00e4hlen +sciorganization.ui.organization.projects.none=Keine Projekte gefunden +sciorganization.ui.organization.project=Projekt +sciorganization.ui.organization.project.remove=Projekt entfernen +sciorganization.ui.organization.project.up=Hoch +sciorganization.ui.organization.project.down=Runter +sciorganization.ui.organization.project.confirm_remove=Wollen sie dieses Projekt wirklich entfernen? +sciorganization.ui.project.addSubProject=Unterprojekt hinzuf\u00fcgen +sciorganization.ui.department.select_project=Projekt zum hinzuf\u00fcgen ausw\u00e4hlen +sciorganization.ui.organization.select_project=Projekt zum hinzuf\u00fcgen ausw\u00e4hlen +sciorganization.ui.department.subdepartments.none=Keine Unterabteilungen gefunden +sciorganization.ui.department.subdepartment=Unterabteilung +sciorganization.ui.department.subdepartment.remove=Unterabteilung entfernen +sciorganization.ui.department.subdepartment.up=Hoch +sciorganization.ui.department.subdepartment.down=Runter +sciorganization.ui.department.subdepartment.confirm_remove=Wollen sie diese Unterabteilung wirklich entfernen +sciorganizations.ui.department.shortdescription=Kurzbeschreibung +sciorganizations.ui.organization.shortdescription=Kurzbeschreibung +sciorganization.ui.department.select_subdepartment=Unterabteilung zum hinzuf\u00fcgen ausw\u00e4hlen +sciorganization.ui.department.add_member=Mitglied ausw\u00e4hlen +sciorganizations.ui.project.shortdesc=Kurzbeschreibung +sciorganization.ui.project.addDepartment=Beteiligte Abteilung hinzuf\u00fcgen +sciorganization.ui.project.addOrga=Beteiligte Organization hinzuf\u00fcgen +sciorganization.ui.project.departments.none=Keine beteiligen Abteilungen gefunden +sciorganization.ui.project.department=Beteiligte Abteilung +sciorganization.ui.project.department.remove=Beteiligte Abteilung entfernen +sciorganization.ui.project.department.up=Hoch +sciorganization.ui.project.department.down=Runter +sciorganization.ui.project.organization.confirm_remove=Wollen diese beteiligte Organization wirklich entfernen? +sciorganization.ui.project.select_organization=Organisation zum hinzuf\u00fcgen ausw\u00e4hlen +sciorganization.ui.project.organization.none=Keine beteiligten Organisationen gefunden +sciorganization.ui.project.organization=Beteiligte Organisation +sciorganization.ui.project.organization.remove=Beteiligte Organisation entfernen +sciorganization.ui.project.organization.up=Hoch +sciorganization.ui.project.organization.down=Runter +sciorganization.ui.project.select_department=Abteilung zum hinzuf\u00fcgen ausw\u00e4hlen +sciorganization.ui.project.superproject_none=Kein \u00fcbergeordnetes Projekt gefunden +sciorganization.ui.project.superproject=\u00dcbergeordnetes Projekt +sciorganization.ui.project.superproject.remove=\u00dcbergeordnetes Projekt entfernen +sciorganization.ui.project.superproject.confirm_remove=Wollen sie dieses \u00fcbergeordnete projekt wirklich entfernen? +sciorganization.ui.department.select_superdepartment=\u00dcbergeordnete Abteilung +sciorganization.ui.project.setSuperProject=\u00dcbergeordnetes Projekt setzen +sciorganization.ui.project.description.upload=Projektbeschreibung hochladen +sciorganization.ui.project.description.upload.mimetype=Dateityp +sciorganization.ui.organization.edit_desc=Beschreibung bearbeiten +sciorganization.ui.organization.upload_desc=Beschreibung hochladen +sciorganization.ui.organization.desc=Beschreibung +sciorganization.ui.organization.description=Beschreibung +sciorganization.ui.organization.description.upload=Beschriebung hochladen +sciorganization.ui.organization.description.upload.mimetype=Dateityp +sciorganization.ui.project.select_superproject=\u00dcbergeordnetes Projekt ausw\u00e4hlen +sciorganization.ui.department.setSuperDepartment=\u00dcbergeordnetes Projekt setzen +sciorganization.ui.department.superdepartment_none=Keine \u00fcbergeordnete Abteilung gefunden +sciorganization.ui.department.superdepartment=\u00dcbergeordnete Abteilung +sciorganization.ui.department.superdepartment.remove=\u00dcbergeordnete Abteilung entfernen +sciorganization.ui.department.superdepartment.confirm_remove=Wollen sie die \u00fcbergeordnete Abteilung wirklich entfernen? +sciorganization.ui.department.setOrganization=Organization setzen +sciorganization.ui.department.select_organization=Organization ausw\u00e4hlen +sciorganization.ui.department.organization_none=Keine zugeordnete Organization gefunden +sciorganization.ui.department.organization=Organisation +sciorganization.ui.department.organization.remove=Zugeordnete Organisation entfernen +sciorganization.ui.department.organization.confirm_remove=Wollen sie zugeordnete Organisation wirklich entfernen? +sciorganization.ui.department.edit_desc=Beschreibung bearbeiten +sciorganization.ui.department.upload_desc=Beschreibung hochladen +sciorganization.ui.department.desc=Beschreibung +sciorganization.ui.department.description=Beschreibung +sciorganization.ui.department.description.upload=Beschreibung hochladen +sciorganization.ui.department.description.upload.mimetype=Dateityp +sciorganization.ui.orgnization.add_member=Mitglied hinzuf\u00fcgen diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectDepartmentAddForm.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectDepartmentAddForm.java index cfe0db9af..8eba6fecf 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectDepartmentAddForm.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectDepartmentAddForm.java @@ -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; import com.arsdigita.bebop.FormData; @@ -15,6 +34,8 @@ import com.arsdigita.cms.ui.ItemSearchWidget; import com.arsdigita.cms.ui.authoring.BasicItemForm; /** + * Form for adding a link between a {@link SciProject} and a + * {@link SciDepartment}. * * @author Jens Pelzetter */ diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectDepartmentsStep.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectDepartmentsStep.java index 9c311e75c..9664fb0bd 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectDepartmentsStep.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectDepartmentsStep.java @@ -1,12 +1,35 @@ +/* + * 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; import com.arsdigita.cms.ItemSelectionModel; +import com.arsdigita.cms.contenttypes.SciDepartment; +import com.arsdigita.cms.contenttypes.SciProject; 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; /** + * Step for adding and removing links between a {@link SciProject} and a + * {@link SciDepartment}. * * @author Jens Pelzetter */ diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectDepartmentsTable.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectDepartmentsTable.java index 2ddba4aca..8fbcac81b 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectDepartmentsTable.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectDepartmentsTable.java @@ -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; import com.arsdigita.bebop.Component; @@ -22,6 +41,8 @@ import com.arsdigita.util.LockableImpl; import java.math.BigDecimal; /** + * Table for showing the links between a {@link SciProject} and a + * {@link SciDepartment}. * * @author Jens Pelzetter */ diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectDescriptionEditForm.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectDescriptionEditForm.java index ee6973a37..660a562ba 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectDescriptionEditForm.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectDescriptionEditForm.java @@ -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; import com.arsdigita.bebop.FormData; @@ -16,6 +35,7 @@ import com.arsdigita.cms.ui.CMSDHTMLEditor; import com.arsdigita.cms.ui.authoring.BasicItemForm; /** + * Form for editing the description of a {@link SciProject}. * * @author Jens Pelzetter */ @@ -31,7 +51,7 @@ public class SciProjectDescriptionEditForm @Override protected void addWidgets() { add(new Label(SciOrganizationGlobalizationUtil.globalize( - "sciorganizazion.ui.project.description"))); + "sciorganization.ui.project.description"))); ParameterModel descParam = new StringParameter( SciProject.PROJECT_DESCRIPTION); TextArea desc; @@ -47,7 +67,7 @@ public class SciProjectDescriptionEditForm if (!SciProject.getConfig().getProjectFundingHide()) { add(new Label(SciOrganizationGlobalizationUtil.globalize( - "sciorganizazion.ui.project.funding"))); + "sciorganization.ui.project.funding"))); ParameterModel fundingParam = new StringParameter( SciProject.FUNDING); TextArea funding; diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectDescriptionStep.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectDescriptionStep.java index 2a805f9ed..050c1e5f3 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectDescriptionStep.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectDescriptionStep.java @@ -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; import com.arsdigita.bebop.Component; @@ -10,6 +29,7 @@ import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; import com.arsdigita.toolbox.ui.DomainObjectPropertySheet; /** + * Step for editing the description of a {@link SciProject}. * * @author Jens Pelzetter */ diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectDescriptionUploadForm.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectDescriptionUploadForm.java index 9b9300d58..90b146878 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectDescriptionUploadForm.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectDescriptionUploadForm.java @@ -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; import com.arsdigita.bebop.PageState; @@ -6,6 +25,7 @@ import com.arsdigita.cms.contenttypes.SciProject; import com.arsdigita.globalization.GlobalizedMessage; /** + * Form for uploading the description of a {@link SciProject}. * * @author Jens Pelzetter */ diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectMemberAddForm.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectMemberAddForm.java new file mode 100644 index 000000000..a242cf01f --- /dev/null +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectMemberAddForm.java @@ -0,0 +1,43 @@ +/* + * 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; + +import com.arsdigita.cms.contenttypes.SciMember; +import com.arsdigita.cms.ItemSelectionModel; +import com.arsdigita.cms.contenttypes.SciProject; + +/** + * Form for adding a link between a {@link SciProject} and a {@link SciMember}. + * + * @author Jens Pelzetter + */ +public class SciProjectMemberAddForm + extends GenericOrganizationalUnitPersonAddForm { + + public SciProjectMemberAddForm( + ItemSelectionModel itemModel) { + super(itemModel); + } + + @Override + protected String getPersonType() { + return SciMember.class.getName(); + } +} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectMemberStep.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectMemberStep.java new file mode 100644 index 000000000..0c91187b0 --- /dev/null +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectMemberStep.java @@ -0,0 +1,60 @@ +/* + * 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; + +import com.arsdigita.cms.ItemSelectionModel; +import com.arsdigita.cms.contenttypes.SciProject; +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; + +/** + * Step for adding and removing member to and from a {@link SciProject}. + * + * @author Jens Pelzetter + */ +public class SciProjectMemberStep extends SimpleEditStep { + + private static final String ADD_MEMBER_SHEET_NAME = "addMember"; + + public SciProjectMemberStep(ItemSelectionModel itemModel, + AuthoringKitWizard parent) { + this(itemModel, parent, null); + } + + public SciProjectMemberStep(ItemSelectionModel itemModel, + AuthoringKitWizard parent, + String prefix) { + super(itemModel, parent, prefix); + + BasicItemForm addMemberSheet = + new SciProjectMemberAddForm(itemModel); + add(ADD_MEMBER_SHEET_NAME, + (String) SciOrganizationGlobalizationUtil.globalize( + "sciorganization.ui.department.add_member").localize(), + new WorkflowLockedComponentAccess(addMemberSheet, itemModel), + addMemberSheet.getSaveCancelSection().getCancelButton()); + + GenericOrganizationalUnitPersonsTable memberTable = new GenericOrganizationalUnitPersonsTable( + itemModel); + setDisplayComponent(memberTable); + } +} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectOrganizationsAddForm.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectOrganizationsAddForm.java index ac8bdedb9..a28267ba8 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectOrganizationsAddForm.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectOrganizationsAddForm.java @@ -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; import com.arsdigita.bebop.FormData; @@ -15,6 +34,8 @@ import com.arsdigita.cms.ui.ItemSearchWidget; import com.arsdigita.cms.ui.authoring.BasicItemForm; /** + * Form for adding a link between a {@link SciProject} and a + * {@link SciOrganization}. * * @author Jens Pelzetter */ diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectOrganizationsStep.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectOrganizationsStep.java index ac9c776e7..1d5279984 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectOrganizationsStep.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectOrganizationsStep.java @@ -1,12 +1,35 @@ +/* + * 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; import com.arsdigita.cms.ItemSelectionModel; +import com.arsdigita.cms.contenttypes.SciOrganization; +import com.arsdigita.cms.contenttypes.SciProject; 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; /** + * Step for adding and removing links between a {@link SciProject} and + * {@link SciOrganization}s. * * @author Jens Pelzetter */ diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectOrganizationsTable.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectOrganizationsTable.java index b4315d0ed..1fe0f2028 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectOrganizationsTable.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectOrganizationsTable.java @@ -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; import java.math.BigDecimal; @@ -24,6 +43,8 @@ import com.arsdigita.cms.dispatcher.Utilities; import com.arsdigita.util.LockableImpl; /** + * Table for showing the links between a {@link SciProject} and + * {@link SciOrganization}s. * * @author Jens Pelzetter */ diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectPropertiesStep.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectPropertiesStep.java index d6b7090a8..db8e76f2c 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectPropertiesStep.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectPropertiesStep.java @@ -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; import com.arsdigita.bebop.Component; @@ -12,6 +31,7 @@ import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; import com.arsdigita.toolbox.ui.DomainObjectPropertySheet; /** + * Step for editing the basic properties of a {@link SciProject}. * * @author Jens Pelzetter */ @@ -79,17 +99,15 @@ public class SciProjectPropertiesStep if (!config.getProjectAddContactHide()) { addStep(new GenericOrganizationalUnitContactPropertiesStep(itemModel, parent), - "cms.contenttypes.ui.orgaunit.contact"); + "sciorganization.ui.project.contacts"); } if (!config.getProjectAddPersonHide()) { - addStep(new GenericOrganizationalUnitPersonPropertiesStep(itemModel, - parent), - "cms.contenttypes.ui.orgaunit.persons"); + addStep(new SciProjectMemberStep(itemModel, + parent), + "sciorganization.ui.project.members"); } - //super.addSteps(itemModel, parent); - if (!config.getProjectSetSuperProjectHide()) { addStep(new SciProjectSuperProjectStep(itemModel, parent), diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectPropertyForm.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectPropertyForm.java index ff32ee811..4751d8f36 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectPropertyForm.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectPropertyForm.java @@ -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; import com.arsdigita.bebop.FormData; @@ -18,6 +37,7 @@ import java.util.Calendar; import java.util.GregorianCalendar; /** + * Form for editing the basic properties of a {@link SciProject}. * * @author Jens Pelzetter */ @@ -59,7 +79,7 @@ public class SciProjectPropertyForm add(end); add(new Label(SciOrganizationGlobalizationUtil.globalize( - "sciorganizations.ui.projectshortdesc"))); + "sciorganizations.ui.project.shortdesc"))); ParameterModel shortDescParam = new StringParameter( SciProject.PROJECT_SHORT_DESCRIPTION); TextArea shortDesc = new TextArea(shortDescParam); diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectSubProjectsTable.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectSubProjectsTable.java index 6892f6894..22b2fab54 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectSubProjectsTable.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectSubProjectsTable.java @@ -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; import java.math.BigDecimal; @@ -22,6 +41,7 @@ import com.arsdigita.cms.dispatcher.Utilities; import com.arsdigita.util.LockableImpl; /** + * Table of showing the subprojects of a {@link SciProject}. * * @author Jens Pelzetter */ diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectSubprojectAddForm.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectSubprojectAddForm.java index 5c251aee2..b10a97d81 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectSubprojectAddForm.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectSubprojectAddForm.java @@ -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; import com.arsdigita.bebop.FormData; @@ -14,6 +33,7 @@ import com.arsdigita.cms.ui.ItemSearchWidget; import com.arsdigita.cms.ui.authoring.BasicItemForm; /** + * Form for adding a subproject to a {@link SciProject}. * * @author Jens Pelzetter */ diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectSubprojectsStep.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectSubprojectsStep.java index a2da17bc7..f4fa3f78e 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectSubprojectsStep.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectSubprojectsStep.java @@ -1,6 +1,26 @@ +/* + * 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; import com.arsdigita.cms.ItemSelectionModel; +import com.arsdigita.cms.contenttypes.SciProject; import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; import com.arsdigita.cms.ui.authoring.BasicItemForm; import com.arsdigita.cms.ui.authoring.SimpleEditStep; @@ -8,6 +28,7 @@ import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; import org.apache.log4j.Logger; /** + * Step for adding and removing subprojects to and from a {@link SciProject}. * * @author Jens Pelzetter */ diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectSuperProjectSetForm.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectSuperProjectSetForm.java index e862f2945..c66c30dd8 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectSuperProjectSetForm.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectSuperProjectSetForm.java @@ -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; import com.arsdigita.bebop.FormData; @@ -14,6 +33,7 @@ import com.arsdigita.cms.ui.ItemSearchWidget; import com.arsdigita.cms.ui.authoring.BasicItemForm; /** + * Form for setting the superior project of a {@link SciProject}. * * @author Jens Pelzetter */ diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectSuperProjectSheet.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectSuperProjectSheet.java index 59d7d9a3c..7c3275b5a 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectSuperProjectSheet.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectSuperProjectSheet.java @@ -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; import com.arsdigita.bebop.Component; @@ -20,6 +39,7 @@ import com.arsdigita.cms.dispatcher.Utilities; import com.arsdigita.util.LockableImpl; /** + * Sheet for showing the superior project of a {@link SciProject}. * * @author Jens Pelzetter */ diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectSuperProjectStep.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectSuperProjectStep.java index 2b17e74be..cd01e4d5f 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectSuperProjectStep.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectSuperProjectStep.java @@ -1,12 +1,33 @@ +/* + * 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; import com.arsdigita.cms.ItemSelectionModel; +import com.arsdigita.cms.contenttypes.SciProject; 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; /** + * Step for setting the superior project of a {@link SciProject}. * * @author Jens Pelzetter */ diff --git a/ccm-sci-types-organization/web/static/content-types/com/arsdigita/cms/contenttypes/SciMember.xsl b/ccm-sci-types-organization/web/static/content-types/com/arsdigita/cms/contenttypes/SciMember.xsl new file mode 100644 index 000000000..80359c344 --- /dev/null +++ b/ccm-sci-types-organization/web/static/content-types/com/arsdigita/cms/contenttypes/SciMember.xsl @@ -0,0 +1,20 @@ + +]> + + + + +

+
+ + +

+
+ +
\ No newline at end of file