[Yanel-dev] IMS meetings review page
Ioannis Iordanidis
ioannis at wyona.com
Sat Apr 2 00:20:43 CEST 2011
Hi Michael,
I have added the following in MeetingPageResource.java trying to enable
the rich text editor.
But when I try to edit a meeting page I get a NullPointerException stack
trace.
Thanks,
Giannis
Index:
../imstat-realm/res-types/meeting-page/src/java/org/imstat/yanel/impl/resources/meetingpage/MeetingPageResource.java
===================================================================
---
../imstat-realm/res-types/meeting-page/src/java/org/imstat/yanel/impl/resources/meetingpage/MeetingPageResource.java
(revision 57643)
+++
../imstat-realm/res-types/meeting-page/src/java/org/imstat/yanel/impl/resources/meetingpage/MeetingPageResource.java
(working copy)
@@ -262,9 +262,16 @@
}
input.add(contactEMailInputItem);
- input.add(new TextFieldInputItem(CONTACT_PHONE_INPUT_NAME));
+ TextFieldInputItem contactPhoneInputItem = new
TextFieldInputItem(CONTACT_PHONE_INPUT_NAME);
+ if (meeting != null && meeting.getContactPhone() != null &&
meeting.getContactPhone().trim().length() > 0) {
+ contactPhoneInputItem.setValue(meeting.getContactPhone());
+ }
+ input.add(contactPhoneInputItem);
TextAreaInputItem leadInputItem = new
TextAreaInputItem(LEAD_INPUT_NAME);
+ if (meeting != null && meeting.getDescription() != null &&
meeting.getDescription().trim().length() > 0) {
+ leadInputItem.setValue(meeting.getDescription());
+ }
input.add(leadInputItem);
// TODO: Refactor the code re options
Stacktrace
java.lang.Exception: Due to an exception the request has been canceled.
Exception message: null
at
org.wyona.yanel.impl.resources.jellyadapterofcmdv3.JellyAdapterForCUDResource.getView(JellyAdapterForCUDResource.java:148)
at org.wyona.yanel.servlet.YanelServlet.getContent(YanelServlet.java:541)
at org.wyona.yanel.servlet.YanelServlet.doGet(YanelServlet.java:379)
at org.wyona.yanel.servlet.YanelServlet.service(YanelServlet.java:283)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at
org.wyona.yanel.servlet.communication.YanelFilter.doFilter(YanelFilter.java:37)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.NullPointerException
On 04/01/2011 10:55 PM, Ioannis Iordanidis wrote:
> Hi Michael
>
> Thank you for the pointer to look into the EntryImpl.java class
>
> I have edited the MeetingImpl.java class to enable the short description
> field be reviewed and edited if possible.
>
> Below is a diff of what I have done.
> Essentially the decscription field how now become a NodeList
> and the getDescription() method used the XMLHelper class to get the text.
>
> I have tested it and it works but only partially: The rich text is
> always blank, but:
> - if you leave it blank it does not overwrite the existing entry
> - if you put an entry it does save it.
>
> So I am guessing here, there seems to be a problem with the rich text
> editor picking up and displaying what is already written to file.
>
> Regards,
> Giannis
>
>
> Index:
> ../imstat-realm/res-types/model/src/java/org/imstat/model/impl/MeetingImpl.java
>
> ===================================================================
> ---
> ../imstat-realm/res-types/model/src/java/org/imstat/model/impl/MeetingImpl.java
> (revision 57643)
> +++
> ../imstat-realm/res-types/model/src/java/org/imstat/model/impl/MeetingImpl.java
> (working copy)
> @@ -32,9 +32,11 @@
> private Date meetingEndDate;
> private String meetingType;
> private String meetingWebsite;
> + private NodeList descriptionNodeList;
> private String contactLastname;
> private String contactFirstname;
> private String contactEmail;
> + private String contactPhone;
>
> /**
> * @param in InputStream containing XML representation of a meeting
> @@ -48,6 +50,7 @@
> title = (String) xpath.evaluate("/me:meeting/me:title", doc,
> XPathConstants.STRING);
> city = (String) xpath.evaluate("/me:meeting/me:location/me:city", doc,
> XPathConstants.STRING);
> state = (String) xpath.evaluate("/me:meeting/me:location/me:state", doc,
> XPathConstants.STRING);
> + log.warn("DEBUG: State: " + state);
> country = (String) xpath.evaluate("/me:meeting/me:location/me:country",
> doc, XPathConstants.STRING);
>
> meetingStartDate = parseDate((String)
> xpath.evaluate("/me:meeting/me:valid-from", doc, XPathConstants.STRING));
> @@ -55,9 +58,14 @@
>
> meetingType = (String) xpath.evaluate("/me:meeting/me:meeting-type",
> doc, XPathConstants.STRING);
> meetingWebsite = (String)
> xpath.evaluate("/me:meeting/me:meeting-website", doc,
> XPathConstants.STRING);
> + descriptionNodeList = (NodeList)
> xpath.evaluate("/me:meeting/xhtml:body", doc, XPathConstants.NODESET);
> + log.warn("DEBUG: Desc: " + getDescription());
> +
> contactLastname = (String)
> xpath.evaluate("/me:meeting/me:contact-person/me:lastname", doc,
> XPathConstants.STRING);
> contactFirstname = (String)
> xpath.evaluate("/me:meeting/me:contact-person/me:firstname", doc,
> XPathConstants.STRING);
> contactEmail = (String)
> xpath.evaluate("/me:meeting/me:contact-person/me:email", doc,
> XPathConstants.STRING);
> + contactPhone = (String)
> xpath.evaluate("/me:meeting/me:contact-person/me:phone", doc,
> XPathConstants.STRING);
> + log.warn("DEBUG: Phone: " + contactPhone);
> }
>
> /**
> @@ -145,8 +153,22 @@
> public String getContactEmail() {
> return contactEmail;
> }
> -
> +
> /**
> + * @see org.imstat.model.api.Meeting#getContactPhone()
> + */
> + public String getContactPhone() {
> + return contactPhone;
> + }
> +
> + /**
> + * @see org.imstat.model.api.Meeting#getDescription()
> + */
> + public String getDescription() {
> + return XMLHelper.stringFromNodeList(descriptionNodeList, 0);
> + }
> +
> + /**
> * Parse date
> * @param s Date as string
> */
More information about the Yanel-development
mailing list