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>categoriesprotected Stringnameprotected URLurl-
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:
getNamein interfaceISharedContentProvider
-
getLabel
public String getLabel(Locale locale)
- Specified by:
getLabelin interfaceISharedContentProvider
-
getURL
public URL getURL()
Description copied from interface:ISharedContentProviderget the url of the provider. Can be null and can be only for information about provider (not webservice).- Specified by:
getURLin interfaceISharedContentProvider- Returns:
-
setURL
public void setURL(URL url)
-
getFolder
public File getFolder(ContentContext ctx, String category)
- Specified by:
getFolderin interfaceISharedContentProvider
-
getContent
public abstract Collection<SharedContent> getContent(ContentContext ctx)
- Specified by:
getContentin interfaceISharedContentProvider
-
searchContent
public Collection<SharedContent> searchContent(ContentContext ctx, String query)
- Specified by:
searchContentin 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:
setNamein interfaceISharedContentProvider
-
getCategories
public Map<String,String> getCategories(ContentContext ctx)
- Specified by:
getCategoriesin interfaceISharedContentProvider
-
getContent
public Collection<SharedContent> getContent(ContentContext ctx, Collection<String> categories)
- Specified by:
getContentin interfaceISharedContentProvider
-
isEmpty
public boolean isEmpty(ContentContext ctx)
Description copied from interface:ISharedContentProviderreturn true if provider have no content.- Specified by:
isEmptyin interfaceISharedContentProvider- Returns:
-
refresh
public void refresh(ContentContext ctx)
Description copied from interface:ISharedContentProviderrefresh the content list and the list of categories- Specified by:
refreshin interfaceISharedContentProvider
-
getType
public String getType()
- Specified by:
getTypein interfaceISharedContentProvider
-
isSearch
public boolean isSearch()
Description copied from interface:ISharedContentProviderreturn true if search is possible.- Specified by:
isSearchin interfaceISharedContentProvider- Returns:
-
getContentSize
public int getContentSize(ContentContext ctx)
- Specified by:
getContentSizein interfaceISharedContentProvider
-
getCategoriesSize
public int getCategoriesSize(ContentContext ctx)
- Specified by:
getCategoriesSizein interfaceISharedContentProvider
-
isUploadable
public boolean isUploadable(ContentContext ctx)
- Specified by:
isUploadablein interfaceISharedContentProvider
-
exist
public Boolean exist(ContentContext ctx, String fileName, String category) throws IOException
- Specified by:
existin interfaceISharedContentProvider- Throws:
IOException
-
upload
public void upload(ContentContext ctx, String fileName, InputStream in, String category, boolean rename) throws IOException
- Specified by:
uploadin interfaceISharedContentProvider- Throws:
IOException
-
isLarge
public boolean isLarge()
- Specified by:
isLargein interfaceISharedContentProvider
-
-