@Override public void declareExtensions(ExtensionProfile extProfile) { if (extProfile.isDeclared(ProfileEntry.class)) { return; } super.declareExtensions(extProfile); extProfile.declare(ProfileEntry.class, ContinuityOfCareRecord.class); extProfile.declare(ProfileEntry.class, ProfileMetaData.class); }
@Override public void declareExtensions(ExtensionProfile extProfile) { if (extProfile.isDeclared(PositionFeedLink.class)) { return; } super.declareExtensions(extProfile); ExtensionProfile feedLinkProfile = extProfile.getFeedLinkProfile(); if (feedLinkProfile == null) { feedLinkProfile = new ExtensionProfile(); extProfile.declareFeedLinkProfile(feedLinkProfile); } new TransactionFeed().declareExtensions(feedLinkProfile); }
private static ExtensionProfile getExtProfile(BaseEntry<?> entry, boolean isAdapting) { ExtensionProfile extProfile = null; extProfile = new ExtensionProfile(); ((BaseEntry<?>) entry).declareExtensions(extProfile); if (isAdapting) { extProfile.setAutoExtending(true); } return extProfile; }
@Override public void processEndElement() { if (arbitraryXml) { declareArbitraryXmlExtension(extensionPoint); } for (ExtensionDescription extDescription: extDescriptions) { declare(extensionPoint, extDescription); } }
@Override public void declareExtensions(ExtensionProfile extProfile) { super.declareExtensions(extProfile); extProfile.declare(CaptionTrackEntry.class, YtDerived.class); extProfile.declare(CaptionTrackEntry.class, YtFormatInfo.class); extProfile.declareAdditionalNamespace(YouTubeNamespace.NS); extProfile.declare(PubControl.class, YtPublicationState.class); extProfile.declareArbitraryXmlExtension(CaptionTrackEntry.class); }
@Override public void declareExtensions(ExtensionProfile extProfile) { extProfile.declare(GenericEntry.class, Property.getDefaultDescription()); // Declare our "apps" namespace extProfile.declareAdditionalNamespace(Namespaces.APPS_NAMESPACE); }
@Override public void declareExtensions(ExtensionProfile extProfile) { super.declareExtensions(extProfile); ExtensionProfile ep = new ExtensionProfile(); new AclFeed().declareExtensions(ep); extProfile.declareFeedLinkProfile(ep); } }
/** * Initializes an ExtensionProfile based upon the extensions expected * by a SitemapsEntry. */ @Override public void declareExtensions(ExtensionProfile extProfile) { super.declareExtensions(extProfile); extProfile.declare( SitemapsEntry.class, ExtensionDescription.getDefaultDescription(SitemapStatus.class)); extProfile.declare( SitemapsEntry.class, ExtensionDescription.getDefaultDescription(LastDownloaded.class)); extProfile.declare( SitemapsEntry.class, ExtensionDescription.getDefaultDescription(UrlCount.class)); extProfile.setAutoExtending(true); }
public void writeTo(OutputStream outstream) throws IOException { ExtensionProfile ep = new ExtensionProfile(); ep.addDeclarations(entry); XmlWriter xmlWriter = new XmlWriter(new OutputStreamWriter(outstream, "UTF-8")); entry.generate(xmlWriter, ep);
extProfile.isAutoExtending() && Kind.isKindCategory(Category.this)) { Kind.Adaptor adaptor = Kind.getAdaptor(term, adaptable); if (adaptor != null) { extProfile.addDeclarations(adaptor);
/** * Declare the extensions of the feeds for the Picasa Web Albums Data API. */ private void declareExtensions() { extProfile.setAutoExtending(true); new AlbumEntry().declareExtensions(extProfile); new AlbumFeed().declareExtensions(extProfile); new CommentEntry().declareExtensions(extProfile); new PhotoEntry().declareExtensions(extProfile); new PhotoFeed().declareExtensions(extProfile); new TagEntry().declareExtensions(extProfile); new UserEntry().declareExtensions(extProfile); new UserFeed().declareExtensions(extProfile); }
/** * {@inheritDoc} * <p> * The implementation of this method for BaseFeed will declare any * extensions associated with the contained entry type. */ @Override public void declareExtensions(ExtensionProfile extProfile) { // Create an instance of the associated entry class and declare its // extensions. E entry = createEntry(); extProfile.addDeclarations(entry); }
/** * Specifies that type {@code extendedType} can contain arbitrary XML. * * @param extendedType the type being declared for */ public synchronized void declareArbitraryXmlExtension( Class<? extends ExtensionPoint> extendedType) { declareArbitraryXmlExtension(extendedType, false); }
/** * Declares feed extensions. We only add Webmaster Tools namespace to the * feed, all the other extensions are defined on the feed entry level, see * {@link SitesEntry}. */ @Override public void declareExtensions(ExtensionProfile extProfile) { // Add any feed-level extension declarations here. super.declareExtensions(extProfile); extProfile.declareAdditionalNamespace(Namespaces.WT_NAMESPACE); } }
/** Retrieves a collection of all namespaces used by this profile. */ public synchronized Collection<XmlNamespace> getNamespaceDecls() { if (nsDecls == null) { nsDecls = computeNamespaceDecls(); } return nsDecls; }
/** * Declares the g: extension. */ @Override public void declareExtensions(ExtensionProfile extProfile) { // Declare arbitrary XML support for the feed instances, so any // extensions not explicitly declared in the profile will be captured. extProfile.declareArbitraryXmlExtension(GoogleBaseFeed.class); extProfile.declareFeedExtension(GoogleBaseAttributesExtension.DESCRIPTION); super.declareExtensions(extProfile); } }
ResumableGDataFileUploader uploader = new ResumableGDataFileUploader.Builder( service, new URL("http://uploads.gdata.youtube.com/resumable/feeds/api/users/default/uploads"), ms, newEntry) .title(videoTitle) .trackProgress(listener, 1000) .chunkSize(10000000) .build(); Future<ResumableHttpFileUploader.ResponseMessage> futureResponse = uploader.start(); while (!uploader.isDone()) { Thread.sleep(1000); } switch(uploader.getUploadState()) { case COMPLETE: ResumableHttpFileUploader.ResponseMessage responseMessage = futureResponse.get(); VideoEntry videoEntry = new VideoEntry(); videoEntry.parseAtom(new ExtensionProfile(), responseMessage.getInputStream()); youtubeURL = videoEntry.getHtmlLink().getHref(); logger.info("Uploaded successfully"); return youtubeURL; case CLIENT_ERROR: logger.error("Upload Failed"); return null; default: logger.warn("Unexpected upload status"); return null; }
/** * Initializes parser handler's XML blob state. Should be called by the * handler's constructor in order to honor * {@link ExtensionProfile#declareArbitraryXmlExtension(Class)}. */ protected void initializeArbitraryXml(ExtensionProfile profile, Class<? extends ExtensionPoint> extPoint, ElementHandler handler) { boolean arbitraryXml = profile.allowsArbitraryXml(); boolean mixedContent = false; ExtensionManifest profManifest = getManifest(profile, extPoint); if (profManifest != null) { if (profManifest.arbitraryXml) { arbitraryXml = profManifest.arbitraryXml; // mixedContent is only enabled if the profile manifest is present, and // supports mixed content, regardless of if the profile allows // arbitrary xml. mixedContent = profManifest.mixedContent; } } if (arbitraryXml) { handler.initializeXmlBlob( xmlBlob, mixedContent, /* fullTextIndex */false); } }
@Override public void declareExtensions(ExtensionProfile extProfile) { super.declareExtensions(extProfile); extProfile.declareAdditionalNamespace(YouTubeNamespace.NS); extProfile.declare(CommentEntry.class, YtSpam.class); extProfile.declare(CommentEntry.class, YtCommentRating.class); extProfile.declareArbitraryXmlExtension(CommentEntry.class); } }
@Override public void declareExtensions(ExtensionProfile extProfile) { extProfile.declare(PubControl.class, YtPublicationState.class); extProfile.declareArbitraryXmlExtension(CaptionTrackEntry.class); }