Verschiedene Korrekturen zur Verbesserung der Suchergebnisse

git-svn-id: https://svn.libreccm.org/ccm/trunk@1430 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2012-01-06 07:04:27 +00:00
parent 7e11539fb6
commit ed4b6497ac
7 changed files with 55 additions and 12 deletions

View File

@ -247,4 +247,9 @@ public class GenericOrganizationalUnit extends ContentPage {
public boolean hasSubordinateOrgaUnits() { public boolean hasSubordinateOrgaUnits() {
return !getSubordinateOrgaUnits().isEmpty(); return !getSubordinateOrgaUnits().isEmpty();
} }
@Override
public String getSearchSummary() {
return String.format("%s %s", getTitle(), getAddendum());
}
} }

View File

@ -306,4 +306,9 @@ public class GenericPerson extends ContentPage implements
public String getRelationAttributeKey(String propertyName) { public String getRelationAttributeKey(String propertyName) {
return null; return null;
} }
@Override
public String getSearchSummary() {
return getFullName();
}
} }

View File

@ -7,6 +7,7 @@ import com.arsdigita.cms.contenttypes.GenericOrganizationalUnit;
import com.arsdigita.cms.contenttypes.ui.GenericOrgaUnitTab; import com.arsdigita.cms.contenttypes.ui.GenericOrgaUnitTab;
import com.arsdigita.dispatcher.DispatcherHelper; import com.arsdigita.dispatcher.DispatcherHelper;
import com.arsdigita.domain.DomainObjectFactory; import com.arsdigita.domain.DomainObjectFactory;
import com.arsdigita.globalization.GlobalizationHelper;
import com.arsdigita.navigation.ui.AbstractComponent; import com.arsdigita.navigation.ui.AbstractComponent;
import com.arsdigita.persistence.OID; import com.arsdigita.persistence.OID;
import com.arsdigita.util.UncheckedWrapperException; import com.arsdigita.util.UncheckedWrapperException;
@ -60,6 +61,13 @@ public class GenericOrgaUnitTabComponent extends AbstractComponent {
GenericOrganizationalUnit orgaunit = GenericOrganizationalUnit orgaunit =
(GenericOrganizationalUnit) DomainObjectFactory. (GenericOrganizationalUnit) DomainObjectFactory.
newInstance(orgaunitOid); newInstance(orgaunitOid);
if (!(orgaunit.getLanguage().equals(GlobalizationHelper.
getNegotiatedLocale().getLanguage()))) {
orgaunit = (GenericOrganizationalUnit) orgaunit.getContentBundle().
getInstance(GlobalizationHelper.getNegotiatedLocale());
}
if ((DispatcherHelper.getDispatcherPrefix(request) == null) if ((DispatcherHelper.getDispatcherPrefix(request) == null)
|| !DispatcherHelper.getDispatcherPrefix(request).equals("preview")) { || !DispatcherHelper.getDispatcherPrefix(request).equals("preview")) {
orgaunit = (GenericOrganizationalUnit) orgaunit.getLiveVersion(); orgaunit = (GenericOrganizationalUnit) orgaunit.getLiveVersion();
@ -67,11 +75,13 @@ public class GenericOrgaUnitTabComponent extends AbstractComponent {
final Element contentPanelElem = new Element("cms:contentPanel", final Element contentPanelElem = new Element("cms:contentPanel",
CMS.CMS_XML_NS); 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()); cmsItemElem.addAttribute("oid", orgaunitOid.toString());
final Element objTypeElem = cmsItemElem.newChildElement("objectType"); final Element objTypeElem = cmsItemElem.newChildElement("objectType");
objTypeElem.setText(orgaunit.getClass().getName()); objTypeElem.setText(orgaunit.getClass().getName());
final Element tabsElem = final Element tabsElem =
contentPanelElem.newChildElement("orgaUnitTabs");//new Element("orgaUnitTabs"); contentPanelElem.newChildElement("orgaUnitTabs");//new Element("orgaUnitTabs");
final Element selectedTabElem = tabsElem.newChildElement("selectedTab"); final Element selectedTabElem = tabsElem.newChildElement("selectedTab");

View File

@ -196,7 +196,7 @@ public class Publication extends ContentPage {
link.set(EDITOR, editor); link.set(EDITOR, editor);
link.set(AUTHOR_ORDER, Integer.valueOf((int) getAuthors().size())); link.set(AUTHOR_ORDER, Integer.valueOf((int) getAuthors().size()));
updateAuthorsStr(); updateAuthorsStr();
} }
@ -208,24 +208,24 @@ public class Publication extends ContentPage {
public void removeAuthor(final GenericPerson author) { public void removeAuthor(final GenericPerson author) {
Assert.exists(author, GenericPerson.class); Assert.exists(author, GenericPerson.class);
remove(AUTHORS, author); remove(AUTHORS, author);
updateAuthorsStr(); updateAuthorsStr();
} }
public void swapWithPreviousAuthor(final GenericPerson author) { public void swapWithPreviousAuthor(final GenericPerson author) {
getAuthors().swapWithPrevious(author); getAuthors().swapWithPrevious(author);
updateAuthorsStr(); updateAuthorsStr();
} }
public void swapWithNextAuthor(final GenericPerson author) { public void swapWithNextAuthor(final GenericPerson author) {
getAuthors().swapWithNext(author); getAuthors().swapWithNext(author);
updateAuthorsStr(); updateAuthorsStr();
} }
protected void updateAuthorsStr() { protected void updateAuthorsStr() {
final AuthorshipCollection authors = getAuthors(); final AuthorshipCollection authors = getAuthors();
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
while(authors.next()) { while (authors.next()) {
if (builder.length() > 0) { if (builder.length() > 0) {
builder.append("; "); builder.append("; ");
} }
@ -233,7 +233,7 @@ public class Publication extends ContentPage {
builder.append(", "); builder.append(", ");
builder.append(authors.getGivenName()); 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); orgaunit.remove(ORGAUNIT_PUBLICATIONS, publication);
} }
@Override @Override
public List<ExtraXMLGenerator> getExtraXMLGenerators() { public List<ExtraXMLGenerator> getExtraXMLGenerators() {
final List<ExtraXMLGenerator> generators = super.getExtraXMLGenerators(); final List<ExtraXMLGenerator> generators = super.getExtraXMLGenerators();
generators.add(new SciPublicationExtraXmlGenerator()); generators.add(new SciPublicationExtraXmlGenerator());
return generators; return generators;
} }
@Override
public String getSearchSummary() {
return String.format("%s %s %s",
getTitle(),
getAuthors(),
getAbstract());
}
} }

View File

@ -230,4 +230,9 @@ public class SciDepartment extends GenericOrganizationalUnit {
generators.add(new SciDepartmentExtraXmlGenerator()); generators.add(new SciDepartmentExtraXmlGenerator());
return generators; return generators;
} }
@Override
public String getSearchSummary() {
return getDepartmentShortDescription();
}
} }

View File

@ -237,4 +237,9 @@ public class SciInstitute extends GenericOrganizationalUnit {
generators.add(new SciInstituteExtraXmlGenerator()); generators.add(new SciInstituteExtraXmlGenerator());
return generators; return generators;
} }
@Override
public String getSearchSummary() {
return getInstituteShortDescription();
}
} }

View File

@ -366,4 +366,9 @@ public class SciProject extends GenericOrganizationalUnit {
generators.add(new SciProjectExtraXmlGenerator()); generators.add(new SciProjectExtraXmlGenerator());
return generators; return generators;
} }
@Override
public String getSearchSummary() {
return getProjectShortDescription();
}
} }