diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnit.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnit.java index dfba061a2..fbd3c0c49 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnit.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericOrganizationalUnit.java @@ -247,4 +247,9 @@ public class GenericOrganizationalUnit extends ContentPage { public boolean hasSubordinateOrgaUnits() { return !getSubordinateOrgaUnits().isEmpty(); } + + @Override + public String getSearchSummary() { + return String.format("%s %s", getTitle(), getAddendum()); + } } diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericPerson.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericPerson.java index 2f8c46a18..f88f87ad4 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericPerson.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/GenericPerson.java @@ -306,4 +306,9 @@ public class GenericPerson extends ContentPage implements public String getRelationAttributeKey(String propertyName) { return null; } + + @Override + public String getSearchSummary() { + return getFullName(); + } } diff --git a/ccm-sci-bundle/src/com/arsdigita/bundle/ui/GenericOrgaUnitTabComponent.java b/ccm-sci-bundle/src/com/arsdigita/bundle/ui/GenericOrgaUnitTabComponent.java index d17768fe5..15316ad0f 100644 --- a/ccm-sci-bundle/src/com/arsdigita/bundle/ui/GenericOrgaUnitTabComponent.java +++ b/ccm-sci-bundle/src/com/arsdigita/bundle/ui/GenericOrgaUnitTabComponent.java @@ -7,6 +7,7 @@ import com.arsdigita.cms.contenttypes.GenericOrganizationalUnit; import com.arsdigita.cms.contenttypes.ui.GenericOrgaUnitTab; import com.arsdigita.dispatcher.DispatcherHelper; import com.arsdigita.domain.DomainObjectFactory; +import com.arsdigita.globalization.GlobalizationHelper; import com.arsdigita.navigation.ui.AbstractComponent; import com.arsdigita.persistence.OID; import com.arsdigita.util.UncheckedWrapperException; @@ -60,6 +61,13 @@ public class GenericOrgaUnitTabComponent extends AbstractComponent { GenericOrganizationalUnit orgaunit = (GenericOrganizationalUnit) DomainObjectFactory. newInstance(orgaunitOid); + + if (!(orgaunit.getLanguage().equals(GlobalizationHelper. + getNegotiatedLocale().getLanguage()))) { + orgaunit = (GenericOrganizationalUnit) orgaunit.getContentBundle(). + getInstance(GlobalizationHelper.getNegotiatedLocale()); + } + if ((DispatcherHelper.getDispatcherPrefix(request) == null) || !DispatcherHelper.getDispatcherPrefix(request).equals("preview")) { orgaunit = (GenericOrganizationalUnit) orgaunit.getLiveVersion(); @@ -67,11 +75,13 @@ public class GenericOrgaUnitTabComponent extends AbstractComponent { final Element contentPanelElem = new Element("cms:contentPanel", CMS.CMS_XML_NS); - final Element cmsItemElem = contentPanelElem.newChildElement("cms:item", CMS.CMS_XML_NS); + final Element cmsItemElem = + contentPanelElem.newChildElement("cms:item", + CMS.CMS_XML_NS); cmsItemElem.addAttribute("oid", orgaunitOid.toString()); final Element objTypeElem = cmsItemElem.newChildElement("objectType"); objTypeElem.setText(orgaunit.getClass().getName()); - + final Element tabsElem = contentPanelElem.newChildElement("orgaUnitTabs");//new Element("orgaUnitTabs"); final Element selectedTabElem = tabsElem.newChildElement("selectedTab"); diff --git a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/Publication.java b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/Publication.java index cb048e050..8e7a415cc 100644 --- a/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/Publication.java +++ b/ccm-sci-publications/src/com/arsdigita/cms/contenttypes/Publication.java @@ -196,7 +196,7 @@ public class Publication extends ContentPage { link.set(EDITOR, editor); link.set(AUTHOR_ORDER, Integer.valueOf((int) getAuthors().size())); - + updateAuthorsStr(); } @@ -208,24 +208,24 @@ public class Publication extends ContentPage { public void removeAuthor(final GenericPerson author) { Assert.exists(author, GenericPerson.class); remove(AUTHORS, author); - + updateAuthorsStr(); } - + public void swapWithPreviousAuthor(final GenericPerson author) { getAuthors().swapWithPrevious(author); updateAuthorsStr(); } - + public void swapWithNextAuthor(final GenericPerson author) { getAuthors().swapWithNext(author); updateAuthorsStr(); } - + protected void updateAuthorsStr() { final AuthorshipCollection authors = getAuthors(); StringBuilder builder = new StringBuilder(); - while(authors.next()) { + while (authors.next()) { if (builder.length() > 0) { builder.append("; "); } @@ -233,7 +233,7 @@ public class Publication extends ContentPage { builder.append(", "); builder.append(authors.getGivenName()); } - set(AUTHORS_STR, builder.toString()); + set(AUTHORS_STR, builder.toString()); } /** @@ -311,11 +311,19 @@ public class Publication extends ContentPage { orgaunit.remove(ORGAUNIT_PUBLICATIONS, publication); } - + @Override public List getExtraXMLGenerators() { - final List generators = super.getExtraXMLGenerators(); - generators.add(new SciPublicationExtraXmlGenerator()); + final List generators = super.getExtraXMLGenerators(); + generators.add(new SciPublicationExtraXmlGenerator()); return generators; } + + @Override + public String getSearchSummary() { + return String.format("%s %s %s", + getTitle(), + getAuthors(), + getAbstract()); + } } diff --git a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/SciDepartment.java b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/SciDepartment.java index 24af3f93f..a7b212d64 100644 --- a/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/SciDepartment.java +++ b/ccm-sci-types-department/src/com/arsdigita/cms/contenttypes/SciDepartment.java @@ -230,4 +230,9 @@ public class SciDepartment extends GenericOrganizationalUnit { generators.add(new SciDepartmentExtraXmlGenerator()); return generators; } + + @Override + public String getSearchSummary() { + return getDepartmentShortDescription(); + } } diff --git a/ccm-sci-types-institute/src/com/arsdigita/cms/contenttypes/SciInstitute.java b/ccm-sci-types-institute/src/com/arsdigita/cms/contenttypes/SciInstitute.java index 418ef0e62..69804d326 100644 --- a/ccm-sci-types-institute/src/com/arsdigita/cms/contenttypes/SciInstitute.java +++ b/ccm-sci-types-institute/src/com/arsdigita/cms/contenttypes/SciInstitute.java @@ -237,4 +237,9 @@ public class SciInstitute extends GenericOrganizationalUnit { generators.add(new SciInstituteExtraXmlGenerator()); return generators; } + + @Override + public String getSearchSummary() { + return getInstituteShortDescription(); + } } diff --git a/ccm-sci-types-project/src/com/arsdigita/cms/contenttypes/SciProject.java b/ccm-sci-types-project/src/com/arsdigita/cms/contenttypes/SciProject.java index e96c7b7a6..18c69108b 100644 --- a/ccm-sci-types-project/src/com/arsdigita/cms/contenttypes/SciProject.java +++ b/ccm-sci-types-project/src/com/arsdigita/cms/contenttypes/SciProject.java @@ -366,4 +366,9 @@ public class SciProject extends GenericOrganizationalUnit { generators.add(new SciProjectExtraXmlGenerator()); return generators; } + + @Override + public String getSearchSummary() { + return getProjectShortDescription(); + } }