- DaBInImporter aktueller Stand (Orga, Mitglieder, Abteilungen, Projekte 80%)
- GenericContact: Länge für Wert in der DB bei GenericContactEntry auf 200 Zeichen erhöht - Formatierungen git-svn-id: https://svn.libreccm.org/ccm/trunk@646 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
a28d3f7dfb
commit
2265264a52
|
|
@ -181,6 +181,7 @@ public class RelatedLink extends Link {
|
|||
* Retrieves related links for a given content item
|
||||
*
|
||||
* @param item The item to return links for
|
||||
* @param name Name of the link list
|
||||
*/
|
||||
public static DataCollection getRelatedLinks(ContentItem item, String name) {
|
||||
s_log.debug("Getting related links for a content item");
|
||||
|
|
|
|||
|
|
@ -0,0 +1,25 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ccm:application xmlns:ccm="http://ccm.redhat.com/ccm-project"
|
||||
name="ccm-cms-dabinimporter"
|
||||
prettyName="DaBIn Importer"
|
||||
version="6.6.0"
|
||||
release="1"
|
||||
webapp="ROOT">
|
||||
<ccm:dependencies>
|
||||
<ccm:requires name="ccm-core" version="6.6.0" relation="ge"/>
|
||||
<ccm:requires name="ccm-cms" version="6.6.0" relation="ge"/>
|
||||
<ccm:requires name="ccm-ldn-util" version="6.6.0" relation="ge"/>
|
||||
<ccm:requires name="ccm-cms-types-address" version="6.6.0" relation="ge"/>
|
||||
<ccm:requires name="ccm-cms-types-contact" version="6.6.0" relation="ge"/>
|
||||
<ccm:requires name="ccm-sci-types-organization" version="6.6.0" relation="ge"/>
|
||||
<ccm:requires name="ccm-sci-publications" version="6.6.0" relation="ge"/>
|
||||
<ccm:requires name="ccm-cms-assets-relatedlink" version="6.6.0" relation="ge"/>
|
||||
</ccm:dependencies>
|
||||
<ccm:contacts>
|
||||
<ccm:contact uri="http://www.pwi.uni-bremen.de" type="website"/>
|
||||
<ccm:contact uri="mailto:jensp@barkhof.uni-bremen.de" type="support"/>
|
||||
</ccm:contacts>
|
||||
<ccm:description>
|
||||
Tool to import DaBIn data into OpenCCM
|
||||
</ccm:description>
|
||||
</ccm:application>
|
||||
Binary file not shown.
|
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<registry>
|
||||
<!-- nothing yet -->
|
||||
</registry>
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
|
||||
<load>
|
||||
<requires>
|
||||
<table name="cms_items"/>
|
||||
</requires>
|
||||
<provides>
|
||||
<initializer class="com.arsdigita.cms.dabin.Initializer"/>
|
||||
</provides>
|
||||
<scripts>
|
||||
<data class="com.arsdigita.cms.dabin.Loader"/>
|
||||
</scripts>
|
||||
</load>
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,56 @@
|
|||
package com.arsdigita.cms.dabin;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Jens Pelzetter
|
||||
*/
|
||||
public class DepartmentData {
|
||||
|
||||
private String dabinId;
|
||||
private String nameDe;
|
||||
private String nameEn;
|
||||
private List<MembershipData> members;
|
||||
|
||||
public DepartmentData() {
|
||||
members = new ArrayList<MembershipData>();
|
||||
}
|
||||
|
||||
public String getDabinId() {
|
||||
return dabinId;
|
||||
}
|
||||
|
||||
public void setDabinId(String dabinId) {
|
||||
this.dabinId = dabinId;
|
||||
}
|
||||
|
||||
public String getNameDe() {
|
||||
return nameDe;
|
||||
}
|
||||
|
||||
public void setNameDe(String nameDe) {
|
||||
this.nameDe = nameDe;
|
||||
}
|
||||
|
||||
public String getNameEn() {
|
||||
return nameEn;
|
||||
}
|
||||
|
||||
public void setNameEn(String nameEn) {
|
||||
this.nameEn = nameEn;
|
||||
}
|
||||
|
||||
public List<MembershipData> getMembers() {
|
||||
return members;
|
||||
}
|
||||
|
||||
public void setMembers(List<MembershipData> members) {
|
||||
this.members = members;
|
||||
}
|
||||
|
||||
public void addMember(MembershipData member) {
|
||||
members.add(member);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
/*
|
||||
* Copyright (c) 2010 Jens Pelzetter,
|
||||
* for the Center of Social Politics of the University of Bremen
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public License
|
||||
* as published by the Free Software Foundation; either version 2.1 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* 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.cms.dabin;
|
||||
|
||||
import com.arsdigita.runtime.CompoundInitializer;
|
||||
|
||||
/**
|
||||
* Initializer for the ccm-cms-dabinimporter application
|
||||
*
|
||||
* @author Jens Pelzetter
|
||||
*/
|
||||
public class Initializer extends CompoundInitializer {
|
||||
|
||||
public Initializer() {
|
||||
super();
|
||||
//Nothing more yet
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
/*
|
||||
* Copyright (c) 2010 Jens Pelzetter,
|
||||
* for the Center of Social Politics of the University of Bremen
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public License
|
||||
* as published by the Free Software Foundation; either version 2.1 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* 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.cms.dabin;
|
||||
|
||||
import com.arsdigita.loader.PackageLoader;
|
||||
import com.arsdigita.runtime.ScriptContext;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Jens Pelzetter
|
||||
*/
|
||||
public class Loader extends PackageLoader {
|
||||
|
||||
public void run(final ScriptContext ctx) {
|
||||
//Nothing yet
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
/*
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package com.arsdigita.cms.dabin;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jensp
|
||||
*/
|
||||
public class MemberData {
|
||||
|
||||
private String dabinId;
|
||||
private String titlePre;
|
||||
private String surname;
|
||||
private String givenname;
|
||||
private String titlePost;
|
||||
private String contactData;
|
||||
|
||||
|
||||
public String getDabinId() {
|
||||
return dabinId;
|
||||
}
|
||||
|
||||
public void setDabinId(String dabinId) {
|
||||
this.dabinId = dabinId;
|
||||
}
|
||||
|
||||
public String getGivenname() {
|
||||
return givenname;
|
||||
}
|
||||
|
||||
public void setGivenname(String givenname) {
|
||||
this.givenname = givenname;
|
||||
}
|
||||
|
||||
public String getSurname() {
|
||||
return surname;
|
||||
}
|
||||
|
||||
public void setSurname(String surname) {
|
||||
this.surname = surname;
|
||||
}
|
||||
|
||||
public String getTitlePost() {
|
||||
return titlePost;
|
||||
}
|
||||
|
||||
public void setTitlePost(String titlePost) {
|
||||
this.titlePost = titlePost;
|
||||
}
|
||||
|
||||
public String getTitlePre() {
|
||||
return titlePre;
|
||||
}
|
||||
|
||||
public void setTitlePre(String titlePre) {
|
||||
this.titlePre = titlePre;
|
||||
}
|
||||
|
||||
public String getContactData() {
|
||||
return contactData;
|
||||
}
|
||||
|
||||
public void setContactData(String contactData) {
|
||||
this.contactData = contactData;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
package com.arsdigita.cms.dabin;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jensp
|
||||
*/
|
||||
public class MembershipData {
|
||||
|
||||
private String personDaBInId;
|
||||
private String eigenschaft;
|
||||
private String auftrag;
|
||||
|
||||
public String getAuftrag() {
|
||||
return auftrag;
|
||||
}
|
||||
|
||||
public void setAuftrag(String auftrag) {
|
||||
this.auftrag = auftrag;
|
||||
}
|
||||
|
||||
public String getEigenschaft() {
|
||||
return eigenschaft;
|
||||
}
|
||||
|
||||
public void setEigenschaft(String eigenschaft) {
|
||||
this.eigenschaft = eigenschaft;
|
||||
}
|
||||
|
||||
public String getPersonDaBInId() {
|
||||
return personDaBInId;
|
||||
}
|
||||
|
||||
public void setPersonDaBInId(String personDaBInId) {
|
||||
this.personDaBInId = personDaBInId;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,120 @@
|
|||
package com.arsdigita.cms.dabin;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Jens Pelzetter
|
||||
*/
|
||||
public class ProjectData {
|
||||
|
||||
private String dabinId;
|
||||
private String nameDe;
|
||||
private String nameEn;
|
||||
private String department;
|
||||
private List<MembershipData> members;
|
||||
private Calendar begin;
|
||||
private Calendar end;
|
||||
private String descDe;
|
||||
private String descEn;
|
||||
private String fundingDe;
|
||||
private String fundingEn;
|
||||
|
||||
public ProjectData() {
|
||||
members = new ArrayList<MembershipData>();
|
||||
}
|
||||
|
||||
public Calendar getBegin() {
|
||||
return begin;
|
||||
}
|
||||
|
||||
public void setBegin(Calendar begin) {
|
||||
this.begin = begin;
|
||||
}
|
||||
|
||||
public String getDabinId() {
|
||||
return dabinId;
|
||||
}
|
||||
|
||||
public void setDabinId(String dabinId) {
|
||||
this.dabinId = dabinId;
|
||||
}
|
||||
|
||||
public String getDepartment() {
|
||||
return department;
|
||||
}
|
||||
|
||||
public void setDepartment(String department) {
|
||||
this.department = department;
|
||||
}
|
||||
|
||||
public String getDescDe() {
|
||||
return descDe;
|
||||
}
|
||||
|
||||
public void setDescDe(String desc) {
|
||||
this.descDe = desc;
|
||||
}
|
||||
|
||||
public String getDescEn() {
|
||||
return descEn;
|
||||
}
|
||||
|
||||
public void setDescEn(String descEn) {
|
||||
this.descEn = descEn;
|
||||
}
|
||||
|
||||
public Calendar getEnd() {
|
||||
return end;
|
||||
}
|
||||
|
||||
public void setEnd(Calendar end) {
|
||||
this.end = end;
|
||||
}
|
||||
|
||||
public String getFundingDe() {
|
||||
return fundingDe;
|
||||
}
|
||||
|
||||
public void setFundingDe(String funding) {
|
||||
this.fundingDe = funding;
|
||||
}
|
||||
|
||||
public String getFundingEn() {
|
||||
return fundingEn;
|
||||
}
|
||||
|
||||
public void setFundingEn(String fundingEn) {
|
||||
this.fundingEn = fundingEn;
|
||||
}
|
||||
|
||||
public void addMember(MembershipData member) {
|
||||
members.add(member);
|
||||
}
|
||||
|
||||
public List<MembershipData> getMembers() {
|
||||
return members;
|
||||
}
|
||||
|
||||
public void setMembers(List<MembershipData> members) {
|
||||
this.members = members;
|
||||
}
|
||||
|
||||
public String getNameDe() {
|
||||
return nameDe;
|
||||
}
|
||||
|
||||
public void setNameDe(String nameDe) {
|
||||
this.nameDe = nameDe;
|
||||
}
|
||||
|
||||
public String getNameEn() {
|
||||
return nameEn;
|
||||
}
|
||||
|
||||
public void setNameEn(String nameEn) {
|
||||
this.nameEn = nameEn;
|
||||
}
|
||||
}
|
||||
|
|
@ -201,7 +201,8 @@ public class RelationAttributeImporter extends Program {
|
|||
}
|
||||
};
|
||||
transaction.run();
|
||||
System.out.println("Done\n");
|
||||
System.out.println("Done\n");
|
||||
|
||||
}
|
||||
|
||||
public final static void main(String[] args) {
|
||||
|
|
|
|||
|
|
@ -37,8 +37,8 @@ object type GenericContact extends ContentPage {
|
|||
object type GenericContactEntry extends ContentItem {
|
||||
|
||||
String[1..1] key = cms_contactEntries.key VARCHAR(100);
|
||||
String[0..1] description = cms_contactEntries.description VARCHAR(100);
|
||||
String[1..1] value = cms_contactEntries.value VARCHAR(100);
|
||||
String[0..1] description = cms_contactEntries.description VARCHAR(200);
|
||||
String[1..1] value = cms_contactEntries.value VARCHAR(200);
|
||||
|
||||
reference key ( cms_contactEntries.contactentry_id );
|
||||
|
||||
|
|
|
|||
|
|
@ -128,8 +128,8 @@ public class RelationAttributeCollection extends DomainCollection {
|
|||
}
|
||||
}
|
||||
|
||||
// Nothing found
|
||||
return null;
|
||||
// Nothing found
|
||||
return null;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
|
|
|
|||
|
|
@ -128,3 +128,7 @@ cms.contenttypes.ui.person.contact.type=Contact type
|
|||
cms.contenttypes.ui.person.contact.title=Contact
|
||||
#L\u00f6schen
|
||||
cms.contenttypes.ui.person.contact.del=Delete
|
||||
#No contacts assoicated yet
|
||||
"cms.contenttypes.ui.genericorgaunit.contacts.none=No contacts associated yet
|
||||
cms.contenttypes.ui.genericorgaunit.contact.up=Up
|
||||
cms.contenttypes.ui.genericorgaunit.contact.down=Down
|
||||
|
|
|
|||
|
|
@ -139,3 +139,7 @@ cms.contenttypes.ui.person.contact.type=Kontakttyp
|
|||
cms.contenttypes.ui.person.contact.title=Kontakt
|
||||
#L\u00f6schen
|
||||
cms.contenttypes.ui.person.contact.del=L\u00f6schen
|
||||
#No contacts assoicated yet
|
||||
"cms.contenttypes.ui.genericorgaunit.contacts.none=Derzeit sind keine Kontakte verkn\u00fcpft
|
||||
cms.contenttypes.ui.genericorgaunit.contact.up=Hoch
|
||||
cms.contenttypes.ui.genericorgaunit.contact.down=Runter
|
||||
|
|
|
|||
|
|
@ -170,7 +170,8 @@ public class GenericPerson extends ContentPage implements RelationAttributeInter
|
|||
String fullname = getFullName();
|
||||
if (fullname != null && !fullname.isEmpty()) {
|
||||
setTitle(fullname);
|
||||
setName(GenericPerson.urlSave(fullname));
|
||||
//setName(GenericPerson.urlSave(fullname));
|
||||
setName(GenericPerson.urlSave(String.format("%s %s", getSurname(), getGivenName())));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,6 @@ import com.arsdigita.bebop.table.TableColumn;
|
|||
import com.arsdigita.bebop.table.TableColumnModel;
|
||||
import com.arsdigita.bebop.table.TableModel;
|
||||
import com.arsdigita.bebop.table.TableModelBuilder;
|
||||
import com.arsdigita.bebop.util.GlobalizationUtil;
|
||||
import com.arsdigita.cms.CMS;
|
||||
import com.arsdigita.cms.ContentSection;
|
||||
import com.arsdigita.cms.ItemSelectionModel;
|
||||
|
|
@ -46,6 +45,7 @@ import com.arsdigita.cms.dispatcher.ItemResolver;
|
|||
import com.arsdigita.cms.dispatcher.Utilities;
|
||||
import com.arsdigita.dispatcher.DispatcherHelper;
|
||||
import com.arsdigita.domain.DataObjectNotFoundException;
|
||||
import com.arsdigita.cms.util.GlobalizationUtil;;
|
||||
import com.arsdigita.util.LockableImpl;
|
||||
import java.math.BigDecimal;
|
||||
import org.apache.log4j.Logger;
|
||||
|
|
@ -106,7 +106,7 @@ public class GenericOrganizationalUnitContactTable extends Table implements
|
|||
tabModel.get(1).setCellRenderer(new EditCellRenderer());
|
||||
tabModel.get(2).setCellRenderer(new DeleteCellRenderer());
|
||||
tabModel.get(3).setCellRenderer(new UpCellRenderer());
|
||||
tabModel.get(3).setCellRenderer(new DownCellRenderer());
|
||||
tabModel.get(4).setCellRenderer(new DownCellRenderer());
|
||||
|
||||
addTableActionListener(this);
|
||||
}
|
||||
|
|
@ -174,16 +174,37 @@ public class GenericOrganizationalUnitContactTable extends Table implements
|
|||
s_log.debug(String.format(
|
||||
"Getting human readable contact type for contact type \"%s\"...",
|
||||
m_contactCollection.getContactType()));
|
||||
s_log.debug(String.format(
|
||||
"Human readable contact type is: \"%s\"...",
|
||||
m_contacttypes.getRelationAttribute(
|
||||
m_contactCollection.getContactType(),
|
||||
DispatcherHelper.getNegotiatedLocale().
|
||||
getLanguage())));
|
||||
return m_contacttypes.getRelationAttribute(
|
||||
m_contactCollection.getContactType(),
|
||||
DispatcherHelper.getNegotiatedLocale().
|
||||
getLanguage());
|
||||
String lang =
|
||||
DispatcherHelper.getNegotiatedLocale().
|
||||
getLanguage();
|
||||
if (m_contacttypes.size() <= 0) {
|
||||
s_log.warn(String.format("No matching relation "
|
||||
+ "attributes for contact type '%s' found. "
|
||||
+ "Using key as fallback.",
|
||||
m_contactCollection.getContactType()));
|
||||
return m_contactCollection.getContactType();
|
||||
}
|
||||
if (m_contacttypes.getRelationAttribute(m_contactCollection.
|
||||
getContactType(), lang) == null) {
|
||||
s_log.debug(String.format(
|
||||
"No human readable name "
|
||||
+ "found for '%s' for language '%s' Using key.",
|
||||
m_contactCollection.
|
||||
getContactType(),
|
||||
lang));
|
||||
return m_contactCollection.getContactType();
|
||||
} else {
|
||||
s_log.debug(String.format(
|
||||
"Human readable contact type is: \"%s\"...",
|
||||
m_contacttypes.getRelationAttribute(
|
||||
m_contactCollection.getContactType(),
|
||||
DispatcherHelper.getNegotiatedLocale().
|
||||
getLanguage()).getName()));
|
||||
return m_contacttypes.getRelationAttribute(
|
||||
m_contactCollection.getContactType(),
|
||||
DispatcherHelper.getNegotiatedLocale().
|
||||
getLanguage()).getName();
|
||||
}
|
||||
case 1:
|
||||
return m_contact.getTitle();
|
||||
case 2:
|
||||
|
|
|
|||
|
|
@ -184,16 +184,30 @@ public class GenericPersonContactTable extends Table implements
|
|||
s_log.debug(String.format(
|
||||
"Getting human readable contact type for contact type \"%s\"...",
|
||||
m_contactCollection.getContactType()));
|
||||
String lang = DispatcherHelper.getNegotiatedLocale().
|
||||
getLanguage();
|
||||
if (contacttypes.size() <= 0) {
|
||||
s_log.warn("No contact entry types found. Using key as "
|
||||
+ "fallback.");
|
||||
return m_contactCollection.getContactType();
|
||||
}
|
||||
if ((contacttypes.getRelationAttribute(m_contactCollection.
|
||||
getContactType(), lang) == null)) {
|
||||
s_log.debug(String.format(
|
||||
"No human readable name "
|
||||
+ "found for '%s' for language '%s' Using key.",
|
||||
m_contactCollection.getContactType(),
|
||||
lang));
|
||||
return m_contactCollection.getContactType();
|
||||
}
|
||||
s_log.debug(String.format(
|
||||
"Human readable contact type is: \"%s\"...",
|
||||
contacttypes.getRelationAttribute(
|
||||
m_contactCollection.getContactType(),
|
||||
DispatcherHelper.getNegotiatedLocale().
|
||||
getLanguage())));
|
||||
return contacttypes.getRelationAttribute(m_contactCollection.
|
||||
getContactType(),
|
||||
DispatcherHelper.
|
||||
getNegotiatedLocale().getLanguage()).getName();
|
||||
lang)));
|
||||
return contacttypes.getRelationAttribute(
|
||||
m_contactCollection.getContactType(),
|
||||
lang).getName();
|
||||
case 1:
|
||||
return m_contact.getTitle();
|
||||
case 2:
|
||||
|
|
@ -323,7 +337,7 @@ public class GenericPersonContactTable extends Table implements
|
|||
state);
|
||||
GenericPersonContactCollection contacts = person.getContacts();
|
||||
if ((contacts.size() - 1) == row) {
|
||||
s_log.debug("Row is last row in table, don't show down-link");
|
||||
s_log.debug("Row is last row in table, don't show down-link");
|
||||
return new Label("");
|
||||
} else {
|
||||
ControlLink link = new ControlLink("down");
|
||||
|
|
|
|||
|
|
@ -61,6 +61,6 @@ log4j.logger.com.arsdigita.packaging.Loader=INFO
|
|||
# For debugging all queries run by persistence
|
||||
#log4j.logger.com.redhat.persistence.engine.rdbms.RDBMSEngine=INFO
|
||||
|
||||
log4j.logger.com.arsdigita.cms.search.ContentPageMetadataProvider=DEBUG
|
||||
log4j.logger.com.arsdigita.london.importer=DEBUG
|
||||
log4j.logger.com.arsdigita.london.terms.importer.TermItemBuilder=DEBUG
|
||||
#log4j.logger.com.arsdigita.cms.search.ContentPageMetadataProvider=DEBUG
|
||||
#log4j.logger.com.arsdigita.london.importer=DEBUG
|
||||
#log4j.logger.com.arsdigita.london.terms.importer.TermItemBuilder=DEBUG
|
||||
|
|
@ -154,31 +154,47 @@ public class ItemImportTool extends Program {
|
|||
ContentItem item =
|
||||
(ContentItem) itemParser.getDomainObject();
|
||||
if (item == null) {
|
||||
s_log.warn("item is null.Igoring...");
|
||||
s_log.warn("item is null. Igoring...");
|
||||
return;
|
||||
}
|
||||
s_log.debug(String.format("Got item from ItemParser:"));
|
||||
s_log.debug(String.format("OID : %s", item.getOID()));
|
||||
s_log.debug(String.format("Name : %s", item.getName()));
|
||||
s_log.debug(String.format("Title: %s", item.get("title")));
|
||||
s_log.debug(String.format("Item file name : %s", itemFile.
|
||||
getName()));
|
||||
s_log.debug(
|
||||
String.format("Title: %s", item.get("title")));
|
||||
if (item instanceof ContentPage) {
|
||||
s_log.debug("Item is a content page...");
|
||||
}
|
||||
/*
|
||||
* Multi lang extension begin
|
||||
*/
|
||||
String itemName = item.getName();
|
||||
String itemName = itemFile.getName().substring(
|
||||
0, itemFile.getName().length() - 4);
|
||||
String bundleName;
|
||||
s_log.debug(String.format("Using item name '%s'...",
|
||||
item.getName()));
|
||||
if (itemName.lastIndexOf('-') == -1) {
|
||||
s_log.debug(
|
||||
"No '-' in name, using name as bundle name");
|
||||
bundleName = itemName;
|
||||
} else {
|
||||
if (itemName.substring((itemName.lastIndexOf('-') + 1)).
|
||||
s_log.debug(
|
||||
"Found a '-' in the, name, using part before '-' as bundle name.");
|
||||
if (itemName.substring((itemName.lastIndexOf('-')
|
||||
+ 1)).
|
||||
equals("de")
|
||||
|| itemName.substring((itemName.lastIndexOf('-') + 1)).
|
||||
|| itemName.substring((itemName.lastIndexOf('-')
|
||||
+ 1)).
|
||||
equals("en")) {
|
||||
bundleName = itemName.substring(0, itemName.
|
||||
lastIndexOf('-'));
|
||||
s_log.debug(String.format(
|
||||
"Created bundle name: '%s'", bundleName));
|
||||
} else {
|
||||
s_log.debug(
|
||||
"Part behind the last '-' is not 'de' or 'en', using item name as bundle name");
|
||||
bundleName = itemName;
|
||||
}
|
||||
}
|
||||
|
|
@ -208,13 +224,15 @@ public class ItemImportTool extends Program {
|
|||
s_log.debug("Item is localized...");
|
||||
bundle = bundles.get(bundleName);
|
||||
if (bundle == null) {
|
||||
s_log.debug("No content bundle found for item, creating new.");
|
||||
s_log.debug(
|
||||
"No content bundle found for item, creating new.");
|
||||
bundle = new ContentBundle(item);
|
||||
bundle.setParent(folder);
|
||||
bundle.setName(bundleName);
|
||||
bundles.put(bundleName, bundle);
|
||||
} else {
|
||||
s_log.debug("Found content bundle for item, adding item as instance.");
|
||||
s_log.debug(
|
||||
"Found content bundle for item, adding item as instance.");
|
||||
bundle.addInstance(item);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue