CCM NG/ccm-cms: Some bugfixes
git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@4985 8810af33-2d31-482b-a856-94f89814c4dfccm-docs
parent
ff57430035
commit
15ff6e8f86
|
|
@ -149,6 +149,7 @@ public class WizardSelector extends AuthoringKitSelector
|
||||||
/**
|
/**
|
||||||
* Reset the state of the current wizard
|
* Reset the state of the current wizard
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void reset(final PageState state) {
|
public void reset(final PageState state) {
|
||||||
final Resettable resettable = (Resettable) getCurrentWizard(state);
|
final Resettable resettable = (Resettable) getCurrentWizard(state);
|
||||||
if (resettable != null) {
|
if (resettable != null) {
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,7 @@ import com.arsdigita.bebop.table.TableCellRenderer;
|
||||||
import com.arsdigita.bebop.table.TableColumn;
|
import com.arsdigita.bebop.table.TableColumn;
|
||||||
import com.arsdigita.bebop.table.TableColumnModel;
|
import com.arsdigita.bebop.table.TableColumnModel;
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
|
import com.arsdigita.cms.ui.GlobalNavigation;
|
||||||
import com.arsdigita.cms.ui.authoring.assets.AttachmentListSelectionModel;
|
import com.arsdigita.cms.ui.authoring.assets.AttachmentListSelectionModel;
|
||||||
import com.arsdigita.cms.ui.authoring.assets.AttachmentSelectionModel;
|
import com.arsdigita.cms.ui.authoring.assets.AttachmentSelectionModel;
|
||||||
import com.arsdigita.globalization.GlobalizedMessage;
|
import com.arsdigita.globalization.GlobalizedMessage;
|
||||||
|
|
@ -108,6 +109,10 @@ class AttachmentsTable extends Table {
|
||||||
.getColumn(COL_REMOVE)
|
.getColumn(COL_REMOVE)
|
||||||
.setCellRenderer(new ControlLinkCellRenderer());
|
.setCellRenderer(new ControlLinkCellRenderer());
|
||||||
|
|
||||||
|
setEmptyView(new Label(new GlobalizedMessage(
|
||||||
|
"cms.ui.authoring.assets.related_info_step.attachment.none",
|
||||||
|
CmsConstants.CMS_BUNDLE)));
|
||||||
|
|
||||||
super
|
super
|
||||||
.addTableActionListener(new TableActionListener() {
|
.addTableActionListener(new TableActionListener() {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ package com.arsdigita.cms.ui.authoring.assets.relatedinfo;
|
||||||
|
|
||||||
import com.arsdigita.bebop.Form;
|
import com.arsdigita.bebop.Form;
|
||||||
import com.arsdigita.bebop.FormProcessException;
|
import com.arsdigita.bebop.FormProcessException;
|
||||||
|
import com.arsdigita.bebop.Page;
|
||||||
import com.arsdigita.bebop.PageState;
|
import com.arsdigita.bebop.PageState;
|
||||||
import com.arsdigita.bebop.SaveCancelSection;
|
import com.arsdigita.bebop.SaveCancelSection;
|
||||||
import com.arsdigita.bebop.event.FormInitListener;
|
import com.arsdigita.bebop.event.FormInitListener;
|
||||||
|
|
@ -79,9 +80,20 @@ class RelatedInfoAttachAssetForm
|
||||||
super.addSubmissionListener(this);
|
super.addSubmissionListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void register(final Page page) {
|
||||||
|
super.register(page);
|
||||||
|
|
||||||
|
page.addComponentStateParam(this, itemSelectionModel.getStateParameter());
|
||||||
|
page.addComponentStateParam(this, listSelectionModel.getStateParameter());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init(final FormSectionEvent event) throws FormProcessException {
|
public void init(final FormSectionEvent event) throws FormProcessException {
|
||||||
// Nothing yet
|
if (listSelectionModel.getSelectedKey(event.getPageState()) == null) {
|
||||||
|
throw new UnexpectedErrorException("The selected list null. "
|
||||||
|
+ "This should not happen.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -90,6 +102,11 @@ class RelatedInfoAttachAssetForm
|
||||||
|
|
||||||
final PageState state = event.getPageState();
|
final PageState state = event.getPageState();
|
||||||
|
|
||||||
|
if (listSelectionModel.getSelectedKey(state) == null) {
|
||||||
|
throw new UnexpectedErrorException("The selected list null. "
|
||||||
|
+ "This should not happen.");
|
||||||
|
}
|
||||||
|
|
||||||
final Object value = searchWidget.getValue(state);
|
final Object value = searchWidget.getValue(state);
|
||||||
if (value != null) {
|
if (value != null) {
|
||||||
final CdiUtil cdiUtil = CdiUtil.createCdiUtil();
|
final CdiUtil cdiUtil = CdiUtil.createCdiUtil();
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,6 @@ import com.arsdigita.bebop.form.TextArea;
|
||||||
import com.arsdigita.bebop.form.TextField;
|
import com.arsdigita.bebop.form.TextField;
|
||||||
import com.arsdigita.bebop.parameters.GlobalizedParameterListener;
|
import com.arsdigita.bebop.parameters.GlobalizedParameterListener;
|
||||||
import com.arsdigita.bebop.parameters.ParameterData;
|
import com.arsdigita.bebop.parameters.ParameterData;
|
||||||
import com.arsdigita.bebop.parameters.StringIsLettersOrDigitsValidationListener;
|
|
||||||
import com.arsdigita.bebop.parameters.StringParameter;
|
import com.arsdigita.bebop.parameters.StringParameter;
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
import com.arsdigita.cms.ui.authoring.assets.AttachmentListSelectionModel;
|
import com.arsdigita.cms.ui.authoring.assets.AttachmentListSelectionModel;
|
||||||
|
|
@ -365,6 +364,8 @@ class RelatedInfoListForm
|
||||||
|
|
||||||
controller.saveAttachmentList(attachmentList);
|
controller.saveAttachmentList(attachmentList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
relatedInfoStep.showAttachmentListTable(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -122,6 +122,10 @@ class RelatedInfoListTable extends Table {
|
||||||
.getColumn(COL_DELETE)
|
.getColumn(COL_DELETE)
|
||||||
.setCellRenderer(new ControlLinkCellRenderer());
|
.setCellRenderer(new ControlLinkCellRenderer());
|
||||||
|
|
||||||
|
super.setEmptyView(new Label(new GlobalizedMessage(
|
||||||
|
"cms.ui.authoring.assets.related_info_step.list.none",
|
||||||
|
CmsConstants.CMS_BUNDLE)));
|
||||||
|
|
||||||
super
|
super
|
||||||
.addTableActionListener(new TableActionListener() {
|
.addTableActionListener(new TableActionListener() {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ package com.arsdigita.cms.ui.authoring.assets.relatedinfo;
|
||||||
|
|
||||||
import com.arsdigita.bebop.Label;
|
import com.arsdigita.bebop.Label;
|
||||||
import com.arsdigita.bebop.PageState;
|
import com.arsdigita.bebop.PageState;
|
||||||
|
import com.arsdigita.bebop.Text;
|
||||||
import com.arsdigita.bebop.table.TableModel;
|
import com.arsdigita.bebop.table.TableModel;
|
||||||
import com.arsdigita.cms.ui.authoring.assets.AttachmentListSelectionModel;
|
import com.arsdigita.cms.ui.authoring.assets.AttachmentListSelectionModel;
|
||||||
import com.arsdigita.globalization.GlobalizedMessage;
|
import com.arsdigita.globalization.GlobalizedMessage;
|
||||||
|
|
@ -71,14 +72,15 @@ class RelatedInfoListTableModel implements TableModel {
|
||||||
|
|
||||||
switch (columnIndex) {
|
switch (columnIndex) {
|
||||||
case RelatedInfoListTable.COL_NAME:
|
case RelatedInfoListTable.COL_NAME:
|
||||||
return currentRow.getName();
|
return new Text(currentRow.getName());
|
||||||
case RelatedInfoListTable.COL_TITLE:
|
case RelatedInfoListTable.COL_TITLE:
|
||||||
return currentRow.getTitle();
|
return new Text(currentRow.getTitle());
|
||||||
case RelatedInfoListTable.COL_DESC:
|
case RelatedInfoListTable.COL_DESC:
|
||||||
return currentRow.getDescription();
|
return new Text(currentRow.getDescription());
|
||||||
case RelatedInfoListTable.COL_EDIT:
|
case RelatedInfoListTable.COL_EDIT:
|
||||||
return new Label(new GlobalizedMessage(
|
return new Label(new GlobalizedMessage(
|
||||||
"cms.ui.authoring.assets.related_info_step.list.edit"));
|
"cms.ui.authoring.assets.related_info_step.list.edit",
|
||||||
|
CmsConstants.CMS_BUNDLE));
|
||||||
case RelatedInfoListTable.COL_MOVE:
|
case RelatedInfoListTable.COL_MOVE:
|
||||||
if (moveListModel.getSelectedAttachmentList(state) == null) {
|
if (moveListModel.getSelectedAttachmentList(state) == null) {
|
||||||
return new Label(new GlobalizedMessage(
|
return new Label(new GlobalizedMessage(
|
||||||
|
|
@ -91,7 +93,8 @@ class RelatedInfoListTableModel implements TableModel {
|
||||||
}
|
}
|
||||||
case RelatedInfoListTable.COL_DELETE:
|
case RelatedInfoListTable.COL_DELETE:
|
||||||
return new Label(new GlobalizedMessage(
|
return new Label(new GlobalizedMessage(
|
||||||
"cms.ui.authoring.assets.related_info_step.list.delete"));
|
"cms.ui.authoring.assets.related_info_step.list.delete",
|
||||||
|
CmsConstants.CMS_BUNDLE));
|
||||||
default:
|
default:
|
||||||
throw new IllegalArgumentException(String.format(
|
throw new IllegalArgumentException(String.format(
|
||||||
"Illegal column index %d.", columnIndex));
|
"Illegal column index %d.", columnIndex));
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@
|
||||||
package com.arsdigita.cms.ui.authoring.assets.relatedinfo;
|
package com.arsdigita.cms.ui.authoring.assets.relatedinfo;
|
||||||
|
|
||||||
import com.arsdigita.bebop.ActionLink;
|
import com.arsdigita.bebop.ActionLink;
|
||||||
|
import com.arsdigita.bebop.BoxPanel;
|
||||||
import com.arsdigita.bebop.Label;
|
import com.arsdigita.bebop.Label;
|
||||||
import com.arsdigita.bebop.Page;
|
import com.arsdigita.bebop.Page;
|
||||||
import com.arsdigita.bebop.PageState;
|
import com.arsdigita.bebop.PageState;
|
||||||
|
|
@ -91,9 +92,6 @@ public class RelatedInfoStep extends ResettableContainer {
|
||||||
selectedListModel,
|
selectedListModel,
|
||||||
selectedLanguageParam);
|
selectedLanguageParam);
|
||||||
|
|
||||||
super.add(listTable);
|
|
||||||
super.add(listForm);
|
|
||||||
|
|
||||||
addListLink = new ActionLink(new Label(new GlobalizedMessage(
|
addListLink = new ActionLink(new Label(new GlobalizedMessage(
|
||||||
"cms.ui.authoring.assets.related_info_step.add_list",
|
"cms.ui.authoring.assets.related_info_step.add_list",
|
||||||
CmsConstants.CMS_BUNDLE)));
|
CmsConstants.CMS_BUNDLE)));
|
||||||
|
|
@ -160,8 +158,7 @@ public class RelatedInfoStep extends ResettableContainer {
|
||||||
CmsConstants.CMS_BUNDLE));
|
CmsConstants.CMS_BUNDLE));
|
||||||
attachmentToFirstLink.addActionListener(event -> {
|
attachmentToFirstLink.addActionListener(event -> {
|
||||||
final PageState state = event.getPageState();
|
final PageState state = event.getPageState();
|
||||||
final ItemAttachment<?>
|
final ItemAttachment<?> toMove = moveAttachmentModel
|
||||||
toMove = moveAttachmentModel
|
|
||||||
.getSelectedAttachment(state);
|
.getSelectedAttachment(state);
|
||||||
|
|
||||||
final RelatedInfoStepController controller = CdiUtil
|
final RelatedInfoStepController controller = CdiUtil
|
||||||
|
|
@ -186,6 +183,20 @@ public class RelatedInfoStep extends ResettableContainer {
|
||||||
attachmentToFirstLink.setVisible(state, true);
|
attachmentToFirstLink.setVisible(state, true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
final BoxPanel panel = new BoxPanel(BoxPanel.VERTICAL);
|
||||||
|
|
||||||
|
panel.add(addListLink);
|
||||||
|
panel.add(listToFirstLink);
|
||||||
|
panel.add(listTable);
|
||||||
|
panel.add(listForm);
|
||||||
|
|
||||||
|
panel.add(attachAssetLink);
|
||||||
|
panel.add(attachmentToFirstLink);
|
||||||
|
panel.add(attachmentsTable);
|
||||||
|
panel.add(attachAssetForm);
|
||||||
|
|
||||||
|
super.add(panel);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,6 @@ package com.arsdigita.cms.ui.authoring.assets.relatedinfo;
|
||||||
|
|
||||||
import com.arsdigita.kernel.KernelConfig;
|
import com.arsdigita.kernel.KernelConfig;
|
||||||
|
|
||||||
import org.apache.commons.fileupload.MultipartStream;
|
|
||||||
import org.libreccm.configuration.ConfigurationManager;
|
import org.libreccm.configuration.ConfigurationManager;
|
||||||
import org.librecms.assets.RelatedLink;
|
import org.librecms.assets.RelatedLink;
|
||||||
import org.librecms.contentsection.AttachmentList;
|
import org.librecms.contentsection.AttachmentList;
|
||||||
|
|
@ -297,7 +296,6 @@ class RelatedInfoStepController {
|
||||||
final Locale selectedLocale = new Locale(selectedLanguage);
|
final Locale selectedLocale = new Locale(selectedLanguage);
|
||||||
link.getTitle().addValue(selectedLocale, title);
|
link.getTitle().addValue(selectedLocale, title);
|
||||||
|
|
||||||
|
|
||||||
itemAttachmentManager.attachAsset(link, attachmentList);
|
itemAttachmentManager.attachAsset(link, attachmentList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -319,15 +317,15 @@ class RelatedInfoStepController {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (attachmentList.getDescription().hasValue(selectedLocale)) {
|
if (attachmentList.getDescription().hasValue(selectedLocale)) {
|
||||||
row.setTitle(shortenDescription(attachmentList
|
row.setDescription(shortenDescription(attachmentList
|
||||||
.getDescription()
|
.getDescription()
|
||||||
.getValue(selectedLocale)));
|
.getValue(selectedLocale)));
|
||||||
} else if (attachmentList.getDescription().hasValue(defaultLocale)) {
|
} else if (attachmentList.getDescription().hasValue(defaultLocale)) {
|
||||||
row.setTitle(shortenDescription(attachmentList
|
row.setDescription(shortenDescription(attachmentList
|
||||||
.getDescription()
|
.getDescription()
|
||||||
.getValue(defaultLocale)));
|
.getValue(defaultLocale)));
|
||||||
} else {
|
} else {
|
||||||
row.setTitle(shortenDescription(attachmentList
|
row.setDescription(shortenDescription(attachmentList
|
||||||
.getDescription()
|
.getDescription()
|
||||||
.getValue()));
|
.getValue()));
|
||||||
}
|
}
|
||||||
|
|
@ -366,7 +364,9 @@ class RelatedInfoStepController {
|
||||||
|
|
||||||
private String shortenDescription(final String description) {
|
private String shortenDescription(final String description) {
|
||||||
|
|
||||||
if (description.trim().length() < 140) {
|
if (description == null) {
|
||||||
|
return "";
|
||||||
|
} else if (description.trim().length() < 140) {
|
||||||
return description.trim();
|
return description.trim();
|
||||||
} else {
|
} else {
|
||||||
final String tmp = description.trim().substring(0, 140);
|
final String tmp = description.trim().substring(0, 140);
|
||||||
|
|
|
||||||
|
|
@ -420,3 +420,22 @@ cms.ui.assetlist.add_locale=Add data for language
|
||||||
cms.ui.assetlist.name=Name
|
cms.ui.assetlist.name=Name
|
||||||
cms.ui.assetlist.title=Title
|
cms.ui.assetlist.title=Title
|
||||||
cms.ui.assetlist.description=Description
|
cms.ui.assetlist.description=Description
|
||||||
|
cms.ui.authoring.assets.related_info_step.add_list=Add list
|
||||||
|
cms.ui.authoring.assets.related_info_step.attachment_list.move_to_beginning=Move to first position
|
||||||
|
cms.ui.authoring.assets.related_info_step.attach_asset=Add related information
|
||||||
|
cms.ui.authoring.assets.related_info_step.attachment.move_to_first=Move to first position
|
||||||
|
cms.ui.authoring.assets.related_info_step.list.name=Name of list
|
||||||
|
cms.ui.authoring.assets.related_info_step.list.title=Title of list
|
||||||
|
cms.ui.authoring.assets.related_info_step.list.description=Description
|
||||||
|
cms.ui.authoring.assets.related_info_step.list.edit=Edit
|
||||||
|
cms.ui.authoring.assets.related_info_step.list.move=Move
|
||||||
|
cms.ui.authoring.assets.related_info_step.list.delete=Delete
|
||||||
|
cms.ui.authoring.assets.related_info_step.attachment.title=Attachment title
|
||||||
|
cms.ui.authoring.assets.related_info_step.attachment.type=Type
|
||||||
|
cms.ui.authoring.assets.related_info_step.attachment.move=Move
|
||||||
|
cms.ui.authoring.assets.related_info_step.attachment.remove=Remove
|
||||||
|
cms.ui.authoring.assets.related_info_step.attachment.none=No related information in this list yet
|
||||||
|
cms.ui.authoring.assets.related_info_step.attachment.move_here=Move here
|
||||||
|
cms.ui.authoring.assets.related_info_step.list.move_here=Move here
|
||||||
|
cms.ui.authoring.assets.related_info_step.list.none=No related informations yet
|
||||||
|
cms.ui.authoring.assets.related_info_step.list.edit\ \t=Edit
|
||||||
|
|
|
||||||
|
|
@ -417,3 +417,22 @@ cms.ui.assetlist.add_locale=Daten f\u00fcr folgende Sprache hinzuf\u00fcgen
|
||||||
cms.ui.assetlist.name=Name
|
cms.ui.assetlist.name=Name
|
||||||
cms.ui.assetlist.title=Titel
|
cms.ui.assetlist.title=Titel
|
||||||
cms.ui.assetlist.description=Beschreibung
|
cms.ui.assetlist.description=Beschreibung
|
||||||
|
cms.ui.authoring.assets.related_info_step.add_list=Liste hinzuf\u00fcgen
|
||||||
|
cms.ui.authoring.assets.related_info_step.attachment_list.move_to_beginning=An die erste Position verschieben
|
||||||
|
cms.ui.authoring.assets.related_info_step.attach_asset=Weiterf\u00fchrende Informationen hinzuf\u00fcgen
|
||||||
|
cms.ui.authoring.assets.related_info_step.attachment.move_to_first=An die erste Position verschieben
|
||||||
|
cms.ui.authoring.assets.related_info_step.list.name=Name der Liste
|
||||||
|
cms.ui.authoring.assets.related_info_step.list.title=Titel der Liste
|
||||||
|
cms.ui.authoring.assets.related_info_step.list.description=Beschreibung
|
||||||
|
cms.ui.authoring.assets.related_info_step.list.edit=Bearbeiten
|
||||||
|
cms.ui.authoring.assets.related_info_step.list.move=Verschieben
|
||||||
|
cms.ui.authoring.assets.related_info_step.list.delete=L\u00f6schen
|
||||||
|
cms.ui.authoring.assets.related_info_step.attachment.title=Titel
|
||||||
|
cms.ui.authoring.assets.related_info_step.attachment.type=Typ
|
||||||
|
cms.ui.authoring.assets.related_info_step.attachment.move=Verschieben
|
||||||
|
cms.ui.authoring.assets.related_info_step.attachment.remove=Entfernen
|
||||||
|
cms.ui.authoring.assets.related_info_step.attachment.none=Diese Liste enth\u00e4lt noch keine weiterf\u00fchrenden Informationen
|
||||||
|
cms.ui.authoring.assets.related_info_step.attachment.move_here=Hierher verschieben
|
||||||
|
cms.ui.authoring.assets.related_info_step.list.move_here=Hierher verschieben
|
||||||
|
cms.ui.authoring.assets.related_info_step.list.none=Es wurden noch keine weiterf\u00fchrenden Informationen hinzugef\u00fcgt
|
||||||
|
cms.ui.authoring.assets.related_info_step.list.edit\ \t=Bearbeiten
|
||||||
|
|
|
||||||
|
|
@ -376,3 +376,22 @@ cms.ui.assetlist.add_locale=Add data for language
|
||||||
cms.ui.assetlist.name=Name
|
cms.ui.assetlist.name=Name
|
||||||
cms.ui.assetlist.title=Title
|
cms.ui.assetlist.title=Title
|
||||||
cms.ui.assetlist.description=Description
|
cms.ui.assetlist.description=Description
|
||||||
|
cms.ui.authoring.assets.related_info_step.add_list=Add list
|
||||||
|
cms.ui.authoring.assets.related_info_step.attachment_list.move_to_beginning=Move to first position
|
||||||
|
cms.ui.authoring.assets.related_info_step.attach_asset=Add related information
|
||||||
|
cms.ui.authoring.assets.related_info_step.attachment.move_to_first=Move to first position
|
||||||
|
cms.ui.authoring.assets.related_info_step.list.name=Name of list
|
||||||
|
cms.ui.authoring.assets.related_info_step.list.title=Title of list
|
||||||
|
cms.ui.authoring.assets.related_info_step.list.description=Description
|
||||||
|
cms.ui.authoring.assets.related_info_step.list.edit=Edit
|
||||||
|
cms.ui.authoring.assets.related_info_step.list.move=Move
|
||||||
|
cms.ui.authoring.assets.related_info_step.list.delete=Delete
|
||||||
|
cms.ui.authoring.assets.related_info_step.attachment.title=Attachment title
|
||||||
|
cms.ui.authoring.assets.related_info_step.attachment.type=Type
|
||||||
|
cms.ui.authoring.assets.related_info_step.attachment.move=Move
|
||||||
|
cms.ui.authoring.assets.related_info_step.attachment.remove=Remove
|
||||||
|
cms.ui.authoring.assets.related_info_step.attachment.none=No related information in this list yet
|
||||||
|
cms.ui.authoring.assets.related_info_step.attachment.move_here=Move here
|
||||||
|
cms.ui.authoring.assets.related_info_step.list.move_here=Move here
|
||||||
|
cms.ui.authoring.assets.related_info_step.list.none=No related informations yet
|
||||||
|
cms.ui.authoring.assets.related_info_step.list.edit\ \t=Edit
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue