Package com.google.gdata.data

Examples of com.google.gdata.data.BaseEntry


            LOG.info("create Entry for feedId: " + request.getFeedId());

        ServerBaseEntry entry = buildEntry(request, response);
        entry.setFeedId(request.getFeedId());
        entry.setServiceConfig(request.getConfigurator());
        BaseEntry tempEntry = entry.getEntry();
        tempEntry.setPublished(getCurrentDateTime());
        tempEntry.setUpdated(getCurrentDateTime());
        BaseEntry retVal = null;
        removeDynamicElements(entry.getEntry());
        try {
            retVal = this.storage.storeEntry(entry);
        } catch (Exception e) {
           
View Full Code Here


                                + request.getEntryId());

            throw new ServiceException(
                    "Entry id in the entry xml does not match the requested resource",GDataResponse.BAD_REQUEST);
        }
        BaseEntry tempEntry = entry.getEntry();
        tempEntry.setUpdated(getCurrentDateTime());
        removeDynamicElements(entry.getEntry());
       
        BaseEntry retVal = null;
    
        try {
            retVal = this.storage.updateEntry(entry);
        } catch (ResourceNotFoundException e) {
           
View Full Code Here

           
            if(entry.getId() == null){
                throw new ServiceException("entry is null can't get entry", GDataResponse.BAD_REQUEST);
            }
               
            BaseEntry retVal = null;
            retVal = this.storage.getEntry(entry);
            dynamicElementEntryStragey(retVal, request);
            return retVal;
        } catch (ResourceNotFoundException e) {
            ServiceException ex = new ServiceException(
View Full Code Here

     *             if the entry could not be parsed
     */
    public static BaseEntry buildEntry(final Reader reader,
            final ProvidedService config) throws ParseException, IOException {
      
        BaseEntry e = createEntityInstance(config).createEntry();
        e.parseAtom(config.getExtensionProfile(), reader);
        return e;
    }
View Full Code Here

                        this.feedResponse);

                this.feedResponse.sendResponse(feed, this.feedRequest
                        .getConfigurator());
            } else {
                BaseEntry entry = this.service.getSingleEntry(this.feedRequest,
                        this.feedResponse);
                this.feedResponse.sendResponse(entry, this.feedRequest
                        .getConfigurator());
            }
View Full Code Here

        Hits hits = storageFeedQuery(feedId, this.timeStampSort);
        if (hits.length() > 0) {

            for (; (offset < hits.length()) && (alreadyAdded < resultCount); offset++, alreadyAdded++) {
                Document doc = hits.doc(offset);
                BaseEntry entry = buildEntryFromLuceneDocument(doc, config);
                returnList.add(entry);
            }
            if (updated == null) {
                try {
                    long updatedTimeStamp = Long.parseLong(hits.doc(0).get(
View Full Code Here

        Hits hits = storageQuery(searchList);
        Iterator hitIterator = hits.iterator();
        while (hitIterator.hasNext()) {
            Hit hit = (Hit) hitIterator.next();
            Document doc = hit.getDocument();
            BaseEntry entry = buildEntryFromLuceneDocument(doc, config);
            resultList.add(entry);

        }

        return resultList;
View Full Code Here

    }

    private BaseEntry buildEntryFromLuceneDocument(final Document doc,
            final ProvidedService config) throws ParseException, IOException {
        Reader reader = new StringReader(doc.getField(StorageEntryWrapper.FIELD_CONTENT).stringValue());
        BaseEntry entry = GDataEntityBuilder.buildEntry(reader, config);
        entry.setVersionId(doc.getField(StorageEntryWrapper.FIELD_VERSION).stringValue());
        return entry;

    }
View Full Code Here

    /**
     * Test method for 'org.apache.lucene.gdata.data.GDataEntityBuilder.buildEntry(String, Reader)'
     */
    public void testBuildEntryStringReader() throws  ParseException, IOException {
        this.reader = new FileReader(incomingEntry);
        BaseEntry entry = GDataEntityBuilder.buildEntry(this.reader,this.config);
        assertNotNull(entry);
        assertEquals("entry summary",entry.getSummary().getPlainText(),entrySummaryFromXML);
       
       

        
    }
View Full Code Here

            StorageEntryWrapper wrapper = new StorageEntryWrapper(en,
                    StorageOperation.UPDATE);
            this.modifier.updateEntry(wrapper);
            ReferenceCounter<StorageQuery> innerQuery = this.controller
                    .getStorageQuery();
            BaseEntry fetchedEntry = innerQuery.get().singleEntryQuery("" + i,
                    feedId, this.configurator);
            assertEquals("updated Title:", insertString, fetchedEntry
                    .getTitle().getPlainText());
        }
        // double updates
        for (int i = 1; i < this.count; i++) {
            Entry e = new Entry();
            e.setId("" + i);
            String insertString = "Hello world" + i;
            e.setTitle(new PlainTextConstruct(insertString));
            ServerBaseEntry en = getServerEntry(e);
            StorageEntryWrapper wrapper = new StorageEntryWrapper(en,
                    StorageOperation.UPDATE);
            this.modifier.updateEntry(wrapper);

            e = new Entry();
            e.setId("" + i);
            insertString = "Foo Bar" + i;
            e.setTitle(new PlainTextConstruct(insertString));
            en = getServerEntry(e);
            wrapper = new StorageEntryWrapper(en,
                    StorageOperation.UPDATE);
            this.modifier.updateEntry(wrapper);

            ReferenceCounter<StorageQuery> innerQuery = this.controller
                    .getStorageQuery();

            BaseEntry fetchedEntry = innerQuery.get().singleEntryQuery("" + i,
                    feedId, this.configurator);
            assertEquals("updated Title:", insertString, fetchedEntry
                    .getTitle().getPlainText());
        }
       
      
    }
View Full Code Here

TOP

Related Classes of com.google.gdata.data.BaseEntry

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.