Apply of patch from Roger Kristiansen to fix issue #80

pull/14/head
Tim Su 17 years ago
parent c6ccef1aed
commit 60af08f0b1

@ -1,85 +1,89 @@
/* /*
* Copyright 2007, MetaDimensional Technologies Inc. * Copyright 2007, MetaDimensional Technologies Inc.
* *
* *
* This file is part of the RememberTheMilk Java API. * This file is part of the RememberTheMilk Java API.
* *
* The RememberTheMilk Java API is free software; you can redistribute it * The RememberTheMilk Java API is free software; you can redistribute it
* and/or modify it under the terms of the GNU Lesser General Public License * and/or modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 3 of the * as published by the Free Software Foundation; either version 3 of the
* License, or (at your option) any later version. * License, or (at your option) any later version.
* *
* The RememberTheMilk Java API is distributed in the hope that it will be * The RememberTheMilk Java API is distributed in the hope that it will be
* useful, but WITHOUT ANY WARRANTY; without even the implied warranty of * useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU Lesser General Public License * You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
package com.mdt.rtm.data; package com.mdt.rtm.data;
import java.util.Date; import java.util.Date;
import org.w3c.dom.Element; import org.w3c.dom.Element;
import org.w3c.dom.Text; import org.w3c.dom.Text;
/** /**
* Represents a single task note. * Represents a single task note.
* *
* @author Edouard Mercier * @author Edouard Mercier
* @since 2008.04.22 * @since 2008.04.22
*/ */
public class RtmTaskNote public class RtmTaskNote
extends RtmData extends RtmData
{ {
private String id; private String id;
private Date created; private Date created;
private Date modified; private Date modified;
private String title; private String title;
private String text; private String text;
public RtmTaskNote(Element element) public RtmTaskNote(Element element)
{ {
id = element.getAttribute("id"); id = element.getAttribute("id");
created = parseDate(element.getAttribute("created")); created = parseDate(element.getAttribute("created"));
modified = parseDate(element.getAttribute("modified")); modified = parseDate(element.getAttribute("modified"));
title = element.getAttribute("title"); title = element.getAttribute("title");
if (element.getChildNodes().getLength() > 0)
{ // The note text itself might be split across multiple children of the
Text innerText = (Text) element.getChildNodes().item(0); // note element, so get all of the children.
text = innerText.getData(); for (int i=0; i<element.getChildNodes().getLength(); i++) {
} Text innerText = (Text) element.getChildNodes().item(i);
}
if (text == null) text = "";
public String getId() text = text.concat(innerText.getData().toString());
{ }
return id; }
}
public String getId()
public Date getCreated() {
{ return id;
return created; }
}
public Date getCreated()
public Date getModified() {
{ return created;
return modified; }
}
public Date getModified()
public String getTitle() {
{ return modified;
return title; }
}
public String getTitle()
public String getText() {
{ return title;
return text; }
}
public String getText()
} {
return text;
}
}

Loading…
Cancel
Save