Verschiedene Korrekturen zur Verbesserung der Suchergebnisse
git-svn-id: https://svn.libreccm.org/ccm/trunk@1430 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
7e11539fb6
commit
ed4b6497ac
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -306,4 +306,9 @@ public class GenericPerson extends ContentPage implements
|
|||
public String getRelationAttributeKey(String propertyName) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSearchSummary() {
|
||||
return getFullName();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
|
|
|
|||
|
|
@ -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<ExtraXMLGenerator> getExtraXMLGenerators() {
|
||||
final List<ExtraXMLGenerator> generators = super.getExtraXMLGenerators();
|
||||
generators.add(new SciPublicationExtraXmlGenerator());
|
||||
final List<ExtraXMLGenerator> generators = super.getExtraXMLGenerators();
|
||||
generators.add(new SciPublicationExtraXmlGenerator());
|
||||
return generators;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSearchSummary() {
|
||||
return String.format("%s %s %s",
|
||||
getTitle(),
|
||||
getAuthors(),
|
||||
getAbstract());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -230,4 +230,9 @@ public class SciDepartment extends GenericOrganizationalUnit {
|
|||
generators.add(new SciDepartmentExtraXmlGenerator());
|
||||
return generators;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSearchSummary() {
|
||||
return getDepartmentShortDescription();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -237,4 +237,9 @@ public class SciInstitute extends GenericOrganizationalUnit {
|
|||
generators.add(new SciInstituteExtraXmlGenerator());
|
||||
return generators;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSearchSummary() {
|
||||
return getInstituteShortDescription();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -366,4 +366,9 @@ public class SciProject extends GenericOrganizationalUnit {
|
|||
generators.add(new SciProjectExtraXmlGenerator());
|
||||
return generators;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSearchSummary() {
|
||||
return getProjectShortDescription();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue