Änderungen am Handling von Ordnern aus der Konfiguration für die ItemSearchCreatePane (Ticket #1838). Ordner jetzt außerdem anhand ihres Pfades konfiguriert werden.

git-svn-id: https://svn.libreccm.org/ccm/trunk@2459 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2013-11-26 11:56:41 +00:00
parent 5070517f5a
commit edd6971282
22 changed files with 626 additions and 409 deletions

View File

@ -16,7 +16,6 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* *
*/ */
package com.arsdigita.cms.ui; package com.arsdigita.cms.ui;
import com.arsdigita.bebop.BoxPanel; import com.arsdigita.bebop.BoxPanel;
@ -56,29 +55,25 @@ import java.math.BigDecimal;
* @author Sören Bernstein <quasi@quasiweb.de> * @author Sören Bernstein <quasi@quasiweb.de>
* @author Jens Pelzetter <jens@jp-digital.de> * @author Jens Pelzetter <jens@jp-digital.de>
*/ */
class ItemSearchCreateItemPane extends CMSContainer class ItemSearchCreateItemPane extends CMSContainer
implements FormInitListener, implements FormInitListener,
FormProcessListener, FormProcessListener,
FormSubmissionListener { FormSubmissionListener {
public static final String WIDGET_PARAM = "widget"; public static final String WIDGET_PARAM = "widget";
public static final String SEARCHWIDGET_PARAM = "searchWidget"; public static final String SEARCHWIDGET_PARAM = "searchWidget";
public static final String PUBLISHWIDGET_PARAM = "publishWidget"; public static final String PUBLISHWIDGET_PARAM = "publishWidget";
private static final String CONTENT_TYPE_ID = "ct"; private static final String CONTENT_TYPE_ID = "ct";
private static final String FOLDER_ID = "folder_id"; private static final String FOLDER_ID = "folder_id";
private static final String FLAT_FOLDER = "flatFolder"; private static final String FLAT_FOLDER = "flatFolder";
private final SingleSelectionModel m_typeSel; private final SingleSelectionModel m_typeSel;
private String defaultFolder; private String defaultFolder;
private boolean editAfterCreate = true; private boolean editAfterCreate = true;
private final ContentItemRequestLocal m_contentItem = new ContentItemRequestLocal() { private final ContentItemRequestLocal m_contentItem = new ContentItemRequestLocal() {
}; };
//private final Link m_selectCloseLink; //private final Link m_selectCloseLink;
//private final Link m_selectEditLink; //private final Link m_selectEditLink;
// private final Link m_fallBackLink; // private final Link m_fallBackLink;
private Link m_fallBackLink; private Link m_fallBackLink;
// private final SegmentedPanel m_segPanel; // private final SegmentedPanel m_segPanel;
private SegmentedPanel m_segPanel; private SegmentedPanel m_segPanel;
@ -86,7 +81,7 @@ class ItemSearchCreateItemPane extends CMSContainer
private Segment m_creationSeg; private Segment m_creationSeg;
// private final Segment m_newItemSeg; // private final Segment m_newItemSeg;
private Segment m_newItemSeg; private Segment m_newItemSeg;
private final Segment m_linkSeg = new Segment(); private final Segment m_linkSeg = new Segment();
private final NewItemForm m_newItem = new SectionNewItemForm("newItem"); private final NewItemForm m_newItem = new SectionNewItemForm("newItem");
// private final SingleSelectionModel m_model; // private final SingleSelectionModel m_model;
private SingleSelectionModel m_model; private SingleSelectionModel m_model;
@ -105,11 +100,9 @@ class ItemSearchCreateItemPane extends CMSContainer
// again. // again.
// //
// //////////////////////////////////////////////////////////////////////// // ////////////////////////////////////////////////////////////////////////
/** /**
* *
* @param parent * @param parent
*/ */
public ItemSearchCreateItemPane(final ItemSearchPage parent) { public ItemSearchCreateItemPane(final ItemSearchPage parent) {
super(); super();
@ -120,8 +113,8 @@ class ItemSearchCreateItemPane extends CMSContainer
} }
/** /**
* *
* @param parent * @param parent
*/ */
public ItemSearchCreateItemPane(final CMSItemSearchPage parent) { public ItemSearchCreateItemPane(final CMSItemSearchPage parent) {
super(); super();
@ -132,12 +125,11 @@ class ItemSearchCreateItemPane extends CMSContainer
} }
/** /**
* Private service method to initialize all the instance properties. * Private service method to initialize all the instance properties. Used by constructors as a
* Used by constructors as a temporarly measure to be able to provide * temporarly measure to be able to provide two constructors. Should be removed when migration
* two constructors. * completed (cf. note above).
* Should be removed when migration completed (cf. note above).
*/ */
private void init() { private void init() {
m_segPanel = new SegmentedPanel("itemSearchCreate"); m_segPanel = new SegmentedPanel("itemSearchCreate");
m_creationSeg = new Segment(); m_creationSeg = new Segment();
m_newItemSeg = new Segment(); m_newItemSeg = new Segment();
@ -161,14 +153,13 @@ class ItemSearchCreateItemPane extends CMSContainer
m_contentItem.set(state, item); m_contentItem.set(state, item);
} }
}; };
m_creationSeg.add(m_creator); m_creationSeg.add(m_creator);
m_creationSeg.add(new Label("<br/>", false)); m_creationSeg.add(new Label("<br/>", false));
final BoxPanel folderRow = new BoxPanel(BoxPanel.HORIZONTAL); final BoxPanel folderRow = new BoxPanel(BoxPanel.HORIZONTAL);
folderRow.add(new Label(GlobalizationUtil.globalize( folderRow.add(new Label(GlobalizationUtil.globalize(
"cms.ui.item_search.create.folder_select"))); "cms.ui.item_search.create.folder_select")));
// m_folderPicker = new FlatFolderPicker(FLAT_FOLDER); // m_folderPicker = new FlatFolderPicker(FLAT_FOLDER);
folderRow.add(m_folderPicker); folderRow.add(m_folderPicker);
m_newItem.add(folderRow); m_newItem.add(folderRow);
@ -185,128 +176,56 @@ class ItemSearchCreateItemPane extends CMSContainer
m_fallBackLink = new Link( m_fallBackLink = new Link(
(String) GlobalizationUtil.globalize("cms.ui.search.create.fallback").localize(), (String) GlobalizationUtil.globalize("cms.ui.search.create.fallback").localize(),
new PrintListener() { new PrintListener() {
public void prepare(final PrintEvent event) { public void prepare(final PrintEvent event) {
final Link target = (Link) event.getTarget(); final Link target = (Link) event.getTarget();
final PageState state = event.getPageState(); final PageState state = event.getPageState();
final ContentItem item = m_contentItem.getContentItem(state); final ContentItem item = m_contentItem.getContentItem(state);
final String title; final String title;
if (item instanceof ContentPage) { if (item instanceof ContentPage) {
title = ((ContentPage) item).getTitle(); title = ((ContentPage) item).getTitle();
} else { } else {
title = item.getName(); title = item.getName();
} }
final String widget = (String) state.getValue(new StringParameter(WIDGET_PARAM)); final String widget = (String) state.getValue(new StringParameter(WIDGET_PARAM));
final String searchWidget = (String) state.getValue(new StringParameter(SEARCHWIDGET_PARAM)); final String searchWidget = (String) state.getValue(new StringParameter(
final String publishWidget = (String) state.getValue(new StringParameter(PUBLISHWIDGET_PARAM)); SEARCHWIDGET_PARAM));
final String publishWidget = (String) state.getValue(new StringParameter(
PUBLISHWIDGET_PARAM));
final String scriptAction; final String scriptAction;
if (editAfterCreate) { if (editAfterCreate) {
((Label) target.getChild()).setLabel((String) GlobalizationUtil.globalize( ((Label) target.getChild()).setLabel((String) GlobalizationUtil.globalize(
"cms.ui.search.create.select_edit").localize()); "cms.ui.search.create.select_edit").localize());
final ContentSection section = item.getContentSection(); final ContentSection section = item.getContentSection();
final String nodeURL = section.getPath() + "/"; final String nodeURL = section.getPath() + "/";
final String linkTarget = ContentItemPage.getItemURL(nodeURL, item.getID(), final String linkTarget = ContentItemPage.getItemURL(nodeURL, item.getID(),
ContentItemPage.AUTHORING_TAB, true); ContentItemPage.AUTHORING_TAB,
target.setTarget(linkTarget); true);
scriptAction = ""; target.setTarget(linkTarget);
} else { scriptAction = "";
((Label) target.getChild()).setLabel((String) GlobalizationUtil.globalize( } else {
"cms.ui.search.create.select_close").localize()); ((Label) target.getChild()).setLabel((String) GlobalizationUtil.globalize(
scriptAction = "self.close();\n" "cms.ui.search.create.select_close").localize());
+ "return false;"; scriptAction = "self.close();\n"
} + "return false;";
}
target.setOnClick(String.format("window.opener.document.%s.value=\"%s\";" target.setOnClick(String.format("window.opener.document.%s.value=\"%s\";"
+ "window.opener.document.%s.value=\"%s\";" + "window.opener.document.%s.value=\"%s\";"
+ "window.opener.document.%s.value=\"%s\";" + "window.opener.document.%s.value=\"%s\";"
+ "%s", + "%s",
widget, widget,
item.getID().toString(), item.getID().toString(),
searchWidget, searchWidget,
title.replace("\"", "\\\""), title.replace("\"", "\\\""),
publishWidget, publishWidget,
Boolean.TRUE.toString(), Boolean.TRUE.toString(),
scriptAction)); scriptAction));
} }
});
});
// m_selectCloseLink = new Link(
// (String) GlobalizationUtil.globalize("cms.ui.search.create.select_close").localize(),
// new PrintListener() {
//
// public void prepare(final PrintEvent event) {
// final Link target = (Link) event.getTarget();
// final PageState state = event.getPageState();
//
// final ContentItem item = m_contentItem.getContentItem(state);
// final String title;
// if (item instanceof ContentPage) {
// title = ((ContentPage) item).getTitle();
// } else {
// title = item.getName();
// }
//
// final String widget = (String) state.getValue(new StringParameter(WIDGET_PARAM));
// final String searchWidget = (String) state.getValue(new StringParameter(SEARCHWIDGET_PARAM));
// final String publishWidget = (String) state.getValue(new StringParameter(PUBLISHWIDGET_PARAM));
//
// target.setOnClick(String.format("window.opener.document.%s.value=\"%s\";"
// + "window.opener.document.%s.value=\"%s\";"
// + "window.opener.document.%s.value=\"%s\";"
// + "self.close();"
// + "return false;",
// widget,
// item.getID().toString(),
// searchWidget,
// title,
// publishWidget,
// Boolean.TRUE.toString()));
// }
//
// });
//
// m_selectEditLink = new Link((String) GlobalizationUtil.globalize("cms.ui.search.create.select_edit").localize(),
// new PrintListener() {
//
// public void prepare(final PrintEvent event) {
// final Link target = (Link) event.getTarget();
// final PageState state = event.getPageState();
//
// final ContentItem item = m_contentItem.getContentItem(state);
// final String title;
// if (item instanceof ContentPage) {
// title = ((ContentPage) item).getTitle();
// } else {
// title = item.getName();
// }
//
//
// final String widget = (String) state.getValue(new StringParameter(WIDGET_PARAM));
// final String searchWidget = (String) state.getValue(new StringParameter(SEARCHWIDGET_PARAM));
// final String publishWidget = (String) state.getValue(new StringParameter(PUBLISHWIDGET_PARAM));
//
// final ContentSection section = item.getContentSection();
// final String nodeURL = section.getPath() + "/";
// final String linkTarget = ContentItemPage.getItemURL(nodeURL, item.getID(),
// ContentItemPage.AUTHORING_TAB, true);
// target.setTarget(linkTarget);
// target.setOnClick(String.format("window.opener.document.%s.value=\"%s\";"
// + "window.opener.document.%s.value=\"%s\";"
// + "window.opener.document.%s.value=\"%s\";",
// widget,
// item.getID().toString(),
// searchWidget,
// title,
// publishWidget,
// Boolean.TRUE.toString()));
//
// }
//
// });
final BoxPanel linkPanel = new BoxPanel(BoxPanel.VERTICAL); final BoxPanel linkPanel = new BoxPanel(BoxPanel.VERTICAL);
final Label jsLabel = new Label("", false); final Label jsLabel = new Label("", false);
@ -324,15 +243,18 @@ class ItemSearchCreateItemPane extends CMSContainer
} }
final String widget = (String) state.getValue(new StringParameter(WIDGET_PARAM)); final String widget = (String) state.getValue(new StringParameter(WIDGET_PARAM));
final String searchWidget = (String) state.getValue(new StringParameter(SEARCHWIDGET_PARAM)); final String searchWidget = (String) state.getValue(new StringParameter(
final String publishWidget = (String) state.getValue(new StringParameter(PUBLISHWIDGET_PARAM)); SEARCHWIDGET_PARAM));
final String publishWidget = (String) state.getValue(new StringParameter(
PUBLISHWIDGET_PARAM));
final String scriptAction; final String scriptAction;
if (editAfterCreate) { if (editAfterCreate) {
final ContentSection section = item.getContentSection(); final ContentSection section = item.getContentSection();
final String nodeURL = section.getPath() + "/"; final String nodeURL = section.getPath() + "/";
final String linkTarget = ContentItemPage.getItemURL(nodeURL, item.getID(), final String linkTarget = ContentItemPage.getItemURL(nodeURL, item.getID(),
ContentItemPage.AUTHORING_TAB, true); ContentItemPage.AUTHORING_TAB,
true);
scriptAction = String.format("window.location.href = \"/ccm/%s\";", linkTarget); scriptAction = String.format("window.location.href = \"/ccm/%s\";", linkTarget);
} else { } else {
scriptAction = "self.close();"; scriptAction = "self.close();";
@ -355,7 +277,6 @@ class ItemSearchCreateItemPane extends CMSContainer
scriptAction)); scriptAction));
} }
}); });
linkPanel.add(jsLabel); linkPanel.add(jsLabel);
//linkPanel.add(m_selectCloseLink); //linkPanel.add(m_selectCloseLink);
@ -368,8 +289,8 @@ class ItemSearchCreateItemPane extends CMSContainer
} // init } // init
/** /**
* *
* @param page * @param page
*/ */
@Override @Override
public void register(final Page page) { public void register(final Page page) {
@ -384,9 +305,9 @@ class ItemSearchCreateItemPane extends CMSContainer
} }
/** /**
* *
* @param fse * @param fse
* @throws FormProcessException * @throws FormProcessException
*/ */
public void init(final FormSectionEvent fse) throws FormProcessException { public void init(final FormSectionEvent fse) throws FormProcessException {
final PageState state = fse.getPageState(); final PageState state = fse.getPageState();
@ -431,7 +352,6 @@ class ItemSearchCreateItemPane extends CMSContainer
public ContentSection getContentSection(PageState s) { public ContentSection getContentSection(PageState s) {
return CMS.getContext().getContentSection(); return CMS.getContext().getContentSection();
} }
} }
protected String getDefaultFolder() { protected String getDefaultFolder() {
@ -449,5 +369,4 @@ class ItemSearchCreateItemPane extends CMSContainer
protected void setEditAfterCreate(final boolean editAfterCreate) { protected void setEditAfterCreate(final boolean editAfterCreate) {
this.editAfterCreate = editAfterCreate; this.editAfterCreate = editAfterCreate;
} }
} }

View File

@ -49,16 +49,26 @@ public class PublicationsConfig extends AbstractConfig {
private final Parameter publisherPublicationsStepSortKey; private final Parameter publisherPublicationsStepSortKey;
private final Parameter defaultAuthorsFolderID; private final Parameter defaultAuthorsFolderID;
private final Parameter defaultAuthorsFolderPath; private final Parameter defaultAuthorsFolderPath;
private final Parameter defaultSeriesFolder; private final Parameter defaultSeriesFolderID;
private final Parameter defaultPublisherFolder; private final Parameter defaultSeriesFolderPath;
private final Parameter defaultCollectedVolumesFolder; private final Parameter defaultPublisherFolderID;
private final Parameter defaultJournalsFolder; private final Parameter defaultPublisherFolderPath;
private final Parameter defaultArticlesInCollectedVolumeFolder; private final Parameter defaultCollectedVolumesFolderID;
private final Parameter defaultOrganizationsFolder; private final Parameter defaultCollectedVolumesFolderPath;
private final Parameter defaultProceedingsFolder; private final Parameter defaultJournalsFolderID;
private final Parameter defaultInProceedingsFolder; private final Parameter defaultJournalsFolderPath;
private final Parameter defaultArticlesInJournalFolder; private final Parameter defaultArticlesInCollectedVolumeFolderID;
private final Parameter defaultPublicationsFolder; private final Parameter defaultArticlesInCollectedVolumeFolderPath;
private final Parameter defaultOrganizationsFolderID;
private final Parameter defaultOrganizationsFolderPath;
private final Parameter defaultProceedingsFolderID;
private final Parameter defaultProceedingsFolderPath;
private final Parameter defaultInProceedingsFolderID;
private final Parameter defaultInProceedingsFolderPath;
private final Parameter defaultArticlesInJournalFolderID;
private final Parameter defaultArticlesInJournalFolderPath;
private final Parameter defaultPublicationsFolderID;
private final Parameter defaultPublicationsFolderPath;
private final Parameter orgaType; private final Parameter orgaType;
private final Parameter orgaBundleType; private final Parameter orgaBundleType;
private final Parameter enableFirstPublishedProperty; private final Parameter enableFirstPublishedProperty;
@ -135,53 +145,103 @@ public class PublicationsConfig extends AbstractConfig {
Parameter.OPTIONAL, Parameter.OPTIONAL,
null); null);
defaultSeriesFolder = new IntegerParameter( defaultSeriesFolderID = new IntegerParameter(
"com.arsdigita.cms.contenttypes.publications.default_series_folder", "com.arsdigita.cms.contenttypes.publications.default_series_folder_id",
Parameter.OPTIONAL, Parameter.OPTIONAL,
null); null);
defaultPublisherFolder = new IntegerParameter( defaultSeriesFolderPath = new StringParameter(
"com.arsdigita.cms.contenttypes.publications.default_publisher_folder", "com.arsdigita.cms.contenttypes.publications.default_series_folder_path",
Parameter.OPTIONAL, Parameter.OPTIONAL,
null); null);
defaultCollectedVolumesFolder = new IntegerParameter( defaultPublisherFolderID = new IntegerParameter(
"com.arsdigita.cms.contenttypes.publications.default_collectedvolumes_folder", "com.arsdigita.cms.contenttypes.publications.default_publisher_folder_id",
Parameter.OPTIONAL, Parameter.OPTIONAL,
null); null);
defaultJournalsFolder = new IntegerParameter( defaultPublisherFolderPath = new StringParameter(
"com.arsdigita.cms.contenttypes.publications.default_journals_folder", "com.arsdigita.cms.contenttypes.publications.default_publisher_folder_path",
Parameter.OPTIONAL, Parameter.OPTIONAL,
null); null);
defaultArticlesInCollectedVolumeFolder = new IntegerParameter( defaultCollectedVolumesFolderID = new IntegerParameter(
"com.arsdigita.cms.contenttypes.publications.default_articlesincollectedvolume_folder", "com.arsdigita.cms.contenttypes.publications.default_collectedvolumes_folder_id",
Parameter.OPTIONAL, Parameter.OPTIONAL,
null); null);
defaultOrganizationsFolder = new IntegerParameter( defaultCollectedVolumesFolderPath = new StringParameter(
"com.arsdigita.cms.contenttypes.publications.default_organizations_folder", "com.arsdigita.cms.contenttypes.publications.default_collectedvolumes_folder_path",
Parameter.OPTIONAL, Parameter.OPTIONAL,
null); null);
defaultProceedingsFolder = new IntegerParameter( defaultJournalsFolderID = new IntegerParameter(
"com.arsdigita.cms.contenttypes.publications.default_proceedings_folder", "com.arsdigita.cms.contenttypes.publications.default_journals_folder_id",
Parameter.OPTIONAL, Parameter.OPTIONAL,
null); null);
defaultInProceedingsFolder = new IntegerParameter( defaultJournalsFolderPath = new StringParameter(
"com.arsdigita.cms.contenttypes.publications.default_inproccedings_folder", "com.arsdigita.cms.contenttypes.publications.default_journals_folder_path",
Parameter.OPTIONAL, Parameter.OPTIONAL,
null); null);
defaultArticlesInJournalFolder = new IntegerParameter( defaultArticlesInCollectedVolumeFolderID = new IntegerParameter(
"com.arsdigita.cms.contenttypes.publications.default_articlesinjournal_folder", "com.arsdigita.cms.contenttypes.publications.default_articlesincollectedvolume_folder_id",
Parameter.OPTIONAL, Parameter.OPTIONAL,
null); null);
defaultPublicationsFolder = new IntegerParameter( defaultArticlesInCollectedVolumeFolderPath = new StringParameter(
"com.arsdigita.cms.contenttypes.publications.default_publications_folder", "com.arsdigita.cms.contenttypes.publications.default_articlesincollectedvolume_folder_path",
Parameter.OPTIONAL,
null);
defaultOrganizationsFolderID = new IntegerParameter(
"com.arsdigita.cms.contenttypes.publications.default_organizations_folder_id",
Parameter.OPTIONAL,
null);
defaultOrganizationsFolderPath = new StringParameter(
"com.arsdigita.cms.contenttypes.publications.default_organizations_folder_path",
Parameter.OPTIONAL,
null);
defaultProceedingsFolderID = new IntegerParameter(
"com.arsdigita.cms.contenttypes.publications.default_proceedings_folder_id",
Parameter.OPTIONAL,
null);
defaultProceedingsFolderPath = new StringParameter(
"com.arsdigita.cms.contenttypes.publications.default_proceedings_folder_path",
Parameter.OPTIONAL,
null);
defaultInProceedingsFolderID = new IntegerParameter(
"com.arsdigita.cms.contenttypes.publications.default_inproccedings_folder_id",
Parameter.OPTIONAL,
null);
defaultInProceedingsFolderPath = new StringParameter(
"com.arsdigita.cms.contenttypes.publications.default_inproceedings_folder_path",
Parameter.OPTIONAL,
null);
defaultArticlesInJournalFolderID = new IntegerParameter(
"com.arsdigita.cms.contenttypes.publications.default_articlesinjournal_folder_id",
Parameter.OPTIONAL,
null);
defaultArticlesInJournalFolderPath = new StringParameter(
"com.arsdigita.cms.contenttypes.publications.default_articlesinjournal_folder_path",
Parameter.OPTIONAL,
null);
defaultPublicationsFolderID = new IntegerParameter(
"com.arsdigita.cms.contenttypes.publications.default_publications_folder_id",
Parameter.OPTIONAL,
null);
defaultPublicationsFolderPath = new StringParameter(
"com.arsdigita.cms.contenttypes.publications.default_publications_folder_path",
Parameter.OPTIONAL, Parameter.OPTIONAL,
null); null);
@ -216,16 +276,26 @@ public class PublicationsConfig extends AbstractConfig {
register(publisherPublicationsStepSortKey); register(publisherPublicationsStepSortKey);
register(defaultAuthorsFolderID); register(defaultAuthorsFolderID);
register(defaultAuthorsFolderPath); register(defaultAuthorsFolderPath);
register(defaultSeriesFolder); register(defaultSeriesFolderID);
register(defaultPublisherFolder); register(defaultSeriesFolderPath);
register(defaultCollectedVolumesFolder); register(defaultPublisherFolderID);
register(defaultJournalsFolder); register(defaultPublisherFolderPath);
register(defaultArticlesInCollectedVolumeFolder); register(defaultCollectedVolumesFolderID);
register(defaultOrganizationsFolder); register(defaultCollectedVolumesFolderPath);
register(defaultProceedingsFolder); register(defaultJournalsFolderID);
register(defaultInProceedingsFolder); register(defaultJournalsFolderPath);
register(defaultArticlesInJournalFolder); register(defaultArticlesInCollectedVolumeFolderID);
register(defaultPublicationsFolder); register(defaultArticlesInCollectedVolumeFolderPath);
register(defaultOrganizationsFolderID);
register(defaultOrganizationsFolderPath);
register(defaultProceedingsFolderID);
register(defaultProceedingsFolderPath);
register(defaultInProceedingsFolderID);
register(defaultInProceedingsFolderPath);
register(defaultArticlesInJournalFolderID);
register(defaultArticlesInJournalFolderPath);
register(defaultPublicationsFolderID);
register(defaultPublicationsFolderPath);
register(orgaType); register(orgaType);
register(orgaBundleType); register(orgaBundleType);
register(enableFirstPublishedProperty); register(enableFirstPublishedProperty);
@ -234,6 +304,52 @@ public class PublicationsConfig extends AbstractConfig {
loadInfo(); loadInfo();
} }
/**
* Helper method for retrieving the default folders. The method takes two parameters (for now):
* the path of the folder to retrieve and the id of the folder to retrieve. If the path
* parameter is not {@code null}, the path is used. If the path is invalid (the path does not
* point to a existing folder), the root folder of the default content section is returned.
*
* If the folder path is {@code null}, the second parameter, the Id is used. Please note that
* the ID settings for default folders have been marked as deprecated. For new default folder
* settings there should be no ID settings, only a path setting and corresponding method which
* retrieves the folder using this method. The {@code folderId} parameter will be removed
* together with the folder id settings. If there is no folder with the given id, the root
* folder of the default content section is returned.
*
* If both parameters are {@code null} the method returns {@code null} which indicates that no
* default folder has been set.
*
* @param folderPath Path of the default folder.
* @param folderId ID of the default folder.
* @return
*/
private Folder getDefaultFolder(final String folderPath, final Integer folderId) {
if (folderPath != null) {
final Folder folder = Folder.retrieveFolder(folderPath);
if (folder == null) {
LOGGER.warn(String.format("There is no folder with the path '%s'.",
folderPath));
return ContentSection.getDefaultSection().getRootFolder();
} else {
return folder;
}
}
if (folderId != null) {
try {
return new Folder(new BigDecimal(folderId));
} catch (DataObjectNotFoundException ex) {
LOGGER.warn(String.format("Failed to retrieve folder with id %s.",
folderId.toString()),
ex);
return ContentSection.getDefaultSection().getRootFolder();
}
}
return null;
}
public Boolean getAttachOrgaUnitsStep() { public Boolean getAttachOrgaUnitsStep() {
return (Boolean) get(attachOrgaUnitsStep); return (Boolean) get(attachOrgaUnitsStep);
} }
@ -275,10 +391,9 @@ public class PublicationsConfig extends AbstractConfig {
} }
/** /**
* *
* @return * @return @deprecated Use {@link #getDefaultAuthorsFolderPath()} or
* @deprecated Use {@link #getDefaultAuthorsFolderPath()} or {@link #getDefaultAuthorsFolder()} * {@link #getDefaultAuthorsFolder()} instead.
* instead.
*/ */
@Deprecated @Deprecated
public Integer getDefaultAuthorsFolderID() { public Integer getDefaultAuthorsFolderID() {
@ -298,129 +413,317 @@ public class PublicationsConfig extends AbstractConfig {
} }
/** /**
* Retrieves the default folder for storing authors created using the * Retrieves the default folder for storing authors created using the
* {@link ItemSearchCreateItemPane}. * {@link ItemSearchCreateItemPane}.
* *
* If both {@link #getDefaultAuthorsFolderPath()} and {@link #getDefaultAuthorsFolderID()} * If both {@link #getDefaultAuthorsFolderPath()} and {@link #getDefaultAuthorsFolderID()} are
* are not set, the method will return {@code null}. If {@link #getDefaultAuthorsFolderPath()} * not set, the method will return {@code null}. If {@link #getDefaultAuthorsFolderPath()} is
* is set the path returned by that method is used to retrieve the folder. If there is no folder * 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. * 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 * 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 * {@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 * provided id, the root folder of the default content section is returned. Please note that
* that {@link #getDefaultAuthorsFolderID()} is marked as deprecated and will be removed in * {@link #getDefaultAuthorsFolderID()} is marked as deprecated and will be removed in one of
* one of the next releases. Instead the path property should be used. * the next releases. Instead the path property should be used.
* *
* @return {@code null} if {@link #getDefaultAuthorsFolderPath()} and * @return {@code null} if {@link #getDefaultAuthorsFolderPath()} and
* {@link #getDefaultAuthorsFolderID()} both are not set, otherwise a {@link Folder} object. * {@link #getDefaultAuthorsFolderID()} both are not set, otherwise a {@link Folder} object.
*/ */
public Folder getDefaultAuthorsFolder() { public Folder getDefaultAuthorsFolder() {
if (getDefaultAuthorsFolderPath() != null) { return getDefaultFolder(getDefaultAuthorsFolderPath(), getDefaultAuthorsFolderID());
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) { // if (getDefaultAuthorsFolderPath() != null) {
try { // final Folder folder = Folder.retrieveFolder(getDefaultAuthorsFolderPath());
return new Folder(new BigDecimal(getDefaultAuthorsFolderID())); // if (folder == null) {
} catch (DataObjectNotFoundException ex) { // LOGGER.warn(String.format("There is no folder with the path '%s'.",
LOGGER.warn(String.format("Failed to retrieve folder with id %s.", // getDefaultAuthorsFolderPath()));
getDefaultAuthorsFolderID().toString()), // return ContentSection.getDefaultSection().getRootFolder();
ex); // } else {
return ContentSection.getDefaultSection().getRootFolder(); // return folder;
} // }
} // }
//
return null; // 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() { /**
if (get(defaultSeriesFolder) == null) { *
* @return @deprecated Use {@link #getDefaultSeriesFolder()} instead
*/
@Deprecated
public Integer getDefaultSeriesFolderID() {
if (get(defaultSeriesFolderID) == null) {
return null; return null;
} else { } else {
return (Integer) get(defaultSeriesFolder); return (Integer) get(defaultSeriesFolderID);
} }
} }
public Integer getDefaultPublisherFolder() { public String getDefaultSeriesFolderPath() {
if (get(defaultPublisherFolder) == null) { if (get(defaultSeriesFolderPath) == null) {
return null; return null;
} else { } else {
return (Integer) get(defaultPublisherFolder); return (String) get(defaultSeriesFolderPath);
} }
} }
public Integer getDefaultCollectedVolumesFolder() { /**
if (get(defaultCollectedVolumesFolder) == null) { * Retrieves the default folder for storing series items created using the ItemSearchCreatePane.
* The method works like the method for authors (see {@link #getDefaultAuthorsFolder()} and
* {@link #getDefaultFolder(java.lang.String, java.lang.Integer)}).
*
* @return The default folder for series items, if set, or {@code null}.
*/
public Folder getDefaultSeriesFolder() {
return getDefaultFolder(getDefaultSeriesFolderPath(), getDefaultSeriesFolderID());
}
/**
*
* @return @deprecated Use {@link #getDefaultPublisherFolder()} instead.
*/
@Deprecated
public Integer getDefaultPublisherFolderID() {
if (get(defaultPublisherFolderID) == null) {
return null; return null;
} else { } else {
return (Integer) get(defaultCollectedVolumesFolder); return (Integer) get(defaultPublisherFolderID);
} }
} }
public Integer getDefaultJournalsFolder() { public String getDefaultPublisherFolderPath() {
if (get(defaultJournalsFolder) == null) { if (getDefaultPublisherFolderPath() == null) {
return null; return null;
} else { } else {
return (Integer) get(defaultJournalsFolder); return (String) get(defaultPublisherFolderPath);
} }
} }
public Integer getDefaultArticlesInCollectedVolumeFolder() { public Folder getDefaultPublisherFolder() {
if (get(defaultArticlesInCollectedVolumeFolder) == null) { return getDefaultFolder(getDefaultPublisherFolderPath(), getDefaultPublisherFolderID());
}
/**
*
* @return @deprecated Use {@link #getDefaultCollectedVolumesFolder()}
*/
@Deprecated
public Integer getDefaultCollectedVolumesFolderID() {
if (get(defaultCollectedVolumesFolderID) == null) {
return null; return null;
} else { } else {
return (Integer) get(defaultArticlesInCollectedVolumeFolder); return (Integer) get(defaultCollectedVolumesFolderID);
} }
} }
public Integer getDefaultOrganizationsFolder() { public String getDefaultCollectedVolumesFolderPath() {
if (get(defaultOrganizationsFolder) == null) { if (get(defaultCollectedVolumesFolderPath) == null) {
return null; return null;
} else { } else {
return (Integer) get(defaultOrganizationsFolder); return (String) get(defaultCollectedVolumesFolderPath);
} }
} }
public Integer getDefaultProceedingsFolder() { public Folder getDefaultCollectedVolumesFolder() {
if (get(defaultProceedingsFolder) == null) { return getDefaultFolder(getDefaultCollectedVolumesFolderPath(),
getDefaultCollectedVolumesFolderID());
}
/**
*
* @return @deprecated Use {@link #getDefaultJournalsFolder() }
*/
@Deprecated
public Integer getDefaultJournalsFolderID() {
if (get(defaultJournalsFolderID) == null) {
return null; return null;
} else { } else {
return (Integer) get(defaultProceedingsFolder); return (Integer) get(defaultJournalsFolderID);
} }
} }
public Integer getDefaultInProceedingsFolder() { public String getDefaultJournalsFolderPath() {
if (get(defaultInProceedingsFolder) == null) { if (get(defaultJournalsFolderPath) == null) {
return null; return null;
} else { } else {
return (Integer) get(defaultInProceedingsFolder); return (String) get(defaultJournalsFolderPath);
} }
} }
public Integer getDefaultArticlesInJournalFolder() { public Folder getDefaultJournalsFolder() {
if (get(defaultArticlesInJournalFolder) == null) { return getDefaultFolder(getDefaultJournalsFolderPath(), getDefaultJournalsFolderID());
}
/**
*
* @return @deprecated Use {@link #getDefaultArticlesInCollectedVolumeFolder() }
*/
@Deprecated
public Integer getDefaultArticlesInCollectedVolumeFolderID() {
if (get(defaultArticlesInCollectedVolumeFolderID) == null) {
return null; return null;
} else { } else {
return (Integer) get(defaultArticlesInJournalFolder); return (Integer) get(defaultArticlesInCollectedVolumeFolderID);
} }
} }
public Integer getDefaultPublicationsFolder() { public String getDefaultArticlesInCollectedVolumeFolderPath() {
if (get(defaultPublicationsFolder) == null) { if (get(defaultArticlesInCollectedVolumeFolderPath) == null) {
return null; return null;
} else { } else {
return (Integer) get(defaultPublicationsFolder); return (String) get(defaultArticlesInCollectedVolumeFolderPath);
} }
} }
public Folder getDefaultArticlesInCollectedVolumeFolder() {
return getDefaultFolder(getDefaultArticlesInCollectedVolumeFolderPath(),
getDefaultArticlesInCollectedVolumeFolderID());
}
/**
*
* @return @deprecated Use {@link #getDefaultOrganizationsFolder() }
*/
@Deprecated
public Integer getDefaultOrganizationsFolderID() {
if (get(defaultOrganizationsFolderID) == null) {
return null;
} else {
return (Integer) get(defaultOrganizationsFolderID);
}
}
public String getDefaultOrganizationsFolderPath() {
if (get(defaultOrganizationsFolderPath) == null) {
return null;
} else {
return (String) get(defaultOrganizationsFolderPath);
}
}
public Folder getDefaultOrganizationsFolder() {
return getDefaultFolder(getDefaultOrganizationsFolderPath(),
getDefaultOrganizationsFolderID());
}
/**
*
* @return @deprecated Use {@link #getDefaultProceedingsFolder() }
*/
@Deprecated
public Integer getDefaultProceedingsFolderID() {
if (get(defaultProceedingsFolderID) == null) {
return null;
} else {
return (Integer) get(defaultProceedingsFolderID);
}
}
public String getDefaultProceedingsFolderPath() {
if (get(defaultProceedingsFolderPath) == null) {
return null;
} else {
return (String) get(defaultProceedingsFolderPath);
}
}
public Folder getDefaultProceedingsFolder() {
return getDefaultFolder(getDefaultProceedingsFolderPath(),
getDefaultProceedingsFolderID());
}
/**
*
* @return
* @deprecated Use {@link getDefaultInProccedingsFolder}
*/
@Deprecated
public Integer getDefaultInProceedingsFolderID() {
if (get(defaultInProceedingsFolderID) == null) {
return null;
} else {
return (Integer) get(defaultInProceedingsFolderID);
}
}
public String getDefaultInProceedingsFolderPath() {
if (get(defaultInProceedingsFolderPath) == null) {
return null;
} else {
return (String) get(defaultInProceedingsFolderPath);
}
}
public Folder getDefaultInProceedingsFolder() {
return getDefaultFolder(getDefaultInProceedingsFolderPath(),
getDefaultInProceedingsFolderID());
}
/**
*
* @return @deprecated Use {@link #getDefaultArticlesInJournalFolder() }
*/
@Deprecated
public Integer getDefaultArticlesInJournalFolderID() {
if (get(defaultArticlesInJournalFolderID) == null) {
return null;
} else {
return (Integer) get(defaultArticlesInJournalFolderID);
}
}
public String getDefaultArticlesInJournalFolderPath() {
if (get(defaultArticlesInJournalFolderPath) == null) {
return null;
} else {
return (String) get(defaultArticlesInJournalFolderPath);
}
}
public Folder getDefaultArticlesInJournalFolder() {
return getDefaultFolder(getDefaultArticlesInJournalFolderPath(),
getDefaultArticlesInJournalFolderID());
}
/**
*
* @return
* @deprecated Use {@link #getDefaultPublicationsFolder() }
*/
@Deprecated
public Integer getDefaultPublicationsFolderID() {
if (get(defaultPublicationsFolderID) == null) {
return null;
} else {
return (Integer) get(defaultPublicationsFolderID);
}
}
public String getDefaultPublicationsFolderPath() {
if (get(defaultPublicationsFolderPath) == null) {
return null;
} else {
return (String) get(defaultPublicationsFolderPath);
}
}
public Folder getDefaultPublicationsFolder() {
return getDefaultFolder(getDefaultPublicationsFolderPath(),
getDefaultPublicationsFolderID());
}
public String getOrganizationType() { public String getOrganizationType() {
return (String) get(orgaType); return (String) get(orgaType);
} }

View File

@ -58,55 +58,105 @@ com.arsdigita.cms.contenttypes.publications.default_authors_folder_path.purpose
com.arsdigita.cms.contenttypes.publications.default_authors_folder_path.example = main:/path/to/authors/folder 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_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_id.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_id.purpose = Default folder for items created using the create pane of the ItemSearchWidget
com.arsdigita.cms.contenttypes.publications.default_series_folder.example = 10002 com.arsdigita.cms.contenttypes.publications.default_series_folder_id.example = 10002
com.arsdigita.cms.contenttypes.publications.default_series_folder.format = Integer com.arsdigita.cms.contenttypes.publications.default_series_folder_id.flormat = Integer
com.arsdigita.cms.contenttypes.publications.default_publisher_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_path.title = Default series folder
com.arsdigita.cms.contenttypes.publications.default_publisher_folder.purpose = Default folder for items created using the create pane of the ItemSearchWidget com.arsdigita.cms.contenttypes.publications.default_series_folder_path.purpose = Path of the default folder for series items created using the create pane of the ItemSearchWidget when assigning a series. The path *must* include the content section.
com.arsdigita.cms.contenttypes.publications.default_publisher_folder.example = 10002 com.arsdigita.cms.contenttypes.publications.default_series_folder_path.example = main:/path/to/series/folder
com.arsdigita.cms.contenttypes.publications.default_publisher_folder.format = Integer com.arsdigita.cms.contenttypes.publications.default_series_folder_path.format = [String]
com.arsdigita.cms.contenttypes.publications.default_collectedvolumes_folder.title = ID of the default folder for items created using the create pane of the ItemSearchWidget com.arsdigita.cms.contenttypes.publications.default_publisher_folder_id.title = ID of the default folder for items created using the create pane of the ItemSearchWidget
com.arsdigita.cms.contenttypes.publications.default_collectedvolumes_folder.purpose = Default folder for items created using the create pane of the ItemSearchWidget com.arsdigita.cms.contenttypes.publications.default_publisher_folder_id.purpose = Default folder for items created using the create pane of the ItemSearchWidget
com.arsdigita.cms.contenttypes.publications.default_collectedvolumes_folder.example = 10002 com.arsdigita.cms.contenttypes.publications.default_publisher_folder_id.example = 10002
com.arsdigita.cms.contenttypes.publications.default_collectedvolumes_folder.format = Integer com.arsdigita.cms.contenttypes.publications.default_publisher_folder_id.format = Integer
com.arsdigita.cms.contenttypes.publications.default_journals_folder.title = ID of the default folder for items created using the create pane of the ItemSearchWidget com.arsdigita.cms.contenttypes.publications.default_publisher_folder_path.title = Default publisher folder
com.arsdigita.cms.contenttypes.publications.default_journals_folder.purpose = Default folder for items created using the create pane of the ItemSearchWidget com.arsdigita.cms.contenttypes.publications.default_publisher_folder_path.purpose = Path of the default folder for publisher items created using the create pane of the ItemSearchWidget when assigning a publisher. The path *must* include the content section.
com.arsdigita.cms.contenttypes.publications.default_journals_folder.example = 10002 com.arsdigita.cms.contenttypes.publications.default_publisher_folder_path.example = main:/path/to/publisher/folder
com.arsdigita.cms.contenttypes.publications.default_journals_folder.format = Integer com.arsdigita.cms.contenttypes.publications.default_publisher_folder_path.format = [String]
com.arsdigita.cms.contenttypes.publications.default_articlesincollectedvolumes_folder.title = ID of the default folder for items created using the create pane of the ItemSearchWidget com.arsdigita.cms.contenttypes.publications.default_collectedvolumes_folder_id.title = ID of the default folder for items created using the create pane of the ItemSearchWidget
com.arsdigita.cms.contenttypes.publications.default_articlesincollectedvolumes_folder.purpose = Default folder for items created using the create pane of the ItemSearchWidget com.arsdigita.cms.contenttypes.publications.default_collectedvolumes_folder_id.purpose = Default folder for items created using the create pane of the ItemSearchWidget
com.arsdigita.cms.contenttypes.publications.default_articlesincollectedvolumes_folder.example = 10002 com.arsdigita.cms.contenttypes.publications.default_collectedvolumes_folder_id.example = 10002
com.arsdigita.cms.contenttypes.publications.default_articlesincollectedvolumes_folder.format = Integer com.arsdigita.cms.contenttypes.publications.default_collectedvolumes_folder_id.format = Integer
com.arsdigita.cms.contenttypes.publications.default_organizations_folder.title = ID of the default folder for items created using the create pane of the ItemSearchWidget com.arsdigita.cms.contenttypes.publications.default_collectedvolumes_folder_path.title = Default collectedvolumes folder
com.arsdigita.cms.contenttypes.publications.default_organizations_folder.purpose = Default folder for items created using the create pane of the ItemSearchWidget com.arsdigita.cms.contenttypes.publications.default_collectedvolumes_folder_path.purpose = Path of the default folder for collectedvolumes items created using the create pane of the ItemSearchWidget when assigning a collectedvolumes. The path *must* include the content section.
com.arsdigita.cms.contenttypes.publications.default_organizations_folder.example = 10002 com.arsdigita.cms.contenttypes.publications.default_collectedvolumes_folder_path.example = main:/path/to/collectedvolumes/folder
com.arsdigita.cms.contenttypes.publications.default_organizations_folder.format = Integer com.arsdigita.cms.contenttypes.publications.default_collectedvolumes_folder_path.format = [String]
com.arsdigita.cms.contenttypes.publications.default_proceedings_folder.title = ID of the default folder for items created using the create pane of the ItemSearchWidget com.arsdigita.cms.contenttypes.publications.default_journals_folder_id.title = ID of the default folder for items created using the create pane of the ItemSearchWidget
com.arsdigita.cms.contenttypes.publications.default_proceedings_folder.purpose = Default folder for items created using the create pane of the ItemSearchWidget com.arsdigita.cms.contenttypes.publications.default_journals_folder_id.purpose = Default folder for items created using the create pane of the ItemSearchWidget
com.arsdigita.cms.contenttypes.publications.default_proceedings_folder.example = 10002 com.arsdigita.cms.contenttypes.publications.default_journals_folder_id.example = 10002
com.arsdigita.cms.contenttypes.publications.default_proceedings_folder.format = Integer com.arsdigita.cms.contenttypes.publications.default_journals_folder_id.format = Integer
com.arsdigita.cms.contenttypes.publications.default_inproceedings_folder.title = ID of the default folder for items created using the create pane of the ItemSearchWidget com.arsdigita.cms.contenttypes.publications.default_journals_folder_path.title = Default journals folder
com.arsdigita.cms.contenttypes.publications.default_inproceedings_folder.purpose = Default folder for items created using the create pane of the ItemSearchWidget com.arsdigita.cms.contenttypes.publications.default_journals_folder_path.purpose = Path of the default folder for journals items created using the create pane of the ItemSearchWidget when assigning a journals. The path *must* include the content section.
com.arsdigita.cms.contenttypes.publications.default_inproceedings_folder.example = 10002 com.arsdigita.cms.contenttypes.publications.default_journals_folder_path.example = main:/path/to/journals/folder
com.arsdigita.cms.contenttypes.publications.default_inproceedings_folder.format = Integer com.arsdigita.cms.contenttypes.publications.default_journals_folder_path.format = [String]
com.arsdigita.cms.contenttypes.publications.default_articlesinjournal_folder.title = ID of the default folder for items created using the create pane of the ItemSearchWidget com.arsdigita.cms.contenttypes.publications.default_articlesincollectedvolumes_folder_id.title = ID of the default folder for items created using the create pane of the ItemSearchWidget
com.arsdigita.cms.contenttypes.publications.default_articlesinjournal_folder.purpose = Default folder for items created using the create pane of the ItemSearchWidget com.arsdigita.cms.contenttypes.publications.default_articlesincollectedvolumes_folder_id.purpose = Default folder for items created using the create pane of the ItemSearchWidget
com.arsdigita.cms.contenttypes.publications.default_articlesinjournal_folder.example = 10002 com.arsdigita.cms.contenttypes.publications.default_articlesincollectedvolumes_folder_id.example = 10002
com.arsdigita.cms.contenttypes.publications.default_articlesinjournal_folder.format = Integer com.arsdigita.cms.contenttypes.publications.default_articlesincollectedvolumes_folder_id.format = Integer
com.arsdigita.cms.contenttypes.publications.default_publications_folder.title = Default publications folder com.arsdigita.cms.contenttypes.publications.default_articlesincollectedvolumes_folder_path.title = Default articlesincollectedvolumes folder
com.arsdigita.cms.contenttypes.publications.default_publications_folder.purpose = Folder to put publications created using an importer in com.arsdigita.cms.contenttypes.publications.default_articlesincollectedvolumes_folder_path.purpose = Path of the default folder for articlesincollectedvolumes items created using the create pane of the ItemSearchWidget when assigning a articlesincollectedvolumes. The path *must* include the content section.
com.arsdigita.cms.contenttypes.publications.default_publications_folder.example = 10002 com.arsdigita.cms.contenttypes.publications.default_articlesincollectedvolumes_folder_path.example = main:/path/to/articlesincollectedvolumes/folder
com.arsdigita.cms.contenttypes.publications.default_publications_folder.format = Integer com.arsdigita.cms.contenttypes.publications.default_articlesincollectedvolumes_folder_path.format = [String]
com.arsdigita.cms.contenttypes.publications.default_organizations_folder_id.title = ID of the default folder for items created using the create pane of the ItemSearchWidget
com.arsdigita.cms.contenttypes.publications.default_organizations_folder_id.purpose = Default folder for items created using the create pane of the ItemSearchWidget
com.arsdigita.cms.contenttypes.publications.default_organizations_folder_id.example = 10002
com.arsdigita.cms.contenttypes.publications.default_organizations_folder_id.format = Integer
com.arsdigita.cms.contenttypes.publications.default_organizations_folder_path.title = Default organizations folder
com.arsdigita.cms.contenttypes.publications.default_organizations_folder_path.purpose = Path of the default folder for organizations items created using the create pane of the ItemSearchWidget when assigning a organizations. The path *must* include the content section.
com.arsdigita.cms.contenttypes.publications.default_organizations_folder_path.example = main:/path/to/organizations/folder
com.arsdigita.cms.contenttypes.publications.default_organizations_folder_path.format = [String]
com.arsdigita.cms.contenttypes.publications.default_proceedings_folder_id.title = ID of the default folder for items created using the create pane of the ItemSearchWidget
com.arsdigita.cms.contenttypes.publications.default_proceedings_folder_id.purpose = Default folder for items created using the create pane of the ItemSearchWidget
com.arsdigita.cms.contenttypes.publications.default_proceedings_folder_id.example = 10002
com.arsdigita.cms.contenttypes.publications.default_proceedings_folder_id.format = Integer
com.arsdigita.cms.contenttypes.publications.default_proceedings_folder_path.title = Default proceedings folder
com.arsdigita.cms.contenttypes.publications.default_proceedings_folder_path.purpose = Path of the default folder for proceedings items created using the create pane of the ItemSearchWidget when assigning a proceedings. The path *must* include the content section.
com.arsdigita.cms.contenttypes.publications.default_proceedings_folder_path.example = main:/path/to/proceedings/folder
com.arsdigita.cms.contenttypes.publications.default_proceedings_folder_path.format = [String]
com.arsdigita.cms.contenttypes.publications.default_inproceedings_folder_id.title = ID of the default folder for items created using the create pane of the ItemSearchWidget
com.arsdigita.cms.contenttypes.publications.default_inproceedings_folder_id.purpose = Default folder for items created using the create pane of the ItemSearchWidget
com.arsdigita.cms.contenttypes.publications.default_inproceedings_folder_id.example = 10002
com.arsdigita.cms.contenttypes.publications.default_inproceedings_folder_id.format = Integer
com.arsdigita.cms.contenttypes.publications.default_inproceedings_folder_path.title = Default inproceedings folder
com.arsdigita.cms.contenttypes.publications.default_inproceedings_folder_path.purpose = Path of the default folder for inproceedings items created using the create pane of the ItemSearchWidget when assigning a inproceedings. The path *must* include the content section.
com.arsdigita.cms.contenttypes.publications.default_inproceedings_folder_path.example = main:/path/to/inproceedings/folder
com.arsdigita.cms.contenttypes.publications.default_inproceedings_folder_path.format = [String]
com.arsdigita.cms.contenttypes.publications.default_articlesinjournal_folder_id.title = ID of the default folder for items created using the create pane of the ItemSearchWidget
com.arsdigita.cms.contenttypes.publications.default_articlesinjournal_folder_id.purpose = Default folder for items created using the create pane of the ItemSearchWidget
com.arsdigita.cms.contenttypes.publications.default_articlesinjournal_folder_id.example = 10002
com.arsdigita.cms.contenttypes.publications.default_articlesinjournal_folder_id.format = Integer
com.arsdigita.cms.contenttypes.publications.default_articlesinjournal_folder_path.title = Default articlesinjournal folder
com.arsdigita.cms.contenttypes.publications.default_articlesinjournal_folder_path.purpose = Path of the default folder for articlesinjournal items created using the create pane of the ItemSearchWidget when assigning a articlesinjournal. The path *must* include the content section.
com.arsdigita.cms.contenttypes.publications.default_articlesinjournal_folder_path.example = main:/path/to/articlesinjournal/folder
com.arsdigita.cms.contenttypes.publications.default_articlesinjournal_folder_path.format = [String]
com.arsdigita.cms.contenttypes.publications.default_publications_folder_id.title = Default publications folder
com.arsdigita.cms.contenttypes.publications.default_publications_folder_id.purpose = Folder to put publications created using an importer in
com.arsdigita.cms.contenttypes.publications.default_publications_folder_id.example = 10002
com.arsdigita.cms.contenttypes.publications.default_publications_folder_id.format = Integer
com.arsdigita.cms.contenttypes.publications.default_publications_folder_path.title = Default publications folder
com.arsdigita.cms.contenttypes.publications.default_publications_folder_path.purpose = Path of the default folder for publications items created using the create pane of the ItemSearchWidget when assigning a publications. The path *must* include the content section.
com.arsdigita.cms.contenttypes.publications.default_publications_folder_path.example = main:/path/to/publications/folder
com.arsdigita.cms.contenttypes.publications.default_publications_folder_path.format = [String]
com.arsdigita.cms.contenttypes.publications.organization_type.title = Type for imported organizations com.arsdigita.cms.contenttypes.publications.organization_type.title = Type for imported organizations
com.arsdigita.cms.contenttypes.publications.organization_type.purpose = Sets the type used for imported organization. Must be a subtype of com.arsdigita.cms.contenttypes.GenericOrganizationalUnit com.arsdigita.cms.contenttypes.publications.organization_type.purpose = Sets the type used for imported organization. Must be a subtype of com.arsdigita.cms.contenttypes.GenericOrganizationalUnit

View File

@ -69,9 +69,7 @@ public class ArticleInCollectedVolumeCollectedVolumeForm
itemSearch = new ItemSearchWidget(ITEM_SEARCH, itemSearch = new ItemSearchWidget(ITEM_SEARCH,
ContentType.findByAssociatedObjectType( ContentType.findByAssociatedObjectType(
CollectedVolume.class.getName())); CollectedVolume.class.getName()));
if ((config.getDefaultCollectedVolumesFolder() != null) && (config.getDefaultCollectedVolumesFolder() != 0)) { itemSearch.setDefaultCreationFolder(config.getDefaultCollectedVolumesFolder());
itemSearch.setDefaultCreationFolder(new Folder(new BigDecimal(config.getDefaultCollectedVolumesFolder())));
}
add(itemSearch); add(itemSearch);
} }

