Verschiedene zusätzliche AuthoringSteps (PersonPublications, PublisherPublications, PersonOrgaUnits, GenericOrganizationalUnitPublications) können jetzt per Konfiguration deaktiviert werden (Ticket #1505).
git-svn-id: https://svn.libreccm.org/ccm/trunk@2021 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
4cc6541072
commit
efd744be3e
|
|
@ -15,7 +15,6 @@
|
|||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
package com.arsdigita.atoz.tools;
|
||||
|
||||
import com.arsdigita.atoz.AtoZ;
|
||||
|
|
@ -32,7 +31,6 @@ import com.arsdigita.web.Application;
|
|||
import org.apache.commons.cli.CommandLine;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
|
||||
/**
|
||||
* Command line utility to create an application instance of AtoZ.
|
||||
*
|
||||
|
|
@ -53,14 +51,15 @@ public class AtoZCreator extends Program {
|
|||
|
||||
private void addAtoZ(String atozURL, String atozTitle) {
|
||||
|
||||
if (!Application.isInstalled(AtoZ.BASE_DATA_OBJECT_TYPE, "/"+atozURL+"/")) {
|
||||
if (!Application.isInstalled(AtoZ.BASE_DATA_OBJECT_TYPE, "/" + atozURL + "/")) {
|
||||
|
||||
DomainObjectFactory.registerInstantiator(
|
||||
AtoZ.BASE_DATA_OBJECT_TYPE, new DomainObjectInstantiator() {
|
||||
public DomainObject doNewInstance(DataObject dataObject) {
|
||||
return new AtoZ(dataObject);
|
||||
}
|
||||
});
|
||||
public DomainObject doNewInstance(DataObject dataObject) {
|
||||
return new AtoZ(dataObject);
|
||||
}
|
||||
|
||||
});
|
||||
Application app = Application.createApplication(
|
||||
AtoZ.BASE_DATA_OBJECT_TYPE, atozURL, atozTitle, null);
|
||||
app.save();
|
||||
|
|
@ -68,7 +67,7 @@ public class AtoZCreator extends Program {
|
|||
} else {
|
||||
|
||||
System.err.println(AtoZ.BASE_DATA_OBJECT_TYPE
|
||||
+ " already installed at " + atozURL);
|
||||
+ " already installed at " + atozURL);
|
||||
System.exit(1);
|
||||
|
||||
}
|
||||
|
|
@ -86,7 +85,7 @@ public class AtoZCreator extends Program {
|
|||
String atozURL = args[0];
|
||||
String atozTitle = args[1];
|
||||
if (atozURL != null && atozURL.length() != 0
|
||||
&& atozTitle != null && atozTitle.length() != 0) {
|
||||
&& atozTitle != null && atozTitle.length() != 0) {
|
||||
addAtoZ(atozURL, atozTitle);
|
||||
} else {
|
||||
help(System.err);
|
||||
|
|
@ -97,8 +96,10 @@ public class AtoZCreator extends Program {
|
|||
System.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
}.run();
|
||||
}
|
||||
|
||||
}.run();
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@
|
|||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
package com.arsdigita.atoz.ui.admin;
|
||||
|
||||
import com.arsdigita.atoz.ItemProvider;
|
||||
|
|
@ -63,12 +62,12 @@ public class ItemProviderForm extends ProviderForm {
|
|||
super.addWidgets();
|
||||
|
||||
m_loadPaths = new TextField(ItemProvider.LOAD_PATHS);
|
||||
((SimpleComponent)m_loadPaths).setMetaDataAttribute("label", "Attributes to retrieve");
|
||||
((SimpleComponent) m_loadPaths).setMetaDataAttribute("label", "Attributes to retrieve");
|
||||
add(m_loadPaths);
|
||||
m_loadPaths.addValidationListener(new StringInRangeValidationListener(0, 200));
|
||||
m_picker = new AllCategoryPicker("rootCategory");
|
||||
((SimpleComponent)m_picker).setMetaDataAttribute("label", "Category filter");
|
||||
((SingleSelect)m_picker).addValidationListener(new NotNullValidationListener());
|
||||
((SimpleComponent) m_picker).setMetaDataAttribute("label", "Category filter");
|
||||
((SingleSelect) m_picker).addValidationListener(new NotNullValidationListener());
|
||||
add(m_picker);
|
||||
}
|
||||
|
||||
|
|
@ -77,10 +76,10 @@ public class ItemProviderForm extends ProviderForm {
|
|||
AtoZProvider provider) {
|
||||
super.processWidgets(state, provider);
|
||||
|
||||
ItemProvider myprovider = (ItemProvider)provider;
|
||||
ItemProvider myprovider = (ItemProvider) provider;
|
||||
|
||||
myprovider.setCategory(m_picker.getCategory(state));
|
||||
myprovider.setLoadPaths( (String) m_loadPaths.getValue(state));
|
||||
myprovider.setLoadPaths((String) m_loadPaths.getValue(state));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -88,7 +87,7 @@ public class ItemProviderForm extends ProviderForm {
|
|||
AtoZProvider provider) {
|
||||
super.initWidgets(state, provider);
|
||||
|
||||
ItemProvider myprovider = (ItemProvider)provider;
|
||||
ItemProvider myprovider = (ItemProvider) provider;
|
||||
if (provider != null) {
|
||||
//m_compound.setValue(state, new Boolean(myprovider.isCompound()));
|
||||
|
||||
|
|
@ -107,26 +106,23 @@ public class ItemProviderForm extends ProviderForm {
|
|||
SingleSelect target) {
|
||||
target.addOption(new Option(null, "-- pick one --"));
|
||||
|
||||
DataCollection domains = SessionManager.getSession()
|
||||
.retrieve("com.arsdigita.london.terms.Domain");
|
||||
DataCollection domains = SessionManager.getSession().retrieve("com.arsdigita.london.terms.Domain");
|
||||
domains.addPath("model.id");
|
||||
domains.addPath("model.objectType");
|
||||
domains.addOrder("title");
|
||||
while (domains.next()) {
|
||||
Category rootCategory = (Category)
|
||||
DomainObjectFactory.newInstance( (DataObject) domains.get("model"));
|
||||
Category rootCategory = (Category) DomainObjectFactory.newInstance((DataObject) domains.get("model"));
|
||||
categorySubtreePath(target, rootCategory, " > ");
|
||||
}
|
||||
}
|
||||
|
||||
private void categorySubtreePath(SingleSelect target, Category root, String join) {
|
||||
DomainCollection cats = new DomainCollection(
|
||||
SessionManager.getSession().retrieve(Category.BASE_DATA_OBJECT_TYPE)
|
||||
);
|
||||
SessionManager.getSession().retrieve(Category.BASE_DATA_OBJECT_TYPE));
|
||||
cats.addFilter("defaultAncestors like :ancestors")
|
||||
.set("ancestors",
|
||||
((String)DomainServiceInterfaceExposer
|
||||
.get(root, "defaultAncestors")) + "%");
|
||||
.set("ancestors",
|
||||
((String) DomainServiceInterfaceExposer
|
||||
.get(root, "defaultAncestors")) + "%");
|
||||
cats.addEqualsFilter("parents.link.isDefault", Boolean.TRUE);
|
||||
cats.addOrder("defaultAncestors");
|
||||
cats.addPath("parents.id");
|
||||
|
|
@ -137,27 +133,27 @@ public class ItemProviderForm extends ProviderForm {
|
|||
path2cat.put(root.getName(), root);
|
||||
cat2path.put(root.getID(), root.getName());
|
||||
target.addOption(new Option(root.getOID().toString(),
|
||||
" +++++++++++++++++++++++++ "
|
||||
+ root.getName()
|
||||
+ " +++++++++++++++++++++++++ "));
|
||||
" +++++++++++++++++++++++++ "
|
||||
+ root.getName()
|
||||
+ " +++++++++++++++++++++++++ "));
|
||||
|
||||
while (cats.next()) {
|
||||
Category cat = (Category)cats.getDomainObject();
|
||||
BigDecimal parent = (BigDecimal)cats.get("parents.id");
|
||||
Category cat = (Category) cats.getDomainObject();
|
||||
BigDecimal parent = (BigDecimal) cats.get("parents.id");
|
||||
|
||||
if (parent == null) {
|
||||
path2cat.put(cat.getName(), cat);
|
||||
cat2path.put(cat.getID(), cat.getName());
|
||||
target.addOption(new Option(cat.getOID().toString(), cat.getName()));
|
||||
} else {
|
||||
String parentPath = (String)cat2path.get(parent);
|
||||
String parentPath = (String) cat2path.get(parent);
|
||||
String path = parentPath + join + cat.getName();
|
||||
path2cat.put(path, cat);
|
||||
cat2path.put(cat.getID(), path);
|
||||
//
|
||||
int breakPos = 0;
|
||||
String prefix = "---";
|
||||
while ((breakPos = 1+parentPath.indexOf(join, breakPos)) > 0) {
|
||||
while ((breakPos = 1 + parentPath.indexOf(join, breakPos)) > 0) {
|
||||
prefix += "---";
|
||||
}
|
||||
target.addOption(new Option(cat.getOID().toString(), prefix + " " + cat.getName()));
|
||||
|
|
@ -166,5 +162,4 @@ public class ItemProviderForm extends ProviderForm {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -83,6 +83,7 @@ public final class CMSConfig extends AbstractConfig {
|
|||
|
||||
return s_config;
|
||||
}
|
||||
|
||||
/**
|
||||
* Storage (map) for method getAssetStepsToSkip(ContentType type) to store
|
||||
* mapping of steps that are deemed irrelevant for the passid in type.
|
||||
|
|
@ -550,7 +551,6 @@ public final class CMSConfig extends AbstractConfig {
|
|||
"com.arsdigita.cms.item_search.flat_browse_pane.page_size",
|
||||
Parameter.REQUIRED,
|
||||
20);
|
||||
|
||||
/////////////////////////////////////////////
|
||||
// FolderBrowse
|
||||
/////////////////////////////////////////////
|
||||
|
|
@ -592,7 +592,6 @@ public final class CMSConfig extends AbstractConfig {
|
|||
"cms.arsdigita.cms.lifecycle.threaded_publishing.notify_on_error.to",
|
||||
Parameter.REQUIRED,
|
||||
"");
|
||||
|
||||
/////////////////////////////////////////////////
|
||||
// ImageBrowser Parameter
|
||||
/////////////////////////////////////////////////
|
||||
|
|
@ -604,7 +603,6 @@ public final class CMSConfig extends AbstractConfig {
|
|||
"com.arsdigita.cms.image_browser.thumbnail_max_height",
|
||||
Parameter.REQUIRED,
|
||||
50);
|
||||
|
||||
/////////////////////////////////////////////////
|
||||
// ImageCache Parameter
|
||||
/////////////////////////////////////////////////
|
||||
|
|
@ -624,7 +622,10 @@ public final class CMSConfig extends AbstractConfig {
|
|||
"com.arsdigita.cms.image_cache.max_age",
|
||||
Parameter.REQUIRED,
|
||||
300);
|
||||
|
||||
private final Parameter m_attachPersonOrgaUnitsStep = new BooleanParameter(
|
||||
"com.arsdigita.cms.contenttypes.genericperson.attach_person_orgaunits_step",
|
||||
Parameter.REQUIRED,
|
||||
Boolean.TRUE);
|
||||
|
||||
// ///////////////////////////////////////////
|
||||
// publishToFile package related parameter
|
||||
|
|
@ -632,7 +633,6 @@ public final class CMSConfig extends AbstractConfig {
|
|||
// Moved to publishToFile.PublishToFileConfig as of version 6.0.2
|
||||
// private final Parameter m_disableItemPfs;
|
||||
// private final Parameter m_publishToFileClass;
|
||||
|
||||
/**
|
||||
* Constructor, but do NOT instantiate this class directly.
|
||||
*
|
||||
|
|
@ -733,6 +733,8 @@ public final class CMSConfig extends AbstractConfig {
|
|||
// register(m_itemSearchFlatBrowsePaneEnable);
|
||||
register(m_itemSearchFlatBrowsePanePageSize);
|
||||
|
||||
register(m_attachPersonOrgaUnitsStep);
|
||||
|
||||
loadInfo();
|
||||
}
|
||||
|
||||
|
|
@ -934,6 +936,7 @@ public final class CMSConfig extends AbstractConfig {
|
|||
protected Object unmarshal(String value, ErrorList errors) {
|
||||
return DHTMLEditor.Config.valueOf(value);
|
||||
}
|
||||
|
||||
}
|
||||
protected static HashMap extraXMLGenerators = new HashMap();
|
||||
|
||||
|
|
@ -1200,9 +1203,12 @@ public final class CMSConfig extends AbstractConfig {
|
|||
// public Boolean getItemSearchFlatBrowsePaneEnable() {
|
||||
// return (Boolean) get(m_itemSearchFlatBrowsePaneEnable);
|
||||
// }
|
||||
|
||||
public Integer getItemSearchFlatBrowsePanePageSize() {
|
||||
return (Integer) get(m_itemSearchFlatBrowsePanePageSize);
|
||||
return (Integer) get(m_itemSearchFlatBrowsePanePageSize);
|
||||
}
|
||||
|
||||
public Boolean getAttachPersonOrgaUnitsStep() {
|
||||
return (Boolean) get(m_attachPersonOrgaUnitsStep);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -314,3 +314,8 @@ com.arsdigita.cms.image_cache.max_age.title=Image cache max age
|
|||
com.arsdigita.cms.image_cache.max_age.purpose=Max unused item age in seconds, keep this low to prevent filling you memory with unsused images
|
||||
com.arsdigita.cms.image_cache.max_age.example=300
|
||||
com.arsdigita.cms.image_cache.max_age.format=[integer]
|
||||
|
||||
com.arsdigita.cms.contenttypes.genericperson.attach_person_orgaunits_step.title = Attach PersonOrgaUnits step
|
||||
com.arsdigita.cms.contenttypes.genericperson.attach_person_orgaunits_step.purpose = Attaches an authoring step to GenericPerson which displays all GenericOrganizationalUnits to which the person is assigned to
|
||||
com.arsdigita.cms.contenttypes.genericperson.attach_person_orgaunits_step.example = true
|
||||
com.arsdigita.cms.contenttypes.genericperson.attach_person_orgaunits_step.foramt = [boolean]
|
||||
|
|
@ -83,7 +83,6 @@ import com.arsdigita.xml.XML;
|
|||
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
|
||||
/**
|
||||
* The main CMS initializer, executed recurringly at each system startup.
|
||||
*
|
||||
|
|
@ -120,7 +119,6 @@ public class Initializer extends CompoundInitializer {
|
|||
s_log.debug("CMS.Initializer.(Constructor) completed");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Initializes domain-coupling machinery, usually consisting of
|
||||
* registering object instantiators and observers.
|
||||
|
|
@ -232,18 +230,18 @@ public class Initializer extends CompoundInitializer {
|
|||
FileAsset.BASE_DATA_OBJECT_TYPE,
|
||||
new AssetMetadataProvider());
|
||||
|
||||
|
||||
AuthoringKitWizard.registerAssetStep(
|
||||
GenericPerson.BASE_DATA_OBJECT_TYPE,
|
||||
GenericPersonOrgaUnitsStep.class,
|
||||
ContenttypesGlobalizationUtil.globalize("person.authoring.orgas.title"),
|
||||
ContenttypesGlobalizationUtil.globalize("person.authoring.orgas.title"),
|
||||
20);
|
||||
if (s_conf.getAttachPersonOrgaUnitsStep()) {
|
||||
AuthoringKitWizard.registerAssetStep(
|
||||
GenericPerson.BASE_DATA_OBJECT_TYPE,
|
||||
GenericPersonOrgaUnitsStep.class,
|
||||
ContenttypesGlobalizationUtil.globalize("person.authoring.orgas.title"),
|
||||
ContenttypesGlobalizationUtil.globalize("person.authoring.orgas.title"),
|
||||
20);
|
||||
}
|
||||
|
||||
s_log.debug("CMS.Initializer.init(DomainInitEvent) completed");
|
||||
} // END init(DomainInitEvent e)
|
||||
|
||||
|
||||
/**
|
||||
* Helper Method, registers stylesheet pattern generators
|
||||
*/
|
||||
|
|
@ -257,7 +255,6 @@ public class Initializer extends CompoundInitializer {
|
|||
new ItemDelegatedURLPatternGenerator());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Registers object instantiators
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@
|
|||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
|
||||
package com.arsdigita.cms.contenttypes;
|
||||
|
||||
import com.arsdigita.cms.contenttypes.ui.GenericOrganizationalUnitPublicationsStep;
|
||||
|
|
@ -94,19 +93,23 @@ public class PublicationInitializer extends ContentTypeInitializer {
|
|||
10);
|
||||
}
|
||||
|
||||
AuthoringKitWizard.registerAssetStep(
|
||||
GenericPerson.BASE_DATA_OBJECT_TYPE,
|
||||
PersonPublicationsStep.class,
|
||||
PublicationGlobalizationUtil.globalize("person.ui.publications.title"),
|
||||
PublicationGlobalizationUtil.globalize("person.ui.publications.description"),
|
||||
10);
|
||||
|
||||
AuthoringKitWizard.registerAssetStep(
|
||||
GenericOrganizationalUnit.BASE_DATA_OBJECT_TYPE,
|
||||
OrganizationPublicationsStep.class,
|
||||
PublicationGlobalizationUtil.globalize("organization.ui.publications.title"),
|
||||
PublicationGlobalizationUtil.globalize("organization.ui.publications.description"),
|
||||
11);
|
||||
if (config.getAttachPersonPublicationsStep()) {
|
||||
AuthoringKitWizard.registerAssetStep(
|
||||
GenericPerson.BASE_DATA_OBJECT_TYPE,
|
||||
PersonPublicationsStep.class,
|
||||
PublicationGlobalizationUtil.globalize("person.ui.publications.title"),
|
||||
PublicationGlobalizationUtil.globalize("person.ui.publications.description"),
|
||||
10);
|
||||
}
|
||||
|
||||
if (config.getAttachOrganizationPublicationsStep()) {
|
||||
AuthoringKitWizard.registerAssetStep(
|
||||
GenericOrganizationalUnit.BASE_DATA_OBJECT_TYPE,
|
||||
OrganizationPublicationsStep.class,
|
||||
PublicationGlobalizationUtil.globalize("organization.ui.publications.title"),
|
||||
PublicationGlobalizationUtil.globalize("organization.ui.publications.description"),
|
||||
11);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -135,4 +138,5 @@ public class PublicationInitializer extends ContentTypeInitializer {
|
|||
public String getTraversalXML() {
|
||||
return "/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/Publication.xml";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,10 @@ import com.arsdigita.util.parameter.StringParameter;
|
|||
public class PublicationsConfig extends AbstractConfig {
|
||||
|
||||
private final Parameter attachOrgaUnitsStep;
|
||||
private final Parameter attachOrganizationPublicationsStep;
|
||||
private final Parameter attachPersonPublicationsStep;
|
||||
private final Parameter attachPublicationsStepTo;
|
||||
private final Parameter attachPublisherPublicationsStep;
|
||||
private final Parameter defaultAuthorsFolder;
|
||||
private final Parameter defaultSeriesFolder;
|
||||
private final Parameter defaultPublisherFolder;
|
||||
|
|
@ -36,12 +39,30 @@ public class PublicationsConfig extends AbstractConfig {
|
|||
Parameter.REQUIRED,
|
||||
Boolean.FALSE);
|
||||
|
||||
attachOrganizationPublicationsStep =
|
||||
new BooleanParameter(
|
||||
"com.arsdigita.cms.contenttypes.publications.attach_organization_publications_step",
|
||||
Parameter.REQUIRED,
|
||||
Boolean.TRUE);
|
||||
|
||||
attachPersonPublicationsStep =
|
||||
new BooleanParameter(
|
||||
"com.arsdigita.cms.contenttypes.publications.attach_person_publications_step",
|
||||
Parameter.REQUIRED,
|
||||
Boolean.TRUE);
|
||||
|
||||
attachPublicationsStepTo =
|
||||
new StringParameter(
|
||||
"com.arsdigita.cms.contenttypes.publications.attach_publications_step_to",
|
||||
Parameter.REQUIRED,
|
||||
"");
|
||||
|
||||
attachPublisherPublicationsStep =
|
||||
new BooleanParameter(
|
||||
"com.arsdigita.cms.contenttypes.publications.attach_publisher_publications_step",
|
||||
Parameter.REQUIRED,
|
||||
Boolean.TRUE);
|
||||
|
||||
defaultAuthorsFolder = new IntegerParameter(
|
||||
"com.arsdigita.cms.contenttypes.publications.default_authors_folder",
|
||||
Parameter.OPTIONAL,
|
||||
|
|
@ -100,14 +121,17 @@ public class PublicationsConfig extends AbstractConfig {
|
|||
orgaType = new StringParameter(
|
||||
"com.arsdigita.cms.contenttypes.publications.organization_type",
|
||||
Parameter.OPTIONAL,
|
||||
Publisher.BASE_DATA_OBJECT_TYPE);
|
||||
Publisher.BASE_DATA_OBJECT_TYPE);
|
||||
orgaBundleType = new StringParameter(
|
||||
"com.arsdigita.cms.contenttypes.publications.organization_bundle_type",
|
||||
Parameter.OPTIONAL,
|
||||
PublisherBundle.BASE_DATA_OBJECT_TYPE);
|
||||
PublisherBundle.BASE_DATA_OBJECT_TYPE);
|
||||
|
||||
register(attachOrgaUnitsStep);
|
||||
register(attachOrganizationPublicationsStep);
|
||||
register(attachPersonPublicationsStep);
|
||||
register(attachPublicationsStepTo);
|
||||
register(attachPublisherPublicationsStep);
|
||||
register(defaultAuthorsFolder);
|
||||
register(defaultSeriesFolder);
|
||||
register(defaultPublisherFolder);
|
||||
|
|
@ -129,10 +153,22 @@ public class PublicationsConfig extends AbstractConfig {
|
|||
return (Boolean) get(attachOrgaUnitsStep);
|
||||
}
|
||||
|
||||
public Boolean getAttachOrganizationPublicationsStep() {
|
||||
return (Boolean) get(attachOrganizationPublicationsStep);
|
||||
}
|
||||
|
||||
public Boolean getAttachPersonPublicationsStep() {
|
||||
return (Boolean) get(attachPersonPublicationsStep);
|
||||
}
|
||||
|
||||
public String getAttachPublicationsStepTo() {
|
||||
return (String) get(attachPublicationsStepTo);
|
||||
}
|
||||
|
||||
public Boolean getPublisherPublicationsStep() {
|
||||
return (Boolean) get(attachPublisherPublicationsStep);
|
||||
}
|
||||
|
||||
public Integer getDefaultAuthorsFolder() {
|
||||
if (get(defaultAuthorsFolder) == null) {
|
||||
return null;
|
||||
|
|
@ -228,4 +264,5 @@ public class PublicationsConfig extends AbstractConfig {
|
|||
public String getOrganizationBundleType() {
|
||||
return (String) get(orgaBundleType);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,11 +3,26 @@ com.arsdigita.cms.contenttypes.publications.attach_orgaunits_step.purpose = Enab
|
|||
com.arsdigita.cms.contenttypes.publications.attach_orgaunits_step.example = true
|
||||
com.arsdigita.cms.contenttypes.publications.attach_orgaunits_step.format = [Boolean]
|
||||
|
||||
com.arsdigita.cms.contenttypes.publications.attach_organization_publications_step.title = Enable OrganizationPublications step
|
||||
com.arsdigita.cms.contenttypes.publications.attach_organization_publications_step.purpose = Attaches an authoring step to GenericOrganizationalUnit which displays all publications of the type UnPublished to which the organizational unit is assigned as publishing organization.
|
||||
com.arsdigita.cms.contenttypes.publications.attach_organization_publications_step.example = true
|
||||
com.arsdigita.cms.contenttypes.publications.attach_organization_publications_step.format = [Boolean]
|
||||
|
||||
com.arsdigita.cms.contenttypes.publications.attach_person_publications_step.title = Enable authoring which lists all publications of a person
|
||||
com.arsdigita.cms.contenttypes.publications.attach_person_publications_step.purpose = Attaches an authoring step to GenericPerson which displays all publications to which the person is assigned as author.
|
||||
com.arsdigita.cms.contenttypes.publications.attach_person_publications_step.example = true
|
||||
com.arsdigita.cms.contenttypes.publications.attach_person_publications_step.format = [Boolean]
|
||||
|
||||
com.arsdigita.cms.contenttypes.publications.attach_publications_step_to.title = Attach the Publications authoring step
|
||||
com.arsdigita.cms.contenttypes.publications.attach_publications_step_to.purpose = Attaches the authoring step for associating a publication to organizationalunit to the authoring steps of the content types in the string.
|
||||
com.arsdigita.cms.contenttypes.publications.attach_publications_step_to.example = com.arsdigita.cms.contenttypes.SciInstitute;com.arsdigita.cms.contenttypes.SciDepartment;com.arsdigita.cms.contenttypes.SciProject
|
||||
com.arsdigita.cms.contenttypes.publications.attach_publications_step_to.format = [String]
|
||||
|
||||
com.arsdigita.cms.contenttypes.publications.attach_publisher_publications_step.title = Attach PublisherPublications step
|
||||
com.arsdigita.cms.contenttypes.publications.attach_publisher_publications_step.purpose = Attaches an authoring step to Publisher which displays all publications the publisher is assigned to
|
||||
com.arsdigita.cms.contenttypes.publications.attach_publisher_publications_step.example = true
|
||||
com.arsdigita.cms.contenttypes.publications.attach_publisher_publications_step.format = [Boolean]
|
||||
|
||||
com.arsdigita.cms.contenttypes.publications.default_authors_folder.title = ID of the default folder for items created using the create pane of the ItemSearchWidget
|
||||
com.arsdigita.cms.contenttypes.publications.default_authors_folder.purpose = Default folder for items created using the create pane of the ItemSearchWidget
|
||||
com.arsdigita.cms.contenttypes.publications.default_authors_folder.example = 10002
|
||||
|
|
|
|||
|
|
@ -53,12 +53,16 @@ public class PublisherInitializer extends ContentTypeInitializer {
|
|||
public void init(final DomainInitEvent event) {
|
||||
super.init(event);
|
||||
|
||||
AuthoringKitWizard.registerAssetStep(
|
||||
Publisher.BASE_DATA_OBJECT_TYPE,
|
||||
PublisherPublicationsStep.class,
|
||||
PublicationGlobalizationUtil.globalize("publisher.ui.publications.title"),
|
||||
PublicationGlobalizationUtil.globalize("publisher.ui.publications.description"),
|
||||
10);
|
||||
final PublicationsConfig config = Publication.getConfig();
|
||||
|
||||
if (config.getPublisherPublicationsStep()) {
|
||||
AuthoringKitWizard.registerAssetStep(
|
||||
Publisher.BASE_DATA_OBJECT_TYPE,
|
||||
PublisherPublicationsStep.class,
|
||||
PublicationGlobalizationUtil.globalize("publisher.ui.publications.title"),
|
||||
PublicationGlobalizationUtil.globalize("publisher.ui.publications.description"),
|
||||
10);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -259,6 +259,10 @@ public enum RisField {
|
|||
* to 255 characters long.
|
||||
*/
|
||||
A3,
|
||||
/**
|
||||
* Used in GEN type
|
||||
*/
|
||||
A4,
|
||||
/**
|
||||
* Abstract. This is a free text field and can contain alphanumeric
|
||||
* characters; there is no practical length limit to this field.
|
||||
|
|
|
|||
|
|
@ -1,15 +1,11 @@
|
|||
package com.arsdigita.cms.scipublications.importer.ris.converters;
|
||||
|
||||
import com.arsdigita.cms.contenttypes.Monograph;
|
||||
import com.arsdigita.cms.contenttypes.Publication;
|
||||
import com.arsdigita.cms.scipublications.imexporter.ris.RisField;
|
||||
import com.arsdigita.cms.scipublications.imexporter.ris.RisType;
|
||||
import com.arsdigita.cms.scipublications.importer.report.AuthorImportReport;
|
||||
import com.arsdigita.cms.scipublications.importer.report.FieldImportReport;
|
||||
import com.arsdigita.cms.scipublications.importer.report.PublicationImportReport;
|
||||
import com.arsdigita.cms.scipublications.importer.ris.RisConverter;
|
||||
import com.arsdigita.cms.scipublications.importer.ris.RisDataset;
|
||||
import com.arsdigita.cms.scipublications.importer.util.AuthorData;
|
||||
import com.arsdigita.cms.scipublications.importer.util.ImporterUtil;
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -19,7 +15,7 @@ import java.util.List;
|
|||
* @author Jens Pelzetter <jens@jp-digital.de>
|
||||
* @version $Id$
|
||||
*/
|
||||
public class BookConverter implements RisConverter {
|
||||
public class BookConverter extends AbstractRisConverter {
|
||||
|
||||
public PublicationImportReport convert(final RisDataset dataset,
|
||||
final ImporterUtil importerUtil,
|
||||
|
|
@ -33,50 +29,13 @@ public class BookConverter implements RisConverter {
|
|||
monograph.setTitle(dataset.getValues().get(RisField.TI).get(0));
|
||||
report.setTitle(dataset.getValues().get(RisField.TI).get(0));
|
||||
|
||||
final String yearStr = dataset.getValues().get(RisField.PY).get(0);
|
||||
try {
|
||||
final int year = Integer.parseInt(yearStr);
|
||||
monograph.setYearOfPublication(year);
|
||||
report.addField(new FieldImportReport("year", yearStr));
|
||||
} catch (NumberFormatException ex) {
|
||||
report.addMessage(String.format("Failed to convert year of publication value '%s' from RIS to"
|
||||
+ "integer value. Setting year of publication to 0"));
|
||||
monograph.setYearOfPublication(0);
|
||||
}
|
||||
processYear(dataset, pretend, monograph, report);
|
||||
|
||||
final List<String> authors = dataset.getValues().get(RisField.AU);
|
||||
if ((authors != null) && !authors.isEmpty()) {
|
||||
for (String authorStr : authors) {
|
||||
processAuthorStr(authorStr, false, importerUtil, monograph, report, pretend);
|
||||
}
|
||||
}
|
||||
processAuthors(dataset, RisField.AU, importerUtil, monograph, report, pretend);
|
||||
|
||||
final List<String> editors = dataset.getValues().get(RisField.A3);
|
||||
if ((editors != null) && !editors.isEmpty()) {
|
||||
for (String editorStr : editors) {
|
||||
processAuthorStr(editorStr, true, importerUtil, monograph, report, pretend);
|
||||
}
|
||||
}
|
||||
processEditors(dataset, RisField.A3, importerUtil, monograph, report, pretend);
|
||||
|
||||
final List<String> publisherList = dataset.getValues().get(RisField.PB);
|
||||
final List<String> placeList = dataset.getValues().get(RisField.CY);
|
||||
final String publisherName;
|
||||
if ((publisherList == null) || publisherList.isEmpty()) {
|
||||
publisherName = null;
|
||||
} else {
|
||||
publisherName = publisherList.get(0);
|
||||
}
|
||||
|
||||
final String place;
|
||||
if ((placeList == null) || placeList.isEmpty()) {
|
||||
place = null;
|
||||
} else {
|
||||
place = placeList.get(0);
|
||||
}
|
||||
|
||||
if (publisherName != null) {
|
||||
report.setPublisher(importerUtil.processPublisher(monograph, place, publisherName, pretend));
|
||||
}
|
||||
processPublisher(dataset, pretend, monograph, importerUtil, report);
|
||||
|
||||
final List<String> abstractList = dataset.getValues().get(RisField.AB);
|
||||
if ((abstractList != null) && (!abstractList.isEmpty())) {
|
||||
|
|
@ -89,46 +48,19 @@ public class BookConverter implements RisConverter {
|
|||
monograph.setEdition(edition.get(0));
|
||||
report.addField(new FieldImportReport("edition", edition.get(0)));
|
||||
}
|
||||
|
||||
final List<String> numberOfVols = dataset.getValues().get(RisField.NV);
|
||||
if ((numberOfVols != null) && !numberOfVols.isEmpty()) {
|
||||
try {
|
||||
final int value = Integer.parseInt(numberOfVols.get(0));
|
||||
monograph.setNumberOfVolumes(value);
|
||||
report.addField(new FieldImportReport("number of volumes", numberOfVols.get(0)));
|
||||
} catch (NumberFormatException ex) {
|
||||
report.addMessage("Failed to parse number of volumes.");
|
||||
}
|
||||
}
|
||||
|
||||
processNumberOfVolumes(dataset, pretend, monograph, report);
|
||||
|
||||
final List<String> isbn = dataset.getValues().get(RisField.SN);
|
||||
if ((isbn != null) && !isbn.isEmpty()) {
|
||||
monograph.setISBN(isbn.get(0));
|
||||
report.addField(new FieldImportReport("isbn", isbn.get(0)));
|
||||
}
|
||||
|
||||
final List<String> numberOfPages = dataset.getValues().get(RisField.SP);
|
||||
if ((numberOfPages != null) && !numberOfPages.isEmpty()) {
|
||||
try {
|
||||
final int value = Integer.parseInt(numberOfPages.get(0));
|
||||
monograph.setNumberOfPages(value);
|
||||
report.addField(new FieldImportReport("number of pages", numberOfPages.get(0)));
|
||||
} catch(NumberFormatException ex) {
|
||||
report.addMessage("Failed to parse number of pages");
|
||||
}
|
||||
}
|
||||
|
||||
final List<String> volume = dataset.getValues().get(RisField.VL);
|
||||
if ((volume != null) && !volume.isEmpty()) {
|
||||
try {
|
||||
final int value = Integer.parseInt(volume.get(0));
|
||||
monograph.setVolume(value);
|
||||
report.addField(new FieldImportReport("volume", volume.get(0)));
|
||||
} catch(NumberFormatException ex) {
|
||||
report.addMessage("Failed to parse value of field 'volume'.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
processNumberOfPages(dataset, pretend, monograph, report);
|
||||
|
||||
processVolume(dataset, pretend, monograph, report);
|
||||
|
||||
final List<String> series = dataset.getValues().get(RisField.T2);
|
||||
if ((series != null) && !series.isEmpty()) {
|
||||
report.setSeries(importerUtil.processSeries(monograph, series.get(0), pretend));
|
||||
|
|
@ -137,34 +69,6 @@ public class BookConverter implements RisConverter {
|
|||
return report;
|
||||
}
|
||||
|
||||
private void processAuthorStr(final String authorStr,
|
||||
final boolean editor,
|
||||
final ImporterUtil importerUtil,
|
||||
final Publication publication,
|
||||
final PublicationImportReport importReport,
|
||||
final boolean pretend) {
|
||||
final AuthorData authorData = new AuthorData();
|
||||
|
||||
final String[] tokens = authorStr.split(",");
|
||||
if (tokens.length == 0) {
|
||||
importReport.addMessage(String.format("Failed to parse author string '%s'.", authorStr));
|
||||
return;
|
||||
}
|
||||
|
||||
if (tokens.length >= 1) {
|
||||
authorData.setSurname(tokens[0]);
|
||||
}
|
||||
|
||||
if (tokens.length >= 2) {
|
||||
authorData.setGivenName(tokens[1]);
|
||||
}
|
||||
|
||||
authorData.setEditor(editor);
|
||||
|
||||
final AuthorImportReport authorReport = importerUtil.processAuthor(publication, authorData, pretend);
|
||||
importReport.addAuthor(authorReport);
|
||||
}
|
||||
|
||||
public RisType getRisType() {
|
||||
return RisType.BOOK;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,15 +1,11 @@
|
|||
package com.arsdigita.cms.scipublications.importer.ris.converters;
|
||||
|
||||
import com.arsdigita.cms.contenttypes.Monograph;
|
||||
import com.arsdigita.cms.contenttypes.Publication;
|
||||
import com.arsdigita.cms.scipublications.imexporter.ris.RisField;
|
||||
import com.arsdigita.cms.scipublications.imexporter.ris.RisType;
|
||||
import com.arsdigita.cms.scipublications.importer.report.AuthorImportReport;
|
||||
import com.arsdigita.cms.scipublications.importer.report.FieldImportReport;
|
||||
import com.arsdigita.cms.scipublications.importer.report.PublicationImportReport;
|
||||
import com.arsdigita.cms.scipublications.importer.ris.RisConverter;
|
||||
import com.arsdigita.cms.scipublications.importer.ris.RisDataset;
|
||||
import com.arsdigita.cms.scipublications.importer.util.AuthorData;
|
||||
import com.arsdigita.cms.scipublications.importer.util.ImporterUtil;
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -19,7 +15,7 @@ import java.util.List;
|
|||
* @author Jens Pelzetter <jens@jp-digital.de>
|
||||
* @version $Id$
|
||||
*/
|
||||
public class EbookConverter implements RisConverter {
|
||||
public class EbookConverter extends AbstractRisConverter {
|
||||
|
||||
public PublicationImportReport convert(final RisDataset dataset,
|
||||
final ImporterUtil importerUtil,
|
||||
|
|
@ -33,50 +29,13 @@ public class EbookConverter implements RisConverter {
|
|||
monograph.setTitle(dataset.getValues().get(RisField.TI).get(0));
|
||||
report.setTitle(dataset.getValues().get(RisField.TI).get(0));
|
||||
|
||||
final String yearStr = dataset.getValues().get(RisField.PY).get(0);
|
||||
try {
|
||||
final int year = Integer.parseInt(yearStr);
|
||||
monograph.setYearOfPublication(year);
|
||||
report.addField(new FieldImportReport("year", yearStr));
|
||||
} catch (NumberFormatException ex) {
|
||||
report.addMessage(String.format("Failed to convert year of publication value '%s' from RIS to"
|
||||
+ "integer value. Setting year of publication to 0"));
|
||||
monograph.setYearOfPublication(0);
|
||||
}
|
||||
processYear(dataset, pretend, monograph, report);
|
||||
|
||||
final List<String> authors = dataset.getValues().get(RisField.AU);
|
||||
if ((authors != null) && !authors.isEmpty()) {
|
||||
for (String authorStr : authors) {
|
||||
processAuthorStr(authorStr, false, importerUtil, monograph, report, pretend);
|
||||
}
|
||||
}
|
||||
processAuthors(dataset, RisField.AU, importerUtil, monograph, report, pretend);
|
||||
|
||||
final List<String> editors = dataset.getValues().get(RisField.A3);
|
||||
if ((editors != null) && !editors.isEmpty()) {
|
||||
for (String editorStr : editors) {
|
||||
processAuthorStr(editorStr, true, importerUtil, monograph, report, pretend);
|
||||
}
|
||||
}
|
||||
processEditors(dataset, RisField.A3, importerUtil, monograph, report, pretend);
|
||||
|
||||
final List<String> publisherList = dataset.getValues().get(RisField.PB);
|
||||
final List<String> placeList = dataset.getValues().get(RisField.CY);
|
||||
final String publisherName;
|
||||
if ((publisherList == null) || publisherList.isEmpty()) {
|
||||
publisherName = null;
|
||||
} else {
|
||||
publisherName = publisherList.get(0);
|
||||
}
|
||||
|
||||
final String place;
|
||||
if ((placeList == null) || placeList.isEmpty()) {
|
||||
place = null;
|
||||
} else {
|
||||
place = placeList.get(0);
|
||||
}
|
||||
|
||||
if (publisherName != null) {
|
||||
report.setPublisher(importerUtil.processPublisher(monograph, place, publisherName, pretend));
|
||||
}
|
||||
processPublisher(dataset, pretend, monograph, importerUtil, report);
|
||||
|
||||
final List<String> abstractList = dataset.getValues().get(RisField.AB);
|
||||
if ((abstractList != null) && (!abstractList.isEmpty())) {
|
||||
|
|
@ -89,35 +48,17 @@ public class EbookConverter implements RisConverter {
|
|||
monograph.setEdition(edition.get(0));
|
||||
report.addField(new FieldImportReport("edition", edition.get(0)));
|
||||
}
|
||||
|
||||
|
||||
final List<String> isbn = dataset.getValues().get(RisField.SN);
|
||||
if ((isbn != null) && !isbn.isEmpty()) {
|
||||
monograph.setISBN(isbn.get(0));
|
||||
report.addField(new FieldImportReport("isbn", isbn.get(0)));
|
||||
}
|
||||
|
||||
final List<String> numberOfPages = dataset.getValues().get(RisField.SP);
|
||||
if ((numberOfPages != null) && !numberOfPages.isEmpty()) {
|
||||
try {
|
||||
final int value = Integer.parseInt(numberOfPages.get(0));
|
||||
monograph.setNumberOfPages(value);
|
||||
report.addField(new FieldImportReport("number of pages", numberOfPages.get(0)));
|
||||
} catch(NumberFormatException ex) {
|
||||
report.addMessage("Failed to parse number of pages");
|
||||
}
|
||||
}
|
||||
|
||||
final List<String> volume = dataset.getValues().get(RisField.VL);
|
||||
if ((volume != null) && !volume.isEmpty()) {
|
||||
try {
|
||||
final int value = Integer.parseInt(volume.get(0));
|
||||
monograph.setVolume(value);
|
||||
report.addField(new FieldImportReport("volume", volume.get(0)));
|
||||
} catch(NumberFormatException ex) {
|
||||
report.addMessage("Failed to parse value of field 'volume'.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
processNumberOfPages(dataset, pretend, monograph, report);
|
||||
|
||||
processVolume(dataset, pretend, monograph, report);
|
||||
|
||||
final List<String> series = dataset.getValues().get(RisField.T2);
|
||||
if ((series != null) && !series.isEmpty()) {
|
||||
report.setSeries(importerUtil.processSeries(monograph, series.get(0), pretend));
|
||||
|
|
@ -126,34 +67,6 @@ public class EbookConverter implements RisConverter {
|
|||
return report;
|
||||
}
|
||||
|
||||
private void processAuthorStr(final String authorStr,
|
||||
final boolean editor,
|
||||
final ImporterUtil importerUtil,
|
||||
final Publication publication,
|
||||
final PublicationImportReport importReport,
|
||||
final boolean pretend) {
|
||||
final AuthorData authorData = new AuthorData();
|
||||
|
||||
final String[] tokens = authorStr.split(",");
|
||||
if (tokens.length == 0) {
|
||||
importReport.addMessage(String.format("Failed to parse author string '%s'.", authorStr));
|
||||
return;
|
||||
}
|
||||
|
||||
if (tokens.length >= 1) {
|
||||
authorData.setSurname(tokens[0]);
|
||||
}
|
||||
|
||||
if (tokens.length >= 2) {
|
||||
authorData.setGivenName(tokens[1]);
|
||||
}
|
||||
|
||||
authorData.setEditor(editor);
|
||||
|
||||
final AuthorImportReport authorReport = importerUtil.processAuthor(publication, authorData, pretend);
|
||||
importReport.addAuthor(authorReport);
|
||||
}
|
||||
|
||||
public RisType getRisType() {
|
||||
return RisType.EBOOK;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue