abdera-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stevenson, Christopher" <Christopher.Steven...@gs.com>
Subject Storing extension elements using JCR Provider
Date Tue, 24 Jun 2008 18:28:23 GMT
Hello All, 

 

I have a quick question on the best way to store custom extension
elements, using the JCR provider.

 

It seems that the data is exposed as a FOM object at
AbstractEntityCollectionAdaptor line 140 (see below)

 

If we have extension elements we wish to store in the feed entry, should
we extend the JCR provider and implement our own postEntry method, that
retrieves these elements from the FOM and passes it to another method
that adds these entries to the JCR node?

 

Also, has anyone had any thoughts on a generic way to do this, it seems
like a generic solution of adding any extensions to the node that are
present and that have the handler registered might be a good thing, is
there any downside anyone knows if we do this?

 

Thanks in advance,

 

Chris

 

<code>

 

public ResponseContext postEntry(RequestContext request) {

    try {

      Entry entry = getEntryFromRequest(request);

      if (entry != null) {

        if (!ProviderHelper.isValidEntry(entry))

          return new EmptyResponseContext(400);

  

        entry.setUpdated(new Date());

        

        

          T entryObj = postEntry(entry.getTitle(),

                                 entry.getId(),

                                 entry.getSummary(),

                                 entry.getUpdated(),

                                 entry.getAuthors(),

                                 entry.getContentElement(), request);

          entry.getIdElement().setValue(getId(entryObj));

        

          IRI feedIri = getFeedIRI(entryObj, request);    

          String link = getLink(entryObj, feedIri, request);

          

          entry.addLink(link, "edit");

    

          return buildCreateEntryResponse(link, entry);

      } else {

        return new EmptyResponseContext(400);

      }

    } catch (ResponseContextException e) {

      return createErrorResponse(e);

    }

  }

</code>

 

 

_______________________________________________ 
Chris Stevenson 
LDN Cross Derivative Technology 
RC06 | 8-7051-0148 


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message