com.dotmarketing.viewtools
Class DotCMSMacroWebAPI

java.lang.Object
  extended by com.dotmarketing.viewtools.DotCMSMacroWebAPI
All Implemented Interfaces:
org.apache.velocity.tools.view.tools.ViewTool

public class DotCMSMacroWebAPI
extends java.lang.Object
implements org.apache.velocity.tools.view.tools.ViewTool


Constructor Summary
DotCMSMacroWebAPI()
           
 
Method Summary
 java.util.List getEvents(java.lang.String categories, int limit, int startDayOffset, int daysToShow)
          Get a list of x number of events, from a category inode list in a range of dates.
 java.util.List getEvents(java.lang.String categories, int limit, int startDayOffset, java.lang.String daysToShow)
          Get a list of x number of events, from a category inode list in a range of dates.
 java.util.List getEvents(java.lang.String categories, int limit, java.lang.String startDayOffset, int daysToShow)
          Get a list of x number of events, from a category inode list in a range of dates.
 java.util.List getEvents(java.lang.String categories, int limit, java.lang.String startDayOffset, java.lang.String daysToShow)
          Get a list of x number of events, from a category inode list in a range of dates.
 java.util.List getfileRepository(java.lang.String folderPath, java.lang.String searchFolder, javax.servlet.http.HttpServletRequest request)
           
 java.util.List getFileSystemFolder(java.lang.String folder)
           
 java.lang.String getFolderPath(java.lang.String rootFolder, javax.servlet.http.HttpServletRequest request)
           
 java.util.List<Link> getLinkRepository(java.lang.String folderPath, javax.servlet.http.HttpServletRequest request)
           
 java.util.List<java.util.HashMap<java.lang.String,IFileAsset>> getMediaGalleryFolderFiles(java.lang.String folderPath, Host host)
          Return a list of hashmap with the files to show in the media gallery
 java.util.List<java.util.HashMap<java.lang.String,IFileAsset>> getMediaGalleryFolderFiles(java.lang.String folderPath, long hostId)
          Deprecated. 
 java.util.List<java.util.HashMap<java.lang.String,IFileAsset>> getMediaGalleryFolderFiles(java.lang.String folderPath, java.lang.String hostId)
           
 java.util.ArrayList<java.util.HashMap<java.lang.String,java.lang.String>> getSQLResults(java.lang.String dataSource, java.lang.String sql, int startRow, int maxRow)
           
static Structure getStructureByName(java.lang.String structureName)
          returns a structure using the structure name
static java.util.Map<java.lang.String,java.lang.Integer> getTagsCount(java.util.List<java.lang.String> structures, int maxNumberOfTags, java.util.List<java.lang.String> ignoredTags, javax.servlet.http.HttpServletRequest request)
          returns a map of the top most popular tags [numberOfTags] used by the given list of structures
 void init(java.lang.Object obj)
           
static java.util.List<java.lang.String> sortAlpha(java.util.Set<java.lang.String> stringSet)
          returns a string set alphabetically ordered
static java.util.HashMap topMostPopularTags(java.util.HashMap tagHashMap, int maxNumberOfTags)
          returns a map of the top most popular tags, this map has the tag name as a key and the tag count as value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DotCMSMacroWebAPI

public DotCMSMacroWebAPI()
Method Detail

init

public void init(java.lang.Object obj)
Specified by:
init in interface org.apache.velocity.tools.view.tools.ViewTool

getfileRepository

public java.util.List getfileRepository(java.lang.String folderPath,
                                        java.lang.String searchFolder,
                                        javax.servlet.http.HttpServletRequest request)
                                 throws DotDataException,
                                        com.liferay.portal.PortalException,
                                        com.liferay.portal.SystemException,
                                        DotSecurityException
Throws:
DotDataException
com.liferay.portal.PortalException
com.liferay.portal.SystemException
DotSecurityException

getLinkRepository

public java.util.List<Link> getLinkRepository(java.lang.String folderPath,
                                              javax.servlet.http.HttpServletRequest request)

getFolderPath

public java.lang.String getFolderPath(java.lang.String rootFolder,
                                      javax.servlet.http.HttpServletRequest request)

getEvents

public java.util.List getEvents(java.lang.String categories,
                                int limit,
                                int startDayOffset,
                                java.lang.String daysToShow)
                         throws DotDataException,
                                DotSecurityException
Get a list of x number of events, from a category inode list in a range of dates. if startDayOffset is null or 0, the start date begin from today at 00:00:00. if daysToShow is null or cero, en end date is today at 00:00:00, if not the end date if from the start date + daysToShow

Parameters:
categories - a string list of comma separated categories inodes
limit - max number of events to get
startDayOffset -
daysToShow -
Returns:
a list of events
Throws:
DotSecurityException
DotDataException

getEvents

public java.util.List getEvents(java.lang.String categories,
                                int limit,
                                java.lang.String startDayOffset,
                                int daysToShow)
                         throws DotDataException,
                                DotSecurityException
