Package org.javlo.service.shared
Class AbstractSharedContentProvider
- java.lang.Object
-
- org.javlo.service.shared.AbstractSharedContentProvider
-
- All Implemented Interfaces:
ISharedContentProvider
- Direct Known Subclasses:
CloserJavloSharedContentProvider
,FotogrphSharedContentProvider
,JavloSharedContentProvider
,LocalImageSharedContentProvider
,PixabaySharedContentProvider
,StockvaultSharedContentProvider
,URLImageSharedContentProvider
public abstract class AbstractSharedContentProvider extends Object implements ISharedContentProvider
-
-
Field Summary
Fields Modifier and Type Field Description protected Map<String,String>
categories
protected String
name
protected URL
url
-
Fields inherited from interface org.javlo.service.shared.ISharedContentProvider
TYPE_DEFAULT, TYPE_IMAGE, TYPE_MULTIMEDIA, TYPE_TEXT
-
-
Constructor Summary
Constructors Constructor Description AbstractSharedContentProvider()
-
Method Summary
-
-
-
Method Detail
-
getName
public String getName()
- Specified by:
getName
in interfaceISharedContentProvider
-
getLabel
public String getLabel(Locale locale)
- Specified by:
getLabel
in interfaceISharedContentProvider
-
getURL
public URL getURL()
Description copied from interface:ISharedContentProvider
get the url of the provider. Can be null and can be only for information about provider (not webservice).- Specified by:
getURL
in interfaceISharedContentProvider
- Returns:
-
setURL
public void setURL(URL url)
-
getFolder
public File getFolder(ContentContext ctx, String category)
- Specified by:
getFolder
in interfaceISharedContentProvider
-
getContent
public abstract Collection<SharedContent> getContent(ContentContext ctx)
- Specified by:
getContent
in interfaceISharedContentProvider
-
searchContent
public Collection<SharedContent> searchContent(ContentContext ctx, String query)
- Specified by:
searchContent
in interfaceISharedContentProvider
-
isCategoryAccepted
protected boolean isCategoryAccepted(ContentContext ctx, Collection<String> categories, MenuElement cp, Template template)
-
isCategoryAccepted
protected boolean isCategoryAccepted(ContentContext ctx, String category, MenuElement cp, Template template)
-
setName
public void setName(String name)
- Specified by:
setName
in interfaceISharedContentProvider
-
getCategories
public Map<String,String> getCategories(ContentContext ctx)
- Specified by:
getCategories
in interfaceISharedContentProvider
-
getContent
public Collection<SharedContent> getContent(ContentContext ctx, Collection<String> categories)
- Specified by:
getContent
in interfaceISharedContentProvider
-
isEmpty
public boolean isEmpty(ContentContext ctx)
Description copied from interface:ISharedContentProvider
return true if provider have no content.- Specified by:
isEmpty
in interfaceISharedContentProvider
- Returns:
-
refresh
public void refresh(ContentContext ctx)
Description copied from interface:ISharedContentProvider
refresh the content list and the list of categories- Specified by:
refresh
in interfaceISharedContentProvider
-
getType
public String getType()
- Specified by:
getType
in interfaceISharedContentProvider
-
isSearch
public boolean isSearch()
Description copied from interface:ISharedContentProvider
return true if search is possible.- Specified by:
isSearch
in interfaceISharedContentProvider
- Returns:
-
getContentSize
public int getContentSize(ContentContext ctx)
- Specified by:
getContentSize
in interfaceISharedContentProvider
-
getCategoriesSize
public int getCategoriesSize(ContentContext ctx)
- Specified by:
getCategoriesSize
in interfaceISharedContentProvider
-
isUploadable
public boolean isUploadable(ContentContext ctx)
- Specified by:
isUploadable
in interfaceISharedContentProvider
-
exist
public Boolean exist(ContentContext ctx, String fileName, String category) throws IOException
- Specified by:
exist
in interfaceISharedContentProvider
- Throws:
IOException
-
upload
public void upload(ContentContext ctx, String fileName, InputStream in, String category, boolean rename) throws IOException
- Specified by:
upload
in interfaceISharedContentProvider
- Throws:
IOException
-
isLarge
public boolean isLarge()
- Specified by:
isLarge
in interfaceISharedContentProvider
-
-