Skip to content

Package: GalleryAdapter

GalleryAdapter

Coverage

1: /*
2: * *************************************************************************************************************************************************************
3: *
4: * NorthernWind - lightweight CMS
5: * http://tidalwave.it/projects/northernwind
6: *
7: * Copyright (C) 2011 - 2025 Tidalwave s.a.s. (http://tidalwave.it)
8: *
9: * *************************************************************************************************************************************************************
10: *
11: * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
12: * You may obtain a copy of the License at
13: *
14: * http://www.apache.org/licenses/LICENSE-2.0
15: *
16: * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
17: * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
18: *
19: * *************************************************************************************************************************************************************
20: *
21: * git clone https://bitbucket.org/tidalwave/northernwind-src
22: * git clone https://github.com/tidalwave-it/northernwind-src
23: *
24: * *************************************************************************************************************************************************************
25: */
26: package it.tidalwave.northernwind.frontend.ui.component.gallery.spi;
27:
28: import javax.annotation.Nonnull;
29: import java.util.List;
30: import it.tidalwave.util.Id;
31: import it.tidalwave.northernwind.core.model.ResourceProperties;
32: import it.tidalwave.northernwind.frontend.ui.RenderContext;
33: import it.tidalwave.northernwind.frontend.ui.component.gallery.GalleryViewController.GalleryItem;
34:
35: /***************************************************************************************************************************************************************
36: *
37: * @author Fabrizio Giudici
38: *
39: **************************************************************************************************************************************************************/
40: public interface GalleryAdapter
41: {
42: /***********************************************************************************************************************************************************
43: *
44: **********************************************************************************************************************************************************/
45: @Nonnull
46: public ResourceProperties getExtraViewProperties (@Nonnull Id viewId);
47:
48: /***********************************************************************************************************************************************************
49: *
50: **********************************************************************************************************************************************************/
51: @Nonnull
52: public String getInlinedScript();
53:
54: /***********************************************************************************************************************************************************
55: * Prepares a catalog of media items to be consumed by the gallery client software.
56: *
57: * @param items the list of gallery items
58: **********************************************************************************************************************************************************/
59: public void prepareCatalog (@Nonnull List<? extends GalleryItem> items);
60:
61: /***********************************************************************************************************************************************************
62: * Prepares the full JS page.
63: *
64: * @param item the gallery item
65: * @param items the list of gallery items
66: **********************************************************************************************************************************************************/
67: public void prepareGallery (@Nonnull GalleryItem item, @Nonnull List<? extends GalleryItem> items);
68:
69: /***********************************************************************************************************************************************************
70: * Prepares the fallback page.
71: *
72: * @param item the gallery item
73: * @param items the list of gallery items
74: **********************************************************************************************************************************************************/
75: public void prepareFallbackGallery (@Nonnull GalleryItem item, @Nonnull List<? extends GalleryItem> items);
76:
77: /***********************************************************************************************************************************************************
78: * Prepares the fallback lightbox.
79: *
80: * @param items the list of gallery items
81: **********************************************************************************************************************************************************/
82: public void prepareFallbackLightbox (@Nonnull List<? extends GalleryItem> items);
83:
84: /***********************************************************************************************************************************************************
85: * Renders what has been previously prepared.
86: **********************************************************************************************************************************************************/
87: public void render (@Nonnull RenderContext context);
88: }