View File

@ -66,9 +66,7 @@ public class ArticleInJournalJournalForm
itemSearch = new ItemSearchWidget(ITEM_SEARCH, itemSearch = new ItemSearchWidget(ITEM_SEARCH,
ContentType.findByAssociatedObjectType( ContentType.findByAssociatedObjectType(
Journal.class.getName())); Journal.class.getName()));
if ((config.getDefaultJournalsFolder() != null) && (config.getDefaultJournalsFolder() != 0)) { itemSearch.setDefaultCreationFolder(config.getDefaultJournalsFolder());
itemSearch.setDefaultCreationFolder(new Folder(new BigDecimal(config.getDefaultJournalsFolder())));
}
itemSearch.setEditAfterCreate(false); itemSearch.setEditAfterCreate(false);
itemSearch.setQueryField("symbol"); itemSearch.setQueryField("symbol");
add(itemSearch); add(itemSearch);

View File

@ -75,9 +75,7 @@ public class CollectedVolumeArticleAddForm
ITEM_SEARCH, ITEM_SEARCH,
ContentType.findByAssociatedObjectType( ContentType.findByAssociatedObjectType(
ArticleInCollectedVolume.class.getName())); ArticleInCollectedVolume.class.getName()));
if ((config.getDefaultArticlesInCollectedVolumeFolder() != null) && (config.getDefaultArticlesInCollectedVolumeFolder() != 0)) { m_itemSearch.setDefaultCreationFolder(config.getDefaultArticlesInCollectedVolumeFolder());
m_itemSearch.setDefaultCreationFolder(new Folder(new BigDecimal(config.getDefaultArticlesInCollectedVolumeFolder())));
}
add(m_itemSearch); add(m_itemSearch);
} }

View File

@ -65,9 +65,7 @@ public class ExpertiseOrdererForm
itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType. itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.
findByAssociatedObjectType(GenericOrganizationalUnit.class. findByAssociatedObjectType(GenericOrganizationalUnit.class.
getName())); getName()));
if ((config.getDefaultOrganizationsFolder() != null) && (config.getDefaultOrganizationsFolder() != 0)) { itemSearch.setDefaultCreationFolder(config.getDefaultOrganizationsFolder());
itemSearch.setDefaultCreationFolder(new Folder(new BigDecimal(config.getDefaultOrganizationsFolder())));
}
itemSearch.setEditAfterCreate(false); itemSearch.setEditAfterCreate(false);
add(itemSearch); add(itemSearch);
} }

View File

@ -65,9 +65,7 @@ public class ExpertiseOrganizationForm
itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType. itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.
findByAssociatedObjectType(GenericOrganizationalUnit.class. findByAssociatedObjectType(GenericOrganizationalUnit.class.
getName())); getName()));
if ((config.getDefaultOrganizationsFolder() != null) && (config.getDefaultOrganizationsFolder() != 0)) { itemSearch.setDefaultCreationFolder(config.getDefaultOrganizationsFolder());
itemSearch.setDefaultCreationFolder(new Folder(new BigDecimal(config.getDefaultOrganizationsFolder())));
}
itemSearch.setEditAfterCreate(false); itemSearch.setEditAfterCreate(false);
add(itemSearch); add(itemSearch);
} }

