public class EWFUtil extends Object
Modifier and Type | Field and Description |
---|---|
static int |
MASTER_WIDGET_DEFAULT_NESTING_LIMIT |
Modifier and Type | Method and Description |
---|---|
static Number |
convertFahrenheitToCelsius(int pFahrenheit,
boolean pRound)
converts temparature value from fahrenheit to celsius scale
|
static String |
createSectionIDPath(neo.xredsys.api.Section pSection)
Returns the path of a section based on section id.
|
static int |
decreaseMasterWidgetNestingLevel(String pUnsafeCurrentLevel) |
static List |
filterArticleList(Collection pArticles,
String pArticleId,
String pMaxSize)
Remove a article with given article Id from a list of articles
|
static neo.xredsys.presentation.PresentationElement |
findGroupByName(neo.xredsys.presentation.PresentationPool pPresentationPool,
String pGroupName,
int pGroupIndex) |
static String |
generatePageURL(String pBaseURL,
Map<String,String> pPageParameters)
Takes a base URL and parameters to generate a URL
|
static String |
generatePageURLWithoutQueryString(javax.servlet.http.HttpServletRequest pRequest) |
static String |
generatePageURLWithQueryString(javax.servlet.http.HttpServletRequest pRequest) |
static com.escenic.common.util.JSONMap |
getAMPGATrackerConfig(neo.xredsys.api.Section pSection) |
static String |
getArticleSummary(int pArticleId) |
static String |
getCaptchaHTML()
returns the HTML markup containing the Captcha challenge
|
static com.escenic.common.util.JSONMap |
getClientTypeDefinition(neo.xredsys.api.Section pSection) |
static neo.xredsys.api.Section |
getConfigSectionByInheritance(neo.xredsys.api.Section pContentSection,
String pBaseConfigSectionName,
int pPublicationId)
returns the config section for a specific content section
|
static neo.xredsys.api.Section |
getConfigSectionFromGroupOption(neo.xredsys.api.Section pContentSection,
int pPublicationID) |
static ConfigUtil |
getConfigUtil() |
static String |
getDateDifference(Date pFrom,
Date pTo)
calculates difference of two given date
|
static Date |
getDateObject(String pTimeInMillis)
Returns a date object based on input in millisecond
|
static String |
getDateString(String pHourDiff)
Returns a date string based on the input
The input string needs to represent an integer value, which is interpreted as the number of hours.
|
static String |
getDefaultAspectVariant() |
static ArrayList<Integer> |
getDescBreakpointsAsList(String[] breakpointsAsStringArray)
Deprecated.
|
static Map<String,String> |
getImageDimension(String imageVersion)
Return the width and height of provided imageRepresentation
|
static String |
getImageRepresentation(String pPreferredWidth,
neo.xredsys.api.Publication pPublication,
String pContentType)
Deprecated.
Don't use this method, instead use
getSuitableRepresentation |
static Set<Integer> |
getImageSizes(int pPublicationID) |
static int |
getMasterWidgetNestingLimit(neo.xredsys.api.Section pSection) |
static String |
getMediaInfoLink(neo.xredsys.presentation.PresentationArticle pArticle) |
static List<neo.xredsys.presentation.PresentationElement> |
getRelatedElements(neo.xredsys.presentation.PresentationArticle pArticle,
String pRelationName,
String pContentType,
Integer pMaxItem) |
static Date |
getRelativeDate(Date pDate,
long pHourDiff)
get Date relative to a reference date
|
static Map<String,Object> |
getRelativeTime(Date pDate)
This method takes a $
Date object, compares with current date-time, and returns
the given date as a relative time |
static String |
getRssSource(String pRssUrl)
Extracts the host name from the RSS source URL
|
static neo.xredsys.api.Section |
getSection(String pSectionUniqueName,
int pPublicationId)
Returns section name, section unique name and publication name
|
static neo.xredsys.api.Section |
getSection(String pSectionUniqueName,
String pPublicationName)
Returns section name, section unique name and publication name
|
static List |
getSubList(List pSourceList,
String pStartIndex,
String pNumberOfItems)
Gets a sub list of a given list.
|
static String |
getSuitableRepresentation(String pPreferredWidth,
neo.xredsys.api.Publication pPublication,
String pContentType,
String pRepresentationVariant)
Get appropriate image representation(based on variant type) closest and smaller than preferred width
|
static String |
getTaggingEntity(neo.xredsys.presentation.PresentationTag pPresentationTag)
Returns the tagging entity part of tag URI(tag:taggingEntity:specific)
|
static String |
getTagPageUrl(neo.xredsys.api.Publication publication,
neo.xredsys.presentation.PresentationTag pTag)
Returns the tag page url based on provided publication and tag.
|
static String |
getTagPageUrl(neo.xredsys.api.Section section,
neo.xredsys.presentation.PresentationTag pTag)
Returns the tag page url based on provided section and tag.
|
static int |
getTagUriHashCode(neo.xredsys.presentation.PresentationTag pTag)
Returns the hash code of the tag URI of the given tag.
|
static String |
getTermFromTagIdentifier(String pTagIdentifier,
String pTagStructureScheme)
Extracts the term from the tag identifier
|
static String |
getTopicURL(String pSectionURL,
String pTopicPattern,
String pTopicTerm) |
static String |
handleLineBreaks(String pInputText)
Replaces the new lines with html <br/> tag.
|
static boolean |
hasLazyFragment(neo.xredsys.presentation.PresentationElement pElement)
Checks the tree hierarchy of the $
PresentationElement for any lazily loaded
fragment |
static int |
increaseMasterWidgetNestingLevel(String pCurrentLevel) |
static boolean |
isContainedInList(List pItemList,
Object pItem)
Determines whether a object is in the list or not
|
static boolean |
isEmbeddedContent(neo.xredsys.presentation.PresentationArticle pArticle) |
static boolean |
isFieldAccessible(int pArticleId,
String pFieldName,
String pPaymentStatus)
Deprecated.
Do not use this method. Premium content is not currently supported by widget framework.
|
static boolean |
isImageContent(neo.xredsys.presentation.PresentationArticle pArticle) |
static boolean |
isMediaContent(neo.xredsys.presentation.PresentationArticle pArticle) |
static boolean |
isNumeric(String pValue) |
static boolean |
isValidMasterWidgetNestingLimit(String pCurrentNestingLevel,
String pMasterWidgetNestingLimit) |
static boolean |
isValidName(String pName)
Checks whether a widget name and a view name is valid or not.
|
static boolean |
matchFileExtension(neo.xredsys.presentation.PresentationArticle pVideoArticle,
String pFileExtensions)
Match the file extension of a video article
|
static String |
parseFeedForImage(String value)
Gets the first image from the feed
|
static String |
resolveAMPLink(String pBaseURL,
String pAMPLinkSuffix) |
public static final int MASTER_WIDGET_DEFAULT_NESTING_LIMIT
public static boolean matchFileExtension(neo.xredsys.presentation.PresentationArticle pVideoArticle, String pFileExtensions)
pVideoArticle
- the video article objectpFileExtensions
- supported file extensionspublic static String getTopicURL(String pSectionURL, String pTopicPattern, String pTopicTerm)
pSectionURL
- URL of the sectionpTopicPattern
- Pattern of the topicpTopicTerm
- Name of the topicpublic static List getSubList(List pSourceList, String pStartIndex, String pNumberOfItems)
pSourceList
- The source list form where the sub list will be created.pStartIndex
- Sub list will start from this index of the source listpNumberOfItems
- How many items of source list will be present in the sub list.public static List filterArticleList(Collection pArticles, String pArticleId, String pMaxSize)
pArticles
- The list of input articlespArticleId
- The id of the article which we search in the list to removepMaxSize
- maximum size of the output listpublic static boolean isValidName(String pName)
pName
- the name of the widget or viewpublic static String handleLineBreaks(String pInputText)
pInputText
- the input text with line breakspublic static String getDateDifference(Date pFrom, Date pTo) throws IOException
pFrom
- The date from where the difference have to be calculatedpTo
- Difference is measured to this dateIOException
- for loading the properties if properties file not found@Deprecated public static boolean isFieldAccessible(int pArticleId, String pFieldName, String pPaymentStatus)
pArticleId
- the article in which the function searches for premium and non premium fieldspFieldName
- the field name to check whether the field is premium or notpPaymentStatus
- check whether payment is done or not@Deprecated public static String getImageRepresentation(String pPreferredWidth, neo.xredsys.api.Publication pPublication, String pContentType)
getSuitableRepresentation
pPreferredWidth
- the width which closest representation to findpPublication
- for which publicationpContentType
- for which content typepublic static String getSuitableRepresentation(String pPreferredWidth, neo.xredsys.api.Publication pPublication, String pContentType, String pRepresentationVariant)
pPreferredWidth
- the width which closest representation to findpPublication
- for which publicationpContentType
- for which content typepRepresentationVariant
- describe the aspectVariant type, null
means it will take the default one.public static String getRssSource(String pRssUrl)
pRssUrl
- the source URLpublic static String getCaptchaHTML()
public static Number convertFahrenheitToCelsius(int pFahrenheit, boolean pRound)
pFahrenheit
- temprature in fahrenheit scalepRound
- whether the value should be roundedpublic static Date getRelativeDate(Date pDate, long pHourDiff)
pDate
- the reference datepHourDiff
- the difference in hourspublic static String getDateString(String pHourDiff)
1. The number of days is computed from the input hour value 2. Then we go back that many days in the past, but set the hour, minute and second value to 0
pHourDiff
- the string representing the number of hourspublic static Date getDateObject(String pTimeInMillis)
pTimeInMillis
- the time in millisecondpublic static String getTermFromTagIdentifier(String pTagIdentifier, String pTagStructureScheme)
pTagIdentifier
- the tag identifierpTagStructureScheme
- the tag structure schemepublic static Map<String,String> getImageDimension(String imageVersion)
imageVersion
- the width and height of this image version is returned.public static neo.xredsys.api.Section getConfigSectionByInheritance(neo.xredsys.api.Section pContentSection, String pBaseConfigSectionName, int pPublicationId)
pContentSection
- the content sectionpBaseConfigSectionName
- the prefix of the config section namepPublicationId
- the publication idpublic static neo.xredsys.api.Section getConfigSectionFromGroupOption(neo.xredsys.api.Section pContentSection, int pPublicationID)
public static neo.xredsys.api.Section getSection(String pSectionUniqueName, int pPublicationId)
pSectionUniqueName
- unique name of the sectionpPublicationId
- id of the publication to search for.public static neo.xredsys.api.Section getSection(String pSectionUniqueName, String pPublicationName)
pSectionUniqueName
- unique name of the sectionpPublicationName
- name of the publication to search for.public static String parseFeedForImage(String value)
value
- the feed entry where the image url ispublic static boolean isContainedInList(List pItemList, Object pItem)
pItemList
- the list of objects to search forpItem
- searches for this item in the listpublic static boolean isNumeric(String pValue)
public static ArrayList<Integer> getDescBreakpointsAsList(String[] breakpointsAsStringArray)
breakpointsAsStringArray
- string array of breakpointspublic static String getDefaultAspectVariant()
public static String generatePageURLWithQueryString(javax.servlet.http.HttpServletRequest pRequest)
public static String generatePageURLWithoutQueryString(javax.servlet.http.HttpServletRequest pRequest)
public static String generatePageURL(String pBaseURL, Map<String,String> pPageParameters)
pBaseURL
- base URL to work onpPageParameters
- parameters to be added to base URL as query stringpublic static boolean isImageContent(neo.xredsys.presentation.PresentationArticle pArticle)
public static String getArticleSummary(int pArticleId)
pArticleId
- the id of the article to get summary ofpublic static Map<String,Object> getRelativeTime(Date pDate)
Date
object, compares with current date-time, and returns
the given date as a relative timepublic static com.escenic.common.util.JSONMap getClientTypeDefinition(neo.xredsys.api.Section pSection)
public static String getTagPageUrl(neo.xredsys.api.Section section, neo.xredsys.presentation.PresentationTag pTag)
section
- tag specific section objectpTag
- tha tag object for which the url should be generatedpublic static String getTagPageUrl(neo.xredsys.api.Publication publication, neo.xredsys.presentation.PresentationTag pTag)
publication
- publication object. For this 'home section' will be used by default.pTag
- tha tag object for which the url should be generated.public static String getTaggingEntity(neo.xredsys.presentation.PresentationTag pPresentationTag)
pPresentationTag
- the tag object.public static int getTagUriHashCode(neo.xredsys.presentation.PresentationTag pTag)
pTag
- the tag object.public static String createSectionIDPath(neo.xredsys.api.Section pSection)
pSection
- the given section.public static ConfigUtil getConfigUtil()
public static boolean hasLazyFragment(neo.xredsys.presentation.PresentationElement pElement)
PresentationElement
for any lazily loaded
fragmentpElement
- the root element for which we are to traverse the hierarchypublic static boolean isMediaContent(neo.xredsys.presentation.PresentationArticle pArticle)
public static boolean isEmbeddedContent(neo.xredsys.presentation.PresentationArticle pArticle)
public static List<neo.xredsys.presentation.PresentationElement> getRelatedElements(neo.xredsys.presentation.PresentationArticle pArticle, String pRelationName, String pContentType, Integer pMaxItem)
public static neo.xredsys.presentation.PresentationElement findGroupByName(neo.xredsys.presentation.PresentationPool pPresentationPool, String pGroupName, int pGroupIndex)
public static int increaseMasterWidgetNestingLevel(String pCurrentLevel)
public static int decreaseMasterWidgetNestingLevel(String pUnsafeCurrentLevel)
public static boolean isValidMasterWidgetNestingLimit(String pCurrentNestingLevel, String pMasterWidgetNestingLimit)
public static int getMasterWidgetNestingLimit(neo.xredsys.api.Section pSection)
public static String getMediaInfoLink(neo.xredsys.presentation.PresentationArticle pArticle)
public static com.escenic.common.util.JSONMap getAMPGATrackerConfig(neo.xredsys.api.Section pSection)
© 1998- 2018 Escenic AS