CCM NG/ccm-cms: RelatedInfoStep bug fixes
git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@4991 8810af33-2d31-482b-a856-94f89814c4df
parent
a4b413c02f
commit
f1e899f8a5
|
|
@ -31,7 +31,6 @@ 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;
|
||||||
|
|
@ -89,11 +88,13 @@ class AttachmentsTable extends Table {
|
||||||
columnModel.add(new TableColumn(
|
columnModel.add(new TableColumn(
|
||||||
COL_MOVE,
|
COL_MOVE,
|
||||||
new Label(new GlobalizedMessage(
|
new Label(new GlobalizedMessage(
|
||||||
"cms.ui.authoring.assets.related_info_step.attachment.move"))));
|
"cms.ui.authoring.assets.related_info_step.attachment.move",
|
||||||
|
CmsConstants.CMS_BUNDLE))));
|
||||||
columnModel.add(new TableColumn(
|
columnModel.add(new TableColumn(
|
||||||
COL_REMOVE,
|
COL_REMOVE,
|
||||||
new Label(new GlobalizedMessage(
|
new Label(new GlobalizedMessage(
|
||||||
"cms.ui.authoring.assets.related_info_step.attachment.remove"))));
|
"cms.ui.authoring.assets.related_info_step.attachment.remove",
|
||||||
|
CmsConstants.CMS_BUNDLE))));
|
||||||
|
|
||||||
super
|
super
|
||||||
.setModelBuilder(new AttachmentsTableModelBuilder(
|
.setModelBuilder(new AttachmentsTableModelBuilder(
|
||||||
|
|
|
||||||
|
|
@ -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.Label;
|
||||||
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;
|
||||||
|
|
@ -31,8 +32,10 @@ import com.arsdigita.bebop.parameters.StringParameter;
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
import com.arsdigita.cms.ui.assets.ItemSearchWidget;
|
import com.arsdigita.cms.ui.assets.ItemSearchWidget;
|
||||||
import com.arsdigita.cms.ui.authoring.assets.AttachmentListSelectionModel;
|
import com.arsdigita.cms.ui.authoring.assets.AttachmentListSelectionModel;
|
||||||
|
import com.arsdigita.globalization.GlobalizedMessage;
|
||||||
|
|
||||||
import org.libreccm.cdi.utils.CdiUtil;
|
import org.libreccm.cdi.utils.CdiUtil;
|
||||||
|
import org.librecms.CmsConstants;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
@ -67,10 +70,24 @@ public class InternalLinkAddForm
|
||||||
this.listSelectionModel = listSelectionModel;
|
this.listSelectionModel = listSelectionModel;
|
||||||
this.selectedLanguageParam = selectedLanguageParam;
|
this.selectedLanguageParam = selectedLanguageParam;
|
||||||
|
|
||||||
|
final Label titleLabel = new Label(new GlobalizedMessage(
|
||||||
|
"cms.ui.authoring.assets.related_info_step.internal_link.title",
|
||||||
|
CmsConstants.CMS_BUNDLE));
|
||||||
titleField = new TextField("link-title");
|
titleField = new TextField("link-title");
|
||||||
|
|
||||||
// descriptionArea = new TextArea("link-description");
|
// descriptionArea = new TextArea("link-description");
|
||||||
|
final Label itemSearchLabel = new Label(new GlobalizedMessage(
|
||||||
|
"cms.ui.authoring.assets.related_info_step.internal_link.target_item",
|
||||||
|
CmsConstants.CMS_BUNDLE));
|
||||||
itemSearchWidget = new ItemSearchWidget("link-item-search");
|
itemSearchWidget = new ItemSearchWidget("link-item-search");
|
||||||
|
|
||||||
saveCancelSection = new SaveCancelSection();
|
saveCancelSection = new SaveCancelSection();
|
||||||
|
|
||||||
|
super.add(titleLabel);
|
||||||
|
super.add(titleField);
|
||||||
|
super.add(itemSearchLabel);
|
||||||
|
super.add(itemSearchWidget);
|
||||||
|
super.add(saveCancelSection);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -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.Label;
|
||||||
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;
|
||||||
|
|
@ -30,13 +31,12 @@ import com.arsdigita.bebop.parameters.StringParameter;
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
import com.arsdigita.cms.ui.assets.AssetSearchWidget;
|
import com.arsdigita.cms.ui.assets.AssetSearchWidget;
|
||||||
import com.arsdigita.cms.ui.authoring.assets.AttachmentListSelectionModel;
|
import com.arsdigita.cms.ui.authoring.assets.AttachmentListSelectionModel;
|
||||||
|
import com.arsdigita.globalization.GlobalizedMessage;
|
||||||
|
|
||||||
import org.libreccm.cdi.utils.CdiUtil;
|
import org.libreccm.cdi.utils.CdiUtil;
|
||||||
import org.libreccm.core.UnexpectedErrorException;
|
import org.libreccm.core.UnexpectedErrorException;
|
||||||
import org.librecms.contentsection.Asset;
|
import org.librecms.CmsConstants;
|
||||||
import org.librecms.contentsection.AssetRepository;
|
|
||||||
import org.librecms.contentsection.AttachmentList;
|
import org.librecms.contentsection.AttachmentList;
|
||||||
import org.librecms.contentsection.ItemAttachmentManager;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
@ -69,6 +69,10 @@ class RelatedInfoAttachAssetForm
|
||||||
this.listSelectionModel = listSelectionModel;
|
this.listSelectionModel = listSelectionModel;
|
||||||
this.selectedLanguageParameter = selectedLangugeParam;
|
this.selectedLanguageParameter = selectedLangugeParam;
|
||||||
|
|
||||||
|
final Label label = new Label(new GlobalizedMessage(
|
||||||
|
"cms.ui.authoring.assets.related_info_step.attach_asset.selected_asset",
|
||||||
|
CmsConstants.CMS_BUNDLE));
|
||||||
|
super.add(label);
|
||||||
searchWidget = new AssetSearchWidget("asset-search-widget");
|
searchWidget = new AssetSearchWidget("asset-search-widget");
|
||||||
super.add(searchWidget);
|
super.add(searchWidget);
|
||||||
saveCancelSection = new SaveCancelSection();
|
saveCancelSection = new SaveCancelSection();
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ 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;
|
||||||
|
import com.arsdigita.bebop.SimpleContainer;
|
||||||
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.AuthoringKitWizard;
|
import com.arsdigita.cms.ui.authoring.AuthoringKitWizard;
|
||||||
|
|
@ -65,7 +66,10 @@ public class RelatedInfoStep extends ResettableContainer {
|
||||||
|
|
||||||
private final AttachmentsTable attachmentsTable;
|
private final AttachmentsTable attachmentsTable;
|
||||||
private final RelatedInfoAttachAssetForm attachAssetForm;
|
private final RelatedInfoAttachAssetForm attachAssetForm;
|
||||||
|
private final InternalLinkAddForm internalLinkAddForm;
|
||||||
|
|
||||||
private final ActionLink attachAssetLink;
|
private final ActionLink attachAssetLink;
|
||||||
|
private final ActionLink internalLinkAddLink;
|
||||||
private final ActionLink attachmentToFirstLink;
|
private final ActionLink attachmentToFirstLink;
|
||||||
|
|
||||||
public RelatedInfoStep(final ItemSelectionModel itemSelectionModel,
|
public RelatedInfoStep(final ItemSelectionModel itemSelectionModel,
|
||||||
|
|
@ -145,6 +149,11 @@ public class RelatedInfoStep extends ResettableContainer {
|
||||||
itemSelectionModel,
|
itemSelectionModel,
|
||||||
selectedListModel,
|
selectedListModel,
|
||||||
selectedLanguageParam);
|
selectedLanguageParam);
|
||||||
|
internalLinkAddForm = new InternalLinkAddForm(this,
|
||||||
|
itemSelectionModel,
|
||||||
|
selectedListModel,
|
||||||
|
selectedLanguageParam);
|
||||||
|
|
||||||
|
|
||||||
attachAssetLink = new ActionLink(new GlobalizedMessage(
|
attachAssetLink = new ActionLink(new GlobalizedMessage(
|
||||||
"cms.ui.authoring.assets.related_info_step.attach_asset",
|
"cms.ui.authoring.assets.related_info_step.attach_asset",
|
||||||
|
|
@ -153,6 +162,13 @@ public class RelatedInfoStep extends ResettableContainer {
|
||||||
showAttachAssetForm(event.getPageState());
|
showAttachAssetForm(event.getPageState());
|
||||||
});
|
});
|
||||||
|
|
||||||
|
internalLinkAddLink = new ActionLink(new GlobalizedMessage(
|
||||||
|
"cms.ui.authoring.assets.related_info_step.add_internal_link",
|
||||||
|
CmsConstants.CMS_BUNDLE));
|
||||||
|
internalLinkAddLink.addActionListener(event -> {
|
||||||
|
showAddInternalLinkForm(event.getPageState());
|
||||||
|
});
|
||||||
|
|
||||||
attachmentToFirstLink = new ActionLink(new GlobalizedMessage(
|
attachmentToFirstLink = new ActionLink(new GlobalizedMessage(
|
||||||
"cms.ui.authoring.assets.related_info_step.attachment.move_to_first",
|
"cms.ui.authoring.assets.related_info_step.attachment.move_to_first",
|
||||||
CmsConstants.CMS_BUNDLE));
|
CmsConstants.CMS_BUNDLE));
|
||||||
|
|
@ -184,9 +200,13 @@ public class RelatedInfoStep extends ResettableContainer {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
final SimpleContainer addLinks = new SimpleContainer();
|
||||||
|
addLinks.add(addListLink);
|
||||||
|
addLinks.add(internalLinkAddLink);
|
||||||
|
|
||||||
final BoxPanel panel = new BoxPanel(BoxPanel.VERTICAL);
|
final BoxPanel panel = new BoxPanel(BoxPanel.VERTICAL);
|
||||||
|
|
||||||
panel.add(addListLink);
|
panel.add(addLinks);
|
||||||
panel.add(listToFirstLink);
|
panel.add(listToFirstLink);
|
||||||
panel.add(listTable);
|
panel.add(listTable);
|
||||||
panel.add(listForm);
|
panel.add(listForm);
|
||||||
|
|
@ -195,6 +215,7 @@ public class RelatedInfoStep extends ResettableContainer {
|
||||||
panel.add(attachmentToFirstLink);
|
panel.add(attachmentToFirstLink);
|
||||||
panel.add(attachmentsTable);
|
panel.add(attachmentsTable);
|
||||||
panel.add(attachAssetForm);
|
panel.add(attachAssetForm);
|
||||||
|
panel.add(internalLinkAddForm);
|
||||||
|
|
||||||
super.add(panel);
|
super.add(panel);
|
||||||
}
|
}
|
||||||
|
|
@ -211,17 +232,14 @@ public class RelatedInfoStep extends ResettableContainer {
|
||||||
page.addComponentStateParam(this,
|
page.addComponentStateParam(this,
|
||||||
moveAttachmentModel.getStateParameter());
|
moveAttachmentModel.getStateParameter());
|
||||||
|
|
||||||
// page.addGlobalStateParam(selectedListModel.getStateParameter());
|
|
||||||
// page.addGlobalStateParam(moveListModel.getStateParameter());
|
|
||||||
// page.addGlobalStateParam(selectedAttachmentModel.getStateParameter());
|
|
||||||
// page.addGlobalStateParam(moveAttachmentModel.getStateParameter());
|
|
||||||
|
|
||||||
page.setVisibleDefault(listTable, true);
|
page.setVisibleDefault(listTable, true);
|
||||||
page.setVisibleDefault(listForm, false);
|
page.setVisibleDefault(listForm, false);
|
||||||
page.setVisibleDefault(addListLink, true);
|
page.setVisibleDefault(addListLink, true);
|
||||||
page.setVisibleDefault(listToFirstLink, false);
|
page.setVisibleDefault(listToFirstLink, false);
|
||||||
page.setVisibleDefault(attachmentsTable, false);
|
page.setVisibleDefault(attachmentsTable, false);
|
||||||
page.setVisibleDefault(attachAssetForm, false);
|
page.setVisibleDefault(attachAssetForm, false);
|
||||||
|
page.setVisibleDefault(internalLinkAddForm, false);
|
||||||
|
page.setVisibleDefault(internalLinkAddLink, false);
|
||||||
page.setVisibleDefault(attachAssetLink, false);
|
page.setVisibleDefault(attachAssetLink, false);
|
||||||
page.setVisibleDefault(attachmentToFirstLink, false);
|
page.setVisibleDefault(attachmentToFirstLink, false);
|
||||||
}
|
}
|
||||||
|
|
@ -236,6 +254,8 @@ public class RelatedInfoStep extends ResettableContainer {
|
||||||
attachAssetForm.setVisible(state, false);
|
attachAssetForm.setVisible(state, false);
|
||||||
attachAssetLink.setVisible(state, false);
|
attachAssetLink.setVisible(state, false);
|
||||||
attachmentToFirstLink.setVisible(state, false);
|
attachmentToFirstLink.setVisible(state, false);
|
||||||
|
internalLinkAddForm.setVisible(state, false);
|
||||||
|
internalLinkAddLink.setVisible(state, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void showListEditForm(final PageState state) {
|
void showListEditForm(final PageState state) {
|
||||||
|
|
@ -248,6 +268,8 @@ public class RelatedInfoStep extends ResettableContainer {
|
||||||
attachAssetForm.setVisible(state, false);
|
attachAssetForm.setVisible(state, false);
|
||||||
attachAssetLink.setVisible(state, false);
|
attachAssetLink.setVisible(state, false);
|
||||||
attachmentToFirstLink.setVisible(state, false);
|
attachmentToFirstLink.setVisible(state, false);
|
||||||
|
internalLinkAddForm.setVisible(state, false);
|
||||||
|
internalLinkAddLink.setVisible(state, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void showAttachmentsTable(final PageState state) {
|
void showAttachmentsTable(final PageState state) {
|
||||||
|
|
@ -260,6 +282,8 @@ public class RelatedInfoStep extends ResettableContainer {
|
||||||
attachAssetForm.setVisible(state, false);
|
attachAssetForm.setVisible(state, false);
|
||||||
attachAssetLink.setVisible(state, true);
|
attachAssetLink.setVisible(state, true);
|
||||||
attachmentToFirstLink.setVisible(state, false);
|
attachmentToFirstLink.setVisible(state, false);
|
||||||
|
internalLinkAddForm.setVisible(state, false);
|
||||||
|
internalLinkAddLink.setVisible(state, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void showAttachAssetForm(final PageState state) {
|
void showAttachAssetForm(final PageState state) {
|
||||||
|
|
@ -271,6 +295,21 @@ public class RelatedInfoStep extends ResettableContainer {
|
||||||
attachAssetForm.setVisible(state, true);
|
attachAssetForm.setVisible(state, true);
|
||||||
attachAssetLink.setVisible(state, false);
|
attachAssetLink.setVisible(state, false);
|
||||||
attachmentToFirstLink.setVisible(state, false);
|
attachmentToFirstLink.setVisible(state, false);
|
||||||
|
internalLinkAddForm.setVisible(state, false);
|
||||||
|
internalLinkAddLink.setVisible(state, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
void showAddInternalLinkForm(final PageState state) {
|
||||||
|
listTable.setVisible(state, false);
|
||||||
|
listForm.setVisible(state, false);
|
||||||
|
addListLink.setVisible(state, false);
|
||||||
|
listToFirstLink.setVisible(state, false);
|
||||||
|
attachmentsTable.setVisible(state, false);
|
||||||
|
attachAssetForm.setVisible(state, false);
|
||||||
|
attachAssetLink.setVisible(state, false);
|
||||||
|
attachmentToFirstLink.setVisible(state, false);
|
||||||
|
internalLinkAddForm.setVisible(state, true);
|
||||||
|
internalLinkAddLink.setVisible(state, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -439,3 +439,8 @@ 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.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.none=No related informations yet
|
||||||
cms.ui.authoring.assets.related_info_step.list.edit\ \t=Edit
|
cms.ui.authoring.assets.related_info_step.list.edit\ \t=Edit
|
||||||
|
cms.ui.authoring.assets.related_info_step.attach_asset.selected_asset=Selected asset
|
||||||
|
cms.ui.authoring.assets.related_info_step.attachment.move\ \t=Move
|
||||||
|
cms.ui.authoring.assets.related_info_step.add_internal_link=Add internal link
|
||||||
|
cms.ui.authoring.assets.related_info_step.internal_link.title=Title
|
||||||
|
cms.ui.authoring.assets.related_info_step.internal_link.target_item=Target
|
||||||
|
|
|
||||||
|
|
@ -436,3 +436,8 @@ cms.ui.authoring.assets.related_info_step.attachment.move_here=Hierher verschieb
|
||||||
cms.ui.authoring.assets.related_info_step.list.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.none=Es wurden noch keine weiterf\u00fchrenden Informationen hinzugef\u00fcgt
|
||||||
cms.ui.authoring.assets.related_info_step.list.edit\ \t=Bearbeiten
|
cms.ui.authoring.assets.related_info_step.list.edit\ \t=Bearbeiten
|
||||||
|
cms.ui.authoring.assets.related_info_step.attach_asset.selected_asset=Ausgew\u00e4hltes Asset
|
||||||
|
cms.ui.authoring.assets.related_info_step.attachment.move\ \t=Verschieben
|
||||||
|
cms.ui.authoring.assets.related_info_step.add_internal_link=Internen Link hinzuf\u00fcgen
|
||||||
|
cms.ui.authoring.assets.related_info_step.internal_link.title=Titel
|
||||||
|
cms.ui.authoring.assets.related_info_step.internal_link.target_item=Ziel
|
||||||
|
|
|
||||||
|
|
@ -395,3 +395,8 @@ 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.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.none=No related informations yet
|
||||||
cms.ui.authoring.assets.related_info_step.list.edit\ \t=Edit
|
cms.ui.authoring.assets.related_info_step.list.edit\ \t=Edit
|
||||||
|
cms.ui.authoring.assets.related_info_step.attach_asset.selected_asset=Selected asset
|
||||||
|
cms.ui.authoring.assets.related_info_step.attachment.move\ \t=Move
|
||||||
|
cms.ui.authoring.assets.related_info_step.add_internal_link=Add internal link
|
||||||
|
cms.ui.authoring.assets.related_info_step.internal_link.title=Title
|
||||||
|
cms.ui.authoring.assets.related_info_step.internal_link.target_item=Target
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue