You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@abdera.apache.org by "Ugo Cei (JIRA)" <ji...@apache.org> on 2007/10/04 13:06:51 UTC

[jira] Created: (ABDERA-70) Link in entry disappears after adding entry to a feed

Link in entry disappears after adding entry to a feed
-----------------------------------------------------

                 Key: ABDERA-70
                 URL: https://issues.apache.org/jira/browse/ABDERA-70
             Project: Abdera
          Issue Type: Bug
    Affects Versions: 0.3.0
            Reporter: Ugo Cei


The following code demonstrates the problem:

        Abdera abdera = new Abdera();
        Factory factory = abdera.getFactory();
        Feed feed = factory.newFeed();
        feed.setTitle("Test");
        feed.setId("http://example.com/feed");
        Parser parser = abdera.getParser();
        Document<Entry> doc = parser.parse(this.getClass().getResourceAsStream("/entry.xml"));
        Entry entry = doc.getRoot();
        Link link = factory.newLink();
        link.setHref(entry.getId().toString());
        link.setRel(Link.REL_EDIT);
        entry.addLink(link);
        assertNotNull("Link is null", entry.getLink(Link.REL_EDIT));
        feed.addEntry(entry);
        assertNotNull("Link is null", entry.getLink(Link.REL_EDIT));
        for (Entry e : feed.getEntries()) {
            assertNotNull("Link is null", e.getLink(Link.REL_EDIT));
        }

Note that this happens only when the entry is read and parsed from a file, not when it is created in memory.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ABDERA-70) Link in entry disappears after adding entry to a feed

Posted by "James M Snell (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ABDERA-70?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12534446 ] 

James M Snell commented on ABDERA-70:
-------------------------------------

I've made some changes that address this.  I'm not going to close the issue yet as I'm not sure if we're going to want to stick with this particular solution long term

> Link in entry disappears after adding entry to a feed
> -----------------------------------------------------
>
>                 Key: ABDERA-70
>                 URL: https://issues.apache.org/jira/browse/ABDERA-70
>             Project: Abdera
>          Issue Type: Bug
>    Affects Versions: 0.3.0
>            Reporter: Ugo Cei
>
> The following code demonstrates the problem:
>         Abdera abdera = new Abdera();
>         Factory factory = abdera.getFactory();
>         Feed feed = factory.newFeed();
>         feed.setTitle("Test");
>         feed.setId("http://example.com/feed");
>         Parser parser = abdera.getParser();
>         Document<Entry> doc = parser.parse(this.getClass().getResourceAsStream("/entry.xml"));
>         Entry entry = doc.getRoot();
>         Link link = factory.newLink();
>         link.setHref(entry.getId().toString());
>         link.setRel(Link.REL_EDIT);
>         entry.addLink(link);
>         assertNotNull("Link is null", entry.getLink(Link.REL_EDIT));
>         feed.addEntry(entry);
>         assertNotNull("Link is null", entry.getLink(Link.REL_EDIT));
>         for (Entry e : feed.getEntries()) {
>             assertNotNull("Link is null", e.getLink(Link.REL_EDIT));
>         }
> Note that this happens only when the entry is read and parsed from a file, not when it is created in memory.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (ABDERA-70) Link in entry disappears after adding entry to a feed

Posted by "James M Snell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ABDERA-70?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

James M Snell resolved ABDERA-70.
---------------------------------

       Resolution: Fixed
    Fix Version/s: 0.4.0

The fix appears to be adequate. Please reopen the issue if problems persist

> Link in entry disappears after adding entry to a feed
> -----------------------------------------------------
>
>                 Key: ABDERA-70
>                 URL: https://issues.apache.org/jira/browse/ABDERA-70
>             Project: Abdera
>          Issue Type: Bug
>    Affects Versions: 0.3.0
>            Reporter: Ugo Cei
>             Fix For: 0.4.0
>
>
> The following code demonstrates the problem:
>         Abdera abdera = new Abdera();
>         Factory factory = abdera.getFactory();
>         Feed feed = factory.newFeed();
>         feed.setTitle("Test");
>         feed.setId("http://example.com/feed");
>         Parser parser = abdera.getParser();
>         Document<Entry> doc = parser.parse(this.getClass().getResourceAsStream("/entry.xml"));
>         Entry entry = doc.getRoot();
>         Link link = factory.newLink();
>         link.setHref(entry.getId().toString());
>         link.setRel(Link.REL_EDIT);
>         entry.addLink(link);
>         assertNotNull("Link is null", entry.getLink(Link.REL_EDIT));
>         feed.addEntry(entry);
>         assertNotNull("Link is null", entry.getLink(Link.REL_EDIT));
>         for (Entry e : feed.getEntries()) {
>             assertNotNull("Link is null", e.getLink(Link.REL_EDIT));
>         }
> Note that this happens only when the entry is read and parsed from a file, not when it is created in memory.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (ABDERA-70) Link in entry disappears after adding entry to a feed

Posted by "James M Snell (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ABDERA-70?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12532449 ] 

James M Snell commented on ABDERA-70:
-------------------------------------

Hmm.. interesting. This looks like it could be an artifact of the incremental parsing process. Before adding the new link, try cloning the entry and working with the clone.  That will force the entry to be fully parsed.

e.g. Entry entry = (Entry)doc.getRoot().clone();



> Link in entry disappears after adding entry to a feed
> -----------------------------------------------------
>
>                 Key: ABDERA-70
>                 URL: https://issues.apache.org/jira/browse/ABDERA-70
>             Project: Abdera
>          Issue Type: Bug
>    Affects Versions: 0.3.0
>            Reporter: Ugo Cei
>
> The following code demonstrates the problem:
>         Abdera abdera = new Abdera();
>         Factory factory = abdera.getFactory();
>         Feed feed = factory.newFeed();
>         feed.setTitle("Test");
>         feed.setId("http://example.com/feed");
>         Parser parser = abdera.getParser();
>         Document<Entry> doc = parser.parse(this.getClass().getResourceAsStream("/entry.xml"));
>         Entry entry = doc.getRoot();
>         Link link = factory.newLink();
>         link.setHref(entry.getId().toString());
>         link.setRel(Link.REL_EDIT);
>         entry.addLink(link);
>         assertNotNull("Link is null", entry.getLink(Link.REL_EDIT));
>         feed.addEntry(entry);
>         assertNotNull("Link is null", entry.getLink(Link.REL_EDIT));
>         for (Entry e : feed.getEntries()) {
>             assertNotNull("Link is null", e.getLink(Link.REL_EDIT));
>         }
> Note that this happens only when the entry is read and parsed from a file, not when it is created in memory.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.