View File

@ -37,8 +37,7 @@ import com.arsdigita.kernel.Kernel;
import java.math.BigDecimal; import java.math.BigDecimal;
/** /**
* Form for adding an association between a InProceedings publication and * Form for adding an association between a InProceedings publication and a proceedings publication.
* a proceedings publication.
* *
* @author Jens Pelzetter * @author Jens Pelzetter
* @version $Id$ * @version $Id$
@ -68,9 +67,7 @@ public class InProceedingsProceedingsForm
itemSearch = new ItemSearchWidget(ITEM_SEARCH, itemSearch = new ItemSearchWidget(ITEM_SEARCH,
ContentType.findByAssociatedObjectType( ContentType.findByAssociatedObjectType(
Proceedings.class.getName())); Proceedings.class.getName()));
if ((config.getDefaultProceedingsFolder() != null) && (config.getDefaultProceedingsFolder() != 0)) { itemSearch.setDefaultCreationFolder(config.getDefaultProceedingsFolder());
itemSearch.setDefaultCreationFolder(new Folder(new BigDecimal(config.getDefaultProceedingsFolder())));
}
add(itemSearch); add(itemSearch);
} }

View File

@ -65,9 +65,7 @@ public class InternetArticleOrganizationForm
itemSearch = new ItemSearchWidget(ITEM_SEARCH, itemSearch = new ItemSearchWidget(ITEM_SEARCH,
ContentType.findByAssociatedObjectType( ContentType.findByAssociatedObjectType(
GenericOrganizationalUnit.class.getName())); GenericOrganizationalUnit.class.getName()));
if ((config.getDefaultOrganizationsFolder() != null) && (config.getDefaultOrganizationsFolder() != 0)) { itemSearch.setDefaultCreationFolder(config.getDefaultOrganizationsFolder());
itemSearch.setDefaultCreationFolder(new Folder(new BigDecimal(config.getDefaultOrganizationsFolder())));
}
itemSearch.setEditAfterCreate(false); itemSearch.setEditAfterCreate(false);
add(itemSearch); add(itemSearch);
} }

View File

@ -74,9 +74,7 @@ public class JournalArticleAddForm
ITEM_SEARCH, ITEM_SEARCH,
ContentType.findByAssociatedObjectType( ContentType.findByAssociatedObjectType(
ArticleInJournal.class.getName())); ArticleInJournal.class.getName()));
if ((config.getDefaultArticlesInJournalFolder() != null) && (config.getDefaultArticlesInJournalFolder() != 0)) { m_itemSearch.setDefaultCreationFolder(config.getDefaultArticlesInJournalFolder());
m_itemSearch.setDefaultCreationFolder(new Folder(new BigDecimal(config.getDefaultArticlesInJournalFolder())));
}
add(m_itemSearch); add(m_itemSearch);
} }

View File

@ -65,9 +65,7 @@ public class ProceedingsOrganizerForm
itemSearch = new ItemSearchWidget(ITEM_SEARCH, itemSearch = new ItemSearchWidget(ITEM_SEARCH,
ContentType.findByAssociatedObjectType( ContentType.findByAssociatedObjectType(
GenericOrganizationalUnit.class.getName())); GenericOrganizationalUnit.class.getName()));
if ((config.getDefaultOrganizationsFolder() != null) && (config.getDefaultOrganizationsFolder() != 0)) { itemSearch.setDefaultCreationFolder(config.getDefaultOrganizationsFolder());
itemSearch.setDefaultCreationFolder(new Folder(new BigDecimal(config.getDefaultOrganizationsFolder())));
}
itemSearch.setEditAfterCreate(false); itemSearch.setEditAfterCreate(false);
add(itemSearch); add(itemSearch);
} }

View File

@ -69,9 +69,7 @@ public class ProceedingsPapersAddForm
ITEM_SEARCH, ITEM_SEARCH,
ContentType.findByAssociatedObjectType( ContentType.findByAssociatedObjectType(
InProceedings.class.getName())); InProceedings.class.getName()));
if ((config.getDefaultInProceedingsFolder() != null) && (config.getDefaultInProceedingsFolder() != 0)) { m_itemSearch.setDefaultCreationFolder(config.getDefaultInProceedingsFolder());
m_itemSearch.setDefaultCreationFolder(new Folder(new BigDecimal(config.getDefaultInProceedingsFolder())));
}
add(m_itemSearch); add(m_itemSearch);
} }

View File

@ -80,18 +80,6 @@ public class PublicationAuthorAddForm
m_itemSearch = new ItemSearchWidget( m_itemSearch = new ItemSearchWidget(
ITEM_SEARCH, ITEM_SEARCH,
ContentType.findByAssociatedObjectType(GenericPerson.class.getName())); ContentType.findByAssociatedObjectType(GenericPerson.class.getName()));
// if ((config.getDefaultAuthorsFolderID() != null)
// && (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.setDefaultCreationFolder(config.getDefaultAuthorsFolder());
m_itemSearch.setEditAfterCreate(false); m_itemSearch.setEditAfterCreate(false);
add(m_itemSearch); add(m_itemSearch);

View File

@ -77,9 +77,7 @@ public class PublicationSeriesAddForm
m_itemSearch = new ItemSearchWidget( m_itemSearch = new ItemSearchWidget(
ITEM_SEARCH, ITEM_SEARCH,
ContentType.findByAssociatedObjectType(Series.class.getName())); ContentType.findByAssociatedObjectType(Series.class.getName()));
if ((config.getDefaultSeriesFolder() != null) && (config.getDefaultSeriesFolder() != 0)) { m_itemSearch.setDefaultCreationFolder(config.getDefaultSeriesFolder());
m_itemSearch.setDefaultCreationFolder(new Folder(new BigDecimal(config.getDefaultSeriesFolder())));
}
add(m_itemSearch); add(m_itemSearch);
add(new Label((String) PublicationGlobalizationUtil.globalize( add(new Label((String) PublicationGlobalizationUtil.globalize(

View File

@ -66,10 +66,7 @@ public class PublicationWithPublisherSetPublisherForm
itemSearch = itemSearch =
new ItemSearchWidget(ITEM_SEARCH, ContentType.findByAssociatedObjectType(Publisher.class. new ItemSearchWidget(ITEM_SEARCH, ContentType.findByAssociatedObjectType(Publisher.class.
getName())); getName()));
if ((config.getDefaultPublisherFolder() != null) && config.getDefaultPublisherFolder() != 0) { itemSearch.setDefaultCreationFolder(config.getDefaultPublisherFolder());
itemSearch.setDefaultCreationFolder(new Folder(new BigDecimal(config.
getDefaultPublisherFolder())));
}
itemSearch.setEditAfterCreate(false); itemSearch.setEditAfterCreate(false);
add(itemSearch); add(itemSearch);
} }

View File

@ -86,17 +86,7 @@ public class SeriesEditshipAddForm
ITEM_SEARCH, ITEM_SEARCH,
ContentType.findByAssociatedObjectType(GenericPerson.class. ContentType.findByAssociatedObjectType(GenericPerson.class.
getName())); getName()));
if ((config.getDefaultAuthorsFolderID() != null) && (config.getDefaultAuthorsFolderID() != 0)) { m_itemSearch.setDefaultCreationFolder(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);

View File

@ -172,7 +172,6 @@ public class SeriesExtraXmlGenerator implements ExtraXMLGenerator {
return; return;
} }
final Element volumesElem = parent.newChildElement("volumes"); final Element volumesElem = parent.newChildElement("volumes");
while (volumes.next()) { while (volumes.next()) {
// createVolumeXml(volumes.getPublication(GlobalizationHelper. // createVolumeXml(volumes.getPublication(GlobalizationHelper.

View File

@ -65,9 +65,7 @@ public class UnPublishedOrganizationForm
itemSearch = new ItemSearchWidget(ITEM_SEARCH, itemSearch = new ItemSearchWidget(ITEM_SEARCH,
ContentType.findByAssociatedObjectType( ContentType.findByAssociatedObjectType(
GenericOrganizationalUnit.class.getName())); GenericOrganizationalUnit.class.getName()));
if ((config.getDefaultOrganizationsFolder() != null) && (config.getDefaultOrganizationsFolder() != 0)) { itemSearch.setDefaultCreationFolder(config.getDefaultOrganizationsFolder());
itemSearch.setDefaultCreationFolder(new Folder(new BigDecimal(config.getDefaultOrganizationsFolder())));
}
itemSearch.setEditAfterCreate(false); itemSearch.setEditAfterCreate(false);
add(itemSearch); add(itemSearch);
} }

View File

@ -27,7 +27,8 @@ import org.jbibtex.BibTeXEntry;
import org.jbibtex.ParseException; import org.jbibtex.ParseException;
/** /**
* Central access point for retrieving {@link BibTeXConverter}s for importing publication data in the BibTeX format. * Central access point for retrieving {@link BibTeXConverter}s for importing publication data in
* the BibTeX format.
* *
* @author Jens Pelzetter <jens@jp-digital.de> * @author Jens Pelzetter <jens@jp-digital.de>
* @version $Id$ * @version $Id$
@ -73,10 +74,11 @@ public class BibTeXConverters {
getType().getValue().toLowerCase()); getType().getValue().toLowerCase());
if (converter == null) { if (converter == null) {
report.addMessage(String.format("No converter for BibTeX type '%s' available. Publication '%s' has not" report.addMessage(String.format(
+ "been imported.", "No converter for BibTeX type '%s' available. Publication '%s' has not"
bibTeXEntry.getType().getValue(), + "been imported.",
bibTeXEntry.getKey().getValue())); bibTeXEntry.getType().getValue(),
bibTeXEntry.getKey().getValue()));
return report; return report;
} }
@ -89,20 +91,22 @@ public class BibTeXConverters {
converter = converter.getClass().newInstance(); converter = converter.getClass().newInstance();
} catch (InstantiationException ex) { } catch (InstantiationException ex) {
final StringWriter writer = new StringWriter(); final StringWriter writer = new StringWriter();
writer.append(String.format("Failed to create instance of converter for BibTeX type '%s'. Publication" writer.append(String.format(
+ " '%s' was not imported.", "Failed to create instance of converter for BibTeX type '%s'. Publication"
bibTeXEntry.getType().getValue(), + " '%s' was not imported.",
bibTeXEntry.getKey().getValue())); bibTeXEntry.getType().getValue(),
bibTeXEntry.getKey().getValue()));
ex.printStackTrace(new PrintWriter(writer)); ex.printStackTrace(new PrintWriter(writer));
report.addMessage(writer.toString()); report.addMessage(writer.toString());
return report; return report;
} catch (IllegalAccessException ex) { } catch (IllegalAccessException ex) {
final StringWriter writer = new StringWriter(); final StringWriter writer = new StringWriter();
writer.append(String.format("Failed to create instance of converter for BibTeX type '%s'. Publication" writer.append(String.format(
+ " '%s' was not imported.", "Failed to create instance of converter for BibTeX type '%s'. Publication"
bibTeXEntry.getType().getValue(), + " '%s' was not imported.",
bibTeXEntry.getKey().getValue())); bibTeXEntry.getType().getValue(),
bibTeXEntry.getKey().getValue()));
ex.printStackTrace(new PrintWriter(writer)); ex.printStackTrace(new PrintWriter(writer));
report.addMessage(writer.toString()); report.addMessage(writer.toString());
@ -146,12 +150,12 @@ public class BibTeXConverters {
* *
* @return * @return
*/ */
protected Integer getFolderId() { protected Folder getFolder() {
return Publication.getConfig().getDefaultPublicationsFolder(); return Publication.getConfig().getDefaultProceedingsFolder();
} }
protected void assignFolder(final Publication publication, final PublicationBundle bundle) { protected void assignFolder(final Publication publication, final PublicationBundle bundle) {
final Folder folder = new Folder(new BigDecimal(getFolderId())); final Folder folder = getFolder();
bundle.setParent(folder); bundle.setParent(folder);
bundle.setContentSection(folder.getContentSection()); bundle.setContentSection(folder.getContentSection());
publication.setContentSection(folder.getContentSection()); publication.setContentSection(folder.getContentSection());
@ -208,5 +212,4 @@ public class BibTeXConverters {
return result; return result;
} }
} }

