Weiterführung der Korrektur für die Sprachvarianten (s. auch r 973)
git-svn-id: https://svn.libreccm.org/ccm/trunk@977 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
ea39e12ae9
commit
fe237419bf
|
|
@ -134,3 +134,14 @@ cms.contenttypes.ui.genericorgaunit.contact.up=Up
|
|||
cms.contenttypes.ui.genericorgaunit.contact.down=Down
|
||||
cms.contenttypes.ui.genericorgaunit.contact.edit=Edit association
|
||||
cms.contenttypes.ui.genericorganunit.persons.edit=Edit association
|
||||
cms.contenttypes.ui.contact.select_address.no_suitable_language_variant=The selected address item is not available in the language of the current contact.
|
||||
cms.contenttypes.ui.contact.select_person.no_suitable_language_variant=The selected person item is not available in the langauge of the current contact.
|
||||
cms.contenttypes.ui.genericorgaunit.select_contact.no_suitable_language_variant=The selected contact item is not available in the language of the current item.
|
||||
cms.contenttypes.ui.genericorgaunit.select_contact.already_added=The selected contact item has already been added to the current item.
|
||||
cms.contenttypes.ui.genericorgaunit.select_contact.no_contact_selected=No contact selected.
|
||||
cms.contenttypes.ui.genericorgaunit.person.no_person_selected=No person selected
|
||||
cms.contenttypes.ui.genericorgaunit.person.no_suitable_language_variant=The selected person item is not availabe in the language of the current item.
|
||||
cms.contenttypes.ui.genericorgaunit.person.already_added=The selected person has already been added to the current item.
|
||||
cms.contenttypes.ui.person.select_contact.no_contact_selected=No contact selected.
|
||||
cms.contenttypes.ui.person.select_contact.no_suitable_language_variant=The selected contact item is not avilable in the language of the current item.
|
||||
cms.contenttypes.ui.person.select_contact.already_added=The selected contact has already been added to current item.
|
||||
|
|
|
|||
|
|
@ -145,3 +145,14 @@ cms.contenttypes.ui.genericorgaunit.contact.up=Hoch
|
|||
cms.contenttypes.ui.genericorgaunit.contact.down=Runter
|
||||
cms.contenttypes.ui.genericorgaunit.contact.edit=Verkn\u00fcpfung bearbeiten
|
||||
cms.contenttypes.ui.genericorganunit.persons.edit=Verkn\u00fcpfung bearbeiten
|
||||
cms.contenttypes.ui.contact.select_address.no_suitable_language_variant=Das ausgew\u00e4hlte Address-Item ist nicht in der Sprache des aktuellen Kontaktes verf\u00fcgbar.
|
||||
cms.contenttypes.ui.contact.select_person.no_suitable_language_variant=Das ausgew\u00e4hlte Personen-Item ist nicht in der Sprache des aktuellen Kontaktes verf\u00fcgbar.
|
||||
cms.contenttypes.ui.genericorgaunit.select_contact.no_suitable_language_variant=Das ausgew\u00e4hlte Kontakt-Item ist nicht in der Sprache der des aktuellen Items verf\u00fcgbar.
|
||||
cms.contenttypes.ui.genericorgaunit.select_contact.already_added=Das ausgew\u00e4hlte Kontakt-Item wurde dem aktuellen Item bereits hinzugef\u00fcgt.
|
||||
cms.contenttypes.ui.genericorgaunit.select_contact.no_contact_selected=Kein Kontakt ausgew\u00e4hlt.
|
||||
cms.contenttypes.ui.genericorgaunit.person.no_person_selected=Keine Person ausgew\u00e4hlt.
|
||||
cms.contenttypes.ui.genericorgaunit.person.no_suitable_language_variant=Das ausgew\u00e4hlte Personen-Item ist nicht in der Sprache des aktuellen Items verf\u00fcgbar.
|
||||
cms.contenttypes.ui.genericorgaunit.person.already_added=Das ausgew\u00e4hlte Personen-Item wurde dem aktuellen Item bereits hinzugef\u00fcgt.
|
||||
cms.contenttypes.ui.person.select_contact.no_contact_selected=Kein Kontakt ausgew\u00e4hlt.
|
||||
cms.contenttypes.ui.person.select_contact.no_suitable_language_variant=Das ausgew\u00e4hlte Kontakt-Item ist nicht in der Sprache des aktuellen Items verf\u00fcgbar.
|
||||
cms.contenttypes.ui.person.select_contact.already_added=Das ausgew\u00e4hlte Kontakt-Item wurde dem aktuellen Item bereits hinzugef\u00fcgt.
|
||||
|
|
|
|||
|
|
@ -1,12 +1,3 @@
|
|||
/*
|
||||
* ContactEditAddressPropertyForm.java
|
||||
*
|
||||
* Created on 8. Juli 2009, 10:27
|
||||
*
|
||||
* To change this template, choose Tools | Template Manager
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
package com.arsdigita.cms.contenttypes.ui;
|
||||
|
||||
import com.arsdigita.bebop.FormData;
|
||||
|
|
@ -36,15 +27,16 @@ import org.apache.log4j.Logger;
|
|||
*
|
||||
* @author quasi
|
||||
*/
|
||||
public class GenericContactAttachAddressPropertyForm extends BasicPageForm implements FormProcessListener, FormInitListener, FormSubmissionListener {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(GenericContactPropertyForm.class);
|
||||
public class GenericContactAttachAddressPropertyForm extends BasicPageForm
|
||||
implements FormProcessListener, FormInitListener, FormSubmissionListener {
|
||||
|
||||
private static final Logger logger =
|
||||
Logger.getLogger(
|
||||
GenericContactPropertyForm.class);
|
||||
private GenericContactAddressPropertiesStep m_step;
|
||||
private ItemSearchWidget m_itemSearch;
|
||||
private SaveCancelSection m_saveCancelSection;
|
||||
private final String ITEM_SEARCH = "contactAddress";
|
||||
|
||||
/**
|
||||
* ID of the form
|
||||
*/
|
||||
|
|
@ -55,7 +47,7 @@ public class GenericContactAttachAddressPropertyForm extends BasicPageForm imple
|
|||
*
|
||||
* @param itemModel
|
||||
*/
|
||||
public GenericContactAttachAddressPropertyForm(ItemSelectionModel itemModel) {
|
||||
public GenericContactAttachAddressPropertyForm(ItemSelectionModel itemModel) {
|
||||
this(itemModel, null);
|
||||
}
|
||||
|
||||
|
|
@ -65,7 +57,8 @@ public class GenericContactAttachAddressPropertyForm extends BasicPageForm imple
|
|||
* @param itemModel
|
||||
* @param step
|
||||
*/
|
||||
public GenericContactAttachAddressPropertyForm(ItemSelectionModel itemModel, GenericContactAddressPropertiesStep step) {
|
||||
public GenericContactAttachAddressPropertyForm(ItemSelectionModel itemModel,
|
||||
GenericContactAddressPropertiesStep step) {
|
||||
super(ID, itemModel);
|
||||
addSubmissionListener(this);
|
||||
|
||||
|
|
@ -78,16 +71,20 @@ public class GenericContactAttachAddressPropertyForm extends BasicPageForm imple
|
|||
|
||||
@Override
|
||||
public void addWidgets() {
|
||||
add(new Label((String)ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.select_address").localize()));
|
||||
this.m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.findByAssociatedObjectType("com.arsdigita.cms.contenttypes.GenericAddress"));
|
||||
add(new Label((String) ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.contact.select_address").localize()));
|
||||
this.m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.
|
||||
findByAssociatedObjectType(
|
||||
"com.arsdigita.cms.contenttypes.GenericAddress"));
|
||||
add(this.m_itemSearch);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(FormSectionEvent fse) {
|
||||
FormData data = fse.getFormData();
|
||||
FormData data = fse.getFormData();
|
||||
PageState state = fse.getPageState();
|
||||
GenericContact contact = (GenericContact)getItemSelectionModel().getSelectedObject(state);
|
||||
GenericContact contact = (GenericContact) getItemSelectionModel().
|
||||
getSelectedObject(state);
|
||||
|
||||
setVisible(state, true);
|
||||
|
||||
|
|
@ -98,17 +95,23 @@ public class GenericContactAttachAddressPropertyForm extends BasicPageForm imple
|
|||
|
||||
@Override
|
||||
public void process(FormSectionEvent fse) {
|
||||
FormData data = fse.getFormData();
|
||||
FormData data = fse.getFormData();
|
||||
PageState state = fse.getPageState();
|
||||
GenericContact contact = (GenericContact)getItemSelectionModel().getSelectedObject(state);
|
||||
GenericContact contact = (GenericContact) getItemSelectionModel().
|
||||
getSelectedObject(state);
|
||||
|
||||
if (!this.getSaveCancelSection().getCancelButton().isSelected(state)) {
|
||||
contact.setAddress((GenericAddress)data.get(ITEM_SEARCH));
|
||||
GenericAddress address = (GenericAddress) data.get(ITEM_SEARCH);
|
||||
|
||||
address = (GenericAddress) address.getContentBundle().getInstance(
|
||||
contact.getLanguage());
|
||||
|
||||
contact.setAddress(address);
|
||||
}
|
||||
|
||||
init(fse);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Creates the section with the save and the cancel button.
|
||||
*/
|
||||
|
|
@ -119,13 +122,21 @@ public class GenericContactAttachAddressPropertyForm extends BasicPageForm imple
|
|||
|
||||
@Override
|
||||
public void prepare(PrintEvent e) {
|
||||
GenericContact contact = (GenericContact)getItemSelectionModel().getSelectedObject(e.getPageState());
|
||||
GenericContact contact =
|
||||
(GenericContact) getItemSelectionModel().
|
||||
getSelectedObject(e.getPageState());
|
||||
Submit target = (Submit) e.getTarget();
|
||||
|
||||
if (contact.getAddress() != null) {
|
||||
target.setButtonLabel((String)ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.select_address.change").localize());
|
||||
target.setButtonLabel((String) ContenttypesGlobalizationUtil.
|
||||
globalize(
|
||||
"cms.contenttypes.ui.contact.select_address.change").
|
||||
localize());
|
||||
} else {
|
||||
target.setButtonLabel((String)ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.select_address.add").localize());
|
||||
target.setButtonLabel((String) ContenttypesGlobalizationUtil.
|
||||
globalize(
|
||||
"cms.contenttypes.ui.contact.select_address.add").
|
||||
localize());
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
@ -136,16 +147,35 @@ public class GenericContactAttachAddressPropertyForm extends BasicPageForm imple
|
|||
|
||||
@Override
|
||||
public void validate(FormSectionEvent e) throws FormProcessException {
|
||||
if (e.getFormData().get(ITEM_SEARCH) == null) {
|
||||
throw new FormProcessException((String)ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.select_address.wrong_type").localize());
|
||||
final PageState state = e.getPageState();
|
||||
final FormData data = e.getFormData();
|
||||
|
||||
if (data.get(ITEM_SEARCH) == null) {
|
||||
throw new FormProcessException((String) ContenttypesGlobalizationUtil.
|
||||
globalize(
|
||||
"cms.contenttypes.ui.contact.select_address.wrong_type").
|
||||
localize());
|
||||
}
|
||||
|
||||
GenericContact contact = (GenericContact) getItemSelectionModel().
|
||||
getSelectedObject(state);
|
||||
|
||||
GenericAddress address = (GenericAddress) data.get(ITEM_SEARCH);
|
||||
|
||||
if (!(address.getContentBundle().hasInstance(contact.getLanguage()))) {
|
||||
data.addError( ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.contact.select_address.no_suitable_language_variant"));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void submitted(FormSectionEvent e) throws FormProcessException {
|
||||
if (getSaveCancelSection().getCancelButton().isSelected(e.getPageState())) {
|
||||
init(e);
|
||||
throw new FormProcessException((String)ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.select_address.cancelled").localize());
|
||||
throw new FormProcessException((String) ContenttypesGlobalizationUtil.
|
||||
globalize(
|
||||
"cms.contenttypes.ui.contact.select_address.cancelled").
|
||||
localize());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,11 +1,3 @@
|
|||
/*
|
||||
* ContactEditPersonPropertyForm.java
|
||||
*
|
||||
* Created on 8. Juli 2009, 10:27
|
||||
*
|
||||
* To change this template, choose Tools | Template Manager
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package com.arsdigita.cms.contenttypes.ui;
|
||||
|
||||
import com.arsdigita.bebop.FormData;
|
||||
|
|
@ -44,14 +36,18 @@ import org.apache.log4j.Logger;
|
|||
*
|
||||
* @author quasi
|
||||
*/
|
||||
public class GenericContactAttachPersonPropertyForm extends BasicPageForm implements FormProcessListener, FormInitListener, FormSubmissionListener {
|
||||
public class GenericContactAttachPersonPropertyForm extends BasicPageForm
|
||||
implements FormProcessListener, FormInitListener, FormSubmissionListener {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(GenericContactPropertyForm.class);
|
||||
private static final Logger logger =
|
||||
Logger.getLogger(
|
||||
GenericContactPropertyForm.class);
|
||||
private GenericContactPersonPropertiesStep m_step;
|
||||
private ItemSearchWidget m_itemSearch;
|
||||
private SaveCancelSection m_saveCancelSection;
|
||||
private final String ITEM_SEARCH = "contactPerson";
|
||||
private final String CONTACTS_KEY = GenericPersonContactCollection.CONTACTS_KEY;
|
||||
private final String CONTACTS_KEY =
|
||||
GenericPersonContactCollection.CONTACTS_KEY;
|
||||
/**
|
||||
* ID of the form
|
||||
*/
|
||||
|
|
@ -72,7 +68,8 @@ public class GenericContactAttachPersonPropertyForm extends BasicPageForm implem
|
|||
* @param itemModel
|
||||
* @param step
|
||||
*/
|
||||
public GenericContactAttachPersonPropertyForm(ItemSelectionModel itemModel, GenericContactPersonPropertiesStep step) {
|
||||
public GenericContactAttachPersonPropertyForm(ItemSelectionModel itemModel,
|
||||
GenericContactPersonPropertiesStep step) {
|
||||
super(ID, itemModel);
|
||||
addSubmissionListener(this);
|
||||
|
||||
|
|
@ -85,20 +82,28 @@ public class GenericContactAttachPersonPropertyForm extends BasicPageForm implem
|
|||
|
||||
@Override
|
||||
public void addWidgets() {
|
||||
add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.select_person").localize()));
|
||||
this.m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.findByAssociatedObjectType("com.arsdigita.cms.contenttypes.GenericPerson"));
|
||||
add(new Label((String) ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.contact.select_person").localize()));
|
||||
this.m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.
|
||||
findByAssociatedObjectType(
|
||||
"com.arsdigita.cms.contenttypes.GenericPerson"));
|
||||
add(this.m_itemSearch);
|
||||
|
||||
// GenericContact type field
|
||||
add(new Label(ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.contact.type")));
|
||||
add(new Label(ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.person.contact.type")));
|
||||
ParameterModel contactTypeParam = new StringParameter(CONTACTS_KEY);
|
||||
SingleSelect contactType = new SingleSelect(contactTypeParam);
|
||||
contactType.addValidationListener(new NotNullValidationListener());
|
||||
contactType.addOption(new Option("", new Label((String) ContenttypesGlobalizationUtil.globalize("cms.ui.select_one").localize())));
|
||||
contactType.addOption(new Option("",
|
||||
new Label((String) ContenttypesGlobalizationUtil.
|
||||
globalize("cms.ui.select_one").localize())));
|
||||
|
||||
// Add the Options to the SingleSelect widget
|
||||
GenericContactTypeCollection contacttypes = new GenericContactTypeCollection();
|
||||
contacttypes.addLanguageFilter(DispatcherHelper.getNegotiatedLocale().getLanguage());
|
||||
GenericContactTypeCollection contacttypes =
|
||||
new GenericContactTypeCollection();
|
||||
contacttypes.addLanguageFilter(DispatcherHelper.getNegotiatedLocale().
|
||||
getLanguage());
|
||||
|
||||
while (contacttypes.next()) {
|
||||
RelationAttribute ct = contacttypes.getRelationAttribute();
|
||||
|
|
@ -111,7 +116,8 @@ public class GenericContactAttachPersonPropertyForm extends BasicPageForm implem
|
|||
public void init(FormSectionEvent fse) {
|
||||
FormData data = fse.getFormData();
|
||||
PageState state = fse.getPageState();
|
||||
GenericContact contact = (GenericContact) getItemSelectionModel().getSelectedObject(state);
|
||||
GenericContact contact = (GenericContact) getItemSelectionModel().
|
||||
getSelectedObject(state);
|
||||
|
||||
setVisible(state, true);
|
||||
|
||||
|
|
@ -124,10 +130,16 @@ public class GenericContactAttachPersonPropertyForm extends BasicPageForm implem
|
|||
public void process(FormSectionEvent fse) {
|
||||
FormData data = fse.getFormData();
|
||||
PageState state = fse.getPageState();
|
||||
GenericContact contact = (GenericContact) getItemSelectionModel().getSelectedObject(state);
|
||||
GenericContact contact = (GenericContact) getItemSelectionModel().
|
||||
getSelectedObject(state);
|
||||
|
||||
if (!this.getSaveCancelSection().getCancelButton().isSelected(state)) {
|
||||
contact.setPerson((GenericPerson) data.get(ITEM_SEARCH), (String) data.get(CONTACTS_KEY));
|
||||
GenericPerson person = (GenericPerson) data.get(ITEM_SEARCH);
|
||||
|
||||
person = (GenericPerson) person.getContentBundle().getInstance(contact.
|
||||
getLanguage());
|
||||
|
||||
contact.setPerson(person, (String) data.get(CONTACTS_KEY));
|
||||
}
|
||||
init(fse);
|
||||
}
|
||||
|
|
@ -141,13 +153,21 @@ public class GenericContactAttachPersonPropertyForm extends BasicPageForm implem
|
|||
getSaveCancelSection().getSaveButton().addPrintListener(new PrintListener() {
|
||||
|
||||
public void prepare(PrintEvent e) {
|
||||
GenericContact contact = (GenericContact) getItemSelectionModel().getSelectedObject(e.getPageState());
|
||||
GenericContact contact =
|
||||
(GenericContact) getItemSelectionModel().
|
||||
getSelectedObject(e.getPageState());
|
||||
Submit target = (Submit) e.getTarget();
|
||||
|
||||
if (contact.getPerson() != null) {
|
||||
target.setButtonLabel((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.select_person.change").localize());
|
||||
target.setButtonLabel((String) ContenttypesGlobalizationUtil.
|
||||
globalize(
|
||||
"cms.contenttypes.ui.contact.select_person.change").
|
||||
localize());
|
||||
} else {
|
||||
target.setButtonLabel((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.select_person.add").localize());
|
||||
target.setButtonLabel((String) ContenttypesGlobalizationUtil.
|
||||
globalize(
|
||||
"cms.contenttypes.ui.contact.select_person.add").
|
||||
localize());
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
@ -158,15 +178,33 @@ public class GenericContactAttachPersonPropertyForm extends BasicPageForm implem
|
|||
|
||||
@Override
|
||||
public void validate(FormSectionEvent e) throws FormProcessException {
|
||||
if (e.getFormData().get(ITEM_SEARCH) == null) {
|
||||
throw new FormProcessException((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.select_person.wrong_type").localize());
|
||||
final PageState state = e.getPageState();
|
||||
final FormData data = e.getFormData();
|
||||
|
||||
if (data.get(ITEM_SEARCH) == null) {
|
||||
throw new FormProcessException((String) ContenttypesGlobalizationUtil.
|
||||
globalize(
|
||||
"cms.contenttypes.ui.contact.select_person.wrong_type").
|
||||
localize());
|
||||
}
|
||||
|
||||
GenericContact contact = (GenericContact) getItemSelectionModel().
|
||||
getSelectedObject(state);
|
||||
GenericPerson person = (GenericPerson) data.get(ITEM_SEARCH);
|
||||
|
||||
if (!(person.getContentBundle().hasInstance(contact.getLanguage()))) {
|
||||
data.addError("cms.contenttypes.ui.contact.select_person.no_suitable_language_variant");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void submitted(FormSectionEvent e) throws FormProcessException {
|
||||
if (getSaveCancelSection().getCancelButton().isSelected(e.getPageState())) {
|
||||
init(e);
|
||||
throw new FormProcessException((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.contact.select_person.cancelled").localize());
|
||||
throw new FormProcessException((String) ContenttypesGlobalizationUtil.
|
||||
globalize(
|
||||
"cms.contenttypes.ui.contact.select_person.cancelled").
|
||||
localize());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -88,7 +88,8 @@ public class GenericOrganizationalUnitContactAddForm
|
|||
GenericOrganizationalUnit.CONTACT_TYPE);
|
||||
SingleSelect contactType = new SingleSelect(contactTypeParam);
|
||||
contactType.addValidationListener(new NotNullValidationListener());
|
||||
contactType.addOption(new Option("", new Label((String) ContenttypesGlobalizationUtil.
|
||||
contactType.addOption(new Option("",
|
||||
new Label((String) ContenttypesGlobalizationUtil.
|
||||
globalize("cms.ui.select_one").localize())));
|
||||
|
||||
GenericContactTypeCollection contacttypes =
|
||||
|
|
@ -131,17 +132,21 @@ public class GenericOrganizationalUnitContactAddForm
|
|||
public void process(FormSectionEvent fse) throws FormProcessException {
|
||||
FormData data = fse.getFormData();
|
||||
PageState state = fse.getPageState();
|
||||
GenericOrganizationalUnit orgaunit = (GenericOrganizationalUnit) getItemSelectionModel().
|
||||
GenericOrganizationalUnit orgaunit =
|
||||
(GenericOrganizationalUnit) getItemSelectionModel().
|
||||
getSelectedObject(state);
|
||||
|
||||
|
||||
|
||||
if (this.getSaveCancelSection().getSaveButton().isSelected(state)) {
|
||||
GenericContact selectedContact;
|
||||
selectedContact = editStep.getSelectedContact();
|
||||
|
||||
if (selectedContact == null) {
|
||||
orgaunit.addContact((GenericContact) data.get(ITEM_SEARCH),
|
||||
GenericContact contact = (GenericContact) data.get(ITEM_SEARCH);
|
||||
|
||||
contact = (GenericContact) contact.getContentBundle().
|
||||
getInstance(orgaunit.getLanguage());
|
||||
|
||||
orgaunit.addContact(contact,
|
||||
(String) data.get(
|
||||
GenericOrganizationalUnit.CONTACT_TYPE));
|
||||
} else {
|
||||
|
|
@ -176,4 +181,49 @@ public class GenericOrganizationalUnitContactAddForm
|
|||
init(fse);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate(FormSectionEvent fse) throws FormProcessException {
|
||||
final PageState state = fse.getPageState();
|
||||
final FormData data = fse.getFormData();
|
||||
|
||||
if ((editStep.getSelectedContact() == null)
|
||||
&& (data.get(ITEM_SEARCH) == null)) {
|
||||
data.addError(
|
||||
"cms.contenttypes.ui.genericorgaunit.select_contact.no_contact_selected");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (editStep.getSelectedContact() == null) {
|
||||
GenericOrganizationalUnit orgaunit =
|
||||
(GenericOrganizationalUnit) getItemSelectionModel().
|
||||
getSelectedObject(state);
|
||||
|
||||
GenericContact contact = (GenericContact) data.get(ITEM_SEARCH);
|
||||
|
||||
if (!(contact.getContentBundle().hasInstance(orgaunit.getLanguage()))) {
|
||||
data.addError(
|
||||
ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.genericorgaunit.select_contact.no_suitable_language_variant"));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
contact = (GenericContact) contact.getContentBundle().getInstance(orgaunit.
|
||||
getLanguage());
|
||||
GenericOrganizationalUnitContactCollection contacts = orgaunit.
|
||||
getContacts();
|
||||
|
||||
contacts.addFilter(String.format("id = %s",
|
||||
contact.getID().toString()));
|
||||
if (contacts.size() > 0) {
|
||||
data.addError(
|
||||
ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.genericorgaunit.select_contact.already_added"));
|
||||
}
|
||||
|
||||
contacts.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ public class GenericOrganizationalUnitPersonAddForm
|
|||
m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.
|
||||
findByAssociatedObjectType(getPersonType()));
|
||||
/*m_itemSearch.getItemField().addValidationListener(
|
||||
new NotNullValidationListener());*/
|
||||
new NotNullValidationListener());*/
|
||||
add(this.m_itemSearch);
|
||||
|
||||
selectedPersonNameLabel = new Label("");
|
||||
|
|
@ -116,7 +116,8 @@ public class GenericOrganizationalUnitPersonAddForm
|
|||
statusSelect.addOption(new Option("",
|
||||
new Label((String) ContenttypesGlobalizationUtil.
|
||||
globalize("cms.ui.select_one").localize())));
|
||||
RelationAttributeCollection statusColl = new RelationAttributeCollection(
|
||||
RelationAttributeCollection statusColl =
|
||||
new RelationAttributeCollection(
|
||||
getStatusAttributeName());
|
||||
statusColl.addLanguageFilter(DispatcherHelper.getNegotiatedLocale().
|
||||
getLanguage());
|
||||
|
|
@ -164,7 +165,8 @@ public class GenericOrganizationalUnitPersonAddForm
|
|||
public void process(FormSectionEvent fse) throws FormProcessException {
|
||||
FormData data = fse.getFormData();
|
||||
PageState state = fse.getPageState();
|
||||
GenericOrganizationalUnit orga = (GenericOrganizationalUnit) getItemSelectionModel().
|
||||
GenericOrganizationalUnit orga =
|
||||
(GenericOrganizationalUnit) getItemSelectionModel().
|
||||
getSelectedObject(state);
|
||||
|
||||
if (this.getSaveCancelSection().getSaveButton().isSelected(state)) {
|
||||
|
|
@ -173,11 +175,14 @@ public class GenericOrganizationalUnitPersonAddForm
|
|||
person = selector.getSelectedPerson();
|
||||
|
||||
if (person == null) {
|
||||
logger.debug(String.format("Adding person %s",
|
||||
((GenericPerson) data.get(ITEM_SEARCH)).
|
||||
getFullName()));
|
||||
GenericPerson personToAdd =
|
||||
(GenericPerson) data.get(ITEM_SEARCH);
|
||||
personToAdd.getContentBundle().getInstance(orga.getLanguage());
|
||||
|
||||
orga.addPerson((GenericPerson) data.get(ITEM_SEARCH),
|
||||
logger.debug(String.format("Adding person %s",
|
||||
personToAdd.getFullName()));
|
||||
|
||||
orga.addPerson(personToAdd,
|
||||
(String) data.get(
|
||||
GenericOrganizationalUnitPersonCollection.PERSON_ROLE),
|
||||
(String) data.get(
|
||||
|
|
@ -220,6 +225,51 @@ public class GenericOrganizationalUnitPersonAddForm
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate(FormSectionEvent fse) throws FormProcessException {
|
||||
final PageState state = fse.getPageState();
|
||||
final FormData data = fse.getFormData();
|
||||
|
||||
if ((selector.getSelectedPerson() == null)
|
||||
&& (data.get(ITEM_SEARCH) == null)) {
|
||||
data.addError(
|
||||
ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.genericorgaunit.person.no_person_selected"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (selector.getSelectedPerson() == null) {
|
||||
GenericOrganizationalUnit orga =
|
||||
(GenericOrganizationalUnit) getItemSelectionModel().
|
||||
getSelectedObject(state);
|
||||
|
||||
GenericPerson person = (GenericPerson) data.get(ITEM_SEARCH);
|
||||
|
||||
if (!(person.getContentBundle().hasInstance(orga.getLanguage()))) {
|
||||
data.addError(
|
||||
ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.genericorgaunit.person.no_suitable_language_variant"));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
person = (GenericPerson) person.getContentBundle().getInstance(orga.
|
||||
getLanguage());
|
||||
GenericOrganizationalUnitPersonCollection persons =
|
||||
orga.getPersons();
|
||||
|
||||
persons.addFilter(String.format("id = %s",
|
||||
person.getID().toString()));
|
||||
if (persons.size() > 0) {
|
||||
data.addError(
|
||||
ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.genericorgaunit.person.already_added"));
|
||||
}
|
||||
|
||||
persons.close();
|
||||
}
|
||||
}
|
||||
|
||||
protected String getPersonType() {
|
||||
return GenericPerson.class.getName();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
package com.arsdigita.cms.contenttypes.ui;
|
||||
|
||||
import com.arsdigita.bebop.FormData;
|
||||
import com.arsdigita.bebop.FormProcessException;
|
||||
import com.arsdigita.bebop.Label;
|
||||
import com.arsdigita.bebop.PageState;
|
||||
import com.arsdigita.bebop.SaveCancelSection;
|
||||
|
|
@ -52,7 +53,9 @@ import org.apache.log4j.Logger;
|
|||
*/
|
||||
public class GenericPersonContactAddForm extends BasicItemForm {
|
||||
|
||||
private static final Logger s_log = Logger.getLogger(GenericPersonContactAddForm.class);
|
||||
private static final Logger s_log =
|
||||
Logger.getLogger(
|
||||
GenericPersonContactAddForm.class);
|
||||
private GenericPersonPropertiesStep m_step;
|
||||
private ItemSearchWidget m_itemSearch;
|
||||
private SaveCancelSection m_saveCancelSection;
|
||||
|
|
@ -71,20 +74,30 @@ public class GenericPersonContactAddForm extends BasicItemForm {
|
|||
protected void addWidgets() {
|
||||
|
||||
// Attach a GenericContact object
|
||||
add(new Label((String) ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.select_contact").localize()));
|
||||
this.m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.findByAssociatedObjectType("com.arsdigita.cms.contenttypes.GenericContact"));
|
||||
add(new Label((String) ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.person.select_contact").localize()));
|
||||
this.m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.
|
||||
findByAssociatedObjectType(
|
||||
"com.arsdigita.cms.contenttypes.GenericContact"));
|
||||
add(this.m_itemSearch);
|
||||
|
||||
// GenericContact type field
|
||||
add(new Label(ContenttypesGlobalizationUtil.globalize("cms.contenttypes.ui.person.contact.type")));
|
||||
ParameterModel contactTypeParam = new StringParameter(GenericPersonContactCollection.CONTACTS_KEY);
|
||||
add(new Label(ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.person.contact.type")));
|
||||
ParameterModel contactTypeParam =
|
||||
new StringParameter(
|
||||
GenericPersonContactCollection.CONTACTS_KEY);
|
||||
SingleSelect contactType = new SingleSelect(contactTypeParam);
|
||||
contactType.addValidationListener(new NotNullValidationListener());
|
||||
contactType.addOption(new Option("", new Label((String) ContenttypesGlobalizationUtil.globalize("cms.ui.select_one").localize())));
|
||||
contactType.addOption(new Option("",
|
||||
new Label((String) ContenttypesGlobalizationUtil.
|
||||
globalize("cms.ui.select_one").localize())));
|
||||
|
||||
// Add the Options to the SingleSelect widget
|
||||
GenericContactTypeCollection contacttypes = new GenericContactTypeCollection();
|
||||
contacttypes.addLanguageFilter(DispatcherHelper.getNegotiatedLocale().getLanguage());
|
||||
GenericContactTypeCollection contacttypes =
|
||||
new GenericContactTypeCollection();
|
||||
contacttypes.addLanguageFilter(DispatcherHelper.getNegotiatedLocale().
|
||||
getLanguage());
|
||||
|
||||
while (contacttypes.next()) {
|
||||
RelationAttribute ct = contacttypes.getRelationAttribute();
|
||||
|
|
@ -94,6 +107,7 @@ public class GenericPersonContactAddForm extends BasicItemForm {
|
|||
add(contactType);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(FormSectionEvent fse) {
|
||||
FormData data = fse.getFormData();
|
||||
PageState state = fse.getPageState();
|
||||
|
|
@ -102,16 +116,63 @@ public class GenericPersonContactAddForm extends BasicItemForm {
|
|||
setVisible(state, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void process(FormSectionEvent fse) {
|
||||
FormData data = fse.getFormData();
|
||||
PageState state = fse.getPageState();
|
||||
GenericPerson person = (GenericPerson) getItemSelectionModel().getSelectedObject(state);
|
||||
final FormData data = fse.getFormData();
|
||||
final PageState state = fse.getPageState();
|
||||
GenericPerson person = (GenericPerson) getItemSelectionModel().
|
||||
getSelectedObject(state);
|
||||
|
||||
//
|
||||
if (!this.getSaveCancelSection().getCancelButton().isSelected(state)) {
|
||||
person.addContact((GenericContact) data.get(ITEM_SEARCH), (String) data.get(GenericPersonContactCollection.CONTACTS_KEY));
|
||||
GenericContact contact = (GenericContact) data.get(ITEM_SEARCH);
|
||||
|
||||
contact = (GenericContact) contact.getContentBundle().getInstance(
|
||||
person.getLanguage());
|
||||
|
||||
person.addContact(contact,
|
||||
(String) data.get(
|
||||
GenericPersonContactCollection.CONTACTS_KEY));
|
||||
}
|
||||
|
||||
init(fse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate(FormSectionEvent fse) throws FormProcessException {
|
||||
final PageState state = fse.getPageState();
|
||||
final FormData data = fse.getFormData();
|
||||
|
||||
if (data.get(ITEM_SEARCH) == null) {
|
||||
data.addError(
|
||||
ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.person.select_contact.no_contact_selected"));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
GenericPerson person = (GenericPerson) getItemSelectionModel().
|
||||
getSelectedObject(state);
|
||||
|
||||
GenericContact contact = (GenericContact) data.get(ITEM_SEARCH);
|
||||
|
||||
if (!(contact.getContentBundle().hasInstance(person.getLanguage()))) {
|
||||
data.addError(
|
||||
ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.person.select_contact.no_suitable_language_variant"));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
contact = (GenericContact) contact.getContentBundle().getInstance(person.getLanguage());
|
||||
GenericPersonContactCollection contacts = person.getContacts();
|
||||
|
||||
contacts.addFilter(String.format("id = %s", contact.getID().toString()));
|
||||
if (contacts.size() > 0) {
|
||||
data.addError(
|
||||
ContenttypesGlobalizationUtil.globalize(
|
||||
"cms.contenttypes.ui.person.select_contact.already_added"));
|
||||
}
|
||||
|
||||
contacts.close();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -79,10 +79,39 @@ public class ArticleInCollectedVolumeCollectedVolumeForm
|
|||
getSelectedObject(state);
|
||||
|
||||
if (this.getSaveCancelSection().getSaveButton().isSelected(state)) {
|
||||
article.setCollectedVolume((CollectedVolume) data.get(ITEM_SEARCH));
|
||||
CollectedVolume collectedVolume = (CollectedVolume) data.get(
|
||||
ITEM_SEARCH);
|
||||
collectedVolume =
|
||||
(CollectedVolume) collectedVolume.getContentBundle().getInstance(
|
||||
article.getLanguage());
|
||||
|
||||
init(fse);
|
||||
article.setCollectedVolume(collectedVolume);
|
||||
}
|
||||
|
||||
init(fse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate(FormSectionEvent fse) throws FormProcessException {
|
||||
final PageState state = fse.getPageState();
|
||||
final FormData data = fse.getFormData();
|
||||
|
||||
if (data.get(ITEM_SEARCH) == null) {
|
||||
data.addError(
|
||||
PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.articleInCollectedVolume.selectCollectedVolume.no_collected_volume_selected"));
|
||||
return;
|
||||
}
|
||||
|
||||
ArticleInCollectedVolume article = (ArticleInCollectedVolume) getItemSelectionModel().getSelectedObject(state);
|
||||
|
||||
CollectedVolume collectedVolume = (CollectedVolume) data.get(ITEM_SEARCH);
|
||||
|
||||
if (!(collectedVolume.getContentBundle().hasInstance(article.getLanguage()))) {
|
||||
data.addError(
|
||||
PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.articleInCollectedVolume.selectCollectedVolume.no_suitable_language_variant"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ public class ArticleInJournalJournalForm
|
|||
add(new Label(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.articleInJournal.selectJournal")));
|
||||
itemSearch = new ItemSearchWidget(ITEM_SEARCH,
|
||||
ContentType.findByAssociatedObjectType(
|
||||
ContentType.findByAssociatedObjectType(
|
||||
Journal.class.getName()));
|
||||
add(itemSearch);
|
||||
}
|
||||
|
|
@ -71,14 +71,39 @@ public class ArticleInJournalJournalForm
|
|||
public void process(FormSectionEvent fse) throws FormProcessException {
|
||||
FormData data = fse.getFormData();
|
||||
PageState state = fse.getPageState();
|
||||
ArticleInJournal article = (ArticleInJournal) getItemSelectionModel().getSelectedObject(state);
|
||||
ArticleInJournal article = (ArticleInJournal) getItemSelectionModel().
|
||||
getSelectedObject(state);
|
||||
|
||||
if (this.getSaveCancelSection().getSaveButton().isSelected(state)) {
|
||||
article.setJournal((Journal) data.get(ITEM_SEARCH));
|
||||
Journal journal = (Journal) data.get(ITEM_SEARCH);
|
||||
journal = (Journal) journal.getContentBundle().getInstance(article.
|
||||
getLanguage());
|
||||
|
||||
init(fse);
|
||||
article.setJournal(journal);
|
||||
}
|
||||
|
||||
init(fse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate(FormSectionEvent fse) throws FormProcessException {
|
||||
final PageState state= fse.getPageState();
|
||||
final FormData data = fse.getFormData();
|
||||
|
||||
if (data.get(ITEM_SEARCH) == null) {
|
||||
data.addError(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.articleInJournal.selectJournal.no_journal_selected"));
|
||||
return;
|
||||
}
|
||||
|
||||
ArticleInJournal article = (ArticleInJournal) getItemSelectionModel().getSelectedObject(
|
||||
state);
|
||||
Journal journal = (Journal) data.get(ITEM_SEARCH);
|
||||
|
||||
if (!(journal.getContentBundle().hasInstance(article.getLanguage()))) {
|
||||
data.addError(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.articleInJournal.selectJournal.no_suitable_language_variant"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ import com.arsdigita.bebop.event.FormSectionEvent;
|
|||
import com.arsdigita.cms.ContentType;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.contenttypes.ArticleInCollectedVolume;
|
||||
import com.arsdigita.cms.contenttypes.ArticleInCollectedVolumeCollection;
|
||||
import com.arsdigita.cms.contenttypes.CollectedVolume;
|
||||
import com.arsdigita.cms.ui.ItemSearchWidget;
|
||||
import com.arsdigita.cms.ui.authoring.BasicItemForm;
|
||||
|
|
@ -86,10 +87,47 @@ public class CollectedVolumeArticleAddForm
|
|||
|
||||
if (!(this.getSaveCancelSection().getCancelButton().
|
||||
isSelected(state))) {
|
||||
collectedVolume.addArticle((ArticleInCollectedVolume) data.get(
|
||||
ITEM_SEARCH));
|
||||
ArticleInCollectedVolume article = (ArticleInCollectedVolume) data.
|
||||
get(ITEM_SEARCH);
|
||||
article = (ArticleInCollectedVolume) article.getContentBundle().
|
||||
getInstance(collectedVolume.getLanguage());
|
||||
|
||||
collectedVolume.addArticle(article);
|
||||
}
|
||||
|
||||
init(fse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate(FormSectionEvent fse) throws FormProcessException {
|
||||
final PageState state = fse.getPageState();
|
||||
final FormData data = fse.getFormData();
|
||||
|
||||
if (data.get(ITEM_SEARCH) == null) {
|
||||
data.addError(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.collected_volume.articles.select_article.no_article_selected"));
|
||||
return;
|
||||
}
|
||||
|
||||
CollectedVolume collectedVolume = (CollectedVolume) getItemSelectionModel().getSelectedObject(state);
|
||||
ArticleInCollectedVolume article = (ArticleInCollectedVolume) data.get(ITEM_SEARCH);
|
||||
|
||||
if (!(article.getContentBundle().hasInstance(collectedVolume.getLanguage()))) {
|
||||
data.addError(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.collected_volume.articles.select_article.no_suitable_language_variant"));
|
||||
return;
|
||||
}
|
||||
|
||||
article = (ArticleInCollectedVolume) article.getContentBundle().getInstance(collectedVolume.getLanguage());
|
||||
ArticleInCollectedVolumeCollection articles = collectedVolume.getArticles();
|
||||
|
||||
articles.addFilter(String.format("id = %s", article.getID().toString()));
|
||||
if (articles.size() > 0) {
|
||||
data.addError(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.collected_volume.articles.select_article.already_added"));
|
||||
return;
|
||||
}
|
||||
|
||||
articles.close();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ public class ExpertiseOrdererForm
|
|||
}
|
||||
|
||||
@Override
|
||||
public void init(final FormSectionEvent fse) throws FormProcessException{
|
||||
public void init(final FormSectionEvent fse) throws FormProcessException {
|
||||
PageState state = fse.getPageState();
|
||||
|
||||
setVisible(state, true);
|
||||
|
|
@ -51,12 +51,40 @@ public class ExpertiseOrdererForm
|
|||
public void process(final FormSectionEvent fse) throws FormProcessException {
|
||||
FormData data = fse.getFormData();
|
||||
PageState state = fse.getPageState();
|
||||
Expertise expertise = (Expertise) getItemSelectionModel().getSelectedObject(state);
|
||||
Expertise expertise = (Expertise) getItemSelectionModel().
|
||||
getSelectedObject(state);
|
||||
|
||||
if (this.getSaveCancelSection().getSaveButton().isSelected(state)) {
|
||||
expertise.setOrderer((GenericOrganizationalUnit) data.get(ITEM_SEARCH));
|
||||
GenericOrganizationalUnit orderer =
|
||||
(GenericOrganizationalUnit) data.get(
|
||||
ITEM_SEARCH);
|
||||
orderer = (GenericOrganizationalUnit) orderer.getContentBundle().
|
||||
getInstance(expertise.getLanguage());
|
||||
|
||||
init(fse);
|
||||
expertise.setOrderer(orderer);
|
||||
}
|
||||
|
||||
init(fse);
|
||||
}
|
||||
|
||||
@Override public void validate(FormSectionEvent fse) throws FormProcessException {
|
||||
final PageState state = fse.getPageState();
|
||||
final FormData data = fse.getFormData();
|
||||
|
||||
if (data.get(ITEM_SEARCH) == null) {
|
||||
data.addError(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.expertise.orderer.no_orderer_selected"));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
Expertise expertise = (Expertise) getItemSelectionModel().getSelectedObject(state);
|
||||
GenericOrganizationalUnit orderer = (GenericOrganizationalUnit) data.get(ITEM_SEARCH);
|
||||
if (!(orderer.getContentBundle().hasInstance(expertise.getLanguage()))) {
|
||||
data.addError(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.expertise.orderer.no_suitable_langauge_variant"));
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -41,7 +41,7 @@ public class ExpertiseOrganizationForm
|
|||
}
|
||||
|
||||
@Override
|
||||
public void init(final FormSectionEvent fse) throws FormProcessException{
|
||||
public void init(final FormSectionEvent fse) throws FormProcessException {
|
||||
PageState state = fse.getPageState();
|
||||
|
||||
setVisible(state, true);
|
||||
|
|
@ -51,12 +51,40 @@ public class ExpertiseOrganizationForm
|
|||
public void process(final FormSectionEvent fse) throws FormProcessException {
|
||||
FormData data = fse.getFormData();
|
||||
PageState state = fse.getPageState();
|
||||
Expertise expertise = (Expertise) getItemSelectionModel().getSelectedObject(state);
|
||||
Expertise expertise = (Expertise) getItemSelectionModel().
|
||||
getSelectedObject(state);
|
||||
|
||||
if (this.getSaveCancelSection().getSaveButton().isSelected(state)) {
|
||||
expertise.setOrganization((GenericOrganizationalUnit) data.get(ITEM_SEARCH));
|
||||
GenericOrganizationalUnit orga = (GenericOrganizationalUnit) data.
|
||||
get(ITEM_SEARCH);
|
||||
orga = (GenericOrganizationalUnit) orga.getContentBundle().
|
||||
getInstance(expertise.getLanguage());
|
||||
|
||||
expertise.setOrganization(orga);
|
||||
|
||||
init(fse);
|
||||
}
|
||||
|
||||
init(fse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate(FormSectionEvent fse) throws FormProcessException {
|
||||
final PageState state = fse.getPageState();
|
||||
final FormData data = fse.getFormData();
|
||||
|
||||
if (data.get(ITEM_SEARCH) == null) {
|
||||
data.addError(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.expertise.organization.no_orga_selected"));
|
||||
return;
|
||||
}
|
||||
|
||||
Expertise expertise = (Expertise) getItemSelectionModel().getSelectedObject(state);
|
||||
GenericOrganizationalUnit orga = (GenericOrganizationalUnit) data.get(ITEM_SEARCH);
|
||||
if (!(orga.getContentBundle().hasInstance(expertise.getLanguage()))) {
|
||||
data.addError(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.expertise.organization.no_suitable_language_variant"));
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -77,10 +77,37 @@ public class InProceedingsProceedingsForm
|
|||
getSelectedObject(state);
|
||||
|
||||
if (this.getSaveCancelSection().getSaveButton().isSelected(state)) {
|
||||
inProceedings.setProceedings((Proceedings) data.get(ITEM_SEARCH));
|
||||
Proceedings proceedings = (Proceedings) data.get(ITEM_SEARCH);
|
||||
proceedings = (Proceedings) proceedings.getContentBundle().
|
||||
getInstance(inProceedings.getLanguage());
|
||||
|
||||
init(fse);
|
||||
inProceedings.setProceedings(proceedings);
|
||||
}
|
||||
|
||||
init(fse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate(FormSectionEvent fse) throws FormProcessException {
|
||||
final PageState state = fse.getPageState();
|
||||
final FormData data = fse.getFormData();
|
||||
|
||||
if (data.get(ITEM_SEARCH) == null) {
|
||||
data.addError(
|
||||
PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.inProceedings.selectProceedings.no_proceedings_selected"));
|
||||
return;
|
||||
}
|
||||
|
||||
InProceedings inProceedings = (InProceedings) getItemSelectionModel().
|
||||
getSelectedObject(state);
|
||||
Proceedings proceedings = (Proceedings) data.get(ITEM_SEARCH);
|
||||
if (!(proceedings.getContentBundle().hasInstance(inProceedings.
|
||||
getLanguage()))) {
|
||||
data.addError(
|
||||
PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.inProceedings.selectProceedings.no_suitable_language_variant"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,13 +51,42 @@ public class InternetArticleOrganizationForm
|
|||
public void process(final FormSectionEvent fse) throws FormProcessException {
|
||||
FormData data = fse.getFormData();
|
||||
PageState state = fse.getPageState();
|
||||
InternetArticle article = (InternetArticle) getItemSelectionModel().getSelectedObject(state);
|
||||
InternetArticle article = (InternetArticle) getItemSelectionModel().
|
||||
getSelectedObject(state);
|
||||
|
||||
if (this.getSaveCancelSection().getSaveButton().isSelected(state)) {
|
||||
article.setOrganization((GenericOrganizationalUnit) data.get(ITEM_SEARCH));
|
||||
GenericOrganizationalUnit orga = (GenericOrganizationalUnit) data.
|
||||
get(ITEM_SEARCH);
|
||||
orga = (GenericOrganizationalUnit) orga.getContentBundle().
|
||||
getInstance(article.getLanguage());
|
||||
|
||||
init(fse);
|
||||
article.setOrganization(orga);
|
||||
}
|
||||
|
||||
init(fse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate(final FormSectionEvent fse) throws FormProcessException {
|
||||
final PageState state = fse.getPageState();
|
||||
final FormData data = fse.getFormData();
|
||||
|
||||
if (data.get(ITEM_SEARCH) == null) {
|
||||
data.addError(
|
||||
PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.internetarticle.select_organization.no_orga_selected"));
|
||||
return;
|
||||
}
|
||||
|
||||
InternetArticle article = (InternetArticle) getItemSelectionModel().
|
||||
getSelectedObject(state);
|
||||
GenericOrganizationalUnit orga = (GenericOrganizationalUnit) data.get(
|
||||
ITEM_SEARCH);
|
||||
if (!(orga.getContentBundle().hasInstance(article.getLanguage()))) {
|
||||
data.addError(
|
||||
PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.internetarticle.select_organization.no_suitable_language_variant"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ import com.arsdigita.bebop.event.FormSectionEvent;
|
|||
import com.arsdigita.cms.ContentType;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.contenttypes.ArticleInJournal;
|
||||
import com.arsdigita.cms.contenttypes.ArticleInJournalCollection;
|
||||
import com.arsdigita.cms.contenttypes.Journal;
|
||||
import com.arsdigita.cms.ui.ItemSearchWidget;
|
||||
import com.arsdigita.cms.ui.authoring.BasicItemForm;
|
||||
|
|
@ -57,7 +58,7 @@ public class JournalArticleAddForm
|
|||
|
||||
@Override
|
||||
public void addWidgets() {
|
||||
add(new Label((String) PublicationGlobalizationUtil.globalize(
|
||||
add(new Label((String) PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.journal.articles.select_article").
|
||||
localize()));
|
||||
m_itemSearch = new ItemSearchWidget(
|
||||
|
|
@ -83,9 +84,48 @@ public class JournalArticleAddForm
|
|||
state);
|
||||
|
||||
if (this.getSaveCancelSection().getSaveButton().isSelected(state)) {
|
||||
journal.addArticle((ArticleInJournal) data.get(ITEM_SEARCH));
|
||||
ArticleInJournal article = (ArticleInJournal) data.get(ITEM_SEARCH);
|
||||
article = (ArticleInJournal) article.getContentBundle().getInstance(journal.
|
||||
getLanguage());
|
||||
|
||||
journal.addArticle(article);
|
||||
}
|
||||
|
||||
init(fse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate(FormSectionEvent fse) throws FormProcessException {
|
||||
final PageState state = fse.getPageState();
|
||||
final FormData data = fse.getFormData();
|
||||
|
||||
if (data.get(ITEM_SEARCH) == null) {
|
||||
data.addError(
|
||||
PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.journal.articles.select_article.no_article_selected"));
|
||||
return;
|
||||
}
|
||||
|
||||
Journal journal = (Journal) getItemSelectionModel().getSelectedObject(
|
||||
state);
|
||||
ArticleInJournal article = (ArticleInJournal) data.get(ITEM_SEARCH);
|
||||
if (!(article.getContentBundle().hasInstance(journal.getLanguage()))) {
|
||||
data.addError(
|
||||
PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.journal.articles.select_article.no_suitable_language_variant"));
|
||||
return;
|
||||
}
|
||||
|
||||
article = (ArticleInJournal) article.getContentBundle().getInstance(journal.
|
||||
getLanguage());
|
||||
ArticleInJournalCollection articles = journal.getArticles();
|
||||
articles.addFilter(String.format("id = %s", article.getID().toString()));
|
||||
if (articles.size() > 0) {
|
||||
data.addError(
|
||||
PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.journal.articles.select_article.already_added"));
|
||||
}
|
||||
|
||||
articles.close();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,10 +55,38 @@ public class ProceedingsOrganizerForm
|
|||
getSelectedObject(state);
|
||||
|
||||
if (this.getSaveCancelSection().getSaveButton().isSelected(state)) {
|
||||
proceedings.setOrganizerOfConference((GenericOrganizationalUnit) data.
|
||||
get(ITEM_SEARCH));
|
||||
GenericOrganizationalUnit organizer =
|
||||
(GenericOrganizationalUnit) data.get(
|
||||
ITEM_SEARCH);
|
||||
organizer = (GenericOrganizationalUnit) organizer.getContentBundle().
|
||||
getInstance(proceedings.getLanguage());
|
||||
|
||||
init(fse);
|
||||
proceedings.setOrganizerOfConference(organizer);
|
||||
|
||||
}
|
||||
|
||||
init(fse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate(final FormSectionEvent fse) throws FormProcessException {
|
||||
final PageState state = fse.getPageState();
|
||||
final FormData data = fse.getFormData();
|
||||
|
||||
if (data.get(ITEM_SEARCH) == null) {
|
||||
data.addError(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.proceedings.organizer.no_orga_selected"));
|
||||
return;
|
||||
}
|
||||
|
||||
Proceedings proceedings = (Proceedings) getItemSelectionModel().
|
||||
getSelectedObject(state);
|
||||
GenericOrganizationalUnit organizer = (GenericOrganizationalUnit) data.
|
||||
get(ITEM_SEARCH);
|
||||
if (!(organizer.getContentBundle().hasInstance(proceedings.getLanguage()))) {
|
||||
data.addError(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.proceedings.organizer.no_suitable_language_variant"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ import com.arsdigita.bebop.event.FormSectionEvent;
|
|||
import com.arsdigita.cms.ContentType;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.contenttypes.InProceedings;
|
||||
import com.arsdigita.cms.contenttypes.InProceedingsCollection;
|
||||
import com.arsdigita.cms.contenttypes.Proceedings;
|
||||
import com.arsdigita.cms.ui.ItemSearchWidget;
|
||||
import com.arsdigita.cms.ui.authoring.BasicItemForm;
|
||||
|
|
@ -78,10 +79,47 @@ public class ProceedingsPapersAddForm
|
|||
getSelectedObject(state);
|
||||
|
||||
if (!(this.getSaveCancelSection().getCancelButton().
|
||||
isSelected(state))) {
|
||||
proceedings.addPaper((InProceedings) data.get(ITEM_SEARCH));
|
||||
isSelected(state))) {
|
||||
InProceedings paper = (InProceedings) data.get(ITEM_SEARCH);
|
||||
paper = (InProceedings) paper.getContentBundle().getInstance(proceedings.
|
||||
getLanguage());
|
||||
|
||||
proceedings.addPaper(paper);
|
||||
}
|
||||
|
||||
init(fse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate(FormSectionEvent fse) throws FormProcessException {
|
||||
final PageState state = fse.getPageState();
|
||||
final FormData data = fse.getFormData();
|
||||
|
||||
if (data.get(ITEM_SEARCH) == null) {
|
||||
data.addError(
|
||||
PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.proceedings.select_paper.no_paper_selected"));
|
||||
return;
|
||||
}
|
||||
|
||||
Proceedings proceedings = (Proceedings) getItemSelectionModel().
|
||||
getSelectedObject(state);
|
||||
InProceedings paper = (InProceedings) data.get(ITEM_SEARCH);
|
||||
if (!(paper.getContentBundle().hasInstance(proceedings.getLanguage()))) {
|
||||
data.addError(
|
||||
PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.proceedings.select_paper.no_suitable_language_variant"));
|
||||
return;
|
||||
}
|
||||
|
||||
paper = (InProceedings) paper.getContentBundle().getInstance(proceedings.getLanguage());
|
||||
InProceedingsCollection papers = proceedings.getPapers();
|
||||
papers.addFilter(String.format("id = %s", paper.getID().toString()));
|
||||
if (papers.size() > 0) {
|
||||
data.addError(
|
||||
PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.proceedings.select_paper.already_added"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -146,9 +146,12 @@ public class PublicationAuthorAddForm
|
|||
}
|
||||
|
||||
if (author == null) {
|
||||
publication.addAuthor(
|
||||
(GenericPerson) data.get(ITEM_SEARCH),
|
||||
editor);
|
||||
GenericPerson authorToAdd =
|
||||
(GenericPerson) data.get(ITEM_SEARCH);
|
||||
authorToAdd = (GenericPerson) authorToAdd.getContentBundle().
|
||||
getInstance(publication.getLanguage());
|
||||
|
||||
publication.addAuthor(authorToAdd, editor);
|
||||
} else {
|
||||
AuthorshipCollection authors;
|
||||
|
||||
|
|
@ -174,6 +177,7 @@ public class PublicationAuthorAddForm
|
|||
init(fse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void submitted(FormSectionEvent fse) throws FormProcessException {
|
||||
if (getSaveCancelSection().getCancelButton().isSelected(
|
||||
fse.getPageState())) {
|
||||
|
|
@ -185,4 +189,37 @@ public class PublicationAuthorAddForm
|
|||
init(fse);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate(FormSectionEvent fse) throws FormProcessException {
|
||||
final PageState state = fse.getPageState();
|
||||
final FormData data = fse.getFormData();
|
||||
|
||||
if ((((PublicationAuthorsPropertyStep) editStep).getSelectedAuthor()
|
||||
== null)
|
||||
&& (data.get(ITEM_SEARCH) == null)) {
|
||||
data.addError(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.authors.selectAuthor.no_author_selected"));
|
||||
return;
|
||||
}
|
||||
|
||||
Publication publication = (Publication) getItemSelectionModel().
|
||||
getSelectedObject(state);
|
||||
GenericPerson author = (GenericPerson) data.get(ITEM_SEARCH);
|
||||
if (!(author.getContentBundle().hasInstance(publication.getLanguage()))) {
|
||||
data.addError(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.authors.selectAuthor.no_suitable_language_variant"));
|
||||
return;
|
||||
}
|
||||
|
||||
author = (GenericPerson) author.getContentBundle().getInstance(publication.getLanguage());
|
||||
AuthorshipCollection authors = publication.getAuthors();
|
||||
authors.addFilter(String.format("id = %s", author.getID().toString()));
|
||||
if (authors.size() > 0) {
|
||||
data.addError(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.authors.selectAuthor.already_added"));
|
||||
}
|
||||
|
||||
authors.close();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -320,3 +320,42 @@ publications.ui.workingpaper.reviewed.yes=Yes
|
|||
publications.ui.workingpaper.reviewed.no=No
|
||||
publication.ui.publisher.name=Name of publisher
|
||||
publications.ui.publisher.name=Name of publisher
|
||||
publications.ui.articleInCollectedVolume.selectCollectedVolume.no_collected_volume_selected=No collected volume selected.
|
||||
publications.ui.articleInCollectedVolume.selectCollectedVolume.no_suitable_language_variant=The selected collected volume item is not available in the language of the current article.
|
||||
publications.ui.articleInJournal.selectJournal.no_journal_selected=No journal selected
|
||||
publications.ui.articleInJournal.selectJournal.no_suitable_language_variant=The selected journal item is not available in the language of the current article.
|
||||
publications.ui.collected_volume.articles.select_article.no_article_selected=No article selected.
|
||||
publications.ui.collected_volume.articles.select_article.no_suitable_language_variant=The selected article item is not avialable in the language of the current collected volume item.
|
||||
publications.ui.collected_volume.articles.select_article.already_added=The selected article has already been added to the current collected volume.
|
||||
publications.ui.expertise.orderer.no_orderer_selected=No orderer selected.
|
||||
publications.ui.expertise.orderer.no_suitable_langauge_variant=The item selected as orderer is not available in the language of the current expertise item.
|
||||
publications.ui.expertise.organization.no_orga_selected=No organization selected.
|
||||
publications.ui.expertise.organization.no_suitable_language_variant=The selected item is not avaialable for the language of the current expertise.
|
||||
publications.ui.inProceedings.selectProceedings.no_proceedings_selected=No proceedings selected.
|
||||
publications.ui.inProceedings.selectProceedings.no_suitable_language_variant=The selected proceedings publiciation item is not avialable for the language of the current in proceedings publication item.
|
||||
publications.ui.internetarticle.select_organization.no_orga_selected=No organization selected.
|
||||
publications.ui.internetarticle.select_organization.no_suitable_language_variant=The selected item is not avilable for the langauge of the current internet article.
|
||||
publications.ui.journal.articles.select_article.no_article_selected=No article selected.
|
||||
publications.ui.journal.articles.select_article.no_suitable_language_variant=The selected article in journal item is not available for the language of the current journal item.
|
||||
publications.ui.journal.articles.select_article.already_added=The selected article has already been added to the current journal.
|
||||
publications.ui.proceedings.organizer.no_orga_selected=No orderer selected.
|
||||
publications.ui.proceedings.organizer.no_suitable_language_variant=The selected item is not avialable for the language of the current proceedings item.
|
||||
publications.ui.proceedings.select_paper.no_paper_selected=No paper selected.
|
||||
publications.ui.proceedings.select_paper.no_suitable_language_variant=The selected InProceedings-Item is not avaiable for the language of the current proceedings item.
|
||||
publications.ui.proceedings.select_paper.already_added=The selected item has already been added to the current Proceedings item
|
||||
publications.ui.authors.selectAuthor.no_author_selected=No author selected.
|
||||
publications.ui.authors.selectAuthor.no_suitable_language_variant=The person item selected as author is not available for the language of the current publication item.
|
||||
publications.ui.authors.selectAuthor.already_added=The selected person has already been added as author to the current publication.
|
||||
publications.ui.series.select_series.no_series_selected=No series selected.
|
||||
publications.ui.series.select_series.no_suitable_language_variant=The selected series item is not available for the language of the current publication item.
|
||||
publications.ui.series.select_series.already_added=The current publication has already been added to the selected series.
|
||||
publications.ui.with_publisher.publisher.no_publisher_selected=No publisher selected.
|
||||
publications.ui.with_publisher.publisher.no_suitable_language_variant=The selected publisher item is not available for the language of the current publication item.
|
||||
publications.ui.series.editship.no_editor_selected=No editor selected.
|
||||
publications.ui.series.editship.no_suitable_language_variant=The person item selected as editor in not available for the language of the current series item.
|
||||
publications.ui.series.editship.already_added=The selected person has already been added to the series as editor.
|
||||
publications.ui.series.volume_of_series.no_volume_selected=No publication selected.
|
||||
publications.ui.series.volume_of_series.no_suitable_language_variant=The selected publication item is not available for the language of the current series item.
|
||||
publications.ui.series.volume_of_series.already_added=The selected publication has already been added to the series.
|
||||
publications.ui.unpublished.organization.no_orga_selected=No organization selected.
|
||||
publications.ui.unpublished.organization.no_suitable_language_variant=The selected organization item is not available for the language of the current item.
|
||||
|
|
|
|||
|
|
@ -319,3 +319,42 @@ publications.ui.workingpaper.reviewed.yes=Ja
|
|||
publications.ui.workingpaper.reviewed.no=Nein
|
||||
publication.ui.publisher.name=Name des Verlages
|
||||
publications.ui.publisher.name=Name des Verlages
|
||||
publications.ui.articleInCollectedVolume.selectCollectedVolume.no_collected_volume_selected=Kein Sammelband ausgew\u00e4hlt.
|
||||
publications.ui.articleInCollectedVolume.selectCollectedVolume.no_suitable_language_variant=Das ausgew\u00e4hlte Sammelband-Item ist nicht in der Sprache des aktuellen Artikels verf\u00fcgbar.
|
||||
publications.ui.articleInJournal.selectJournal.no_journal_selected=Keine Zeitschrift ausgew\u00e4hlt.
|
||||
publications.ui.articleInJournal.selectJournal.no_suitable_language_variant=Das ausgew\u00e4hlte Zeitschriften-Item ist nicht in der Sprache des aktuellen Artikels verf\u00fcgbar.
|
||||
publications.ui.collected_volume.articles.select_article.no_article_selected=Kein Artikel ausgew\u00e4hlt.
|
||||
publications.ui.collected_volume.articles.select_article.no_suitable_language_variant=Das ausgew\u00e4hlte Artikel-Item ist nicht in der Sprache des aktuellen Sammelband-Items verf\u00fcbar.
|
||||
publications.ui.collected_volume.articles.select_article.already_added=Der ausgew\u00e4hlte Artikel wurde dem aktuellen Sammelband bereits hinzugef\u00fcgt.
|
||||
publications.ui.expertise.orderer.no_orderer_selected=Ein Auftraggeber ausgew\u00e4hlt.
|
||||
publications.ui.expertise.orderer.no_suitable_langauge_variant=Das als Auftraggeber ausgew\u00e4hlte Item ist nicht f\u00fcr die Sprache des aktuellen Gutachtens verf\u00fcgbar.
|
||||
publications.ui.expertise.organization.no_orga_selected=Keine Organisation ausgew\u00e4hlt.
|
||||
publications.ui.expertise.organization.no_suitable_language_variant=Das ausgew\u00e4hlte Item ist nicht in der Sprache des aktuellen Gutachtens verf\u00fcgbar.
|
||||
publications.ui.inProceedings.selectProceedings.no_proceedings_selected=Kein Tagungsband ausgew\u00e4hlt.
|
||||
publications.ui.inProceedings.selectProceedings.no_suitable_language_variant=Das ausgew\u00e4hlte Tagungsband-Item ist f\u00fcr die Sprache des aktuellen Tagungsbandbeitrag-Items nicht verf\u00fcgbar.
|
||||
publications.ui.internetarticle.select_organization.no_orga_selected=Keine Organisation ausgew\u00e4hlt.
|
||||
publications.ui.internetarticle.select_organization.no_suitable_language_variant=Das ausgew\u00e4hlte Item ist nicht f\u00fcr die Sprache des aktuellen Internet-Artikels verf\u00fcgbar.
|
||||
publications.ui.journal.articles.select_article.no_article_selected=Kein Artikel ausgew\u00e4hlt.
|
||||
publications.ui.journal.articles.select_article.no_suitable_language_variant=Das ausgew\u00e4hlte ArticleInJournal-Item ist nicht f\u00fcr die Sprache des aktuellen Journal-Items verf\u00fcgbar.
|
||||
publications.ui.journal.articles.select_article.already_added=Der ausgew\u00e4hlte Artikel ist dem aktuellen Journal-Item bereits hinzugef\u00fcgt worden.
|
||||
publications.ui.proceedings.organizer.no_orga_selected=Kein Auftraggeber ausgew\u00e4hlt.
|
||||
publications.ui.proceedings.organizer.no_suitable_language_variant=Das ausgew\u00e4hlte Item ist nicht f\u00fcr die Sprache des aktuellen Proceedings-Items verf\u00fcgbar.
|
||||
publications.ui.proceedings.select_paper.no_paper_selected=Keine Paper ausgew\u00e4hlt.
|
||||
publications.ui.proceedings.select_paper.no_suitable_language_variant=Das ausgew\u00e4hlte InProceedingsItem ist nicht f\u00fcr die Sprache des aktuellen Proceedings-Items verf\u00fcgbar.
|
||||
publications.ui.proceedings.select_paper.already_added=Das ausgewh\u00e4hlte Item wurde dem aktuellen Proceedings-Item bereits zugeordnet.
|
||||
publications.ui.authors.selectAuthor.no_author_selected=Kein Autor ausgew\u00e4hlt.
|
||||
publications.ui.authors.selectAuthor.no_suitable_language_variant=Das als Autor ausgew\u00e4hlte Personen-Item ist nicht f\u00fcr die Sprache des aktuellen Publikations-Items verf\u00fcgbar.
|
||||
publications.ui.authors.selectAuthor.already_added=Die als Autor ausgew\u00e4hlte Person wurde der aktuellen Publikation bereits als Autor hinzugef\u00fcgt.
|
||||
publications.ui.series.select_series.no_series_selected=Keine Reihe ausgew\u00e4hlt.
|
||||
publications.ui.series.select_series.no_suitable_language_variant=Das ausgew\u00e4hlte Series-Item ist nicht f\u00fcr die Sprache des aktuellen Publikations-Items verf\u00fcgbar.
|
||||
publications.ui.series.select_series.already_added=Die aktuelle Publikation wurde der ausgew\u00e4hlten Reihe bereits hinzugef\u00fcgt.
|
||||
publications.ui.with_publisher.publisher.no_publisher_selected=Kein Verlag ausgew\u00e4hlt.
|
||||
publications.ui.with_publisher.publisher.no_suitable_language_variant=Das ausgew\u00e4hlte Publisher-Item ist nicht f\u00fcr die Sprache des aktuellen Publikations-Items verf\u00fcgbar.
|
||||
publications.ui.series.editship.no_editor_selected=Kein Herausgeber ausgew\u00e4hlt.
|
||||
publications.ui.series.editship.no_suitable_language_variant=Das als Herausgeber ausgew\u00e4hlte Personen-Item ist nicht f\u00fc die Sprache der des aktuellen Series-Items verf\u00fcgbar.
|
||||
publications.ui.series.editship.already_added=Die ausgew\u00e4hlte Person wurde der aktuellen Reihe bereits als Herausgeber zugeordnet.
|
||||
publications.ui.series.volume_of_series.no_volume_selected=Keine Publikation ausgew\u00e4hlt.
|
||||
publications.ui.series.volume_of_series.no_suitable_language_variant=Das ausgew\u00e4hlte Publikations-Item ist nicht f\u00fcr die Sprache des aktuellen Series-Items verf\u00fcgbar.
|
||||
publications.ui.series.volume_of_series.already_added=Die ausgew\u00e4hlte Publikation wurde der aktuellen Reihe bereits hinzugef\u00fcgt.
|
||||
publications.ui.unpublished.organization.no_orga_selected=Keine Organisation ausgew\u00e4hlt.
|
||||
publications.ui.unpublished.organization.no_suitable_language_variant=Das ausgew\u00e4hlte Item ist nicht f\u00fcr die Sprache des aktuellen Items verf\u00fcgbar.
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ import com.arsdigita.cms.ContentType;
|
|||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.contenttypes.Publication;
|
||||
import com.arsdigita.cms.contenttypes.Series;
|
||||
import com.arsdigita.cms.contenttypes.SeriesCollection;
|
||||
import com.arsdigita.cms.ui.ItemSearchWidget;
|
||||
import com.arsdigita.cms.ui.authoring.BasicItemForm;
|
||||
|
||||
|
|
@ -83,10 +84,46 @@ public class PublicationSeriesAddForm
|
|||
|
||||
if (!(this.getSaveCancelSection().getCancelButton().
|
||||
isSelected(state))) {
|
||||
publication.addSeries(
|
||||
(Series) data.get(ITEM_SEARCH));
|
||||
Series series = (Series) data.get(ITEM_SEARCH);
|
||||
series = (Series) series.getContentBundle().getInstance(publication.
|
||||
getLanguage());
|
||||
|
||||
publication.addSeries(series);
|
||||
}
|
||||
|
||||
init(fse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate(FormSectionEvent fse) throws FormProcessException {
|
||||
final PageState state = fse.getPageState();
|
||||
final FormData data = fse.getFormData();
|
||||
|
||||
if (data.get(ITEM_SEARCH) == null) {
|
||||
data.addError(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.series.select_series.no_series_selected"));
|
||||
return;
|
||||
}
|
||||
|
||||
Publication publication = (Publication) getItemSelectionModel().
|
||||
getSelectedObject(state);
|
||||
Series series = (Series) data.get(ITEM_SEARCH);
|
||||
if (!(series.getContentBundle().hasInstance(publication.getLanguage()))) {
|
||||
data.addError(
|
||||
PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.series.select_series.no_suitable_language_variant"));
|
||||
return;
|
||||
}
|
||||
|
||||
series = (Series) series.getContentBundle().getInstance(publication.
|
||||
getLanguage());
|
||||
SeriesCollection seriesColl = publication.getSeries();
|
||||
seriesColl.addFilter(String.format("id = %s", series.getID().toString()));
|
||||
if (seriesColl.size() > 0) {
|
||||
data.addError(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.series.select_series.already_added"));
|
||||
}
|
||||
|
||||
seriesColl.close();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,14 +54,42 @@ public class PublicationWithPublisherSetPublisherForm
|
|||
public void process(final FormSectionEvent fse) throws FormProcessException {
|
||||
FormData data = fse.getFormData();
|
||||
PageState state = fse.getPageState();
|
||||
PublicationWithPublisher publication = (PublicationWithPublisher) getItemSelectionModel().
|
||||
PublicationWithPublisher publication =
|
||||
(PublicationWithPublisher) getItemSelectionModel().
|
||||
getSelectedObject(state);
|
||||
|
||||
if (this.getSaveCancelSection().getSaveButton().isSelected(state)) {
|
||||
publication.setPublisher((Publisher) data.get(ITEM_SEARCH));
|
||||
Publisher publisher = (Publisher) data.get(ITEM_SEARCH);
|
||||
publisher = (Publisher) publisher.getContentBundle().getInstance(publication.
|
||||
getLanguage());
|
||||
|
||||
init(fse);
|
||||
publication.setPublisher(publisher);
|
||||
}
|
||||
|
||||
init(fse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate(final FormSectionEvent fse) throws FormProcessException {
|
||||
final PageState state = fse.getPageState();
|
||||
final FormData data = fse.getFormData();
|
||||
|
||||
if (data.get(ITEM_SEARCH) == null) {
|
||||
data.addError(
|
||||
PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.with_publisher.publisher.no_publisher_selected"));
|
||||
return;
|
||||
}
|
||||
|
||||
PublicationWithPublisher publication =
|
||||
(PublicationWithPublisher) getItemSelectionModel().
|
||||
getSelectedObject(state);
|
||||
Publisher publisher = (Publisher) data.get(ITEM_SEARCH);
|
||||
if (!(publisher.getContentBundle().hasInstance(publication.getLanguage()))) {
|
||||
data.addError(
|
||||
PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.with_publisher.publisher.no_suitable_language_variant"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -139,7 +139,11 @@ public class SeriesEditshipAddForm
|
|||
editor = editStep.getSelectedEditor();
|
||||
|
||||
if (editor == null) {
|
||||
series.addEditor((GenericPerson) data.get(ITEM_SEARCH),
|
||||
GenericPerson editorToAdd =
|
||||
(GenericPerson) data.get(ITEM_SEARCH);
|
||||
editorToAdd.getContentBundle().getInstance(series.getLanguage());
|
||||
|
||||
series.addEditor(editorToAdd,
|
||||
(Date) data.get(EditshipCollection.FROM),
|
||||
(Date) data.get(EditshipCollection.TO));
|
||||
} else {
|
||||
|
|
@ -166,6 +170,7 @@ public class SeriesEditshipAddForm
|
|||
init(fse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void submitted(FormSectionEvent fse) throws FormProcessException {
|
||||
|
||||
if (getSaveCancelSection().getCancelButton().isSelected(
|
||||
|
|
@ -173,9 +178,38 @@ public class SeriesEditshipAddForm
|
|||
editStep.setSelectedEditor(null);
|
||||
editStep.setSelectedEditorDateFrom(null);
|
||||
editStep.setSelectedEditorDateTo(null);
|
||||
|
||||
init(fse);
|
||||
}
|
||||
|
||||
init(fse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate(FormSectionEvent fse) throws FormProcessException {
|
||||
final PageState state = fse.getPageState();
|
||||
final FormData data = fse.getFormData();
|
||||
|
||||
if (data.get(ITEM_SEARCH) == null) {
|
||||
data.addError(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.series.editship.no_editor_selected"));
|
||||
return;
|
||||
}
|
||||
|
||||
Series series = (Series) getItemSelectionModel().getSelectedObject(state);
|
||||
GenericPerson editor = (GenericPerson) data.get(ITEM_SEARCH);
|
||||
if (!(editor.getContentBundle().hasInstance(series.getLanguage()))) {
|
||||
data.addError(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.series.editship.no_suitable_language_variant"));
|
||||
return;
|
||||
}
|
||||
|
||||
editor = (GenericPerson) editor.getContentBundle().getInstance(series.getLanguage());
|
||||
EditshipCollection editors = series.getEditors();
|
||||
editors.addFilter(String.format("id = %s", editor.getID().toString()));
|
||||
if (editors.size() > 0) {
|
||||
data.addError(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.series.editship.already_added"));
|
||||
}
|
||||
|
||||
editors.close();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -92,12 +92,49 @@ public class SeriesVolumeAddForm extends BasicItemForm {
|
|||
|
||||
if (!(this.getSaveCancelSection().getCancelButton().
|
||||
isSelected(state))) {
|
||||
series.addVolume(
|
||||
(Publication) data.get(ITEM_SEARCH),
|
||||
(Integer) data.get(
|
||||
Publication volume = (Publication) data.get(ITEM_SEARCH);
|
||||
volume = (Publication) volume.getContentBundle().getInstance(series.
|
||||
getLanguage());
|
||||
|
||||
series.addVolume(volume,
|
||||
(Integer) data.get(
|
||||
VolumeInSeriesCollection.VOLUME_OF_SERIES));
|
||||
}
|
||||
|
||||
init(fse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate(FormSectionEvent fse) throws FormProcessException {
|
||||
final PageState state = fse.getPageState();
|
||||
final FormData data = fse.getFormData();
|
||||
|
||||
if (data.get(ITEM_SEARCH) == null) {
|
||||
data.addError(
|
||||
PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.series.volume_of_series.no_volume_selected"));
|
||||
return;
|
||||
}
|
||||
|
||||
Series series = (Series) getItemSelectionModel().
|
||||
getSelectedObject(state);
|
||||
Publication volume = (Publication) data.get(ITEM_SEARCH);
|
||||
if (!(volume.getContentBundle().hasInstance(series.getLanguage()))) {
|
||||
data.addError(
|
||||
PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.series.volume_of_series.no_suitable_language_variant"));
|
||||
return;
|
||||
}
|
||||
|
||||
volume = (Publication) volume.getContentBundle().getInstance(series.
|
||||
getLanguage());
|
||||
VolumeInSeriesCollection volumes = series.getVolumes();
|
||||
volumes.addFilter(String.format("id = %s", volume.getID().toString()));
|
||||
if (volumes.size() > 0) {
|
||||
data.addError(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.series.volume_of_series.already_added"));
|
||||
}
|
||||
|
||||
volumes.close();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,9 +55,37 @@ public class UnPublishedOrganizationForm
|
|||
getSelectedObject(state);
|
||||
|
||||
if (this.getSaveCancelSection().getSaveButton().isSelected(state)) {
|
||||
unPublished.setOrganization((GenericOrganizationalUnit) data.get(ITEM_SEARCH));
|
||||
GenericOrganizationalUnit orga = (GenericOrganizationalUnit) data.
|
||||
get(ITEM_SEARCH);
|
||||
orga = (GenericOrganizationalUnit) orga.getContentBundle().
|
||||
getInstance(unPublished.getLanguage());
|
||||
|
||||
init(fse);
|
||||
unPublished.setOrganization(orga);
|
||||
|
||||
}
|
||||
|
||||
init(fse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate(FormSectionEvent fse) throws FormProcessException {
|
||||
final PageState state = fse.getPageState();
|
||||
final FormData data = fse.getFormData();
|
||||
|
||||
if (data.get(ITEM_SEARCH) == null) {
|
||||
data.addError(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.unpublished.organization.no_orga_selected"));
|
||||
return;
|
||||
}
|
||||
|
||||
UnPublished unPublished = (UnPublished) getItemSelectionModel().
|
||||
getSelectedObject(state);
|
||||
GenericOrganizationalUnit orga = (GenericOrganizationalUnit) data.get(
|
||||
ITEM_SEARCH);
|
||||
if (!(orga.getContentBundle().hasInstance(unPublished.getLanguage()))) {
|
||||
data.addError(PublicationGlobalizationUtil.globalize(
|
||||
"publications.ui.unpublished.organization.no_suitable_language_variant"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -93,6 +93,14 @@ public class SciDepartmentOrganizationForm
|
|||
final PageState state = fse.getPageState();
|
||||
final FormData data = fse.getFormData();
|
||||
|
||||
if (data.get(ITEM_SEARCH) == null) {
|
||||
data.addError(
|
||||
SciOrganizationGlobalizationUtil.globalize(
|
||||
"sciorganization.ui.department.organization.add.no_organization_selected"));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
SciDepartment department = (SciDepartment) getItemSelectionModel().
|
||||
getSelectedObject(state);
|
||||
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ import com.arsdigita.bebop.event.FormSectionEvent;
|
|||
import com.arsdigita.cms.ContentType;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.contenttypes.SciDepartment;
|
||||
import com.arsdigita.cms.contenttypes.SciDepartmentProjectsCollection;
|
||||
import com.arsdigita.cms.contenttypes.SciProject;
|
||||
import com.arsdigita.cms.ui.ItemSearchWidget;
|
||||
import com.arsdigita.cms.ui.authoring.BasicItemForm;
|
||||
|
|
@ -79,11 +80,48 @@ public class SciDepartmentProjectAddForm
|
|||
|
||||
if (!(this.getSaveCancelSection().getCancelButton().
|
||||
isSelected(state))) {
|
||||
department.addProject((SciProject) data.get(ITEM_SEARCH));
|
||||
SciProject project = (SciProject) data.get(ITEM_SEARCH);
|
||||
project = (SciProject) project.getContentBundle().getInstance(department.
|
||||
getLanguage());
|
||||
|
||||
department.addProject(project);
|
||||
}
|
||||
|
||||
init(fse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate(FormSectionEvent fse) throws FormProcessException {
|
||||
final PageState state = fse.getPageState();
|
||||
final FormData data = fse.getFormData();
|
||||
|
||||
if (data.get(ITEM_SEARCH) == null) {
|
||||
data.addError(
|
||||
SciOrganizationGlobalizationUtil.globalize(
|
||||
"sciorganization.ui.department.select_project.no_project_selected"));
|
||||
return;
|
||||
}
|
||||
|
||||
SciDepartment department = (SciDepartment) getItemSelectionModel().
|
||||
getSelectedObject(state);
|
||||
SciProject project = (SciProject) data.get(ITEM_SEARCH);
|
||||
if (!(project.getContentBundle().hasInstance(department.getLanguage()))) {
|
||||
data.addError(
|
||||
SciOrganizationGlobalizationUtil.globalize(
|
||||
"sciorganization.ui.department.select_project.no_suitable_language_variant"));
|
||||
return;
|
||||
}
|
||||
|
||||
project = (SciProject) project.getContentBundle().getInstance(department.
|
||||
getLanguage());
|
||||
SciDepartmentProjectsCollection projects = department.getProjects();
|
||||
projects.addFilter(String.format("id = %s", project.getID().toString()));
|
||||
if (projects.size() > 0) {
|
||||
data.addError(
|
||||
SciOrganizationGlobalizationUtil.globalize(
|
||||
"sciorganization.ui.department.select_project.already_added"));
|
||||
}
|
||||
|
||||
projects.close();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ import com.arsdigita.bebop.event.FormSectionEvent;
|
|||
import com.arsdigita.cms.ContentType;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.contenttypes.SciDepartment;
|
||||
import com.arsdigita.cms.contenttypes.SciDepartmentSubDepartmentsCollection;
|
||||
import com.arsdigita.cms.ui.ItemSearchWidget;
|
||||
import com.arsdigita.cms.ui.authoring.BasicItemForm;
|
||||
|
||||
|
|
@ -76,11 +77,56 @@ public class SciDepartmentSubDepartmentAddForm
|
|||
getSelectedObject(state);
|
||||
|
||||
if (!(this.getSaveCancelSection().getCancelButton().
|
||||
isSelected(state))) {
|
||||
department.addSubDepartment((SciDepartment) data.get(ITEM_SEARCH));
|
||||
isSelected(state))) {
|
||||
SciDepartment subDepartment = (SciDepartment) data.get(ITEM_SEARCH);
|
||||
subDepartment = (SciDepartment) subDepartment.getContentBundle().
|
||||
getInstance(department.getLanguage());
|
||||
|
||||
department.addSubDepartment(subDepartment);
|
||||
}
|
||||
|
||||
init(fse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate(FormSectionEvent fse) throws FormProcessException {
|
||||
final PageState state = fse.getPageState();
|
||||
final FormData data = fse.getFormData();
|
||||
|
||||
if (data.get(ITEM_SEARCH) == null) {
|
||||
data.addError(
|
||||
SciOrganizationGlobalizationUtil.globalize(
|
||||
"sciorganization.ui.department.select_subdepartment.no_department_selected"));
|
||||
return;
|
||||
}
|
||||
|
||||
SciDepartment department = (SciDepartment) getItemSelectionModel().
|
||||
getSelectedObject(state);
|
||||
SciDepartment subDepartment = (SciDepartment) data.get(ITEM_SEARCH);
|
||||
if (!(subDepartment.getContentBundle().hasInstance(department.getLanguage()))) {
|
||||
data.addError(
|
||||
SciOrganizationGlobalizationUtil.globalize(
|
||||
"sciorganization.ui.department.select_subdepartment.no_suitable_language_variant"));
|
||||
return;
|
||||
}
|
||||
|
||||
subDepartment = (SciDepartment) subDepartment.getContentBundle().getInstance(department.getLanguage());
|
||||
|
||||
if (department.getID().equals(subDepartment.getID())) {
|
||||
data.addError(
|
||||
SciOrganizationGlobalizationUtil.globalize(
|
||||
"sciorganization.ui.department.select_subdepartment.adding_to_itself"));
|
||||
return;
|
||||
}
|
||||
|
||||
SciDepartmentSubDepartmentsCollection subDepartments = department.getSubDepartments();
|
||||
subDepartments.addFilter(String.format("id = %s", subDepartment.getID().toString()));
|
||||
if (subDepartments.size() > 0) {
|
||||
data.addError(
|
||||
SciOrganizationGlobalizationUtil.globalize(
|
||||
"sciorganization.ui.department.select_subdepartment.already_added"));
|
||||
}
|
||||
|
||||
subDepartments.close();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -77,10 +77,48 @@ public class SciDepartmentSuperDepartmentForm
|
|||
getSelectedObject(state);
|
||||
|
||||
if ((this.getSaveCancelSection().getSaveButton().isSelected(state))) {
|
||||
department.setSuperDepartment(
|
||||
(SciDepartment) data.get(ITEM_SEARCH));
|
||||
SciDepartment superDepartment =
|
||||
(SciDepartment) data.get(ITEM_SEARCH);
|
||||
superDepartment = (SciDepartment) superDepartment.getContentBundle().
|
||||
getInstance(department.getLanguage());
|
||||
|
||||
init(fse);
|
||||
department.setSuperDepartment(superDepartment);
|
||||
}
|
||||
|
||||
init(fse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate(FormSectionEvent fse) throws FormProcessException {
|
||||
final PageState state = fse.getPageState();
|
||||
final FormData data = fse.getFormData();
|
||||
|
||||
if (data.get(ITEM_SEARCH) == null) {
|
||||
data.addError(
|
||||
SciOrganizationGlobalizationUtil.globalize(
|
||||
"sciorganization.ui.department.select_superdepartment.no_department_selected"));
|
||||
return;
|
||||
}
|
||||
|
||||
SciDepartment department = (SciDepartment) getItemSelectionModel().
|
||||
getSelectedObject(state);
|
||||
SciDepartment superDepartment =
|
||||
(SciDepartment) data.get(ITEM_SEARCH);
|
||||
if (!(superDepartment.getContentBundle().hasInstance(department.
|
||||
getLanguage()))) {
|
||||
data.addError(
|
||||
SciOrganizationGlobalizationUtil.globalize(
|
||||
"sciorganization.ui.department.select_superdepartment.no_suitable_language_variant"));
|
||||
return;
|
||||
}
|
||||
|
||||
superDepartment = (SciDepartment) superDepartment.getContentBundle().
|
||||
getInstance(department.getLanguage());
|
||||
if (superDepartment.getID().equals(department.getID())) {
|
||||
data.addError(
|
||||
SciOrganizationGlobalizationUtil.globalize(
|
||||
"sciorganization.ui.department.select_superdepartment.same_department"));
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -90,7 +90,8 @@ public class SciMemberSciDepartmentAddForm
|
|||
statusSelect.addOption(new Option("",
|
||||
new Label((String) ContenttypesGlobalizationUtil.
|
||||
globalize("cms.ui.select_one").localize())));
|
||||
RelationAttributeCollection statusColl = new RelationAttributeCollection(
|
||||
RelationAttributeCollection statusColl =
|
||||
new RelationAttributeCollection(
|
||||
"GenericOrganizationalUnitMemberStatus");
|
||||
statusColl.addLanguageFilter(DispatcherHelper.getNegotiatedLocale().
|
||||
getLanguage());
|
||||
|
|
@ -143,7 +144,13 @@ public class SciMemberSciDepartmentAddForm
|
|||
department = step.getSelectedDepartment();
|
||||
|
||||
if (department == null) {
|
||||
member.addDepartment((SciDepartment) data.get(ITEM_SEARCH),
|
||||
SciDepartment departmentToAdd = (SciDepartment) data.get(
|
||||
ITEM_SEARCH);
|
||||
departmentToAdd = (SciDepartment) departmentToAdd.
|
||||
getContentBundle().getInstance(
|
||||
member.getLanguage());
|
||||
|
||||
member.addDepartment(departmentToAdd,
|
||||
(String) data.get(
|
||||
SciMemberSciDepartmentsCollection.MEMBER_ROLE),
|
||||
(String) data.get(
|
||||
|
|
@ -177,7 +184,8 @@ public class SciMemberSciDepartmentAddForm
|
|||
|
||||
@Override
|
||||
public void submitted(FormSectionEvent fse) throws FormProcessException {
|
||||
if (getSaveCancelSection().getCancelButton().isSelected(fse.getPageState())) {
|
||||
if (getSaveCancelSection().getCancelButton().isSelected(
|
||||
fse.getPageState())) {
|
||||
step.setSelectedDepartment(null);
|
||||
step.setSelectedDepartmentRole(null);
|
||||
step.setSelectedDepartmentStatus(null);
|
||||
|
|
@ -185,4 +193,39 @@ public class SciMemberSciDepartmentAddForm
|
|||
init(fse);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate(FormSectionEvent fse) throws FormProcessException {
|
||||
final PageState state = fse.getPageState();
|
||||
final FormData data = fse.getFormData();
|
||||
|
||||
if (data.get(ITEM_SEARCH) == null) {
|
||||
data.addError(
|
||||
SciOrganizationGlobalizationUtil.globalize(
|
||||
"scimember.ui.department.select_department.no_department_selected"));
|
||||
return;
|
||||
}
|
||||
|
||||
SciMember member = (SciMember) getItemSelectionModel().getSelectedObject(
|
||||
state);
|
||||
SciDepartment department = (SciDepartment) data.get(ITEM_SEARCH);
|
||||
if (!(department.getContentBundle().hasInstance(member.getLanguage()))) {
|
||||
data.addError(
|
||||
SciOrganizationGlobalizationUtil.globalize(
|
||||
"scimember.ui.department.select_department.no_suitable_language_variant"));
|
||||
return;
|
||||
}
|
||||
|
||||
department = (SciDepartment) department.getContentBundle().getInstance(member.
|
||||
getLanguage());
|
||||
SciMemberSciDepartmentsCollection departments = member.getDepartments();
|
||||
departments.addFilter(String.format("id = %s", department.getID().toString()));
|
||||
if (departments.size() > 0) {
|
||||
data.addError(
|
||||
SciOrganizationGlobalizationUtil.globalize(
|
||||
"scimember.ui.department.select_department.already_added"));
|
||||
}
|
||||
|
||||
departments.close();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -90,7 +90,8 @@ public class SciMemberSciOrganizationAddForm
|
|||
statusSelect.addOption(new Option("",
|
||||
new Label((String) ContenttypesGlobalizationUtil.
|
||||
globalize("cms.ui.select_one").localize())));
|
||||
RelationAttributeCollection statusColl = new RelationAttributeCollection(
|
||||
RelationAttributeCollection statusColl =
|
||||
new RelationAttributeCollection(
|
||||
"GenericOrganizationalUnitMemberStatus");
|
||||
statusColl.addLanguageFilter(DispatcherHelper.getNegotiatedLocale().
|
||||
getLanguage());
|
||||
|
|
@ -144,7 +145,12 @@ public class SciMemberSciOrganizationAddForm
|
|||
orga = step.getSelectedOrganization();
|
||||
|
||||
if (orga == null) {
|
||||
member.addOrganization((SciOrganization) data.get(ITEM_SEARCH),
|
||||
SciOrganization orgaToAdd = (SciOrganization) data.get(
|
||||
ITEM_SEARCH);
|
||||
orgaToAdd = (SciOrganization) orgaToAdd.getContentBundle().
|
||||
getInstance(member.getLanguage());
|
||||
|
||||
member.addOrganization(orga,
|
||||
(String) data.get(
|
||||
SciMemberSciOrganizationsCollection.MEMBER_ROLE),
|
||||
(String) data.get(
|
||||
|
|
@ -187,4 +193,42 @@ public class SciMemberSciOrganizationAddForm
|
|||
init(fse);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate(FormSectionEvent fse) throws FormProcessException {
|
||||
final PageState state = fse.getPageState();
|
||||
final FormData data = fse.getFormData();
|
||||
|
||||
if (data.get(ITEM_SEARCH) == null) {
|
||||
data.addError(
|
||||
SciOrganizationGlobalizationUtil.globalize(
|
||||
"scimember.ui.organization.select_organization.no_orga_selected"));
|
||||
return;
|
||||
}
|
||||
|
||||
SciMember member = (SciMember) getItemSelectionModel().getSelectedObject(
|
||||
state);
|
||||
SciOrganization orga = (SciOrganization) data.get(
|
||||
ITEM_SEARCH);
|
||||
if (!(orga.getContentBundle().hasInstance(member.getLanguage()))) {
|
||||
data.addError(
|
||||
SciOrganizationGlobalizationUtil.globalize(
|
||||
"scimember.ui.organization.select_organization.no_suitable_language_variant"));
|
||||
return;
|
||||
}
|
||||
|
||||
orga = (SciOrganization) orga.getContentBundle().getInstance(member.
|
||||
getLanguage());
|
||||
SciMemberSciOrganizationsCollection organizations = member.
|
||||
getOrganizations();
|
||||
organizations.addFilter(String.format("id = %s",
|
||||
orga.getID().toString()));
|
||||
if (organizations.size() > 0) {
|
||||
data.addError(
|
||||
SciOrganizationGlobalizationUtil.globalize(
|
||||
"scimember.ui.organization.select_organization.already_added"));
|
||||
}
|
||||
|
||||
organizations.close();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ public class SciMemberSciProjectAddForm
|
|||
private Label selectedProjectNameLabel;
|
||||
|
||||
public SciMemberSciProjectAddForm(ItemSelectionModel itemModel,
|
||||
SciMemberSciProjectsStep step) {
|
||||
SciMemberSciProjectsStep step) {
|
||||
super("sciMemberProjectAddForm", itemModel);
|
||||
this.step = step;
|
||||
}
|
||||
|
|
@ -90,7 +90,8 @@ public class SciMemberSciProjectAddForm
|
|||
statusSelect.addOption(new Option("",
|
||||
new Label((String) ContenttypesGlobalizationUtil.
|
||||
globalize("cms.ui.select_one").localize())));
|
||||
RelationAttributeCollection statusColl = new RelationAttributeCollection(
|
||||
RelationAttributeCollection statusColl =
|
||||
new RelationAttributeCollection(
|
||||
"GenericOrganizationalUnitMemberStatus");
|
||||
statusColl.addLanguageFilter(DispatcherHelper.getNegotiatedLocale().
|
||||
getLanguage());
|
||||
|
|
@ -143,10 +144,14 @@ public class SciMemberSciProjectAddForm
|
|||
project = step.getSelectedProject();
|
||||
|
||||
if (project == null) {
|
||||
member.addProject((SciProject) data.get(ITEM_SEARCH),
|
||||
(String) data.get(
|
||||
SciProject projectToAdd = (SciProject) data.get(ITEM_SEARCH);
|
||||
projectToAdd = (SciProject) projectToAdd.getContentBundle().
|
||||
getInstance(member.getLanguage());
|
||||
|
||||
member.addProject(projectToAdd,
|
||||
(String) data.get(
|
||||
SciMemberSciProjectsCollection.MEMBER_ROLE),
|
||||
(String) data.get(
|
||||
(String) data.get(
|
||||
SciMemberSciProjectsCollection.STATUS));
|
||||
} else {
|
||||
SciMemberSciProjectsCollection projects;
|
||||
|
|
@ -177,7 +182,8 @@ public class SciMemberSciProjectAddForm
|
|||
|
||||
@Override
|
||||
public void submitted(FormSectionEvent fse) throws FormProcessException {
|
||||
if (getSaveCancelSection().getCancelButton().isSelected(fse.getPageState())) {
|
||||
if (getSaveCancelSection().getCancelButton().isSelected(
|
||||
fse.getPageState())) {
|
||||
step.setSelectedProject(null);
|
||||
step.setSelectedProjectRole(null);
|
||||
step.setSelectedProjectStatus(null);
|
||||
|
|
@ -185,4 +191,35 @@ public class SciMemberSciProjectAddForm
|
|||
init(fse);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate(FormSectionEvent fse) throws FormProcessException {
|
||||
final PageState state = fse.getPageState();
|
||||
final FormData data = fse.getFormData();
|
||||
|
||||
if (data.get(ITEM_SEARCH) == null) {
|
||||
data.addError(SciOrganizationGlobalizationUtil.globalize(
|
||||
"scimember.ui.project.select_project.no_project_selected"));
|
||||
return;
|
||||
}
|
||||
|
||||
SciMember member = (SciMember) getItemSelectionModel().getSelectedObject(
|
||||
state);
|
||||
SciProject project = (SciProject) data.get(ITEM_SEARCH);
|
||||
if (!(project.getContentBundle().hasInstance(member.getLanguage()))) {
|
||||
data.addError(SciOrganizationGlobalizationUtil.globalize(
|
||||
"scimember.ui.project.select_project.no_suitable_language_variant"));
|
||||
return;
|
||||
}
|
||||
|
||||
project = (SciProject) project.getContentBundle().getInstance(member.getLanguage());
|
||||
SciMemberSciProjectsCollection projects = member.getProjects();
|
||||
projects.addFilter(String.format("id = %s", project.getID().toString()));
|
||||
if (projects.size() > 0) {
|
||||
data.addError(SciOrganizationGlobalizationUtil.globalize(
|
||||
"scimember.ui.project.select_project.already_added"));
|
||||
}
|
||||
|
||||
projects.close();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ import com.arsdigita.cms.ContentType;
|
|||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.contenttypes.SciDepartment;
|
||||
import com.arsdigita.cms.contenttypes.SciOrganization;
|
||||
import com.arsdigita.cms.contenttypes.SciOrganizationDepartmentsCollection;
|
||||
import com.arsdigita.cms.ui.ItemSearchWidget;
|
||||
import com.arsdigita.cms.ui.authoring.BasicItemForm;
|
||||
|
||||
|
|
@ -96,15 +97,36 @@ public class SciOrganizationDepartmentAddForm
|
|||
final PageState state = fse.getPageState();
|
||||
final FormData data = fse.getFormData();
|
||||
|
||||
if (data.get(ITEM_SEARCH) == null) {
|
||||
data.addError(SciOrganizationGlobalizationUtil.globalize(
|
||||
"sciorganization.ui.organization.department.add.no_department_selected"));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
SciOrganization orga = (SciOrganization) getItemSelectionModel().
|
||||
getSelectedObject(state);
|
||||
|
||||
SciDepartment department = (SciDepartment) data.get(ITEM_SEARCH);
|
||||
|
||||
if (!(department.getContentBundle().hasInstance(orga.getLanguage()))) {
|
||||
data.addError(
|
||||
SciOrganizationGlobalizationUtil.globalize(
|
||||
"sciorganization.ui.organization.department.add.no_suitable_language_variant"));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
department = (SciDepartment) department.getContentBundle().getInstance(orga.
|
||||
getLanguage());
|
||||
SciOrganizationDepartmentsCollection departments = orga.getDepartments();
|
||||
departments.addFilter(String.format("id = %s",
|
||||
department.getID().toString()));
|
||||
if (departments.size() > 0) {
|
||||
data.addError(
|
||||
SciOrganizationGlobalizationUtil.globalize(
|
||||
"sciorganization.ui.organization.department.add.already_added"));
|
||||
}
|
||||
|
||||
departments.close();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ import com.arsdigita.bebop.event.FormSectionEvent;
|
|||
import com.arsdigita.cms.ContentType;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.contenttypes.SciOrganization;
|
||||
import com.arsdigita.cms.contenttypes.SciOrganizationProjectsCollection;
|
||||
import com.arsdigita.cms.contenttypes.SciProject;
|
||||
import com.arsdigita.cms.ui.ItemSearchWidget;
|
||||
import com.arsdigita.cms.ui.authoring.BasicItemForm;
|
||||
|
|
@ -80,9 +81,48 @@ public class SciOrganizationProjectAddForm
|
|||
|
||||
if (!(this.getSaveCancelSection().getCancelButton().
|
||||
isSelected(state))) {
|
||||
orga.addProject((SciProject) data.get(ITEM_SEARCH));
|
||||
SciProject project = (SciProject) data.get(ITEM_SEARCH);
|
||||
project = (SciProject) project.getContentBundle().getInstance(orga.
|
||||
getLanguage());
|
||||
|
||||
orga.addProject(project);
|
||||
}
|
||||
|
||||
init(fse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate(FormSectionEvent fse) throws FormProcessException {
|
||||
final PageState state = fse.getPageState();
|
||||
final FormData data = fse.getFormData();
|
||||
|
||||
if (data.get(ITEM_SEARCH) == null) {
|
||||
data.addError(
|
||||
SciOrganizationGlobalizationUtil.globalize(
|
||||
"sciorganization.ui.organization.select_project.no_project_selected"));
|
||||
return;
|
||||
}
|
||||
|
||||
SciOrganization orga = (SciOrganization) getItemSelectionModel().
|
||||
getSelectedObject(state);
|
||||
SciProject project = (SciProject) data.get(ITEM_SEARCH);
|
||||
if (!(project.getContentBundle().hasInstance(orga.getLanguage()))) {
|
||||
data.addError(
|
||||
SciOrganizationGlobalizationUtil.globalize(
|
||||
"sciorganization.ui.organization.select_project.no_suitable_language_variant"));
|
||||
return;
|
||||
}
|
||||
|
||||
project = (SciProject) project.getContentBundle().getInstance(orga.
|
||||
getLanguage());
|
||||
SciOrganizationProjectsCollection projects = orga.getProjects();
|
||||
projects.addFilter(String.format("id = %s", project.getID().toString()));
|
||||
if (projects.size() > 0) {
|
||||
data.addError(
|
||||
SciOrganizationGlobalizationUtil.globalize(
|
||||
"sciorganization.ui.organization.select_project.already_added"));
|
||||
}
|
||||
|
||||
projects.close();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -180,3 +180,53 @@ scimember.ui.projects.edit_assoc=Edit association
|
|||
sciorganization.ui.project.description=Description of project
|
||||
sciorganization.ui.organization.department.add.no_suitable_language_variant=The selected item has no language variant for the language of the current item. Please add an suitable language variant to the item to add before adding it.
|
||||
sciorganization.ui.department.organization.add.no_suitable_language_variant=The selected item has no language variant for the language of the current item. Please add an suitable language variant to the item to add before adding it.
|
||||
sciorganization.ui.organization.department.add.already_added=The selected department has already been added to the current organization.
|
||||
sciorganization.ui.organization.department.add.no_department_selected=No department selected.
|
||||
sciorganization.ui.department.organization.add.no_organization_selected=No organization selected.
|
||||
sciorganization.ui.department.select_project.no_project_selected=No project selected.
|
||||
sciorganization.ui.department.select_project.no_suitable_language_variant=The select project is no available for the language of the current department item..
|
||||
sciorganization.ui.department.select_project.already_added=The selected project has already been added to the projects of the current department item.
|
||||
sciorganization.ui.department.select_subdepartment.no_department_selected=No department selected.
|
||||
sciorganization.ui.department.select_subdepartment.no_suitable_language_variant=The selected department to add as subdepartment is not available for the language of the current department.
|
||||
sciorganization.ui.department.select_subdepartment.adding_to_itself=It is not possible to add a department to itself as a sub department.
|
||||
sciorganization.ui.department.select_subdepartment.already_added=The selected department is already an sub department of the current department.
|
||||
sciorganization.ui.department.select_superdepartment.no_department_selected=No department selected.
|
||||
sciorganization.ui.department.select_superdepartment.no_suitable_language_variant=The department selected to set as super department is not available in the language of the current department.
|
||||
sciorganization.ui.department.select_superdepartment.same_department=It is not possible to set the super department of a department to itself.
|
||||
scimember.ui.department.select_department.no_department_selected=No department selected.
|
||||
scimember.ui.department.select_department.no_suitable_language_variant=The department to add is not available for the language of the current member item.
|
||||
scimember.ui.department.select_department.already_added=The current member is already a member of the selected department.
|
||||
scimember.ui.organization.select_organization.no_orga_selected=No organization selected.
|
||||
scimember.ui.organization.select_organization.no_suitable_language_variant=The selected organization is not available for the language of the current member item.
|
||||
scimember.ui.organization.select_organization.already_added=The current member is already a member of the selected organization.
|
||||
scimember.ui.project.select_project.no_project_selected=No project selected.
|
||||
scimember.ui.project.select_project.no_suitable_language_variant=The selected project is not available for the language of the current member item.
|
||||
scimember.ui.project.select_project.already_added=The current member is already a member of the selected project.
|
||||
sciorganization.ui.organization.select_project.no_project_selected=No project selected.
|
||||
sciorganization.ui.organization.select_project.no_suitable_language_variant=The selected project is not available for the language of the current organization item.
|
||||
sciorganization.ui.organization.select_project.already_added=The selected project is already a project of the current organization.
|
||||
sciorganization.ui.project.select_department.no_department_selected=No department selected.
|
||||
sciorganization.ui.project.select_department.no_suitable_language_variant=The selected department is not available for the language of the current project item.
|
||||
sciorganization.ui.project.select_department.already_added=The current project is already a project of the selected department.
|
||||
sciorganization.ui.project.select_organization.no_organization_selected=No organization selected.
|
||||
sciorganization.ui.project.select_organization.no_suitable_language_variant=The selected organization is not available for the language of the current project item.
|
||||
sciorganization.ui.project.select_organization.already_added=The current project is already a project of the selected organization.
|
||||
sciorganization.ui.project.select_subproject.no_project_selected=No project selected.
|
||||
sciorganization.ui.project.select_subproject.no_suitable_language_variant=The selected sub project is not available for the language of the current project.
|
||||
sciorganization.ui.project.select_subproject.same_project=A project can't be a sub project of itself.
|
||||
sciorganization.ui.project.select_subproject.already_added=The selected project is already a sub project of the current project.
|
||||
sciorganization.ui.project.select_superproject.no_project_selected=No project selected.
|
||||
sciorganization.ui.project.select_superproject.no_suitable_language_variant=The selected super project is not available for the language of the current project item.
|
||||
sciorganization.ui.project.select_superproject.same_project=A project can't be the super project of itself.
|
||||
sciorganization.ui.selectDepartment.no_department_selected=No department selected.
|
||||
sciorganization.ui.selectDepartment.no_suitable_language_variant=The selected department is not avaiable for the language of the current publication item.
|
||||
sciorganization.ui.selectDepartment.already_added=The current publications has already been added to the list of publications of the selected department.
|
||||
sciorganization.ui.selectOrganization.no_orga_selected=No organization selected.
|
||||
sciorganization.ui.selectOrganization.no_suitable_language_variant=The selected organization is not avaiable for the language of the current publication item.
|
||||
sciorganization.ui.selectOrganization.already_added=The current publication has already been added to the list of publications of the selected organization.
|
||||
sciorganization.ui.selectProject.no_project_selected=No project selected.
|
||||
sciorganization.ui.selectProject.no_suitable_language_variant=The selected project is not available for the language of the current publication item.
|
||||
sciorganization.ui.selectProject.already_added=The current publications has already been added to the publication list of the selected project.
|
||||
sciorganization.ui.selectPublication.no_publication_selected=No publication selected.
|
||||
sciorganization.ui.selectPublication.no_suitable_language_variant=The selected publication is not available for the language of the current item.
|
||||
sciorganization.ui.selectPublication.already_added=The selected publication has already been added to the publication list of the current item.
|
||||
|
|
|
|||
|
|
@ -180,3 +180,53 @@ scimember.ui.projects.edit_assoc=Verkn\u00fcpfung bearbeiten
|
|||
sciorganization.ui.project.description=Projektbeschreibung
|
||||
sciorganization.ui.organization.department.add.no_suitable_language_variant=Das ausgew\u00e4hlte ContentItem besitzt keine Sprachvariante f\u00fcr die Sprache dieses Items und kann daher nicht hinzugef\u00fcgt werden.
|
||||
sciorganization.ui.department.organization.add.no_suitable_language_variant=Das ausgew\u00e4hlte ContentItem besitzt keine Sprachvariante f\u00fcr die Sprache dieses Items und kann daher nicht hinzugef\u00fcgt werden.
|
||||
sciorganization.ui.organization.department.add.already_added=Die ausgew\u00e4hlte Abteilung wurde der aktuellen Organisation bereits hinzugef\u00fcgt.
|
||||
sciorganization.ui.organization.department.add.no_department_selected=Keine Abteilung ausgew\u00e4hlt.
|
||||
sciorganization.ui.department.organization.add.no_organization_selected=Keine Organisation ausgew\u00e4hlt.
|
||||
sciorganization.ui.department.select_project.no_project_selected=Kein Project ausgew\u00e4hlt.
|
||||
sciorganization.ui.department.select_project.no_suitable_language_variant=Das ausgew\u00e4hlte Projekt ist f\u00fcr die Sprache des aktuellen Abteilungs-Items nicht verf\u00fcgbar.
|
||||
sciorganization.ui.department.select_project.already_added=Das ausgew\u00e4hlte Projekt wurde dem aktuellen Abteilungs-Item bereits hinzugef\u00fcgt.
|
||||
sciorganization.ui.department.select_subdepartment.no_department_selected=Keine Abteilung ausgew\u00e4hlt.
|
||||
sciorganization.ui.department.select_subdepartment.no_suitable_language_variant=Die zum hinzuf\u00fcgen als Unterabteilung ausw\u00e4hlte Abteilung ist f\u00fcr die Sprache der aktuellen Abteilung nicht verf\u00fcgbar.
|
||||
sciorganization.ui.department.select_subdepartment.adding_to_itself=Eine Abteilung kann nicht sich selbst als Unterabteilung zugewiesen werden.
|
||||
sciorganization.ui.department.select_subdepartment.already_added=Die ausgew\u00e4hlte Abteilung ist bereits eine Unterabteilung der aktuellen Abteilung.
|
||||
sciorganization.ui.department.select_superdepartment.no_department_selected=Keine Abteilung ausgew\u00e4hlt.
|
||||
sciorganization.ui.department.select_superdepartment.no_suitable_language_variant=Die als \u00fcbergeordnete Abteilung ausgew\u00e4hlte Abteilung ist nicht in der Sprache der aktuellen Abteilung verf\u00fcgbar.
|
||||
sciorganization.ui.department.select_superdepartment.same_department=Eine Abteilung kann nicht ihre eigene \u00fcbergeordnete Abteilung sein.
|
||||
scimember.ui.department.select_department.no_department_selected=Keine Abteilung ausgew\u00e4hlt.
|
||||
scimember.ui.department.select_department.no_suitable_language_variant=Die ausgew\u00e4hlte Abteilung ist nicht f\u00fcr die Sprache des aktuellen Mitglieds-Items verf\u00fcgbar.
|
||||
scimember.ui.department.select_department.already_added=Das aktuelle Mitglieder ist bereits ein Mitglied der ausgew\u00e4hlten Abteilung.
|
||||
scimember.ui.organization.select_organization.no_orga_selected=Keine Organisation ausgew\u00e4hlt.
|
||||
scimember.ui.organization.select_organization.no_suitable_language_variant=Die ausgew\u00e4hlte Organisation ist f\u00fcr die Sprache des aktuellen Mitglieds-Items nicht verf\u00fcgbar.
|
||||
scimember.ui.organization.select_organization.already_added=Das aktuelle Mitglied ist bereits Mitglied der ausgew\u00e4hlten Organisation.
|
||||
scimember.ui.project.select_project.no_project_selected=Kein Projekt ausgew\u00e4hlt.
|
||||
scimember.ui.project.select_project.no_suitable_language_variant=Das ausgew\u00e4hlte Projekt ist f\u00fcr die Sprache des aktuellen Mitglieds-Items nicht verf\u00fcgbar.
|
||||
scimember.ui.project.select_project.already_added=Das aktuelle Mitglied ist bereits ein Mitglied des ausgew\u00e4hlten Projektes.
|
||||
sciorganization.ui.organization.select_project.no_project_selected=Kein Projekt ausgew\u00e4hlt.
|
||||
sciorganization.ui.organization.select_project.no_suitable_language_variant=Das ausgew\u00e4hlte Projekt ist nicht f\u00fcr die Sprache des aktuellen Organisations-Items verf\u00fcgbar.
|
||||
sciorganization.ui.organization.select_project.already_added=Das ausgew\u00e4hlte Projekt ist bereits ein Projekt der aktuellen Organisation.
|
||||
sciorganization.ui.project.select_department.no_department_selected=Kein Projekt ausgew\u00e4hlt.
|
||||
sciorganization.ui.project.select_department.no_suitable_language_variant=Die ausgew\u00e4hlte Abteilung ist nicht f\u00fcr die Sprache des aktuellen Projekt-Items verf\u00fcgbar.
|
||||
sciorganization.ui.project.select_department.already_added=Das aktuelle Projekt ist bereits ein Projekt der ausgew\u00e4hlten Abteilung.
|
||||
sciorganization.ui.project.select_organization.no_organization_selected=Keine Organisation ausgew\u00e4hlt.
|
||||
sciorganization.ui.project.select_organization.no_suitable_language_variant=Die ausgew\u00e4hlte Organisation ist nicht f\u00fcr die Sprache des aktuellen Projekt-Items verf\u00fcgbar.
|
||||
sciorganization.ui.project.select_organization.already_added=Das aktuelle Projekt is bereits ein Projekt der der ausgew\u00e4hlten Organisation.
|
||||
sciorganization.ui.project.select_subproject.no_project_selected=Kein Projekt ausgew\u00e4hlt.
|
||||
sciorganization.ui.project.select_subproject.no_suitable_language_variant=Das ausgew\u00e4hlte Unterprojekt ist nicht f\u00fcr die Sprache des aktuellen Projektes verf\u00fcgbar.
|
||||
sciorganization.ui.project.select_subproject.same_project=Ein Projekt kann kein Unterprojekt von sich selbst sein.
|
||||
sciorganization.ui.project.select_subproject.already_added=Das ausgew\u00e4hlte Projekt ist bereits ein Unterprojekt des aktuellen Projektes.
|
||||
sciorganization.ui.project.select_superproject.no_project_selected=Kein Projekt ausgew\u00e4hlt.
|
||||
sciorganization.ui.project.select_superproject.no_suitable_language_variant=Das ausgew\u00e4hlte Hauptprojekt ist nicht f\u00fcr die Sprache des aktuellen Projektes verf\u00fcgbar.
|
||||
sciorganization.ui.project.select_superproject.same_project=Ein Projekt kann nicht sein eigenes Hauptprojekt sein.
|
||||
sciorganization.ui.selectDepartment.no_department_selected=Keine Abteilung ausgew\u00e4hlt.
|
||||
sciorganization.ui.selectDepartment.no_suitable_language_variant=Die ausgew\u00e4hlte Abteilung ist nicht f\u00fcr die Sprache des aktuellen Publikations-Items verf\u00fcgbar.
|
||||
sciorganization.ui.selectDepartment.already_added=Die aktuelle Publikation wurde bereits der Publikationsliste der ausgew\u00e4hlten Abteilung hinzugef\u00fcgt.
|
||||
sciorganization.ui.selectOrganization.no_orga_selected=Keine Organisation ausgew\u00e4hlt.
|
||||
sciorganization.ui.selectOrganization.no_suitable_language_variant=Die ausgew\u00e4hlte Organisation ist nicht f\u00fcr die Sprache der aktuellen Publikation verf\u00fcgbar.
|
||||
sciorganization.ui.selectOrganization.already_added=Die aktuelle Publikation wurde bereits der Liste der Publikationen der ausgew\u00e4hlten Organisation hinzugef\u00fcgt.
|
||||
sciorganization.ui.selectProject.no_project_selected=Kein Projekt ausgew\u00e4hlt.
|
||||
sciorganization.ui.selectProject.no_suitable_language_variant=Das ausgew\u00e4hlte Projekt ist nicht f\u00fcr die Sprache des aktuellen Publikations-Items verf\u00fcgbar.
|
||||
sciorganization.ui.selectProject.already_added=Die aktuelle Publikation wurde bereits der Publikationsliste des ausgew\u00e4hlten Projektes hinzugef\u00fcgt.
|
||||
sciorganization.ui.selectPublication.no_publication_selected=Keine Publikation ausgew\u00e4hlt.
|
||||
sciorganization.ui.selectPublication.no_suitable_language_variant=Die ausgew\u00e4hlte Publikation ist nicht f\u00fcr die Sprache des aktuellen Items verf\u00fcgbar.
|
||||
sciorganization.ui.selectPublication.already_added=Die ausgew\u00e4hlte Publikation ist bereits Teil der Publikationsliste des aktuellen Items.
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ import com.arsdigita.cms.ContentType;
|
|||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.contenttypes.SciDepartment;
|
||||
import com.arsdigita.cms.contenttypes.SciProject;
|
||||
import com.arsdigita.cms.contenttypes.SciProjectDepartmentsCollection;
|
||||
import com.arsdigita.cms.ui.ItemSearchWidget;
|
||||
import com.arsdigita.cms.ui.authoring.BasicItemForm;
|
||||
|
||||
|
|
@ -77,10 +78,50 @@ public class SciProjectDepartmentAddForm
|
|||
getSelectedObject(state);
|
||||
|
||||
if (!(this.getSaveCancelSection().getCancelButton().
|
||||
isSelected(state))) {
|
||||
project.addDepartment((SciDepartment) data.get(ITEM_SEARCH));
|
||||
isSelected(state))) {
|
||||
SciDepartment department = (SciDepartment) data.get(ITEM_SEARCH);
|
||||
department = (SciDepartment) department.getContentBundle().
|
||||
getInstance(project.getLanguage());
|
||||
|
||||
init(fse);
|
||||
project.addDepartment(department);
|
||||
}
|
||||
|
||||
init(fse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate(FormSectionEvent fse) throws FormProcessException {
|
||||
final PageState state = fse.getPageState();
|
||||
final FormData data = fse.getFormData();
|
||||
|
||||
if (data.get(ITEM_SEARCH) == null) {
|
||||
data.addError(
|
||||
SciOrganizationGlobalizationUtil.globalize(
|
||||
"sciorganization.ui.project.select_department.no_department_selected"));
|
||||
return;
|
||||
}
|
||||
|
||||
SciProject project = (SciProject) getItemSelectionModel().
|
||||
getSelectedObject(state);
|
||||
SciDepartment department = (SciDepartment) data.get(ITEM_SEARCH);
|
||||
if (!(department.getContentBundle().hasInstance(project.getLanguage()))) {
|
||||
data.addError(
|
||||
SciOrganizationGlobalizationUtil.globalize(
|
||||
"sciorganization.ui.project.select_department.no_suitable_language_variant"));
|
||||
return;
|
||||
}
|
||||
|
||||
department = (SciDepartment) department.getContentBundle().getInstance(project.
|
||||
getLanguage());
|
||||
SciProjectDepartmentsCollection departments = project.getDepartments();
|
||||
departments.addFilter(String.format("id = %s", department.getID().
|
||||
toString()));
|
||||
if (departments.size() > 0) {
|
||||
data.addError(
|
||||
SciOrganizationGlobalizationUtil.globalize(
|
||||
"sciorganization.ui.project.select_department.already_added"));
|
||||
}
|
||||
|
||||
departments.close();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ import com.arsdigita.cms.ContentType;
|
|||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.contenttypes.SciOrganization;
|
||||
import com.arsdigita.cms.contenttypes.SciProject;
|
||||
import com.arsdigita.cms.contenttypes.SciProjectOrganizationsCollection;
|
||||
import com.arsdigita.cms.ui.ItemSearchWidget;
|
||||
import com.arsdigita.cms.ui.authoring.BasicItemForm;
|
||||
|
||||
|
|
@ -78,9 +79,44 @@ public class SciProjectOrganizationsAddForm
|
|||
|
||||
if (!(this.getSaveCancelSection().getCancelButton().
|
||||
isSelected(state))) {
|
||||
project.addOrganization((SciOrganization) data.get(ITEM_SEARCH));
|
||||
SciOrganization orga = (SciOrganization) data.get(ITEM_SEARCH);
|
||||
orga = (SciOrganization) orga.getContentBundle().getInstance(project.
|
||||
getLanguage());
|
||||
|
||||
init(fse);
|
||||
project.addOrganization(orga);
|
||||
}
|
||||
|
||||
init(fse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate(FormSectionEvent fse) throws FormProcessException {
|
||||
final PageState state = fse.getPageState();
|
||||
final FormData data = fse.getFormData();
|
||||
|
||||
if (data.get(ITEM_SEARCH) == null) {
|
||||
data.addError(SciOrganizationGlobalizationUtil.globalize(
|
||||
"sciorganization.ui.project.select_organization.no_organization_selected"));
|
||||
return;
|
||||
}
|
||||
|
||||
SciProject project = (SciProject) getItemSelectionModel().
|
||||
getSelectedObject(state);
|
||||
SciOrganization orga = (SciOrganization) data.get(ITEM_SEARCH);
|
||||
if (!(orga.getContentBundle().hasInstance(project.getLanguage()))) {
|
||||
data.addError(SciOrganizationGlobalizationUtil.globalize(
|
||||
"sciorganization.ui.project.select_organization.no_suitable_language_variant"));
|
||||
return;
|
||||
}
|
||||
|
||||
orga = (SciOrganization) orga.getContentBundle().getInstance(project.getLanguage());
|
||||
SciProjectOrganizationsCollection organizations = project.getOrganizations();
|
||||
organizations.addFilter(String.format("id = %s", orga.getID().toString()));
|
||||
if (organizations.size() > 0) {
|
||||
data.addError(SciOrganizationGlobalizationUtil.globalize(
|
||||
"sciorganization.ui.project.select_organization.already_added"));
|
||||
}
|
||||
|
||||
organizations.close();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ import com.arsdigita.bebop.event.FormSectionEvent;
|
|||
import com.arsdigita.cms.ContentType;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.contenttypes.SciProject;
|
||||
import com.arsdigita.cms.contenttypes.SciProjectSubProjectsCollection;
|
||||
import com.arsdigita.cms.ui.ItemSearchWidget;
|
||||
import com.arsdigita.cms.ui.authoring.BasicItemForm;
|
||||
|
||||
|
|
@ -76,9 +77,54 @@ public class SciProjectSubprojectAddForm
|
|||
|
||||
if (!(this.getSaveCancelSection().getCancelButton().
|
||||
isSelected(state))) {
|
||||
project.addSubProject((SciProject) data.get(ITEM_SEARCH));
|
||||
SciProject subProject = (SciProject) data.get(ITEM_SEARCH);
|
||||
subProject = (SciProject) subProject.getContentBundle().
|
||||
getInstance(project.getLanguage());
|
||||
|
||||
init(fse);
|
||||
project.addSubProject(subProject);
|
||||
}
|
||||
|
||||
init(fse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate(FormSectionEvent fse) throws FormProcessException {
|
||||
final PageState state = fse.getPageState();
|
||||
final FormData data = fse.getFormData();
|
||||
|
||||
if (data.get(ITEM_SEARCH) == null) {
|
||||
data.addError(
|
||||
SciOrganizationGlobalizationUtil.globalize(
|
||||
"sciorganization.ui.project.select_subproject.no_project_selected"));
|
||||
return;
|
||||
}
|
||||
|
||||
SciProject project = (SciProject) getItemSelectionModel().
|
||||
getSelectedObject(state);
|
||||
SciProject subProject = (SciProject) data.get(ITEM_SEARCH);
|
||||
if (!(subProject.getContentBundle().hasInstance(project.getLanguage()))) {
|
||||
data.addError(
|
||||
SciOrganizationGlobalizationUtil.globalize(
|
||||
"sciorganization.ui.project.select_subproject.no_suitable_language_variant"));
|
||||
return;
|
||||
}
|
||||
|
||||
subProject = (SciProject) subProject.getContentBundle().getInstance(project.
|
||||
getLanguage());
|
||||
if (subProject.getID().equals(project.getID())) {
|
||||
data.addError(SciOrganizationGlobalizationUtil.globalize(
|
||||
"sciorganization.ui.project.select_subproject.same_project"));
|
||||
return;
|
||||
}
|
||||
|
||||
SciProjectSubProjectsCollection subProjects = project.getSubProjects();
|
||||
subProjects.addFilter(String.format("id = %s", subProject.getID().
|
||||
toString()));
|
||||
if(subProjects.size() > 0) {
|
||||
data.addError(SciOrganizationGlobalizationUtil.globalize(
|
||||
"sciorganization.ui.project.select_subproject.already_added"));
|
||||
}
|
||||
|
||||
subProjects.close();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,16 +69,53 @@ public class SciProjectSuperProjectSetForm
|
|||
|
||||
@Override
|
||||
public void process(FormSectionEvent fse) throws FormProcessException {
|
||||
FormData data = fse.getFormData();
|
||||
PageState state = fse.getPageState();
|
||||
SciProject project = (SciProject) getItemSelectionModel().
|
||||
getSelectedObject(state);
|
||||
FormData data = fse.getFormData();
|
||||
PageState state = fse.getPageState();
|
||||
SciProject project = (SciProject) getItemSelectionModel().
|
||||
getSelectedObject(state);
|
||||
|
||||
if (this.getSaveCancelSection().getSaveButton().
|
||||
isSelected(state)) {
|
||||
project.setSuperProject((SciProject) data.get(ITEM_SEARCH));
|
||||
if (this.getSaveCancelSection().getSaveButton().
|
||||
isSelected(state)) {
|
||||
SciProject superProject = (SciProject) data.get(ITEM_SEARCH);
|
||||
superProject = (SciProject) superProject.getContentBundle().
|
||||
getInstance(project.getLanguage());
|
||||
|
||||
project.setSuperProject(superProject);
|
||||
}
|
||||
|
||||
init(fse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate(FormSectionEvent fse) throws FormProcessException {
|
||||
final PageState state = fse.getPageState();
|
||||
final FormData data = fse.getFormData();
|
||||
|
||||
if (data.get(ITEM_SEARCH) == null) {
|
||||
data.addError(
|
||||
SciOrganizationGlobalizationUtil.globalize(
|
||||
"sciorganization.ui.project.select_superproject.no_project_selected"));
|
||||
return;
|
||||
}
|
||||
|
||||
SciProject project = (SciProject) getItemSelectionModel().
|
||||
getSelectedObject(state);
|
||||
SciProject superProject = (SciProject) data.get(ITEM_SEARCH);
|
||||
if (!(superProject.getContentBundle().hasInstance(project.getLanguage()))) {
|
||||
data.addError(
|
||||
SciOrganizationGlobalizationUtil.globalize(
|
||||
"sciorganization.ui.project.select_superproject.no_suitable_language_variant"));
|
||||
return;
|
||||
}
|
||||
|
||||
superProject = (SciProject) superProject.getContentBundle().getInstance(project.
|
||||
getLanguage());
|
||||
if (superProject.getID().equals(project.getID())) {
|
||||
data.addError(
|
||||
SciOrganizationGlobalizationUtil.globalize(
|
||||
"sciorganization.ui.project.select_superproject.same_project"));
|
||||
return;
|
||||
}
|
||||
|
||||
init(fse);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,9 +29,12 @@ import com.arsdigita.bebop.event.FormSectionEvent;
|
|||
import com.arsdigita.cms.ContentType;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.contenttypes.Publication;
|
||||
import com.arsdigita.cms.contenttypes.PublicationSciDepartmentCollection;
|
||||
import com.arsdigita.cms.contenttypes.SciDepartmentPublicationsCollection;
|
||||
import com.arsdigita.cms.contenttypes.SciDepartmentWithPublications;
|
||||
import com.arsdigita.cms.ui.ItemSearchWidget;
|
||||
import com.arsdigita.cms.ui.authoring.BasicItemForm;
|
||||
import com.arsdigita.persistence.DataCollection;
|
||||
import com.arsdigita.persistence.DataObject;
|
||||
|
||||
/**
|
||||
|
|
@ -78,8 +81,9 @@ public class PublicationSciDepartmentAddForm
|
|||
if (this.getSaveCancelSection().getSaveButton().isSelected(state)) {
|
||||
SciDepartmentWithPublications department =
|
||||
(SciDepartmentWithPublications) data.
|
||||
get(
|
||||
ITEM_SEARCH);
|
||||
get(ITEM_SEARCH);
|
||||
department = (SciDepartmentWithPublications) department.
|
||||
getContentBundle().getInstance(publication.getLanguage());
|
||||
DataObject link = publication.add("departments", department);
|
||||
link.set("publicationOrder", Integer.valueOf((int) department.
|
||||
getPublications().size()));
|
||||
|
|
@ -89,4 +93,41 @@ public class PublicationSciDepartmentAddForm
|
|||
|
||||
init(fse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate(FormSectionEvent fse) throws FormProcessException {
|
||||
final PageState state = fse.getPageState();
|
||||
final FormData data = fse.getFormData();
|
||||
|
||||
if (data.get(ITEM_SEARCH) == null) {
|
||||
data.addError(
|
||||
SciOrganizationWithPublicationsGlobalizationUtil.globalize(
|
||||
"sciorganization.ui.selectDepartment.no_department_selected"));
|
||||
return;
|
||||
}
|
||||
|
||||
Publication publication = (Publication) getItemSelectionModel().
|
||||
getSelectedObject(state);
|
||||
SciDepartmentWithPublications department =
|
||||
(SciDepartmentWithPublications) data.get(
|
||||
ITEM_SEARCH);
|
||||
if (!(department.getContentBundle().hasInstance(publication.getLanguage()))) {
|
||||
data.addError(
|
||||
SciOrganizationWithPublicationsGlobalizationUtil.globalize(
|
||||
"sciorganization.ui.selectDepartment.no_suitable_language_variant"));
|
||||
return;
|
||||
}
|
||||
|
||||
department = (SciDepartmentWithPublications) department.getContentBundle().getInstance(publication.getLanguage());
|
||||
PublicationSciDepartmentCollection departments = new PublicationSciDepartmentCollection((DataCollection) publication.
|
||||
get("departments"));
|
||||
departments.addFilter(String.format("id = %s", department.getID().toString()));
|
||||
if (departments.size() > 0) {
|
||||
data.addError(
|
||||
SciOrganizationWithPublicationsGlobalizationUtil.globalize(
|
||||
"sciorganization.ui.selectDepartment.already_added"));
|
||||
}
|
||||
|
||||
departments.close();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,9 +29,11 @@ import com.arsdigita.bebop.event.FormSectionEvent;
|
|||
import com.arsdigita.cms.ContentType;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.contenttypes.Publication;
|
||||
import com.arsdigita.cms.contenttypes.PublicationSciOrganizationCollection;
|
||||
import com.arsdigita.cms.contenttypes.SciOrganizationWithPublications;
|
||||
import com.arsdigita.cms.ui.ItemSearchWidget;
|
||||
import com.arsdigita.cms.ui.authoring.BasicItemForm;
|
||||
import com.arsdigita.persistence.DataCollection;
|
||||
import com.arsdigita.persistence.DataObject;
|
||||
|
||||
/**
|
||||
|
|
@ -78,13 +80,55 @@ public class PublicationSciOrganizationAddForm
|
|||
if (this.getSaveCancelSection().getSaveButton().isSelected(state)) {
|
||||
SciOrganizationWithPublications organization =
|
||||
(SciOrganizationWithPublications) data.
|
||||
get(
|
||||
ITEM_SEARCH);
|
||||
get(ITEM_SEARCH);
|
||||
organization = (SciOrganizationWithPublications) organization.
|
||||
getContentBundle().getInstance(publication.getLanguage());
|
||||
DataObject link = publication.add("organizations", organization);
|
||||
link.set("publicationOrder", Integer.valueOf((int)organization.getPublications().size()));
|
||||
link.set("publicationOrder", Integer.valueOf((int) organization.
|
||||
getPublications().size()));
|
||||
link.save();
|
||||
}
|
||||
|
||||
init(fse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate(final FormSectionEvent fse) throws FormProcessException {
|
||||
final PageState state = fse.getPageState();
|
||||
final FormData data = fse.getFormData();
|
||||
|
||||
if (data.get(ITEM_SEARCH) == null) {
|
||||
data.addError(SciOrganizationWithPublicationsGlobalizationUtil.
|
||||
globalize(
|
||||
"sciorganization.ui.selectOrganization.no_orga_selected"));
|
||||
return;
|
||||
}
|
||||
|
||||
Publication publication = (Publication) getItemSelectionModel().
|
||||
getSelectedObject(state);
|
||||
SciOrganizationWithPublications organization =
|
||||
(SciOrganizationWithPublications) data.
|
||||
get(ITEM_SEARCH);
|
||||
if (!(organization.getContentBundle().hasInstance(publication.
|
||||
getLanguage()))) {
|
||||
data.addError(
|
||||
SciOrganizationWithPublicationsGlobalizationUtil.globalize(
|
||||
"sciorganization.ui.selectOrganization.no_suitable_language_variant"));
|
||||
return;
|
||||
}
|
||||
|
||||
organization = (SciOrganizationWithPublications) organization.
|
||||
getContentBundle().getInstance(publication.getLanguage());
|
||||
PublicationSciOrganizationCollection organizations =
|
||||
new PublicationSciOrganizationCollection((DataCollection) publication.
|
||||
get("organizations"));
|
||||
organizations.addFilter(String.format("id = %s", organization.getID().toString()));
|
||||
if (organizations.size() > 0 ) {
|
||||
data.addError(
|
||||
SciOrganizationWithPublicationsGlobalizationUtil.globalize(
|
||||
"sciorganization.ui.selectOrganization.already_added"));
|
||||
}
|
||||
|
||||
organizations.close();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,9 +29,11 @@ import com.arsdigita.bebop.event.FormSectionEvent;
|
|||
import com.arsdigita.cms.ContentType;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.contenttypes.Publication;
|
||||
import com.arsdigita.cms.contenttypes.PublicationSciProjectCollection;
|
||||
import com.arsdigita.cms.contenttypes.SciProjectWithPublications;
|
||||
import com.arsdigita.cms.ui.ItemSearchWidget;
|
||||
import com.arsdigita.cms.ui.authoring.BasicItemForm;
|
||||
import com.arsdigita.persistence.DataCollection;
|
||||
import com.arsdigita.persistence.DataObject;
|
||||
|
||||
/**
|
||||
|
|
@ -79,6 +81,8 @@ public class PublicationSciProjectAddForm
|
|||
SciProjectWithPublications project =
|
||||
(SciProjectWithPublications) data.get(
|
||||
ITEM_SEARCH);
|
||||
project = (SciProjectWithPublications) project.getContentBundle().
|
||||
getInstance(publication.getLanguage());
|
||||
DataObject link = publication.add("projects", project);
|
||||
link.set("publicationOrder", Integer.valueOf((int) project.
|
||||
getPublications().size()));
|
||||
|
|
@ -87,4 +91,41 @@ public class PublicationSciProjectAddForm
|
|||
|
||||
init(fse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate(FormSectionEvent fse) throws FormProcessException {
|
||||
final PageState state = fse.getPageState();
|
||||
final FormData data = fse.getFormData();
|
||||
|
||||
if (data.get(ITEM_SEARCH) == null) {
|
||||
data.addError(SciOrganizationWithPublicationsGlobalizationUtil.
|
||||
globalize(
|
||||
"sciorganization.ui.selectProject.no_project_selected"));
|
||||
return;
|
||||
}
|
||||
|
||||
Publication publication = (Publication) getItemSelectionModel().
|
||||
getSelectedObject(state);
|
||||
SciProjectWithPublications project =
|
||||
(SciProjectWithPublications) data.get(
|
||||
ITEM_SEARCH);
|
||||
if (!(project.getContentBundle().hasInstance(publication.getLanguage()))) {
|
||||
data.addError(SciOrganizationWithPublicationsGlobalizationUtil.
|
||||
globalize(
|
||||
"sciorganization.ui.selectProject.no_suitable_language_variant"));
|
||||
return;
|
||||
}
|
||||
|
||||
project = (SciProjectWithPublications) project.getContentBundle().getInstance(publication.getLanguage());
|
||||
PublicationSciProjectCollection projects = new PublicationSciProjectCollection((DataCollection) publication.
|
||||
get("projects"));
|
||||
projects.addFilter(String.format("id = %s", project.getID().toString()));
|
||||
if (projects.size() > 0) {
|
||||
data.addError(SciOrganizationWithPublicationsGlobalizationUtil.
|
||||
globalize(
|
||||
"sciorganization.ui.selectProject.already_added"));
|
||||
}
|
||||
|
||||
projects.close();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ import com.arsdigita.bebop.event.FormSectionEvent;
|
|||
import com.arsdigita.cms.ContentType;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.contenttypes.Publication;
|
||||
import com.arsdigita.cms.contenttypes.SciDepartmentPublicationsCollection;
|
||||
import com.arsdigita.cms.contenttypes.SciDepartmentWithPublications;
|
||||
import com.arsdigita.cms.ui.ItemSearchWidget;
|
||||
import com.arsdigita.cms.ui.authoring.BasicItemForm;
|
||||
|
|
@ -69,14 +70,57 @@ public class SciDepartmentPublicationsAddForm
|
|||
public void process(final FormSectionEvent fse) throws FormProcessException {
|
||||
FormData data = fse.getFormData();
|
||||
PageState state = fse.getPageState();
|
||||
SciDepartmentWithPublications organization =
|
||||
SciDepartmentWithPublications department =
|
||||
(SciDepartmentWithPublications) getItemSelectionModel().
|
||||
getSelectedObject(state);
|
||||
|
||||
if (this.getSaveCancelSection().getSaveButton().isSelected(state)) {
|
||||
organization.addPublication((Publication) data.get(ITEM_SEARCH));
|
||||
Publication publication = (Publication) data.get(ITEM_SEARCH);
|
||||
publication = (Publication) publication.getContentBundle().
|
||||
getInstance(department.getLanguage());
|
||||
|
||||
department.addPublication(publication);
|
||||
}
|
||||
|
||||
init(fse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate(final FormSectionEvent fse) throws FormProcessException {
|
||||
final PageState state = fse.getPageState();
|
||||
final FormData data = fse.getFormData();
|
||||
|
||||
if (data.get(ITEM_SEARCH) == null) {
|
||||
data.addError(
|
||||
SciOrganizationWithPublicationsGlobalizationUtil.globalize(
|
||||
"sciorganization.ui.selectPublication.no_publication_selected"));
|
||||
return;
|
||||
}
|
||||
|
||||
SciDepartmentWithPublications department =
|
||||
(SciDepartmentWithPublications) getItemSelectionModel().
|
||||
getSelectedObject(state);
|
||||
Publication publication = (Publication) data.get(ITEM_SEARCH);
|
||||
if (!(publication.getContentBundle().hasInstance(
|
||||
department.getLanguage()))) {
|
||||
data.addError(
|
||||
SciOrganizationWithPublicationsGlobalizationUtil.globalize(
|
||||
"sciorganization.ui.selectPublication.no_suitable_language_variant"));
|
||||
return;
|
||||
}
|
||||
|
||||
publication = (Publication) publication.getContentBundle().getInstance(
|
||||
department.getLanguage());
|
||||
SciDepartmentPublicationsCollection publications = department.
|
||||
getPublications();
|
||||
publications.addFilter(String.format("id = %s", publication.getID().
|
||||
toString()));
|
||||
if (publications.size() > 0) {
|
||||
data.addError(SciOrganizationWithPublicationsGlobalizationUtil.
|
||||
globalize(
|
||||
"sciorganization.ui.selectPublication.already_added"));
|
||||
}
|
||||
|
||||
publications.close();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ import com.arsdigita.bebop.event.FormSectionEvent;
|
|||
import com.arsdigita.cms.ContentType;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.contenttypes.Publication;
|
||||
import com.arsdigita.cms.contenttypes.SciOrganizationPublicationsCollection;
|
||||
import com.arsdigita.cms.contenttypes.SciOrganizationWithPublications;
|
||||
import com.arsdigita.cms.ui.ItemSearchWidget;
|
||||
import com.arsdigita.cms.ui.authoring.BasicItemForm;
|
||||
|
|
@ -74,9 +75,51 @@ public class SciOrganizationPublicationsAddForm
|
|||
getSelectedObject(state);
|
||||
|
||||
if (this.getSaveCancelSection().getSaveButton().isSelected(state)) {
|
||||
organization.addPublication((Publication) data.get(ITEM_SEARCH));
|
||||
Publication publication = (Publication) data.get(ITEM_SEARCH);
|
||||
publication = (Publication) publication.getContentBundle().
|
||||
getInstance(organization.getLanguage());
|
||||
organization.addPublication(publication);
|
||||
}
|
||||
|
||||
init(fse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate(final FormSectionEvent fse) throws FormProcessException {
|
||||
final PageState state = fse.getPageState();
|
||||
final FormData data = fse.getFormData();
|
||||
|
||||
if (data.get(ITEM_SEARCH) == null) {
|
||||
data.addError(
|
||||
SciOrganizationWithPublicationsGlobalizationUtil.globalize(
|
||||
"sciorganization.ui.selectPublication.no_publication_selected"));
|
||||
return;
|
||||
}
|
||||
|
||||
SciOrganizationWithPublications organization =
|
||||
(SciOrganizationWithPublications) getItemSelectionModel().
|
||||
getSelectedObject(state);
|
||||
Publication publication = (Publication) data.get(ITEM_SEARCH);
|
||||
if (!(publication.getContentBundle().hasInstance(
|
||||
organization.getLanguage()))) {
|
||||
data.addError(
|
||||
SciOrganizationWithPublicationsGlobalizationUtil.globalize(
|
||||
"sciorganization.ui.selectPublication.no_suitable_language_variant"));
|
||||
return;
|
||||
}
|
||||
|
||||
publication = (Publication) publication.getContentBundle().getInstance(
|
||||
organization.getLanguage());
|
||||
SciOrganizationPublicationsCollection publications = organization.
|
||||
getPublications();
|
||||
publications.addFilter(String.format("id = %s", publication.getID().
|
||||
toString()));
|
||||
if (publications.size() > 0) {
|
||||
data.addError(SciOrganizationWithPublicationsGlobalizationUtil.
|
||||
globalize(
|
||||
"sciorganization.ui.selectPublication.already_added"));
|
||||
}
|
||||
|
||||
publications.close();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ import com.arsdigita.bebop.event.FormSectionEvent;
|
|||
import com.arsdigita.cms.ContentType;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
import com.arsdigita.cms.contenttypes.Publication;
|
||||
import com.arsdigita.cms.contenttypes.SciProjectPublicationsCollection;
|
||||
import com.arsdigita.cms.contenttypes.SciProjectWithPublications;
|
||||
import com.arsdigita.cms.ui.ItemSearchWidget;
|
||||
import com.arsdigita.cms.ui.authoring.BasicItemForm;
|
||||
|
|
@ -74,9 +75,51 @@ public class SciProjectPublicationsAddForm
|
|||
getSelectedObject(state);
|
||||
|
||||
if (this.getSaveCancelSection().getSaveButton().isSelected(state)) {
|
||||
project.addPublication((Publication) data.get(ITEM_SEARCH));
|
||||
Publication publication = (Publication) data.get(ITEM_SEARCH);
|
||||
publication = (Publication) publication.getContentBundle().
|
||||
getInstance(project.getLanguage());
|
||||
project.addPublication(publication);
|
||||
}
|
||||
|
||||
init(fse);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate(final FormSectionEvent fse) throws FormProcessException {
|
||||
final PageState state = fse.getPageState();
|
||||
final FormData data = fse.getFormData();
|
||||
|
||||
if (data.get(ITEM_SEARCH) == null) {
|
||||
data.addError(
|
||||
SciOrganizationWithPublicationsGlobalizationUtil.globalize(
|
||||
"sciproject.ui.selectPublication.no_publication_selected"));
|
||||
return;
|
||||
}
|
||||
|
||||
SciProjectWithPublications project =
|
||||
(SciProjectWithPublications) getItemSelectionModel().
|
||||
getSelectedObject(state);
|
||||
Publication publication = (Publication) data.get(ITEM_SEARCH);
|
||||
if (!(publication.getContentBundle().hasInstance(
|
||||
project.getLanguage()))) {
|
||||
data.addError(
|
||||
SciOrganizationWithPublicationsGlobalizationUtil.globalize(
|
||||
"sciproject.ui.selectPublication.no_suitable_language_variant"));
|
||||
return;
|
||||
}
|
||||
|
||||
publication = (Publication) publication.getContentBundle().getInstance(
|
||||
project.getLanguage());
|
||||
SciProjectPublicationsCollection publications =
|
||||
project.getPublications();
|
||||
publications.addFilter(String.format("id = %s", publication.getID().
|
||||
toString()));
|
||||
if (publications.size() > 0) {
|
||||
data.addError(SciOrganizationWithPublicationsGlobalizationUtil.
|
||||
globalize(
|
||||
"sciproject.ui.selectPublication.already_added"));
|
||||
}
|
||||
|
||||
publications.close();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue