|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.cyberneko.html.filters.DefaultFilter
org.exoplatform.social.service.rest.LinkShare
public class LinkShare
LinkShare - gets preview information of a link including: - link - title - description - images - media (from popular sites: youtube, vimeo, flickr...) - low priority (NOT IMPLEMENTED YET) This should be implemented from the client side to display preview and media player.
In order to provide this preview, always looks for the title of the page, a summary of the main content, and an image. Looks for preview information by the following priority:
1.
<meta name="title" content="page_title" /> <meta name="description" content="page_description" /> <link rel="image_src" href="image_source" />
2. If title not found -> find in
tag. If no description -> return "" If img_src not found -> find all images in page with max, min specified width + height
3. To specify medium, use tag:
<meta name="medium" content="medium_type" />In which: medium_type can be "audio", "image", "video", "news", "blog" and "mult".
Created by The eXo Platform SEA TODO: hoatle improvement: + scans description with MIN_CHARACTER + handles exception + parser more faster with and without scanning image tag, stop right when things got.
| Field Summary |
|---|
| Fields inherited from class org.cyberneko.html.filters.DefaultFilter |
|---|
fDocumentHandler, fDocumentSource |
| Method Summary | |
|---|---|
void |
characters(org.apache.xerces.xni.XMLString text,
org.apache.xerces.xni.Augmentations augs)
filter method is called back when scanning meets the end of text in a tag |
void |
emptyElement(org.apache.xerces.xni.QName element,
org.apache.xerces.xni.XMLAttributes attributes,
org.apache.xerces.xni.Augmentations augs)
this filter method is called back when scanning meets empty element tag |
void |
endElement(org.apache.xerces.xni.QName element,
org.apache.xerces.xni.Augmentations augs)
filter method is called back when scanning meets end element tag |
String |
getDescription()
gets description |
List<String> |
getImages()
gets images list |
static LinkShare |
getInstance(String link)
Gets LinkShare instance with specified link. |
static LinkShare |
getInstance(String link,
String lang)
Gets LinkShare instance with link and lang specified. |
String |
getLink()
gets provided link |
String |
getMediaAlbum()
gets mediaAlbum if provided in: |
String |
getMediaArtist()
gets mediaArtist if provided in: |
String |
getMediaHeight()
gets mediaHeight if provided in: |
org.exoplatform.social.common.embedder.ExoSocialMedia |
getMediaObject()
get mediaObject |
String |
getMediaSrc()
gets mediaSrc |
String |
getMediaTitle()
gets mediaTitle if provided in: |
String |
getMediaType()
gets mediaType if provided in: |
String |
getMediaWidth()
gets mediaWidth if provided in: |
String |
getMediumType()
gets mediumType |
String |
getTitle()
gets title |
void |
setDescription(String description)
Set new value for description. |
void |
setTitle(String title)
Set new value for title. |
void |
startElement(org.apache.xerces.xni.QName element,
org.apache.xerces.xni.XMLAttributes attrs,
org.apache.xerces.xni.Augmentations augs)
filter method is called back when scanning meets start element tag |
| Methods inherited from class org.cyberneko.html.filters.DefaultFilter |
|---|
comment, doctypeDecl, endCDATA, endDocument, endGeneralEntity, endPrefixMapping, getDocumentHandler, getDocumentSource, getFeatureDefault, getPropertyDefault, getRecognizedFeatures, getRecognizedProperties, ignorableWhitespace, merge, processingInstruction, reset, setDocumentHandler, setDocumentSource, setFeature, setProperty, startCDATA, startDocument, startDocument, startGeneralEntity, startPrefixMapping, textDecl, xmlDecl |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public String getLink()
public String getTitle()
public void setTitle(String title)
title - public String getDescription()
public void setDescription(String description)
description - public List<String> getImages()
public String getMediumType()
public String getMediaSrc()
public String getMediaType()
<meta name="audio_type" content="Content-Type header field" />or:
<meta name="video_type" content="Content-Type header field" />
public String getMediaTitle()
<meta name="audio_title" content="audio_title_name" />
public String getMediaArtist()
<meta name="audio_artist" content="audio_artist_name" />
public String getMediaAlbum()
<meta name="audio_album" content="audio_album_name" />
public String getMediaHeight()
<meta name="video_height" content="video_height_value" />
public String getMediaWidth()
<meta name="video_width" content="video_width_value" />
public org.exoplatform.social.common.embedder.ExoSocialMedia getMediaObject()
public static LinkShare getInstance(String link)
throws Exception
link -
Exception
public static LinkShare getInstance(String link,
String lang)
throws Exception
link - lang -
Exception
public void startElement(org.apache.xerces.xni.QName element,
org.apache.xerces.xni.XMLAttributes attrs,
org.apache.xerces.xni.Augmentations augs)
startElement in interface org.apache.xerces.xni.XMLDocumentHandlerstartElement in class org.cyberneko.html.filters.DefaultFilter
public void endElement(org.apache.xerces.xni.QName element,
org.apache.xerces.xni.Augmentations augs)
endElement in interface org.apache.xerces.xni.XMLDocumentHandlerendElement in class org.cyberneko.html.filters.DefaultFilter
public void emptyElement(org.apache.xerces.xni.QName element,
org.apache.xerces.xni.XMLAttributes attributes,
org.apache.xerces.xni.Augmentations augs)
emptyElement in interface org.apache.xerces.xni.XMLDocumentHandleremptyElement in class org.cyberneko.html.filters.DefaultFilter
public void characters(org.apache.xerces.xni.XMLString text,
org.apache.xerces.xni.Augmentations augs)
characters in interface org.apache.xerces.xni.XMLDocumentHandlercharacters in class org.cyberneko.html.filters.DefaultFilter
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||