View File

@ -23,19 +23,20 @@ import java.util.List;
/** /**
* *
* @param <T> * @param <T>
* @param <B> * @param <B>
* @author Jens Pelzetter <jens@jp-digital.de> * @author Jens Pelzetter <jens@jp-digital.de>
* @version $Id$ * @version $Id$
*/ */
public abstract class AbstractRisConverter<T extends Publication, B extends PublicationBundle> implements RisConverter { public abstract class AbstractRisConverter<T extends Publication, B extends PublicationBundle>
implements RisConverter {
protected abstract T createPublication(boolean pretend); protected abstract T createPublication(boolean pretend);
protected abstract String getTypeName(); protected abstract String getTypeName();
protected abstract B createBundle(T publication, boolean pretend); protected abstract B createBundle(T publication, boolean pretend);
protected String getYear(final RisDataset dataset) { protected String getYear(final RisDataset dataset) {
final List<String> values = dataset.getValues().get(RisField.PY); final List<String> values = dataset.getValues().get(RisField.PY);
if ((values == null) || values.isEmpty()) { if ((values == null) || values.isEmpty()) {
@ -97,15 +98,15 @@ public abstract class AbstractRisConverter<T extends Publication, B extends Publ
/** /**
* Overwrite this method to put a publication of specific type into a special folder. * Overwrite this method to put a publication of specific type into a special folder.
* *
* @return * @return
*/ */
protected Integer getFolderId() { protected Folder getFolder() {
return Publication.getConfig().getDefaultPublicationsFolder(); return Publication.getConfig().getDefaultProceedingsFolder();
} }
protected void assignFolder(final Publication publication, final PublicationBundle bundle) { protected void assignFolder(final Publication publication, final PublicationBundle bundle) {
final Folder folder = new Folder(new BigDecimal(getFolderId())); final Folder folder = getFolder();
bundle.setParent(folder); bundle.setParent(folder);
bundle.setContentSection(folder.getContentSection()); bundle.setContentSection(folder.getContentSection());
publication.setContentSection(folder.getContentSection()); publication.setContentSection(folder.getContentSection());
@ -136,7 +137,8 @@ public abstract class AbstractRisConverter<T extends Publication, B extends Publ
final DataCollection collection = session.retrieve(type); final DataCollection collection = session.retrieve(type);
final FilterFactory filterFactory = collection.getFilterFactory(); final FilterFactory filterFactory = collection.getFilterFactory();
final Filter titleFilter = filterFactory.equals(Publication.TITLE, title); final Filter titleFilter = filterFactory.equals(Publication.TITLE, title);
final Filter yearFilter = filterFactory.equals(Publication.YEAR_OF_PUBLICATION, yearOfPublication); final Filter yearFilter = filterFactory.equals(Publication.YEAR_OF_PUBLICATION,
yearOfPublication);
collection.addFilter(titleFilter); collection.addFilter(titleFilter);
collection.addFilter(yearFilter); collection.addFilter(yearFilter);
@ -152,5 +154,4 @@ public abstract class AbstractRisConverter<T extends Publication, B extends Publ
return result; return result;
} }
} }

View File

@ -87,8 +87,7 @@ public class ImporterUtil {
if (collection.isEmpty()) { if (collection.isEmpty()) {
if (!pretend) { if (!pretend) {
final Integer folderId = Publication.getConfig().getDefaultAuthorsFolderID(); final Folder folder = Publication.getConfig().getDefaultAuthorsFolder();
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.");
} }
@ -154,8 +153,7 @@ public class ImporterUtil {
report.setPlace(place); report.setPlace(place);
if (collection.isEmpty()) { if (collection.isEmpty()) {
if (!pretend) { if (!pretend) {
final Integer folderId = Publication.getConfig().getDefaultPublisherFolder(); final Folder folder = Publication.getConfig().getDefaultPublisherFolder();
final Folder folder = new Folder(new BigDecimal(folderId));
if (folder == null) { if (folder == null) {
throw new IllegalArgumentException("Error getting folders for publishers"); throw new IllegalArgumentException("Error getting folders for publishers");
} }
@ -225,8 +223,7 @@ public class ImporterUtil {
report.setCollectedVolumeTitle(title); report.setCollectedVolumeTitle(title);
if (collection.isEmpty()) { if (collection.isEmpty()) {
if (!pretend) { if (!pretend) {
final Integer folderId = Publication.getConfig().getDefaultCollectedVolumesFolder(); final Folder folder = Publication.getConfig().getDefaultCollectedVolumesFolder();
final Folder folder = new Folder(new BigDecimal(folderId));
if (folder == null) { if (folder == null) {
throw new IllegalArgumentException("Error getting foldes for collected volumes."); throw new IllegalArgumentException("Error getting foldes for collected volumes.");
} }
@ -322,8 +319,7 @@ public class ImporterUtil {
report.setProceedingsTitle(title); report.setProceedingsTitle(title);
if (collection.isEmpty()) { if (collection.isEmpty()) {
if (!pretend) { if (!pretend) {
final Integer folderId = Publication.getConfig().getDefaultProceedingsFolder(); final Folder folder = Publication.getConfig().getDefaultProceedingsFolder();
final Folder folder = new Folder(new BigDecimal(folderId));
if (folder == null) { if (folder == null) {
throw new IllegalArgumentException("Failed to get folder for proceedings."); throw new IllegalArgumentException("Failed to get folder for proceedings.");
} }
@ -408,8 +404,7 @@ public class ImporterUtil {
report.setJournalTitle(title); report.setJournalTitle(title);
if (collection.isEmpty()) { if (collection.isEmpty()) {
if (!pretend) { if (!pretend) {
final Integer folderId = Publication.getConfig().getDefaultJournalsFolder(); final Folder folder = Publication.getConfig().getDefaultJournalsFolder();
final Folder folder = new Folder(new BigDecimal(folderId));
if (folder == null) { if (folder == null) {
throw new IllegalArgumentException("Error getting folder for journals"); throw new IllegalArgumentException("Error getting folder for journals");
} }
@ -464,8 +459,7 @@ public class ImporterUtil {
report.setName(name); report.setName(name);
if (collection.isEmpty()) { if (collection.isEmpty()) {
if (!pretend) { if (!pretend) {
final Integer folderId = Publication.getConfig().getDefaultOrganizationsFolder(); final Folder folder = Publication.getConfig().getDefaultOrganizationsFolder();
final Folder folder = new Folder(new BigDecimal(folderId));
if (folder == null) { if (folder == null) {
throw new IllegalArgumentException("Error getting folder for organizations."); throw new IllegalArgumentException("Error getting folder for organizations.");
} }
@ -530,8 +524,7 @@ public class ImporterUtil {
report.setName(name); report.setName(name);
if (collection.isEmpty()) { if (collection.isEmpty()) {
if (!pretend) { if (!pretend) {
final Integer folderId = Publication.getConfig().getDefaultOrganizationsFolder(); final Folder folder = Publication.getConfig().getDefaultOrganizationsFolder();
final Folder folder = new Folder(new BigDecimal(folderId));
if (folder == null) { if (folder == null) {
throw new IllegalArgumentException("Error getting folder for organizations."); throw new IllegalArgumentException("Error getting folder for organizations.");
} }
@ -597,8 +590,7 @@ public class ImporterUtil {
report.setSeriesTitle(seriesTitle); report.setSeriesTitle(seriesTitle);
if (collection.isEmpty()) { if (collection.isEmpty()) {
if (!pretend) { if (!pretend) {
final Integer folderId = Publication.getConfig().getDefaultSeriesFolder(); final Folder folder = Publication.getConfig().getDefaultSeriesFolder();
final Folder folder = new Folder(new BigDecimal(folderId));
if (folder == null) { if (folder == null) {
throw new IllegalArgumentException("Error getting folder for series."); throw new IllegalArgumentException("Error getting folder for series.");
} }