Get a list of x number of events, from a category inode list in a range of dates. if startDayOffset is null or 0, the start date begin from today at 00:00:00. if daysToShow is null or cero, en end date is today at 00:00:00, if not the end date if from the start date + daysToShow

Parameters:
categories - a string list of comma separated categories inodes
limit - max number of events to get
startDayOffset -
daysToShow -
Returns:
a list of events
Throws:
DotSecurityException
DotDataException

getEvents

public java.util.List getEvents(java.lang.String categories,
                                int limit,
                                java.lang.String startDayOffset,
                                java.lang.String daysToShow)
                         throws DotDataException,
                                DotSecurityException
Get a list of x number of events, from a category inode list in a range of dates. if startDayOffset is null or 0, the start date begin from today at 00:00:00. if daysToShow is null or cero, en end date is today at 00:00:00, if not the end date if from the start date + daysToShow

Parameters:
categories - a string list of comma separated categories inodes
limit - max number of events to get
startDayOffset -
daysToShow -
Returns:
a list of events
Throws:
DotSecurityException
DotDataException

getEvents

public java.util.List getEvents(java.lang.String categories,
                                int limit,
                                int startDayOffset,
                                int daysToShow)
                         throws DotDataException,
                                DotSecurityException
Get a list of x number of events, from a category inode list in a range of dates. if startDayOffset is null or 0, the start date begin from today at 00:00:00. if daysToShow is null or cero, en end date is today at 00:00:00, if not the end date if from the start date + daysToShow

Parameters:
categories - a string list of comma separated categories inodes
limit - max number of events to get
startDayOffset -
daysToShow -
Returns:
a list of events
Throws:
DotSecurityException
DotDataException

getFileSystemFolder

public java.util.List getFileSystemFolder(java.lang.String folder)

getSQLResults

public java.util.ArrayList<java.util.HashMap<java.lang.String,java.lang.String>> getSQLResults(java.lang.String dataSource,
                                                                                               java.lang.String sql,
                                                                                               int startRow,
                                                                                               int maxRow)

getStructureByName

public static Structure getStructureByName(java.lang.String structureName)
returns a structure using the structure name

Parameters:
structureName - name of the structure to look for
Returns:
structure

getTagsCount

public static java.util.Map<java.lang.String,java.lang.Integer> getTagsCount(java.util.List<java.lang.String> structures,
                                                                             int maxNumberOfTags,
                                                                             java.util.List<java.lang.String> ignoredTags,
                                                                             javax.servlet.http.HttpServletRequest request)
returns a map of the top most popular tags [numberOfTags] used by the given list of structures

Parameters:
structures - Name of the structures to query
maxNumberOfTags - maximum number of tag to be returned, if 0 is provided, then returns all tags
Returns:
map of the top most popular tags

sortAlpha

public static java.util.List<java.lang.String> sortAlpha(java.util.Set<java.lang.String> stringSet)
returns a string set alphabetically ordered

Parameters:
stringSet - set to be ordered
Returns:
string set alphabetically ordered

topMostPopularTags

public static java.util.HashMap topMostPopularTags(java.util.HashMap tagHashMap,
                                                   int maxNumberOfTags)
returns a map of the top most popular tags, this map has the tag name as a key and the tag count as value

Parameters:
tagHashMap - map to be verified, in order to get the top most popular tags
maxNumberOfTags - maximum number of tag to be returned, if 0 is provided, then returns the original map, i.e. returns all tags
Returns:
map of the top most popular tags

getMediaGalleryFolderFiles

public java.util.List<java.util.HashMap<java.lang.String,IFileAsset>> getMediaGalleryFolderFiles(java.lang.String folderPath,
                                                                                                 Host host)
                                                                                          throws DotDataException
Return a list of hashmap with the files to show in the media gallery

Parameters:
folderPath - String with the path with the files to show.
host - Host where the folder path belongs.
Returns:
List of the hashmap with the files to show in the media gallery. Each hashmap can contain these keys: 'movie' (null if there is no movie file) or 'photo' (The photo file. If there is a movie file, this will be the photo associated to the movie).
Throws:
DotDataException

getMediaGalleryFolderFiles

public java.util.List<java.util.HashMap<java.lang.String,IFileAsset>> getMediaGalleryFolderFiles(java.lang.String folderPath,
                                                                                                 java.lang.String hostId)
                                                                                          throws DotDataException
Throws:
DotDataException

getMediaGalleryFolderFiles

@Deprecated
public java.util.List<java.util.HashMap<java.lang.String,IFileAsset>> getMediaGalleryFolderFiles(java.lang.String folderPath,
                                                                                                            long hostId)
                                                                                          throws DotDataException
Deprecated. 

Return a list of hashmap with the files to show in the media gallery

Parameters:
folderPath - String with the path with the files to show.
host - long with the hostId of the host where the folder path belongs.
Returns:
List of the hashmap with the files to show in the media gallery. Each hashmap can contain these keys: 'movie' (null if there is no movie file) or 'photo' (The photo file. If there is a movie file, this will be the photo associated to the movie).
Throws:
DotDataException


Copyright © 2013 dotCMS Inc. All Rights Reserved.