Erster Teil einer Lösung für Ticket #1838 (ItemCreatePane und nicht vorhandener Standard-Order).
git-svn-id: https://svn.libreccm.org/ccm/trunk@2458 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
8a3bb4c295
commit
5070517f5a
|
|
@ -815,10 +815,11 @@ public class Folder extends ContentItem {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves a folder of the current content section by its path. The path is given in a UNIX like synatax and must
|
* Retrieves a folder of the current content section by its path. The path is given in a UNIX
|
||||||
* be an absolute path starting with '/'. The path may be precceded with the name of content section, separated by
|
* like syntax and must be an absolute path starting with '/'. The path may be preceeded with
|
||||||
* ':'. If a content section if given, the path is relative to this content section. If the no content section is
|
* the name of content section, separated by * ':'. If a content section if given, the path is
|
||||||
* given, the current content section returned by {@code CMS.getContext().getContentSection()}. Please note that
|
* relative to this content section. If the no content section is given, the current content
|
||||||
|
* section returned by {@code CMS.getContext().getContentSection()}. Please note that
|
||||||
* {@code CMS.getContext().getContentSection()} may return null.
|
* {@code CMS.getContext().getContentSection()} may return null.
|
||||||
*
|
*
|
||||||
* Examples for valid paths:
|
* Examples for valid paths:
|
||||||
|
|
@ -830,8 +831,9 @@ public class Folder extends ContentItem {
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @param path The path of the folder to retrieve relative to the current content section.
|
* @param path The path of the folder to retrieve relative to the current content section.
|
||||||
* @return The folder with the given path from the content section. If there is no such folder, {@code null} is
|
* @return The folder with the given path from the content section. If there is no such folder,
|
||||||
* returned. It is up to the caller to check the returned value for {@code null} and take appropriate actions.
|
* {@code null} is returned. It is up to the caller to check the returned value for {@code null}
|
||||||
|
* and take appropriate actions.
|
||||||
*/
|
*/
|
||||||
public static Folder retrieveFolder(final String path) {
|
public static Folder retrieveFolder(final String path) {
|
||||||
final String[] tokens = path.split(":");
|
final String[] tokens = path.split(":");
|
||||||
|
|
|
||||||
|
|
@ -18,11 +18,16 @@
|
||||||
*/
|
*/
|
||||||
package com.arsdigita.cms.contenttypes;
|
package com.arsdigita.cms.contenttypes;
|
||||||
|
|
||||||
|
import com.arsdigita.cms.ContentSection;
|
||||||
|
import com.arsdigita.cms.Folder;
|
||||||
|
import com.arsdigita.domain.DataObjectNotFoundException;
|
||||||
import com.arsdigita.runtime.AbstractConfig;
|
import com.arsdigita.runtime.AbstractConfig;
|
||||||
import com.arsdigita.util.parameter.BooleanParameter;
|
import com.arsdigita.util.parameter.BooleanParameter;
|
||||||
import com.arsdigita.util.parameter.IntegerParameter;
|
import com.arsdigita.util.parameter.IntegerParameter;
|
||||||
import com.arsdigita.util.parameter.Parameter;
|
import com.arsdigita.util.parameter.Parameter;
|
||||||
import com.arsdigita.util.parameter.StringParameter;
|
import com.arsdigita.util.parameter.StringParameter;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
@ -31,6 +36,7 @@ import com.arsdigita.util.parameter.StringParameter;
|
||||||
*/
|
*/
|
||||||
public class PublicationsConfig extends AbstractConfig {
|
public class PublicationsConfig extends AbstractConfig {
|
||||||
|
|
||||||
|
private static final Logger LOGGER = Logger.getLogger(PublicationsConfig.class);
|
||||||
private final Parameter attachOrgaUnitsStep;
|
private final Parameter attachOrgaUnitsStep;
|
||||||
private final Parameter orgaUnitsStepSortKey;
|
private final Parameter orgaUnitsStepSortKey;
|
||||||
private final Parameter attachOrganizationPublicationsStepTo;
|
private final Parameter attachOrganizationPublicationsStepTo;
|
||||||
|
|
@ -41,7 +47,8 @@ public class PublicationsConfig extends AbstractConfig {
|
||||||
private final Parameter publicationsStepSortKey;
|
private final Parameter publicationsStepSortKey;
|
||||||
private final Parameter attachPublisherPublicationsStep;
|
private final Parameter attachPublisherPublicationsStep;
|
||||||
private final Parameter publisherPublicationsStepSortKey;
|
private final Parameter publisherPublicationsStepSortKey;
|
||||||
private final Parameter defaultAuthorsFolder;
|
private final Parameter defaultAuthorsFolderID;
|
||||||
|
private final Parameter defaultAuthorsFolderPath;
|
||||||
private final Parameter defaultSeriesFolder;
|
private final Parameter defaultSeriesFolder;
|
||||||
private final Parameter defaultPublisherFolder;
|
private final Parameter defaultPublisherFolder;
|
||||||
private final Parameter defaultCollectedVolumesFolder;
|
private final Parameter defaultCollectedVolumesFolder;
|
||||||
|
|
@ -118,8 +125,13 @@ public class PublicationsConfig extends AbstractConfig {
|
||||||
Parameter.REQUIRED,
|
Parameter.REQUIRED,
|
||||||
10);
|
10);
|
||||||
|
|
||||||
defaultAuthorsFolder = new IntegerParameter(
|
defaultAuthorsFolderID = new IntegerParameter(
|
||||||
"com.arsdigita.cms.contenttypes.publications.default_authors_folder",
|
"com.arsdigita.cms.contenttypes.publications.default_authors_folder_id",
|
||||||
|
Parameter.OPTIONAL,
|
||||||
|
null);
|
||||||
|
|
||||||
|
defaultAuthorsFolderPath = new StringParameter(
|
||||||
|
"com.arsdigita.cms.contenttypes.publications.default_authors_folder_path",
|
||||||
Parameter.OPTIONAL,
|
Parameter.OPTIONAL,
|
||||||
null);
|
null);
|
||||||
|
|
||||||
|
|
@ -202,7 +214,8 @@ public class PublicationsConfig extends AbstractConfig {
|
||||||
register(publicationsStepSortKey);
|
register(publicationsStepSortKey);
|
||||||
register(attachPublisherPublicationsStep);
|
register(attachPublisherPublicationsStep);
|
||||||
register(publisherPublicationsStepSortKey);
|
register(publisherPublicationsStepSortKey);
|
||||||
register(defaultAuthorsFolder);
|
register(defaultAuthorsFolderID);
|
||||||
|
register(defaultAuthorsFolderPath);
|
||||||
register(defaultSeriesFolder);
|
register(defaultSeriesFolder);
|
||||||
register(defaultPublisherFolder);
|
register(defaultPublisherFolder);
|
||||||
register(defaultCollectedVolumesFolder);
|
register(defaultCollectedVolumesFolder);
|
||||||
|
|
@ -261,14 +274,73 @@ public class PublicationsConfig extends AbstractConfig {
|
||||||
return (Integer) get(publisherPublicationsStepSortKey);
|
return (Integer) get(publisherPublicationsStepSortKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getDefaultAuthorsFolder() {
|
/**
|
||||||
if (get(defaultAuthorsFolder) == null) {
|
*
|
||||||
|
* @return
|
||||||
|
* @deprecated Use {@link #getDefaultAuthorsFolderPath()} or {@link #getDefaultAuthorsFolder()}
|
||||||
|
* instead.
|
||||||
|
*/
|
||||||
|
@Deprecated
|
||||||
|
public Integer getDefaultAuthorsFolderID() {
|
||||||
|
if (get(defaultAuthorsFolderID) == null) {
|
||||||
return null;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
return (Integer) get(defaultAuthorsFolder);
|
return (Integer) get(defaultAuthorsFolderID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getDefaultAuthorsFolderPath() {
|
||||||
|
if (get(defaultAuthorsFolderPath) == null) {
|
||||||
|
return null;
|
||||||
|
} else {
|
||||||
|
return (String) get(defaultAuthorsFolderPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves the default folder for storing authors created using the
|
||||||
|
* {@link ItemSearchCreateItemPane}.
|
||||||
|
*
|
||||||
|
* If both {@link #getDefaultAuthorsFolderPath()} and {@link #getDefaultAuthorsFolderID()}
|
||||||
|
* are not set, the method will return {@code null}. If {@link #getDefaultAuthorsFolderPath()}
|
||||||
|
* is set the path returned by that method is used to retrieve the folder. If there is no folder
|
||||||
|
* with this path, the method will return the root folder of the default content section.
|
||||||
|
*
|
||||||
|
* If the default authors folder path property is not set, the
|
||||||
|
* {@link #getDefaultAuthorsFolderID()} is used as a fallback. If there is no folder with the
|
||||||
|
* provided id, the root folder of the default content section is returned. Please note
|
||||||
|
* that {@link #getDefaultAuthorsFolderID()} is marked as deprecated and will be removed in
|
||||||
|
* one of the next releases. Instead the path property should be used.
|
||||||
|
*
|
||||||
|
* @return {@code null} if {@link #getDefaultAuthorsFolderPath()} and
|
||||||
|
* {@link #getDefaultAuthorsFolderID()} both are not set, otherwise a {@link Folder} object.
|
||||||
|
*/
|
||||||
|
public Folder getDefaultAuthorsFolder() {
|
||||||
|
if (getDefaultAuthorsFolderPath() != null) {
|
||||||
|
final Folder folder = Folder.retrieveFolder(getDefaultAuthorsFolderPath());
|
||||||
|
if (folder == null) {
|
||||||
|
LOGGER.warn(String.format("There is no folder with the path '%s'.",
|
||||||
|
getDefaultAuthorsFolderPath()));
|
||||||
|
return ContentSection.getDefaultSection().getRootFolder();
|
||||||
|
} else {
|
||||||
|
return folder;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (getDefaultAuthorsFolderID() != null) {
|
||||||
|
try {
|
||||||
|
return new Folder(new BigDecimal(getDefaultAuthorsFolderID()));
|
||||||
|
} catch (DataObjectNotFoundException ex) {
|
||||||
|
LOGGER.warn(String.format("Failed to retrieve folder with id %s.",
|
||||||
|
getDefaultAuthorsFolderID().toString()),
|
||||||
|
ex);
|
||||||
|
return ContentSection.getDefaultSection().getRootFolder();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
public Integer getDefaultSeriesFolder() {
|
public Integer getDefaultSeriesFolder() {
|
||||||
if (get(defaultSeriesFolder) == null) {
|
if (get(defaultSeriesFolder) == null) {
|
||||||
return null;
|
return null;
|
||||||
|
|
@ -364,5 +436,4 @@ public class PublicationsConfig extends AbstractConfig {
|
||||||
public Boolean getEnableLanguageProperty() {
|
public Boolean getEnableLanguageProperty() {
|
||||||
return (Boolean) get(enableLanguageProperty);
|
return (Boolean) get(enableLanguageProperty);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -48,10 +48,15 @@ com.arsdigita.cms.contenttypes.publications.publisher_publications_step_sort_key
|
||||||
com.arsdigita.cms.contenttypes.publications.publisher_publications_step_sort_key.example = 10
|
com.arsdigita.cms.contenttypes.publications.publisher_publications_step_sort_key.example = 10
|
||||||
com.arsdigita.cms.contenttypes.publications.publisher_publications_step_sort_key = [Integer]
|
com.arsdigita.cms.contenttypes.publications.publisher_publications_step_sort_key = [Integer]
|
||||||
|
|
||||||
com.arsdigita.cms.contenttypes.publications.default_authors_folder.title = ID of the default folder for items created using the create pane of the ItemSearchWidget
|
com.arsdigita.cms.contenttypes.publications.default_authors_folder_id.title = ID of the default folder for items created using the create pane of the ItemSearchWidget
|
||||||
com.arsdigita.cms.contenttypes.publications.default_authors_folder.purpose = Default folder for items created using the create pane of the ItemSearchWidget
|
com.arsdigita.cms.contenttypes.publications.default_authors_folder_id.purpose = Default folder for items created using the create pane of the ItemSearchWidget
|
||||||
com.arsdigita.cms.contenttypes.publications.default_authors_folder.example = 10002
|
com.arsdigita.cms.contenttypes.publications.default_authors_folder_id.example = 10002
|
||||||
com.arsdigita.cms.contenttypes.publications.default_authors_folder.format = [Integer]
|
com.arsdigita.cms.contenttypes.publications.default_authors_folder_id.format = [Integer]
|
||||||
|
|
||||||
|
com.arsdigita.cms.contenttypes.publications.default_authors_folder_path.title = Default authors folder
|
||||||
|
com.arsdigita.cms.contenttypes.publications.default_authors_folder_path.purpose = Path of the default folder for person items created using the create pane of the ItemSearchWidget when assigning authors or editors. The path *must* include the content section.
|
||||||
|
com.arsdigita.cms.contenttypes.publications.default_authors_folder_path.example = main:/path/to/authors/folder
|
||||||
|
com.arsdigita.cms.contenttypes.publications.default_authors_folder_path.format = [String]
|
||||||
|
|
||||||
com.arsdigita.cms.contenttypes.publications.default_series_folder.title = ID of the default folder for items created using the create pane of the ItemSearchWidget
|
com.arsdigita.cms.contenttypes.publications.default_series_folder.title = ID of the default folder for items created using the create pane of the ItemSearchWidget
|
||||||
com.arsdigita.cms.contenttypes.publications.default_series_folder.purpose = Default folder for items created using the create pane of the ItemSearchWidget
|
com.arsdigita.cms.contenttypes.publications.default_series_folder.purpose = Default folder for items created using the create pane of the ItemSearchWidget
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,6 @@ import com.arsdigita.bebop.event.FormSubmissionListener;
|
||||||
import com.arsdigita.bebop.form.CheckboxGroup;
|
import com.arsdigita.bebop.form.CheckboxGroup;
|
||||||
import com.arsdigita.bebop.form.Option;
|
import com.arsdigita.bebop.form.Option;
|
||||||
import com.arsdigita.cms.ContentType;
|
import com.arsdigita.cms.ContentType;
|
||||||
import com.arsdigita.cms.Folder;
|
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
import com.arsdigita.cms.contenttypes.AuthorshipCollection;
|
import com.arsdigita.cms.contenttypes.AuthorshipCollection;
|
||||||
import com.arsdigita.cms.contenttypes.GenericPerson;
|
import com.arsdigita.cms.contenttypes.GenericPerson;
|
||||||
|
|
@ -38,7 +37,6 @@ import com.arsdigita.cms.contenttypes.PublicationsConfig;
|
||||||
import com.arsdigita.cms.ui.ItemSearchWidget;
|
import com.arsdigita.cms.ui.ItemSearchWidget;
|
||||||
import com.arsdigita.cms.ui.authoring.BasicItemForm;
|
import com.arsdigita.cms.ui.authoring.BasicItemForm;
|
||||||
import com.arsdigita.cms.ui.authoring.SimpleEditStep;
|
import com.arsdigita.cms.ui.authoring.SimpleEditStep;
|
||||||
import java.math.BigDecimal;
|
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -51,7 +49,7 @@ public class PublicationAuthorAddForm
|
||||||
FormInitListener,
|
FormInitListener,
|
||||||
FormSubmissionListener {
|
FormSubmissionListener {
|
||||||
|
|
||||||
private static final Logger s_log = Logger.getLogger(
|
private static final Logger LOGGER = Logger.getLogger(
|
||||||
PublicationAuthorAddForm.class);
|
PublicationAuthorAddForm.class);
|
||||||
private PublicationPropertiesStep m_step;
|
private PublicationPropertiesStep m_step;
|
||||||
private ItemSearchWidget m_itemSearch;
|
private ItemSearchWidget m_itemSearch;
|
||||||
|
|
@ -77,14 +75,24 @@ public class PublicationAuthorAddForm
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void addWidgets() {
|
protected void addWidgets() {
|
||||||
add(new Label((String) PublicationGlobalizationUtil.globalize(
|
add(new Label(PublicationGlobalizationUtil.globalize(
|
||||||
"publications.ui.authors.selectAuthor").localize()));
|
"publications.ui.authors.selectAuthor")));
|
||||||
m_itemSearch = new ItemSearchWidget(
|
m_itemSearch = new ItemSearchWidget(
|
||||||
ITEM_SEARCH,
|
ITEM_SEARCH,
|
||||||
ContentType.findByAssociatedObjectType(GenericPerson.class.getName()));
|
ContentType.findByAssociatedObjectType(GenericPerson.class.getName()));
|
||||||
if ((config.getDefaultAuthorsFolder() != null) && (config.getDefaultAuthorsFolder() != 0)) {
|
// if ((config.getDefaultAuthorsFolderID() != null)
|
||||||
m_itemSearch.setDefaultCreationFolder(new Folder(new BigDecimal(config.getDefaultAuthorsFolder())));
|
// && (config.getDefaultAuthorsFolderID() != 0)) {
|
||||||
}
|
// try {
|
||||||
|
// m_itemSearch.setDefaultCreationFolder(new Folder(new BigDecimal(config.getDefaultAuthorsFolderID())));
|
||||||
|
// } catch (DataObjectNotFoundException ex) {
|
||||||
|
// s_log.warn(String.format("Failed to retrieve folder with id %s.",
|
||||||
|
// config.getDefaultAuthorsFolderID().toString()),
|
||||||
|
// ex);
|
||||||
|
// final ContentSection section = ContentSection.getDefaultSection();
|
||||||
|
// m_itemSearch.setDefaultCreationFolder(section.getRootFolder());
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
m_itemSearch.setDefaultCreationFolder(config.getDefaultAuthorsFolder());
|
||||||
m_itemSearch.setEditAfterCreate(false);
|
m_itemSearch.setEditAfterCreate(false);
|
||||||
add(m_itemSearch);
|
add(m_itemSearch);
|
||||||
|
|
||||||
|
|
@ -110,12 +118,12 @@ public class PublicationAuthorAddForm
|
||||||
editor = ((PublicationAuthorsPropertyStep) editStep).isSelectedAuthorEditor();
|
editor = ((PublicationAuthorsPropertyStep) editStep).isSelectedAuthorEditor();
|
||||||
|
|
||||||
if (author == null) {
|
if (author == null) {
|
||||||
s_log.warn("No author selected.");
|
LOGGER.warn("No author selected.");
|
||||||
|
|
||||||
m_itemSearch.setVisible(state, true);
|
m_itemSearch.setVisible(state, true);
|
||||||
selectedAuthorLabel.setVisible(state, false);
|
selectedAuthorLabel.setVisible(state, false);
|
||||||
} else {
|
} else {
|
||||||
s_log.warn(String.format("Author is here: %s", author.getFullName()));
|
LOGGER.warn(String.format("Author is here: %s", author.getFullName()));
|
||||||
|
|
||||||
data.put(ITEM_SEARCH, author);
|
data.put(ITEM_SEARCH, author);
|
||||||
//data.put(AuthorshipCollection.EDITOR, editor);
|
//data.put(AuthorshipCollection.EDITOR, editor);
|
||||||
|
|
@ -256,5 +264,4 @@ public class PublicationAuthorAddForm
|
||||||
authors.close();
|
authors.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@ import com.arsdigita.bebop.form.Hidden;
|
||||||
import com.arsdigita.bebop.parameters.BooleanParameter;
|
import com.arsdigita.bebop.parameters.BooleanParameter;
|
||||||
import com.arsdigita.bebop.parameters.IncompleteDateParameter;
|
import com.arsdigita.bebop.parameters.IncompleteDateParameter;
|
||||||
import com.arsdigita.bebop.parameters.ParameterModel;
|
import com.arsdigita.bebop.parameters.ParameterModel;
|
||||||
|
import com.arsdigita.cms.ContentSection;
|
||||||
import com.arsdigita.cms.ContentType;
|
import com.arsdigita.cms.ContentType;
|
||||||
import com.arsdigita.cms.Folder;
|
import com.arsdigita.cms.Folder;
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
|
|
@ -38,6 +39,7 @@ import com.arsdigita.cms.contenttypes.PublicationsConfig;
|
||||||
import com.arsdigita.cms.contenttypes.Series;
|
import com.arsdigita.cms.contenttypes.Series;
|
||||||
import com.arsdigita.cms.ui.ItemSearchWidget;
|
import com.arsdigita.cms.ui.ItemSearchWidget;
|
||||||
import com.arsdigita.cms.ui.authoring.BasicItemForm;
|
import com.arsdigita.cms.ui.authoring.BasicItemForm;
|
||||||
|
import com.arsdigita.domain.DataObjectNotFoundException;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
@ -53,7 +55,7 @@ public class SeriesEditshipAddForm
|
||||||
extends BasicItemForm
|
extends BasicItemForm
|
||||||
implements FormSubmissionListener {
|
implements FormSubmissionListener {
|
||||||
|
|
||||||
private static final Logger s_log =
|
private static final Logger LOGGER =
|
||||||
Logger.getLogger(SeriesEditshipAddForm.class);
|
Logger.getLogger(SeriesEditshipAddForm.class);
|
||||||
private SeriesPropertiesStep m_step;
|
private SeriesPropertiesStep m_step;
|
||||||
private ItemSearchWidget m_itemSearch;
|
private ItemSearchWidget m_itemSearch;
|
||||||
|
|
@ -78,14 +80,22 @@ public class SeriesEditshipAddForm
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void addWidgets() {
|
protected void addWidgets() {
|
||||||
add(new Label((String) PublicationGlobalizationUtil.globalize(
|
add(new Label(PublicationGlobalizationUtil.globalize(
|
||||||
"publications.ui.series.editship.selectEditors").localize()));
|
"publications.ui.series.editship.selectEditors")));
|
||||||
m_itemSearch = new ItemSearchWidget(
|
m_itemSearch = new ItemSearchWidget(
|
||||||
ITEM_SEARCH,
|
ITEM_SEARCH,
|
||||||
ContentType.findByAssociatedObjectType(GenericPerson.class.
|
ContentType.findByAssociatedObjectType(GenericPerson.class.
|
||||||
getName()));
|
getName()));
|
||||||
if ((config.getDefaultAuthorsFolder() != null) && (config.getDefaultAuthorsFolder() != 0)) {
|
if ((config.getDefaultAuthorsFolderID() != null) && (config.getDefaultAuthorsFolderID() != 0)) {
|
||||||
m_itemSearch.setDefaultCreationFolder(new Folder(new BigDecimal(config.getDefaultAuthorsFolder())));
|
try {
|
||||||
|
m_itemSearch.setDefaultCreationFolder(new Folder(new BigDecimal(config.getDefaultAuthorsFolderID())));
|
||||||
|
} catch (DataObjectNotFoundException ex) {
|
||||||
|
LOGGER.warn(String.format("Failed to retrieve folder with id %s.",
|
||||||
|
config.getDefaultAuthorsFolderID().toString()),
|
||||||
|
ex);
|
||||||
|
final ContentSection section = ContentSection.getDefaultSection();
|
||||||
|
m_itemSearch.setDefaultCreationFolder(section.getRootFolder());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
m_itemSearch.setEditAfterCreate(false);
|
m_itemSearch.setEditAfterCreate(false);
|
||||||
add(m_itemSearch);
|
add(m_itemSearch);
|
||||||
|
|
@ -172,7 +182,7 @@ public class SeriesEditshipAddForm
|
||||||
final FormData data = fse.getFormData();
|
final FormData data = fse.getFormData();
|
||||||
final PageState state = fse.getPageState();
|
final PageState state = fse.getPageState();
|
||||||
final Series series =
|
final Series series =
|
||||||
(Series) getItemSelectionModel().getSelectedObject(state);
|
(Series) getItemSelectionModel().getSelectedObject(state);
|
||||||
|
|
||||||
if (this.getSaveCancelSection().
|
if (this.getSaveCancelSection().
|
||||||
getSaveButton().isSelected(state)) {
|
getSaveButton().isSelected(state)) {
|
||||||
|
|
@ -181,7 +191,7 @@ public class SeriesEditshipAddForm
|
||||||
|
|
||||||
if (editor == null) {
|
if (editor == null) {
|
||||||
final GenericPerson editorToAdd =
|
final GenericPerson editorToAdd =
|
||||||
(GenericPerson) data.get(ITEM_SEARCH);
|
(GenericPerson) data.get(ITEM_SEARCH);
|
||||||
editorToAdd.getContentBundle().getInstance(series.getLanguage());
|
editorToAdd.getContentBundle().getInstance(series.getLanguage());
|
||||||
|
|
||||||
series.addEditor(editorToAdd,
|
series.addEditor(editorToAdd,
|
||||||
|
|
|
||||||
|
|
@ -87,7 +87,7 @@ public class ImporterUtil {
|
||||||
|
|
||||||
if (collection.isEmpty()) {
|
if (collection.isEmpty()) {
|
||||||
if (!pretend) {
|
if (!pretend) {
|
||||||
final Integer folderId = Publication.getConfig().getDefaultAuthorsFolder();
|
final Integer folderId = Publication.getConfig().getDefaultAuthorsFolderID();
|
||||||
final Folder folder = new Folder(new BigDecimal(folderId));
|
final Folder folder = new Folder(new BigDecimal(folderId));
|
||||||
if (folder == null) {
|
if (folder == null) {
|
||||||
throw new IllegalArgumentException("Error getting folders for authors.");
|
throw new IllegalArgumentException("Error getting folders for authors.");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue