- Fixes am DaBInImporter
- Unknown internationalisiert git-svn-id: https://svn.libreccm.org/ccm/trunk@865 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
e8c10aa33e
commit
4345698578
|
|
@ -132,8 +132,12 @@ public class DaBInImporter extends Program {
|
||||||
private SciOrganization orgaDe;
|
private SciOrganization orgaDe;
|
||||||
private SciOrganization orgaEn;
|
private SciOrganization orgaEn;
|
||||||
private ContentBundle orga;
|
private ContentBundle orga;
|
||||||
private Address postalAddress;
|
private ContentBundle postalAddress;
|
||||||
private Address officeAddress;
|
private Address postalAddressDe;
|
||||||
|
private Address postalAddressEn;
|
||||||
|
private ContentBundle officeAddress;
|
||||||
|
private Address officeAddressDe;
|
||||||
|
private Address officeAddressEn;
|
||||||
private Domain termsDomain;
|
private Domain termsDomain;
|
||||||
private Term publicationsTerm;
|
private Term publicationsTerm;
|
||||||
private Term workingPapersTerm;
|
private Term workingPapersTerm;
|
||||||
|
|
@ -333,113 +337,228 @@ public class DaBInImporter extends Program {
|
||||||
orgaDe.setTitle(config.getProperty("orga.title.de"));
|
orgaDe.setTitle(config.getProperty("orga.title.de"));
|
||||||
orgaDe.setContentSection(section);
|
orgaDe.setContentSection(section);
|
||||||
orgaDe.setLanguage("de");
|
orgaDe.setLanguage("de");
|
||||||
orgaDe.save();
|
orgaDe.setLifecycle(createLifecycle(lifecycle));
|
||||||
orgaDe.setContentSection(section);
|
orgaDe.setContentSection(section);
|
||||||
|
orgaDe.save();
|
||||||
|
|
||||||
orgaEn = new SciOrganization();
|
orgaEn = new SciOrganization();
|
||||||
orgaEn.setName(config.getProperty("orga.name.en"));
|
orgaEn.setName(config.getProperty("orga.name.en"));
|
||||||
orgaEn.setTitle(config.getProperty("orga.title.en"));
|
orgaEn.setTitle(config.getProperty("orga.title.en"));
|
||||||
orgaEn.setContentSection(section);
|
orgaEn.setContentSection(section);
|
||||||
orgaEn.setLanguage("en");
|
orgaEn.setLanguage("en");
|
||||||
orgaEn.save();
|
orgaEn.setLifecycle(createLifecycle(lifecycle));
|
||||||
orgaEn.setContentSection(section);
|
orgaEn.setContentSection(section);
|
||||||
|
orgaEn.save();
|
||||||
|
|
||||||
ContentBundle orga = new ContentBundle(orgaDe);
|
ContentBundle orga = new ContentBundle(orgaDe);
|
||||||
orga.addInstance(orgaEn);
|
orga.addInstance(orgaEn);
|
||||||
|
orga.setLifecycle(createLifecycle(lifecycle));
|
||||||
|
orga.setContentSection(section);
|
||||||
organization.addItem(orga);
|
organization.addItem(orga);
|
||||||
|
|
||||||
|
orgaDe.setContentSection(section);
|
||||||
|
orgaEn.setContentSection(section);
|
||||||
|
|
||||||
if (config.getProperty("orga.address.postal.name") != null) {
|
if (config.getProperty("orga.address.postal.name") != null) {
|
||||||
postalAddress = new Address();
|
postalAddressDe = new Address();
|
||||||
postalAddress.setName(config.getProperty(
|
postalAddressDe.setName(config.getProperty(
|
||||||
"orga.address.postal.name"));
|
"orga.address.postal.name"));
|
||||||
postalAddress.setTitle(config.getProperty(
|
postalAddressDe.setTitle(config.getProperty(
|
||||||
"orga.address.postal.title"));
|
"orga.address.postal.title"));
|
||||||
postalAddress.setAddress(config.getProperty(
|
postalAddressDe.setAddress(config.getProperty(
|
||||||
"orga.address.postal.data").
|
"orga.address.postal.data").
|
||||||
trim().
|
trim().
|
||||||
replace("\t", "").
|
replace("\t", "").
|
||||||
replaceAll(" +", " ").
|
replaceAll(" +", " ").
|
||||||
replace("\n ", "\n"));
|
replace("\n ", "\n"));
|
||||||
postalAddress.setPostalCode(config.getProperty(
|
postalAddressDe.setPostalCode(config.getProperty(
|
||||||
"orga.address.postal.code"));
|
"orga.address.postal.code"));
|
||||||
postalAddress.setCity(config.getProperty(
|
postalAddressDe.setCity(config.getProperty(
|
||||||
"orga.address.postal.city"));
|
"orga.address.postal.city"));
|
||||||
postalAddress.setState(config.getProperty(
|
postalAddressDe.setState(config.getProperty(
|
||||||
"orga.address.postal.state"));
|
"orga.address.postal.state"));
|
||||||
postalAddress.setIsoCountryCode(config.getProperty(
|
postalAddressDe.setIsoCountryCode(config.getProperty(
|
||||||
"orga.address.postal.country"));
|
"orga.address.postal.country"));
|
||||||
postalAddress.setContentSection(section);
|
postalAddressDe.setLanguage("de");
|
||||||
postalAddress.setLanguage("de");
|
postalAddressDe.setLifecycle(createLifecycle(lifecycle));
|
||||||
postalAddress.save();
|
postalAddressDe.setContentSection(section);
|
||||||
|
postalAddressDe.save();
|
||||||
|
|
||||||
ContentBundle bundle = new ContentBundle(postalAddress);
|
postalAddressEn = new Address();
|
||||||
organization.addItem(bundle);
|
postalAddressEn.setName(config.getProperty(
|
||||||
|
|
||||||
Contact contact = new Contact();
|
|
||||||
contact.setName(config.getProperty(
|
|
||||||
"orga.address.postal.name"));
|
"orga.address.postal.name"));
|
||||||
contact.setTitle(config.getProperty(
|
postalAddressEn.setTitle(config.getProperty(
|
||||||
"orga.address.postal.title"));
|
"orga.address.postal.title"));
|
||||||
contact.setAddress(postalAddress);
|
postalAddressEn.setAddress(config.getProperty(
|
||||||
contact.setLanguage("de");
|
"orga.address.postal.data").
|
||||||
contact.save();
|
trim().
|
||||||
bundle = new ContentBundle(contact);
|
replace("\t", "").
|
||||||
organization.addItem(bundle);
|
replaceAll(" +", " ").
|
||||||
|
replace("\n ", "\n"));
|
||||||
|
postalAddressEn.setPostalCode(config.getProperty(
|
||||||
|
"orga.address.postal.code"));
|
||||||
|
postalAddressEn.setCity(config.getProperty(
|
||||||
|
"orga.address.postal.city"));
|
||||||
|
postalAddressEn.setState(config.getProperty(
|
||||||
|
"orga.address.postal.state"));
|
||||||
|
postalAddressEn.setIsoCountryCode(config.getProperty(
|
||||||
|
"orga.address.postal.country"));
|
||||||
|
postalAddressEn.setLanguage("en");
|
||||||
|
postalAddressEn.setLifecycle(createLifecycle(lifecycle));
|
||||||
|
postalAddressEn.setContentSection(section);
|
||||||
|
postalAddressEn.save();
|
||||||
|
|
||||||
orgaDe.addContact(contact, "postalAddress");
|
postalAddress = new ContentBundle(postalAddressDe);
|
||||||
|
postalAddress.addInstance(postalAddressEn);
|
||||||
|
postalAddress.setLifecycle(createLifecycle(lifecycle));
|
||||||
|
postalAddress.setContentSection(section);
|
||||||
|
organization.addItem(postalAddress);
|
||||||
|
|
||||||
|
postalAddressDe.setContentSection(section);
|
||||||
|
postalAddressEn.setContentSection(section);
|
||||||
|
|
||||||
|
Contact contactDe = new Contact();
|
||||||
|
contactDe.setName(config.getProperty(
|
||||||
|
"orga.address.postal.name"));
|
||||||
|
contactDe.setTitle(config.getProperty(
|
||||||
|
"orga.address.postal.title"));
|
||||||
|
contactDe.setAddress((Address) postalAddress.
|
||||||
|
getPrimaryInstance());
|
||||||
|
contactDe.setLanguage("de");
|
||||||
|
contactDe.setLifecycle(createLifecycle(lifecycle));
|
||||||
|
contactDe.setContentSection(section);
|
||||||
|
contactDe.save();
|
||||||
|
|
||||||
|
Contact contactEn = new Contact();
|
||||||
|
contactEn.setName(config.getProperty(
|
||||||
|
"orga.address.postal.name"));
|
||||||
|
contactEn.setTitle(config.getProperty(
|
||||||
|
"orga.address.postal.title"));
|
||||||
|
contactEn.setAddress((Address) postalAddress.
|
||||||
|
getPrimaryInstance());
|
||||||
|
contactEn.setLanguage("en");
|
||||||
|
contactEn.setLifecycle(createLifecycle(lifecycle));
|
||||||
|
contactEn.setContentSection(section);
|
||||||
|
contactEn.save();
|
||||||
|
|
||||||
|
ContentBundle contact = new ContentBundle(contactDe);
|
||||||
|
contact.addInstance(contactEn);
|
||||||
|
contact.setLifecycle(createLifecycle(lifecycle));
|
||||||
|
contact.setContentSection(section);
|
||||||
|
organization.addItem(contact);
|
||||||
|
|
||||||
|
contactDe.setContentSection(section);
|
||||||
|
contactEn.setContentSection(section);
|
||||||
|
|
||||||
|
orgaDe.addContact((Contact) contact.getPrimaryInstance(),
|
||||||
|
"postalAddress");
|
||||||
orgaDe.save();
|
orgaDe.save();
|
||||||
orgaEn.addContact(contact, "postalAddress");
|
orgaEn.addContact((Contact) contact.getPrimaryInstance(),
|
||||||
|
"postalAddress");
|
||||||
orgaEn.save();
|
orgaEn.save();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.getProperty("orga.address.office.name") != null) {
|
if (config.getProperty("orga.address.office.name") != null) {
|
||||||
officeAddress = new Address();
|
officeAddressDe = new Address();
|
||||||
officeAddress.setName(config.getProperty(
|
officeAddressDe.setName(config.getProperty(
|
||||||
"orga.address.office.name"));
|
"orga.address.office.name"));
|
||||||
officeAddress.setTitle(config.getProperty(
|
officeAddressDe.setTitle(config.getProperty(
|
||||||
"orga.address.office.title"));
|
"orga.address.office.title"));
|
||||||
officeAddress.setAddress(config.getProperty(
|
officeAddressDe.setAddress(config.getProperty(
|
||||||
"orga.address.office.data").
|
"orga.address.office.data").
|
||||||
trim().
|
trim().
|
||||||
replace("\t", "").
|
replace("\t", "").
|
||||||
replaceAll(" +", " ").
|
replaceAll(" +", " ").
|
||||||
replace("\n ", "\n"));
|
replace("\n ", "\n"));
|
||||||
//.replace("\n ", "\n"));
|
//.replace("\n ", "\n"));
|
||||||
officeAddress.setPostalCode(config.getProperty(
|
officeAddressDe.setPostalCode(config.getProperty(
|
||||||
"orga.address.office.code"));
|
"orga.address.office.code"));
|
||||||
officeAddress.setCity(config.getProperty(
|
officeAddressDe.setCity(config.getProperty(
|
||||||
"orga.address.office.city"));
|
"orga.address.office.city"));
|
||||||
officeAddress.setState(config.getProperty(
|
officeAddressDe.setState(config.getProperty(
|
||||||
"orga.address.office.state"));
|
"orga.address.office.state"));
|
||||||
officeAddress.setIsoCountryCode(config.getProperty(
|
officeAddressDe.setIsoCountryCode(config.getProperty(
|
||||||
"orga.address.office.country"));
|
"orga.address.office.country"));
|
||||||
officeAddress.setContentSection(section);
|
officeAddressDe.setLanguage("de");
|
||||||
officeAddress.setLanguage("de");
|
officeAddressDe.setLifecycle(createLifecycle(lifecycle));
|
||||||
officeAddress.save();
|
officeAddressDe.setContentSection(section);
|
||||||
|
officeAddressDe.save();
|
||||||
|
|
||||||
ContentBundle bundle = new ContentBundle(officeAddress);
|
officeAddressEn = new Address();
|
||||||
organization.addItem(bundle);
|
officeAddressEn.setName(config.getProperty(
|
||||||
|
|
||||||
Contact contact = new Contact();
|
|
||||||
contact.setName(config.getProperty(
|
|
||||||
"orga.address.office.name"));
|
"orga.address.office.name"));
|
||||||
contact.setTitle(config.getProperty(
|
officeAddressEn.setTitle(config.getProperty(
|
||||||
"orga.address.office.title"));
|
"orga.address.office.title"));
|
||||||
contact.setAddress(officeAddress);
|
officeAddressEn.setAddress(config.getProperty(
|
||||||
contact.setLanguage("de");
|
"orga.address.office.data").
|
||||||
|
trim().
|
||||||
|
replace("\t", "").
|
||||||
|
replaceAll(" +", " ").
|
||||||
|
replace("\n ", "\n"));
|
||||||
|
//.replace("\n ", "\n"));
|
||||||
|
officeAddressEn.setPostalCode(config.getProperty(
|
||||||
|
"orga.address.office.code"));
|
||||||
|
officeAddressEn.setCity(config.getProperty(
|
||||||
|
"orga.address.office.city"));
|
||||||
|
officeAddressEn.setState(config.getProperty(
|
||||||
|
"orga.address.office.state"));
|
||||||
|
officeAddressEn.setIsoCountryCode(config.getProperty(
|
||||||
|
"orga.address.office.country"));
|
||||||
|
officeAddressEn.setLanguage("en");
|
||||||
|
officeAddressEn.setLifecycle(createLifecycle(lifecycle));
|
||||||
|
officeAddressEn.setContentSection(section);
|
||||||
|
officeAddressEn.save();
|
||||||
|
|
||||||
|
officeAddress = new ContentBundle(officeAddressDe);
|
||||||
|
officeAddress.setLifecycle(createLifecycle(lifecycle));
|
||||||
|
officeAddress.setContentSection(section);
|
||||||
|
officeAddress.addInstance(officeAddressEn);
|
||||||
|
organization.addItem(officeAddress);
|
||||||
|
|
||||||
|
officeAddressDe.setContentSection(section);
|
||||||
|
officeAddressEn.setContentSection(section);
|
||||||
|
|
||||||
|
Contact contactDe = new Contact();
|
||||||
|
contactDe.setName(config.getProperty(
|
||||||
|
"orga.address.office.name"));
|
||||||
|
contactDe.setTitle(config.getProperty(
|
||||||
|
"orga.address.office.title"));
|
||||||
|
contactDe.setAddress((Address) officeAddress.
|
||||||
|
getPrimaryInstance());
|
||||||
|
contactDe.setLanguage("de");
|
||||||
|
contactDe.setLifecycle(createLifecycle(lifecycle));
|
||||||
|
contactDe.setContentSection(section);
|
||||||
|
contactDe.save();
|
||||||
|
|
||||||
|
Contact contactEn = new Contact();
|
||||||
|
contactEn.setName(config.getProperty(
|
||||||
|
"orga.address.office.name"));
|
||||||
|
contactEn.setTitle(config.getProperty(
|
||||||
|
"orga.address.office.title"));
|
||||||
|
contactEn.setAddress((Address) officeAddress.
|
||||||
|
getPrimaryInstance());
|
||||||
|
contactEn.setLanguage("en");
|
||||||
|
contactEn.setLifecycle(createLifecycle(lifecycle));
|
||||||
|
contactEn.setContentSection(section);
|
||||||
|
contactEn.save();
|
||||||
|
|
||||||
|
ContentBundle contact = new ContentBundle(contactDe);
|
||||||
|
contact.addInstance(contactEn);
|
||||||
|
contact.setLifecycle(createLifecycle(lifecycle));
|
||||||
contact.setContentSection(section);
|
contact.setContentSection(section);
|
||||||
contact.save();
|
organization.addItem(contact);
|
||||||
bundle = new ContentBundle(contact);
|
|
||||||
organization.addItem(bundle);
|
|
||||||
|
|
||||||
orgaDe.addContact(contact, "officeAddress");
|
contactDe.setContentSection(section);
|
||||||
|
contactEn.setContentSection(section);
|
||||||
|
|
||||||
|
orgaDe.addContact((Contact) contact.getPrimaryInstance(),
|
||||||
|
"officeAddress");
|
||||||
orgaDe.save();
|
orgaDe.save();
|
||||||
orgaEn.addContact(contact, "officeAddress");
|
orgaEn.addContact((Contact) contact.getPrimaryInstance(),
|
||||||
|
"officeAddress");
|
||||||
orgaEn.save();
|
orgaEn.save();
|
||||||
|
// orga.setContentSection(section);
|
||||||
|
|
||||||
orgaDe.setContentSection(section);
|
|
||||||
orgaEn.setContentSection(section);
|
|
||||||
orga.setContentSection(section);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,7 @@ import com.arsdigita.kernel.ui.DomainObjectSelectionModel;
|
||||||
import com.arsdigita.globalization.GlobalizedMessage;
|
import com.arsdigita.globalization.GlobalizedMessage;
|
||||||
import com.arsdigita.toolbox.util.GlobalizationUtil;
|
import com.arsdigita.toolbox.util.GlobalizationUtil;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Displays a list of label-value pairs, which represent the attributes
|
* Displays a list of label-value pairs, which represent the attributes
|
||||||
* of a domain object.
|
* of a domain object.
|
||||||
|
|
@ -315,7 +316,7 @@ public class DomainObjectPropertySheet extends PropertySheet {
|
||||||
private String m_default;
|
private String m_default;
|
||||||
|
|
||||||
public DefaultAttributeFormatter() {
|
public DefaultAttributeFormatter() {
|
||||||
this("<i>unknown</i>");
|
this((String)GlobalizationUtil.globalize("cms.ui.unknown").localize());
|
||||||
}
|
}
|
||||||
|
|
||||||
public DefaultAttributeFormatter(String def) {
|
public DefaultAttributeFormatter(String def) {
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,3 @@
|
||||||
toolbox.ui.na=N/A
|
toolbox.ui.na=N/A
|
||||||
toolbox.ui.no_results=No Results.
|
toolbox.ui.no_results=No Results.
|
||||||
|
cms.ui.unknown=<em>unknown</em>
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,3 @@
|
||||||
toolbox.ui.na=N/A
|
toolbox.ui.na=N/A
|
||||||
toolbox.ui.no_results=Keine Ergebnisse.
|
toolbox.ui.no_results=Keine Ergebnisse.
|
||||||
|
cms.ui.unknown=<em>unbekannt</em>
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,3 @@
|
||||||
toolbox.ui.na=N/A
|
toolbox.ui.na=N/A
|
||||||
toolbox.ui.no_results=Pas de résultats
|
toolbox.ui.no_results=Pas de r\u00e9sultats
|
||||||
|
cms.ui.unknown=
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ import com.arsdigita.bebop.Component;
|
||||||
import com.arsdigita.bebop.Label;
|
import com.arsdigita.bebop.Label;
|
||||||
import com.arsdigita.bebop.PageState;
|
import com.arsdigita.bebop.PageState;
|
||||||
import com.arsdigita.bebop.SegmentedPanel;
|
import com.arsdigita.bebop.SegmentedPanel;
|
||||||
|
import com.arsdigita.cms.CMSGlobalized;
|
||||||
import com.arsdigita.cms.ContentPage;
|
import com.arsdigita.cms.ContentPage;
|
||||||
import com.arsdigita.cms.ContentSection;
|
import com.arsdigita.cms.ContentSection;
|
||||||
import com.arsdigita.cms.ItemSelectionModel;
|
import com.arsdigita.cms.ItemSelectionModel;
|
||||||
|
|
@ -33,6 +34,7 @@ import com.arsdigita.cms.contenttypes.Publication;
|
||||||
import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil;
|
import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil;
|
||||||
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
import com.arsdigita.cms.ui.authoring.BasicPageForm;
|
||||||
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
|
import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess;
|
||||||
|
import com.arsdigita.cms.util.GlobalizationUtil;
|
||||||
import com.arsdigita.domain.DomainObject;
|
import com.arsdigita.domain.DomainObject;
|
||||||
import com.arsdigita.domain.DomainService;
|
import com.arsdigita.domain.DomainService;
|
||||||
import java.text.DateFormat;
|
import java.text.DateFormat;
|
||||||
|
|
@ -146,7 +148,7 @@ public class PublicationPropertiesStep extends SimpleEditStep {
|
||||||
step);
|
step);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static class PreFormattedTextFormatter
|
protected static class PreFormattedTextFormatter
|
||||||
extends DomainService
|
extends DomainService
|
||||||
implements DomainObjectPropertySheet.AttributeFormatter {
|
implements DomainObjectPropertySheet.AttributeFormatter {
|
||||||
|
|
||||||
|
|
@ -155,8 +157,13 @@ public class PublicationPropertiesStep extends SimpleEditStep {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String format(DomainObject obj, String attribute, PageState state) {
|
public String format(DomainObject obj, String attribute, PageState state) {
|
||||||
return String.format("<pre>%s</pre>", get(obj, attribute));
|
String str = (String) get(obj, attribute);
|
||||||
|
if ((str == null) || str.trim().isEmpty()) {
|
||||||
|
return (String) GlobalizationUtil.globalize("cms.ui.unknown").
|
||||||
|
localize();
|
||||||
|
} else {
|
||||||
|
return String.format("<pre>%s</pre>", str);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue