From 1ab5e0f6cc72c41b635345e91f15ad736d2fcd91 Mon Sep 17 00:00:00 2001 From: jensp Date: Thu, 2 Dec 2010 19:52:37 +0000 Subject: [PATCH] =?UTF-8?q?Kleinere=20Fehlerkorrekturen:=20-=20Link.java?= =?UTF-8?q?=20und=20LinkPropertyForm.java:=20Hier=20fehlte=20an=20zwei=20S?= =?UTF-8?q?tellen=20eine=20=20=20Pr=C3=BCfung=20auf=20null,=20was=20unter?= =?UTF-8?q?=20bestimmten=20Bedingungen=20zu=20einer=20NullPointerException?= =?UTF-8?q?=20f=C3=BChrte=20-=20CompoundContentPanel,=20SciOrganizationPan?= =?UTF-8?q?el=20und=20SciProjectPanel:=20Fehler=20im=20Paginator=20sowie?= =?UTF-8?q?=20einige=20Formatierungen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://svn.libreccm.org/ccm/trunk@641 8810af33-2d31-482b-a856-94f89814c4df --- ccm-cms/src/com/arsdigita/cms/contenttypes/Link.java | 2 +- .../cms/contenttypes/ui/CompoundContentItemPanel.java | 6 ++++-- .../cms/contenttypes/ui/LinkPropertyForm.java | 3 ++- .../cms/contenttypes/ui/SciOrganizationPanel.java | 5 ++--- .../arsdigita/cms/contenttypes/ui/SciProjectPanel.java | 10 +++++----- 5 files changed, 14 insertions(+), 12 deletions(-) diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/Link.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/Link.java index 450b68aa6..d7282bc05 100755 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/Link.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/Link.java @@ -316,7 +316,7 @@ public class Link extends ACSObject { String url = resolver.generateItemURL( state, item, section, item.getVersion()); - if (getTargetURI().startsWith("&")) { + if ((getTargetURI() != null) && getTargetURI().startsWith("&")) { ParameterMap parameters; StringTokenizer tokenizer; diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/CompoundContentItemPanel.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/CompoundContentItemPanel.java index bc2f54f04..ae0c45d06 100644 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/CompoundContentItemPanel.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/CompoundContentItemPanel.java @@ -234,9 +234,9 @@ public abstract class CompoundContentItemPanel paginator.addAttribute("pageNumber", Long.toString(pageNumber)); paginator.addAttribute("pageCount", Long.toString(pageCount)); paginator.addAttribute("pageSize", Long.toString(m_pageSize)); - paginator.addAttribute("objectBegin", Long.toString(begin)); + paginator.addAttribute("objectBegin", Long.toString(begin + 1)); paginator.addAttribute("objectEnd", Long.toString(end)); - paginator.addAttribute("objectCount", Long.toString(count)); + paginator.addAttribute("objectCount", Long.toString(count + 1)); } /** @@ -313,6 +313,8 @@ public abstract class CompoundContentItemPanel exportAttributes(content); + content.addAttribute("showing", getShowParam(state)); + return content; } diff --git a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/LinkPropertyForm.java b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/LinkPropertyForm.java index 7cc3233e2..61adefe02 100755 --- a/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/LinkPropertyForm.java +++ b/ccm-cms/src/com/arsdigita/cms/contenttypes/ui/LinkPropertyForm.java @@ -409,7 +409,8 @@ public class LinkPropertyForm extends FormSection try { m_title.setValue(state, link.getTitle()); m_description.setValue(state, link.getDescription()); - if (link.getTargetURI().startsWith("&")) { + if ((link.getTargetURI() != null) + && link.getTargetURI().startsWith("&")) { m_itemParams.setValue(state, link.getTargetURI().substring(1)); } else { diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationPanel.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationPanel.java index 394e001f8..bcdc09459 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationPanel.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationPanel.java @@ -502,7 +502,7 @@ public class SciOrganizationPanel extends SciOrganizationBasePanel { Element element, PageState state) { Element content = generateBaseXML(item, element, state); - + Element availableData = content.newChildElement("availableData"); SciOrganization orga = (SciOrganization) item; @@ -578,8 +578,7 @@ public class SciOrganizationPanel extends SciOrganizationBasePanel { } else if (SHOW_PROJECTS_ONGOING.equals(show)) { generateProjectsXML( orga, content, state, getFiltersForOngoingProjects()); - } else if (SHOW_PROJECTS_FINISHED.equals(show)) { - Calendar today = new GregorianCalendar(); + } else if (SHOW_PROJECTS_FINISHED.equals(show)) { generateProjectsXML( orga, content, state, getFiltersForFinishedProjects()); } diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectPanel.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectPanel.java index 53499aa6a..81749732d 100644 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectPanel.java +++ b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectPanel.java @@ -235,12 +235,12 @@ public class SciProjectPanel extends SciOrganizationBasePanel { String show = getShowParam(state); - if (SHOW_DESCRIPTION.equals(show)) { - String desc; - desc = project.getProjectDescription(); - + if (SHOW_DESCRIPTION.equals(show)) { Element description = content.newChildElement("description"); - description.setText(desc); + description.setText(project.getProjectDescription()); + + Element funding = content.newChildElement("funding"); + funding.setText(project.getFunding()); } else if (SHOW_CONTACTS.equals(show)) { generateContactsXML(project, content, state); } else if (SHOW_SUBPROJECTS.equals(show)) {