From edd69712823fdfb7c884760ffdad104d46ce7233 Mon Sep 17 00:00:00 2001 From: jensp Date: Tue, 26 Nov 2013 11:56:41 +0000 Subject: [PATCH] =?UTF-8?q?=C3=84nderungen=20am=20Handling=20von=20Ordnern?= =?UTF-8?q?=20aus=20der=20Konfiguration=20f=C3=BCr=20die=20ItemSearchCreat?= =?UTF-8?q?ePane=20(Ticket=20#1838).=20Ordner=20jetzt=20au=C3=9Ferdem=20an?= =?UTF-8?q?hand=20ihres=20Pfades=20konfiguriert=20werden.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://svn.libreccm.org/ccm/trunk@2459 8810af33-2d31-482b-a856-94f89814c4df --- .../cms/ui/ItemSearchCreateItemPane.java | 219 +++----- .../cms/contenttypes/PublicationsConfig.java | 523 ++++++++++++++---- .../PublicationsConfig_parameter.properties | 130 +++-- ...eInCollectedVolumeCollectedVolumeForm.java | 4 +- .../ui/ArticleInJournalJournalForm.java | 4 +- .../ui/CollectedVolumeArticleAddForm.java | 4 +- .../contenttypes/ui/ExpertiseOrdererForm.java | 4 +- .../ui/ExpertiseOrganizationForm.java | 4 +- .../ui/InProceedingsProceedingsForm.java | 7 +- .../ui/InternetArticleOrganizationForm.java | 4 +- .../ui/JournalArticleAddForm.java | 4 +- .../ui/ProceedingsOrganizerForm.java | 4 +- .../ui/ProceedingsPapersAddForm.java | 4 +- .../ui/PublicationAuthorAddForm.java | 12 - .../ui/PublicationSeriesAddForm.java | 4 +- ...licationWithPublisherSetPublisherForm.java | 5 +- .../ui/SeriesEditshipAddForm.java | 12 +- .../ui/SeriesExtraXmlGenerator.java | 1 - .../ui/UnPublishedOrganizationForm.java | 4 +- .../importer/bibtex/BibTeXConverters.java | 37 +- .../ris/converters/AbstractRisConverter.java | 21 +- .../importer/util/ImporterUtil.java | 24 +- 22 files changed, 626 insertions(+), 409 deletions(-) diff --git a/ccm-cms/src/com/arsdigita/cms/ui/ItemSearchCreateItemPane.java b/ccm-cms/src/com/arsdigita/cms/ui/ItemSearchCreateItemPane.java index 72871fda8..824b4439e 100644 --- a/ccm-cms/src/com/arsdigita/cms/ui/ItemSearchCreateItemPane.java +++ b/ccm-cms/src/com/arsdigita/cms/ui/ItemSearchCreateItemPane.java @@ -16,7 +16,6 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ - package com.arsdigita.cms.ui; import com.arsdigita.bebop.BoxPanel; @@ -56,29 +55,25 @@ import java.math.BigDecimal; * @author Sören Bernstein * @author Jens Pelzetter */ -class ItemSearchCreateItemPane extends CMSContainer - implements FormInitListener, - FormProcessListener, - FormSubmissionListener { +class ItemSearchCreateItemPane extends CMSContainer + implements FormInitListener, + FormProcessListener, + FormSubmissionListener { public static final String WIDGET_PARAM = "widget"; public static final String SEARCHWIDGET_PARAM = "searchWidget"; public static final String PUBLISHWIDGET_PARAM = "publishWidget"; - private static final String CONTENT_TYPE_ID = "ct"; private static final String FOLDER_ID = "folder_id"; private static final String FLAT_FOLDER = "flatFolder"; - private final SingleSelectionModel m_typeSel; private String defaultFolder; private boolean editAfterCreate = true; private final ContentItemRequestLocal m_contentItem = new ContentItemRequestLocal() { }; - //private final Link m_selectCloseLink; //private final Link m_selectEditLink; // private final Link m_fallBackLink; - private Link m_fallBackLink; // private final SegmentedPanel m_segPanel; private SegmentedPanel m_segPanel; @@ -86,7 +81,7 @@ class ItemSearchCreateItemPane extends CMSContainer private Segment m_creationSeg; // private final 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 SingleSelectionModel m_model; private SingleSelectionModel m_model; @@ -105,11 +100,9 @@ class ItemSearchCreateItemPane extends CMSContainer // again. // // //////////////////////////////////////////////////////////////////////// - - /** - * - * @param parent + * + * @param parent */ public ItemSearchCreateItemPane(final ItemSearchPage parent) { super(); @@ -120,8 +113,8 @@ class ItemSearchCreateItemPane extends CMSContainer } /** - * - * @param parent + * + * @param parent */ public ItemSearchCreateItemPane(final CMSItemSearchPage parent) { super(); @@ -132,12 +125,11 @@ class ItemSearchCreateItemPane extends CMSContainer } /** - * Private service method to initialize all the instance properties. - * Used by constructors as a temporarly measure to be able to provide - * two constructors. - * Should be removed when migration completed (cf. note above). + * Private service method to initialize all the instance properties. Used by constructors as a + * temporarly measure to be able to provide two constructors. Should be removed when migration + * completed (cf. note above). */ - private void init() { + private void init() { m_segPanel = new SegmentedPanel("itemSearchCreate"); m_creationSeg = new Segment(); m_newItemSeg = new Segment(); @@ -161,14 +153,13 @@ class ItemSearchCreateItemPane extends CMSContainer m_contentItem.set(state, item); } - }; m_creationSeg.add(m_creator); m_creationSeg.add(new Label("
", false)); final BoxPanel folderRow = new BoxPanel(BoxPanel.HORIZONTAL); 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); folderRow.add(m_folderPicker); m_newItem.add(folderRow); @@ -185,128 +176,56 @@ class ItemSearchCreateItemPane extends CMSContainer m_fallBackLink = new Link( (String) GlobalizationUtil.globalize("cms.ui.search.create.fallback").localize(), new PrintListener() { - public void prepare(final PrintEvent event) { - final Link target = (Link) event.getTarget(); - final PageState state = event.getPageState(); + 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 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 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 String scriptAction; - if (editAfterCreate) { - ((Label) target.getChild()).setLabel((String) GlobalizationUtil.globalize( - "cms.ui.search.create.select_edit").localize()); + final String scriptAction; + if (editAfterCreate) { + ((Label) target.getChild()).setLabel((String) GlobalizationUtil.globalize( + "cms.ui.search.create.select_edit").localize()); - 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); - scriptAction = ""; - } else { - ((Label) target.getChild()).setLabel((String) GlobalizationUtil.globalize( - "cms.ui.search.create.select_close").localize()); - scriptAction = "self.close();\n" - + "return false;"; - } + 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); + scriptAction = ""; + } else { + ((Label) target.getChild()).setLabel((String) GlobalizationUtil.globalize( + "cms.ui.search.create.select_close").localize()); + scriptAction = "self.close();\n" + + "return false;"; + } - target.setOnClick(String.format("window.opener.document.%s.value=\"%s\";" - + "window.opener.document.%s.value=\"%s\";" - + "window.opener.document.%s.value=\"%s\";" - + "%s", - widget, - item.getID().toString(), - searchWidget, - title.replace("\"", "\\\""), - publishWidget, - Boolean.TRUE.toString(), - 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())); -// -// } -// -// }); + target.setOnClick(String.format("window.opener.document.%s.value=\"%s\";" + + "window.opener.document.%s.value=\"%s\";" + + "window.opener.document.%s.value=\"%s\";" + + "%s", + widget, + item.getID().toString(), + searchWidget, + title.replace("\"", "\\\""), + publishWidget, + Boolean.TRUE.toString(), + scriptAction)); + } + }); final BoxPanel linkPanel = new BoxPanel(BoxPanel.VERTICAL); 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 searchWidget = (String) state.getValue(new StringParameter(SEARCHWIDGET_PARAM)); - final String publishWidget = (String) state.getValue(new StringParameter(PUBLISHWIDGET_PARAM)); + final String searchWidget = (String) state.getValue(new StringParameter( + SEARCHWIDGET_PARAM)); + final String publishWidget = (String) state.getValue(new StringParameter( + PUBLISHWIDGET_PARAM)); final String scriptAction; if (editAfterCreate) { final ContentSection section = item.getContentSection(); final String nodeURL = section.getPath() + "/"; 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); } else { scriptAction = "self.close();"; @@ -355,7 +277,6 @@ class ItemSearchCreateItemPane extends CMSContainer scriptAction)); } - }); linkPanel.add(jsLabel); //linkPanel.add(m_selectCloseLink); @@ -368,8 +289,8 @@ class ItemSearchCreateItemPane extends CMSContainer } // init /** - * - * @param page + * + * @param page */ @Override public void register(final Page page) { @@ -384,9 +305,9 @@ class ItemSearchCreateItemPane extends CMSContainer } /** - * + * * @param fse - * @throws FormProcessException + * @throws FormProcessException */ public void init(final FormSectionEvent fse) throws FormProcessException { final PageState state = fse.getPageState(); @@ -431,7 +352,6 @@ class ItemSearchCreateItemPane extends CMSContainer public ContentSection getContentSection(PageState s) { return CMS.getContext().getContentSection(); } - } protected String getDefaultFolder() { @@ -449,5 +369,4 @@ class ItemSearchCreateItemPane extends CMSContainer protected void setEditAfterCreate(final boolean editAfterCreate) { this.editAfterCreate = editAfterCreate; } - } diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/PublicationsConfig.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/PublicationsConfig.java index 57ee1740c..9fa7660b7 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/PublicationsConfig.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/PublicationsConfig.java @@ -49,16 +49,26 @@ public class PublicationsConfig extends AbstractConfig { private final Parameter publisherPublicationsStepSortKey; private final Parameter defaultAuthorsFolderID; private final Parameter defaultAuthorsFolderPath; - private final Parameter defaultSeriesFolder; - private final Parameter defaultPublisherFolder; - private final Parameter defaultCollectedVolumesFolder; - private final Parameter defaultJournalsFolder; - private final Parameter defaultArticlesInCollectedVolumeFolder; - private final Parameter defaultOrganizationsFolder; - private final Parameter defaultProceedingsFolder; - private final Parameter defaultInProceedingsFolder; - private final Parameter defaultArticlesInJournalFolder; - private final Parameter defaultPublicationsFolder; + private final Parameter defaultSeriesFolderID; + private final Parameter defaultSeriesFolderPath; + private final Parameter defaultPublisherFolderID; + private final Parameter defaultPublisherFolderPath; + private final Parameter defaultCollectedVolumesFolderID; + private final Parameter defaultCollectedVolumesFolderPath; + private final Parameter defaultJournalsFolderID; + private final Parameter defaultJournalsFolderPath; + private final Parameter defaultArticlesInCollectedVolumeFolderID; + 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 orgaBundleType; private final Parameter enableFirstPublishedProperty; @@ -135,53 +145,103 @@ public class PublicationsConfig extends AbstractConfig { Parameter.OPTIONAL, null); - defaultSeriesFolder = new IntegerParameter( - "com.arsdigita.cms.contenttypes.publications.default_series_folder", + defaultSeriesFolderID = new IntegerParameter( + "com.arsdigita.cms.contenttypes.publications.default_series_folder_id", Parameter.OPTIONAL, null); - defaultPublisherFolder = new IntegerParameter( - "com.arsdigita.cms.contenttypes.publications.default_publisher_folder", + defaultSeriesFolderPath = new StringParameter( + "com.arsdigita.cms.contenttypes.publications.default_series_folder_path", Parameter.OPTIONAL, null); - defaultCollectedVolumesFolder = new IntegerParameter( - "com.arsdigita.cms.contenttypes.publications.default_collectedvolumes_folder", + defaultPublisherFolderID = new IntegerParameter( + "com.arsdigita.cms.contenttypes.publications.default_publisher_folder_id", Parameter.OPTIONAL, null); - defaultJournalsFolder = new IntegerParameter( - "com.arsdigita.cms.contenttypes.publications.default_journals_folder", + defaultPublisherFolderPath = new StringParameter( + "com.arsdigita.cms.contenttypes.publications.default_publisher_folder_path", Parameter.OPTIONAL, null); - defaultArticlesInCollectedVolumeFolder = new IntegerParameter( - "com.arsdigita.cms.contenttypes.publications.default_articlesincollectedvolume_folder", + defaultCollectedVolumesFolderID = new IntegerParameter( + "com.arsdigita.cms.contenttypes.publications.default_collectedvolumes_folder_id", Parameter.OPTIONAL, null); - defaultOrganizationsFolder = new IntegerParameter( - "com.arsdigita.cms.contenttypes.publications.default_organizations_folder", + defaultCollectedVolumesFolderPath = new StringParameter( + "com.arsdigita.cms.contenttypes.publications.default_collectedvolumes_folder_path", Parameter.OPTIONAL, null); - defaultProceedingsFolder = new IntegerParameter( - "com.arsdigita.cms.contenttypes.publications.default_proceedings_folder", + defaultJournalsFolderID = new IntegerParameter( + "com.arsdigita.cms.contenttypes.publications.default_journals_folder_id", Parameter.OPTIONAL, null); - defaultInProceedingsFolder = new IntegerParameter( - "com.arsdigita.cms.contenttypes.publications.default_inproccedings_folder", + defaultJournalsFolderPath = new StringParameter( + "com.arsdigita.cms.contenttypes.publications.default_journals_folder_path", Parameter.OPTIONAL, null); - defaultArticlesInJournalFolder = new IntegerParameter( - "com.arsdigita.cms.contenttypes.publications.default_articlesinjournal_folder", + defaultArticlesInCollectedVolumeFolderID = new IntegerParameter( + "com.arsdigita.cms.contenttypes.publications.default_articlesincollectedvolume_folder_id", Parameter.OPTIONAL, null); - defaultPublicationsFolder = new IntegerParameter( - "com.arsdigita.cms.contenttypes.publications.default_publications_folder", + defaultArticlesInCollectedVolumeFolderPath = new StringParameter( + "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, null); @@ -216,16 +276,26 @@ public class PublicationsConfig extends AbstractConfig { register(publisherPublicationsStepSortKey); register(defaultAuthorsFolderID); register(defaultAuthorsFolderPath); - register(defaultSeriesFolder); - register(defaultPublisherFolder); - register(defaultCollectedVolumesFolder); - register(defaultJournalsFolder); - register(defaultArticlesInCollectedVolumeFolder); - register(defaultOrganizationsFolder); - register(defaultProceedingsFolder); - register(defaultInProceedingsFolder); - register(defaultArticlesInJournalFolder); - register(defaultPublicationsFolder); + register(defaultSeriesFolderID); + register(defaultSeriesFolderPath); + register(defaultPublisherFolderID); + register(defaultPublisherFolderPath); + register(defaultCollectedVolumesFolderID); + register(defaultCollectedVolumesFolderPath); + register(defaultJournalsFolderID); + register(defaultJournalsFolderPath); + register(defaultArticlesInCollectedVolumeFolderID); + 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(orgaBundleType); register(enableFirstPublishedProperty); @@ -234,6 +304,52 @@ public class PublicationsConfig extends AbstractConfig { 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() { return (Boolean) get(attachOrgaUnitsStep); } @@ -275,10 +391,9 @@ public class PublicationsConfig extends AbstractConfig { } /** - * - * @return - * @deprecated Use {@link #getDefaultAuthorsFolderPath()} or {@link #getDefaultAuthorsFolder()} - * instead. + * + * @return @deprecated Use {@link #getDefaultAuthorsFolderPath()} or + * {@link #getDefaultAuthorsFolder()} instead. */ @Deprecated public Integer getDefaultAuthorsFolderID() { @@ -298,129 +413,317 @@ public class PublicationsConfig extends AbstractConfig { } /** - * 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 + * 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 + * + * 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; - } - } + return getDefaultFolder(getDefaultAuthorsFolderPath(), getDefaultAuthorsFolderID()); - 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; +// 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() { - if (get(defaultSeriesFolder) == null) { + /** + * + * @return @deprecated Use {@link #getDefaultSeriesFolder()} instead + */ + @Deprecated + public Integer getDefaultSeriesFolderID() { + if (get(defaultSeriesFolderID) == null) { return null; } else { - return (Integer) get(defaultSeriesFolder); + return (Integer) get(defaultSeriesFolderID); } } - public Integer getDefaultPublisherFolder() { - if (get(defaultPublisherFolder) == null) { + public String getDefaultSeriesFolderPath() { + if (get(defaultSeriesFolderPath) == null) { return null; } 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; } else { - return (Integer) get(defaultCollectedVolumesFolder); + return (Integer) get(defaultPublisherFolderID); } } - public Integer getDefaultJournalsFolder() { - if (get(defaultJournalsFolder) == null) { + public String getDefaultPublisherFolderPath() { + if (getDefaultPublisherFolderPath() == null) { return null; } else { - return (Integer) get(defaultJournalsFolder); + return (String) get(defaultPublisherFolderPath); } } - public Integer getDefaultArticlesInCollectedVolumeFolder() { - if (get(defaultArticlesInCollectedVolumeFolder) == null) { + public Folder getDefaultPublisherFolder() { + return getDefaultFolder(getDefaultPublisherFolderPath(), getDefaultPublisherFolderID()); + } + + /** + * + * @return @deprecated Use {@link #getDefaultCollectedVolumesFolder()} + */ + @Deprecated + public Integer getDefaultCollectedVolumesFolderID() { + if (get(defaultCollectedVolumesFolderID) == null) { return null; } else { - return (Integer) get(defaultArticlesInCollectedVolumeFolder); + return (Integer) get(defaultCollectedVolumesFolderID); } } - public Integer getDefaultOrganizationsFolder() { - if (get(defaultOrganizationsFolder) == null) { + public String getDefaultCollectedVolumesFolderPath() { + if (get(defaultCollectedVolumesFolderPath) == null) { return null; } else { - return (Integer) get(defaultOrganizationsFolder); + return (String) get(defaultCollectedVolumesFolderPath); } } - public Integer getDefaultProceedingsFolder() { - if (get(defaultProceedingsFolder) == null) { + public Folder getDefaultCollectedVolumesFolder() { + return getDefaultFolder(getDefaultCollectedVolumesFolderPath(), + getDefaultCollectedVolumesFolderID()); + } + + /** + * + * @return @deprecated Use {@link #getDefaultJournalsFolder() } + */ + @Deprecated + public Integer getDefaultJournalsFolderID() { + if (get(defaultJournalsFolderID) == null) { return null; } else { - return (Integer) get(defaultProceedingsFolder); + return (Integer) get(defaultJournalsFolderID); } } - public Integer getDefaultInProceedingsFolder() { - if (get(defaultInProceedingsFolder) == null) { + public String getDefaultJournalsFolderPath() { + if (get(defaultJournalsFolderPath) == null) { return null; } else { - return (Integer) get(defaultInProceedingsFolder); + return (String) get(defaultJournalsFolderPath); } } - public Integer getDefaultArticlesInJournalFolder() { - if (get(defaultArticlesInJournalFolder) == null) { + public Folder getDefaultJournalsFolder() { + return getDefaultFolder(getDefaultJournalsFolderPath(), getDefaultJournalsFolderID()); + } + + /** + * + * @return @deprecated Use {@link #getDefaultArticlesInCollectedVolumeFolder() } + */ + @Deprecated + public Integer getDefaultArticlesInCollectedVolumeFolderID() { + if (get(defaultArticlesInCollectedVolumeFolderID) == null) { return null; } else { - return (Integer) get(defaultArticlesInJournalFolder); + return (Integer) get(defaultArticlesInCollectedVolumeFolderID); } } - public Integer getDefaultPublicationsFolder() { - if (get(defaultPublicationsFolder) == null) { + public String getDefaultArticlesInCollectedVolumeFolderPath() { + if (get(defaultArticlesInCollectedVolumeFolderPath) == null) { return null; } 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() { return (String) get(orgaType); } diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/PublicationsConfig_parameter.properties b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/PublicationsConfig_parameter.properties index 3a0df6e9f..0a2e7a458 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/PublicationsConfig_parameter.properties +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/PublicationsConfig_parameter.properties @@ -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.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.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.format = Integer +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_id.purpose = Default folder for items created using the create pane of the ItemSearchWidget +com.arsdigita.cms.contenttypes.publications.default_series_folder_id.example = 10002 +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_publisher_folder.purpose = Default folder for items created using the create pane of the ItemSearchWidget -com.arsdigita.cms.contenttypes.publications.default_publisher_folder.example = 10002 -com.arsdigita.cms.contenttypes.publications.default_publisher_folder.format = Integer +com.arsdigita.cms.contenttypes.publications.default_series_folder_path.title = Default series folder +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_series_folder_path.example = main:/path/to/series/folder +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_collectedvolumes_folder.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_collectedvolumes_folder.format = Integer +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_publisher_folder_id.purpose = Default folder for items created using the create pane of the ItemSearchWidget +com.arsdigita.cms.contenttypes.publications.default_publisher_folder_id.example = 10002 +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_journals_folder.purpose = Default folder for items created using the create pane of the ItemSearchWidget -com.arsdigita.cms.contenttypes.publications.default_journals_folder.example = 10002 -com.arsdigita.cms.contenttypes.publications.default_journals_folder.format = Integer +com.arsdigita.cms.contenttypes.publications.default_publisher_folder_path.title = Default publisher folder +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_publisher_folder_path.example = main:/path/to/publisher/folder +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_articlesincollectedvolumes_folder.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_articlesincollectedvolumes_folder.format = Integer +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_collectedvolumes_folder_id.purpose = Default folder for items created using the create pane of the ItemSearchWidget +com.arsdigita.cms.contenttypes.publications.default_collectedvolumes_folder_id.example = 10002 +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_organizations_folder.purpose = Default folder for items created using the create pane of the ItemSearchWidget -com.arsdigita.cms.contenttypes.publications.default_organizations_folder.example = 10002 -com.arsdigita.cms.contenttypes.publications.default_organizations_folder.format = Integer +com.arsdigita.cms.contenttypes.publications.default_collectedvolumes_folder_path.title = Default collectedvolumes folder +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_collectedvolumes_folder_path.example = main:/path/to/collectedvolumes/folder +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_proceedings_folder.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_proceedings_folder.format = Integer +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_journals_folder_id.purpose = Default folder for items created using the create pane of the ItemSearchWidget +com.arsdigita.cms.contenttypes.publications.default_journals_folder_id.example = 10002 +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_inproceedings_folder.purpose = Default folder for items created using the create pane of the ItemSearchWidget -com.arsdigita.cms.contenttypes.publications.default_inproceedings_folder.example = 10002 -com.arsdigita.cms.contenttypes.publications.default_inproceedings_folder.format = Integer +com.arsdigita.cms.contenttypes.publications.default_journals_folder_path.title = Default journals folder +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_journals_folder_path.example = main:/path/to/journals/folder +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_articlesinjournal_folder.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_articlesinjournal_folder.format = Integer +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_articlesincollectedvolumes_folder_id.purpose = Default folder for items created using the create pane of the ItemSearchWidget +com.arsdigita.cms.contenttypes.publications.default_articlesincollectedvolumes_folder_id.example = 10002 +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_publications_folder.purpose = Folder to put publications created using an importer in -com.arsdigita.cms.contenttypes.publications.default_publications_folder.example = 10002 -com.arsdigita.cms.contenttypes.publications.default_publications_folder.format = Integer +com.arsdigita.cms.contenttypes.publications.default_articlesincollectedvolumes_folder_path.title = Default articlesincollectedvolumes folder +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_articlesincollectedvolumes_folder_path.example = main:/path/to/articlesincollectedvolumes/folder +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.purpose = Sets the type used for imported organization. Must be a subtype of com.arsdigita.cms.contenttypes.GenericOrganizationalUnit diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ArticleInCollectedVolumeCollectedVolumeForm.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ArticleInCollectedVolumeCollectedVolumeForm.java index bfbd433b2..05a68e6b2 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ArticleInCollectedVolumeCollectedVolumeForm.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ArticleInCollectedVolumeCollectedVolumeForm.java @@ -69,9 +69,7 @@ public class ArticleInCollectedVolumeCollectedVolumeForm itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.findByAssociatedObjectType( CollectedVolume.class.getName())); - if ((config.getDefaultCollectedVolumesFolder() != null) && (config.getDefaultCollectedVolumesFolder() != 0)) { - itemSearch.setDefaultCreationFolder(new Folder(new BigDecimal(config.getDefaultCollectedVolumesFolder()))); - } + itemSearch.setDefaultCreationFolder(config.getDefaultCollectedVolumesFolder()); add(itemSearch); } diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ArticleInJournalJournalForm.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ArticleInJournalJournalForm.java index f6349d09a..557038bb1 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ArticleInJournalJournalForm.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ArticleInJournalJournalForm.java @@ -66,9 +66,7 @@ public class ArticleInJournalJournalForm itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.findByAssociatedObjectType( Journal.class.getName())); - if ((config.getDefaultJournalsFolder() != null) && (config.getDefaultJournalsFolder() != 0)) { - itemSearch.setDefaultCreationFolder(new Folder(new BigDecimal(config.getDefaultJournalsFolder()))); - } + itemSearch.setDefaultCreationFolder(config.getDefaultJournalsFolder()); itemSearch.setEditAfterCreate(false); itemSearch.setQueryField("symbol"); add(itemSearch); diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/CollectedVolumeArticleAddForm.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/CollectedVolumeArticleAddForm.java index 7f1a36dae..53b4d6e60 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/CollectedVolumeArticleAddForm.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/CollectedVolumeArticleAddForm.java @@ -75,9 +75,7 @@ public class CollectedVolumeArticleAddForm ITEM_SEARCH, ContentType.findByAssociatedObjectType( ArticleInCollectedVolume.class.getName())); - if ((config.getDefaultArticlesInCollectedVolumeFolder() != null) && (config.getDefaultArticlesInCollectedVolumeFolder() != 0)) { - m_itemSearch.setDefaultCreationFolder(new Folder(new BigDecimal(config.getDefaultArticlesInCollectedVolumeFolder()))); - } + m_itemSearch.setDefaultCreationFolder(config.getDefaultArticlesInCollectedVolumeFolder()); add(m_itemSearch); } diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ExpertiseOrdererForm.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ExpertiseOrdererForm.java index c7557b952..31e5d7a99 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ExpertiseOrdererForm.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ExpertiseOrdererForm.java @@ -65,9 +65,7 @@ public class ExpertiseOrdererForm itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType. findByAssociatedObjectType(GenericOrganizationalUnit.class. getName())); - if ((config.getDefaultOrganizationsFolder() != null) && (config.getDefaultOrganizationsFolder() != 0)) { - itemSearch.setDefaultCreationFolder(new Folder(new BigDecimal(config.getDefaultOrganizationsFolder()))); - } + itemSearch.setDefaultCreationFolder(config.getDefaultOrganizationsFolder()); itemSearch.setEditAfterCreate(false); add(itemSearch); } diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ExpertiseOrganizationForm.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ExpertiseOrganizationForm.java index 458823458..c9f842645 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ExpertiseOrganizationForm.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ExpertiseOrganizationForm.java @@ -65,9 +65,7 @@ public class ExpertiseOrganizationForm itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType. findByAssociatedObjectType(GenericOrganizationalUnit.class. getName())); - if ((config.getDefaultOrganizationsFolder() != null) && (config.getDefaultOrganizationsFolder() != 0)) { - itemSearch.setDefaultCreationFolder(new Folder(new BigDecimal(config.getDefaultOrganizationsFolder()))); - } + itemSearch.setDefaultCreationFolder(config.getDefaultOrganizationsFolder()); itemSearch.setEditAfterCreate(false); add(itemSearch); } diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/InProceedingsProceedingsForm.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/InProceedingsProceedingsForm.java index 60ff2de16..10f7fb146 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/InProceedingsProceedingsForm.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/InProceedingsProceedingsForm.java @@ -37,8 +37,7 @@ import com.arsdigita.kernel.Kernel; import java.math.BigDecimal; /** - * Form for adding an association between a InProceedings publication and - * a proceedings publication. + * Form for adding an association between a InProceedings publication and a proceedings publication. * * @author Jens Pelzetter * @version $Id$ @@ -68,9 +67,7 @@ public class InProceedingsProceedingsForm itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.findByAssociatedObjectType( Proceedings.class.getName())); - if ((config.getDefaultProceedingsFolder() != null) && (config.getDefaultProceedingsFolder() != 0)) { - itemSearch.setDefaultCreationFolder(new Folder(new BigDecimal(config.getDefaultProceedingsFolder()))); - } + itemSearch.setDefaultCreationFolder(config.getDefaultProceedingsFolder()); add(itemSearch); } diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/InternetArticleOrganizationForm.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/InternetArticleOrganizationForm.java index 370765b31..27b89379f 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/InternetArticleOrganizationForm.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/InternetArticleOrganizationForm.java @@ -65,9 +65,7 @@ public class InternetArticleOrganizationForm itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.findByAssociatedObjectType( GenericOrganizationalUnit.class.getName())); - if ((config.getDefaultOrganizationsFolder() != null) && (config.getDefaultOrganizationsFolder() != 0)) { - itemSearch.setDefaultCreationFolder(new Folder(new BigDecimal(config.getDefaultOrganizationsFolder()))); - } + itemSearch.setDefaultCreationFolder(config.getDefaultOrganizationsFolder()); itemSearch.setEditAfterCreate(false); add(itemSearch); } diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/JournalArticleAddForm.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/JournalArticleAddForm.java index 69d43d0aa..3ceafc45d 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/JournalArticleAddForm.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/JournalArticleAddForm.java @@ -74,9 +74,7 @@ public class JournalArticleAddForm ITEM_SEARCH, ContentType.findByAssociatedObjectType( ArticleInJournal.class.getName())); - if ((config.getDefaultArticlesInJournalFolder() != null) && (config.getDefaultArticlesInJournalFolder() != 0)) { - m_itemSearch.setDefaultCreationFolder(new Folder(new BigDecimal(config.getDefaultArticlesInJournalFolder()))); - } + m_itemSearch.setDefaultCreationFolder(config.getDefaultArticlesInJournalFolder()); add(m_itemSearch); } diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ProceedingsOrganizerForm.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ProceedingsOrganizerForm.java index afcb60f0d..3b176ec89 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ProceedingsOrganizerForm.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ProceedingsOrganizerForm.java @@ -65,9 +65,7 @@ public class ProceedingsOrganizerForm itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.findByAssociatedObjectType( GenericOrganizationalUnit.class.getName())); - if ((config.getDefaultOrganizationsFolder() != null) && (config.getDefaultOrganizationsFolder() != 0)) { - itemSearch.setDefaultCreationFolder(new Folder(new BigDecimal(config.getDefaultOrganizationsFolder()))); - } + itemSearch.setDefaultCreationFolder(config.getDefaultOrganizationsFolder()); itemSearch.setEditAfterCreate(false); add(itemSearch); } diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ProceedingsPapersAddForm.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ProceedingsPapersAddForm.java index 9e37f843a..6e3a8bc15 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ProceedingsPapersAddForm.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/ProceedingsPapersAddForm.java @@ -69,9 +69,7 @@ public class ProceedingsPapersAddForm ITEM_SEARCH, ContentType.findByAssociatedObjectType( InProceedings.class.getName())); - if ((config.getDefaultInProceedingsFolder() != null) && (config.getDefaultInProceedingsFolder() != 0)) { - m_itemSearch.setDefaultCreationFolder(new Folder(new BigDecimal(config.getDefaultInProceedingsFolder()))); - } + m_itemSearch.setDefaultCreationFolder(config.getDefaultInProceedingsFolder()); add(m_itemSearch); } diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationAuthorAddForm.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationAuthorAddForm.java index c051f0dad..601422a6c 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationAuthorAddForm.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationAuthorAddForm.java @@ -80,18 +80,6 @@ public class PublicationAuthorAddForm m_itemSearch = new ItemSearchWidget( ITEM_SEARCH, 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.setEditAfterCreate(false); add(m_itemSearch); diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationSeriesAddForm.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationSeriesAddForm.java index da394e13e..e33b64fc4 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationSeriesAddForm.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationSeriesAddForm.java @@ -77,9 +77,7 @@ public class PublicationSeriesAddForm m_itemSearch = new ItemSearchWidget( ITEM_SEARCH, ContentType.findByAssociatedObjectType(Series.class.getName())); - if ((config.getDefaultSeriesFolder() != null) && (config.getDefaultSeriesFolder() != 0)) { - m_itemSearch.setDefaultCreationFolder(new Folder(new BigDecimal(config.getDefaultSeriesFolder()))); - } + m_itemSearch.setDefaultCreationFolder(config.getDefaultSeriesFolder()); add(m_itemSearch); add(new Label((String) PublicationGlobalizationUtil.globalize( diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationWithPublisherSetPublisherForm.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationWithPublisherSetPublisherForm.java index 7ab88be11..36cb51256 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationWithPublisherSetPublisherForm.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/PublicationWithPublisherSetPublisherForm.java @@ -66,10 +66,7 @@ public class PublicationWithPublisherSetPublisherForm itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.findByAssociatedObjectType(Publisher.class. getName())); - if ((config.getDefaultPublisherFolder() != null) && config.getDefaultPublisherFolder() != 0) { - itemSearch.setDefaultCreationFolder(new Folder(new BigDecimal(config. - getDefaultPublisherFolder()))); - } + itemSearch.setDefaultCreationFolder(config.getDefaultPublisherFolder()); itemSearch.setEditAfterCreate(false); add(itemSearch); } diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/SeriesEditshipAddForm.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/SeriesEditshipAddForm.java index e6054af87..8fea45e1d 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/SeriesEditshipAddForm.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/SeriesEditshipAddForm.java @@ -86,17 +86,7 @@ public class SeriesEditshipAddForm ITEM_SEARCH, 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) { - 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.setDefaultCreationFolder(config.getDefaultAuthorsFolder()); m_itemSearch.setEditAfterCreate(false); add(m_itemSearch); diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/SeriesExtraXmlGenerator.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/SeriesExtraXmlGenerator.java index 58bb39eac..459f84ca6 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/SeriesExtraXmlGenerator.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/SeriesExtraXmlGenerator.java @@ -172,7 +172,6 @@ public class SeriesExtraXmlGenerator implements ExtraXMLGenerator { return; } - final Element volumesElem = parent.newChildElement("volumes"); while (volumes.next()) { // createVolumeXml(volumes.getPublication(GlobalizationHelper. diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/UnPublishedOrganizationForm.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/UnPublishedOrganizationForm.java index ca698ecef..04baf27a4 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/UnPublishedOrganizationForm.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/ui/UnPublishedOrganizationForm.java @@ -65,9 +65,7 @@ public class UnPublishedOrganizationForm itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType.findByAssociatedObjectType( GenericOrganizationalUnit.class.getName())); - if ((config.getDefaultOrganizationsFolder() != null) && (config.getDefaultOrganizationsFolder() != 0)) { - itemSearch.setDefaultCreationFolder(new Folder(new BigDecimal(config.getDefaultOrganizationsFolder()))); - } + itemSearch.setDefaultCreationFolder(config.getDefaultOrganizationsFolder()); itemSearch.setEditAfterCreate(false); add(itemSearch); } diff --git a/ccm-sci-publications/src/com/arsdigita/cms/scipublications/importer/bibtex/BibTeXConverters.java b/ccm-sci-publications/src/com/arsdigita/cms/scipublications/importer/bibtex/BibTeXConverters.java index 2603aace4..365edd175 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/scipublications/importer/bibtex/BibTeXConverters.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/scipublications/importer/bibtex/BibTeXConverters.java @@ -27,7 +27,8 @@ import org.jbibtex.BibTeXEntry; 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 * @version $Id$ @@ -73,10 +74,11 @@ public class BibTeXConverters { getType().getValue().toLowerCase()); if (converter == null) { - report.addMessage(String.format("No converter for BibTeX type '%s' available. Publication '%s' has not" - + "been imported.", - bibTeXEntry.getType().getValue(), - bibTeXEntry.getKey().getValue())); + report.addMessage(String.format( + "No converter for BibTeX type '%s' available. Publication '%s' has not" + + "been imported.", + bibTeXEntry.getType().getValue(), + bibTeXEntry.getKey().getValue())); return report; } @@ -89,20 +91,22 @@ public class BibTeXConverters { converter = converter.getClass().newInstance(); } catch (InstantiationException ex) { final StringWriter writer = new StringWriter(); - writer.append(String.format("Failed to create instance of converter for BibTeX type '%s'. Publication" - + " '%s' was not imported.", - bibTeXEntry.getType().getValue(), - bibTeXEntry.getKey().getValue())); + writer.append(String.format( + "Failed to create instance of converter for BibTeX type '%s'. Publication" + + " '%s' was not imported.", + bibTeXEntry.getType().getValue(), + bibTeXEntry.getKey().getValue())); ex.printStackTrace(new PrintWriter(writer)); report.addMessage(writer.toString()); return report; } catch (IllegalAccessException ex) { final StringWriter writer = new StringWriter(); - writer.append(String.format("Failed to create instance of converter for BibTeX type '%s'. Publication" - + " '%s' was not imported.", - bibTeXEntry.getType().getValue(), - bibTeXEntry.getKey().getValue())); + writer.append(String.format( + "Failed to create instance of converter for BibTeX type '%s'. Publication" + + " '%s' was not imported.", + bibTeXEntry.getType().getValue(), + bibTeXEntry.getKey().getValue())); ex.printStackTrace(new PrintWriter(writer)); report.addMessage(writer.toString()); @@ -146,12 +150,12 @@ public class BibTeXConverters { * * @return */ - protected Integer getFolderId() { - return Publication.getConfig().getDefaultPublicationsFolder(); + protected Folder getFolder() { + return Publication.getConfig().getDefaultProceedingsFolder(); } 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.setContentSection(folder.getContentSection()); publication.setContentSection(folder.getContentSection()); @@ -208,5 +212,4 @@ public class BibTeXConverters { return result; } - } diff --git a/ccm-sci-publications/src/com/arsdigita/cms/scipublications/importer/ris/converters/AbstractRisConverter.java b/ccm-sci-publications/src/com/arsdigita/cms/scipublications/importer/ris/converters/AbstractRisConverter.java index 91ee86309..8d295b417 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/scipublications/importer/ris/converters/AbstractRisConverter.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/scipublications/importer/ris/converters/AbstractRisConverter.java @@ -23,19 +23,20 @@ import java.util.List; /** * - * @param - * @param + * @param + * @param * @author Jens Pelzetter * @version $Id$ */ -public abstract class AbstractRisConverter implements RisConverter { +public abstract class AbstractRisConverter + implements RisConverter { protected abstract T createPublication(boolean pretend); protected abstract String getTypeName(); protected abstract B createBundle(T publication, boolean pretend); - + protected String getYear(final RisDataset dataset) { final List values = dataset.getValues().get(RisField.PY); if ((values == null) || values.isEmpty()) { @@ -97,15 +98,15 @@ public abstract class AbstractRisConverter