Author: pboy
Date: 2012-12-18 08:02:21 +0000 (Tue, 18 Dec 2012)
New Revision: 2419
Modified:
trunk/
trunk/ccm-cms-types-event/src/com/arsdigita/cms/contenttypes/EventResources_de.properties
trunk/ccm-cms/src/com/arsdigita/cms/CMSResources.properties
trunk/ccm-cms/src/com/arsdigita/cms/CMSResources_de.properties
trunk/ccm-cms/src/com/arsdigita/cms/CMSResources_en_GB.properties
trunk/ccm-cms/src/com/arsdigita/cms/CMSResources_fr.properties
trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPersonAddForm.java
trunk/ccm-cms/src/com/arsdigita/cms/ui/ItemSearchCreateItemPane.java
Log:
Improved ItemSearchCreatePane (ensure a folder is selected), Fixed item publishing in ItemSearchWidget (on behalf of JensP)
Property changes on: trunk
___________________________________________________________________
Modified: svn:ignore
- conf
runtime
build-projects.xml
local.**.properties
build.xml
packages
nbproject
.ant-targets-build.xml
.local.ccm.properties.swp
.tmp.project.xml
.tmp.applications.list
.tmp.applications.list.swp
.local.runtime.properties.swp
.local.build.properties.swp
+ conf
runtime
build-projects.xml
local.**.properties
build.xml
packages
nbproject
.ant-targets-build.xml
.local.ccm.properties.swp
.tmp.project.xml
.tmp.applications.list
.tmp.applications.list.swp
.local.runtime.properties.swp
.local.build.properties.swp
.README.swp
Modified: trunk/ccm-cms/src/com/arsdigita/cms/CMSResources.properties
===================================================================
--- trunk/ccm-cms/src/com/arsdigita/cms/CMSResources.properties 2012-12-18 07:59:19 UTC (rev 2418)
+++ trunk/ccm-cms/src/com/arsdigita/cms/CMSResources.properties 2012-12-18 08:02:21 UTC (rev 2419)
@@ -1110,3 +1110,4 @@
cms.ui.search.create.select_edit=Select item and edit
cms.ui.clear=Clear
+cms.ui.item_search.create.folder_missing=No folder selected
Modified: trunk/ccm-cms/src/com/arsdigita/cms/CMSResources_de.properties
===================================================================
--- trunk/ccm-cms/src/com/arsdigita/cms/CMSResources_de.properties 2012-12-18 07:59:19 UTC (rev 2418)
+++ trunk/ccm-cms/src/com/arsdigita/cms/CMSResources_de.properties 2012-12-18 08:02:21 UTC (rev 2419)
@@ -1103,3 +1103,4 @@
cms.ui.clear=Zur\u00fccksetzen
cms.ui.type.minimum_number_of_values_bigger_than_maximum_number_of_values=Maximaler Wert kleiner als minimaler Wert
cms.ui.type.minimummaximum_number_of_values_cannot_be_negative=Keine negativen Werte erlaubt
+cms.ui.item_search.create.folder_missing=kein Ordner ausgew\u00e4hlt
Modified: trunk/ccm-cms/src/com/arsdigita/cms/CMSResources_en_GB.properties
===================================================================
--- trunk/ccm-cms/src/com/arsdigita/cms/CMSResources_en_GB.properties 2012-12-18 07:59:19 UTC (rev 2418)
+++ trunk/ccm-cms/src/com/arsdigita/cms/CMSResources_en_GB.properties 2012-12-18 08:02:21 UTC (rev 2419)
@@ -49,3 +49,4 @@
cms.ui.search.create.select_edit=
cms.ui.clear=
+cms.ui.item_search.create.folder_missing=
Modified: trunk/ccm-cms/src/com/arsdigita/cms/CMSResources_fr.properties
===================================================================
--- trunk/ccm-cms/src/com/arsdigita/cms/CMSResources_fr.properties 2012-12-18 07:59:19 UTC (rev 2418)
+++ trunk/ccm-cms/src/com/arsdigita/cms/CMSResources_fr.properties 2012-12-18 08:02:21 UTC (rev 2419)
@@ -580,3 +580,4 @@
cms.ui.search.create.select_edit=
cms.ui.clear=
+cms.ui.item_search.create.folder_missing=
Modified: trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPersonAddForm.java
===================================================================
--- trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPersonAddForm.java 2012-12-18 07:59:19 UTC (rev 2418)
+++ trunk/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/GenericOrganizationalUnitPersonAddForm.java 2012-12-18 08:02:21 UTC (rev 2419)
@@ -81,7 +81,7 @@
findByAssociatedObjectType(getPersonType()));
/*m_itemSearch.getItemField().addValidationListener(
new NotNullValidationListener());*/
- m_itemSearch.setDisableCreatePane(false);
+ m_itemSearch.setDisableCreatePane(true);
add(this.m_itemSearch);
selectedPersonNameLabel = new Label("");
@@ -188,6 +188,7 @@
GenericOrganizationalUnitPersonCollection.PERSON_ROLE),
(String) data.get(
GenericOrganizationalUnitPersonCollection.STATUS));
+ m_itemSearch.publishCreatedItem(data, personToAdd);
} else {
GenericOrganizationalUnitPersonCollection persons;
Modified: trunk/ccm-cms/src/com/arsdigita/cms/ui/ItemSearchCreateItemPane.java
===================================================================
--- trunk/ccm-cms/src/com/arsdigita/cms/ui/ItemSearchCreateItemPane.java 2012-12-18 07:59:19 UTC (rev 2418)
+++ trunk/ccm-cms/src/com/arsdigita/cms/ui/ItemSearchCreateItemPane.java 2012-12-18 08:02:21 UTC (rev 2419)
@@ -21,8 +21,6 @@
import com.arsdigita.bebop.event.FormSubmissionListener;
import com.arsdigita.bebop.event.PrintEvent;
import com.arsdigita.bebop.event.PrintListener;
-import com.arsdigita.bebop.form.Option;
-import com.arsdigita.bebop.form.SingleSelect;
import com.arsdigita.bebop.parameters.BigDecimalParameter;
import com.arsdigita.bebop.parameters.StringParameter;
import com.arsdigita.cms.CMS;
@@ -32,15 +30,11 @@
import com.arsdigita.cms.ui.authoring.CreationSelector;
import com.arsdigita.cms.ui.authoring.NewItemForm;
import com.arsdigita.cms.ui.folder.FlatFolderPicker;
-import com.arsdigita.cms.ui.folder.FolderRequestLocal;
import com.arsdigita.cms.ui.folder.FolderSelectionModel;
import com.arsdigita.cms.ui.item.ContentItemRequestLocal;
import com.arsdigita.cms.util.GlobalizationUtil;
import com.arsdigita.persistence.OID;
import java.math.BigDecimal;
-import java.util.TooManyListenersException;
-import java.util.logging.Level;
-import java.util.logging.Logger;
/**
*
@@ -56,6 +50,7 @@
public static final String PUBLISHWIDGET_PARAM = "publishWidget";
private static final String CONTENT_TYPE_ID = "ct";
private static final String FOLDER_ID = "folder_id";
+ private static final String FLAT_FOLDER = "flatFolder";
private final NewItemForm m_newItem;
private final SingleSelectionModel m_typeSel;
private final FlatFolderPicker m_folderPicker;
@@ -92,7 +87,6 @@
m_typeSel = new ParameterSingleSelectionModel(new BigDecimalParameter(CONTENT_TYPE_ID));
m_creator = new CreationSelector(m_typeSel, m_folderSel) {
-
@Override
public void editItem(final PageState state, final ContentItem item) {
@@ -108,7 +102,7 @@
final BoxPanel folderRow = new BoxPanel(BoxPanel.HORIZONTAL);
folderRow.add(new Label(GlobalizationUtil.globalize("cms.ui.item_search.create.folder_select")));
- m_folderPicker = new FlatFolderPicker("flatFolder");
+ m_folderPicker = new FlatFolderPicker(FLAT_FOLDER);
folderRow.add(m_folderPicker);
m_newItem.add(folderRow);
m_newItemSeg.add(m_newItem);
@@ -124,7 +118,6 @@
m_fallBackLink = new Link(
(String) GlobalizationUtil.globalize("cms.ui.search.create.fallback").localize(),
new PrintListener() {
-
public void prepare(final PrintEvent event) {
final Link target = (Link) event.getTarget();
final PageState state = event.getPageState();
@@ -156,7 +149,7 @@
((Label) target.getChild()).setLabel((String) GlobalizationUtil.globalize(
"cms.ui.search.create.select_close").localize());
scriptAction = "self.close();\n"
- + "return false;";
+ + "return false;";
}
target.setOnClick(String.format("window.opener.document.%s.value=\"%s\";"
@@ -251,7 +244,6 @@
final BoxPanel linkPanel = new BoxPanel(BoxPanel.VERTICAL);
final Label jsLabel = new Label("", false);
jsLabel.addPrintListener(new PrintListener() {
-
public void prepare(final PrintEvent event) {
final Label target = (Label) event.getTarget();
final PageState state = event.getPageState();
@@ -323,20 +315,28 @@
public void init(final FormSectionEvent fse) throws FormProcessException {
final PageState state = fse.getPageState();
final FormData data = fse.getFormData();
- if (((data.get("flatFolder") == null) || "".equals(data.get("flatFolder")))
+ if (((data.get(FLAT_FOLDER) == null) || "".equals(data.get(FLAT_FOLDER)))
&& (defaultFolder != null)) {
- data.put("flatFolder", defaultFolder.toString());
+ data.put(FLAT_FOLDER, defaultFolder.toString());
}
}
- public void submitted(final FormSectionEvent fse) {
+ public void submitted(final FormSectionEvent fse) throws FormProcessException {
final PageState state = fse.getPageState();
final BigDecimal typeID = m_newItem.getTypeID(state);
m_typeSel.setSelectedKey(state, typeID);
- final OID folderOID = OID.valueOf((String) m_folderPicker.getValue(state));
+
+ final String folderOidStr = (String) m_folderPicker.getValue(state);
+ if ((folderOidStr == null) || folderOidStr.isEmpty()) {
+ fse.getFormData().addError(FLAT_FOLDER, GlobalizationUtil.globalize(
+ "cms.ui.item_search.create.folder_missing"));
+ throw new FormProcessException((String) GlobalizationUtil.globalize(
+ "cms.ui.item_search.create.folder_missing").localize());
+ }
+ final OID folderOID = OID.valueOf(folderOidStr);
m_folderSel.setSelectedKey(state, folderOID.get("id"));
m_newItemSeg.setVisible(state, false);
m_creationSeg.setVisible(state, true);
Modified: trunk/ccm-cms-types-event/src/com/arsdigita/cms/contenttypes/EventResources_de.properties
===================================================================
--- trunk/ccm-cms-types-event/src/com/arsdigita/cms/contenttypes/EventResources_de.properties 2012-12-18 07:59:19 UTC (rev 2418)
+++ trunk/ccm-cms-types-event/src/com/arsdigita/cms/contenttypes/EventResources_de.properties 2012-12-18 08:02:21 UTC (rev 2419)
@@ -9,7 +9,7 @@
cms.contenttypes.ui.event.lead=Zusammenfassung:
#
cms.contenttypes.ui.event.start_date=Anfangs-Datum:
-cms.contenttypes.ui.event.start_time=Begin:
+cms.contenttypes.ui.event.start_time=Beginn:
cms.contenttypes.ui.event.end_date=End-Datum:
cms.contenttypes.ui.event.end_time=Ende:
cms.contenttypes.ui.event.end_date_after_start_date=Das Anfangs-Datum ist sp\u00E4ter als das End-Datum
|