Ä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
*
*/
package com.arsdigita.cms.ui;
import com.arsdigita.bebop.BoxPanel;
@ -57,28 +56,24 @@ import java.math.BigDecimal;
* @author Jens Pelzetter <jens@jp-digital.de>
*/
class ItemSearchCreateItemPane extends CMSContainer
implements FormInitListener,
FormProcessListener,
FormSubmissionListener {
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,8 +100,6 @@ class ItemSearchCreateItemPane extends CMSContainer
// again.
//
// ////////////////////////////////////////////////////////////////////////
/**
*
* @param parent
@ -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("<br/>", 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);
@ -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;
}
}

View File

@ -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);
}
@ -276,9 +392,8 @@ 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() {
@ -301,126 +416,314 @@ 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
* 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.
* 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);
}

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.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

View File

@ -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);
}

View File

@ -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);

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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);

View File

@ -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(

View File

@ -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);
}

View File

@ -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);

View File

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

View File

@ -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);
}

View File

@ -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 <jens@jp-digital.de>
* @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;
}
}

View File

@ -28,7 +28,8 @@ import java.util.List;
* @author Jens Pelzetter <jens@jp-digital.de>
* @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);
@ -100,12 +101,12 @@ public abstract class AbstractRisConverter<T extends Publication, B extends Publ
*
* @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());
@ -136,7 +137,8 @@ public abstract class AbstractRisConverter<T extends Publication, B extends Publ
final DataCollection collection = session.retrieve(type);
final FilterFactory filterFactory = collection.getFilterFactory();
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(yearFilter);
@ -152,5 +154,4 @@ public abstract class AbstractRisConverter<T extends Publication, B extends Publ
return result;
}
}

View File

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