Skip to content

Commit

Permalink
Merge Styling Portlets Framework - Meeds-io/MIPs#144 (#929)
Browse files Browse the repository at this point in the history
  • Loading branch information
boubaker authored Jul 5, 2024
2 parents 6a811cf + 19d823c commit 99243be
Show file tree
Hide file tree
Showing 30 changed files with 1,238 additions and 568 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@

public interface ExoFeatureService {

/**
* An event to trigger using ListenerService when a feature status changes
* using API
*/
public final String FEATURE_STATUS_CHANGED_EVENT = "feature.status.changed";

/**
* Check the status of a feature
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,36 @@ public interface BrandingService {
*/
Long getLoginBackgroundId();

/**
* @return Page Background File details
*/
Background getPageBackground();

/**
* @return Page Background File technical identifier
*/
Long getPageBackgroundId();

/**
* @return Page Background Color
*/
String getPageBackgroundColor();

/**
* @return Page Background Size
*/
String getPageBackgroundSize();

/**
* @return Page Background Position
*/
String getPageBackgroundPosition();

/**
* @return Page Background repeat directive
*/
String getPageBackgroundRepeat();

Logo getLogo();

/**
Expand Down Expand Up @@ -98,6 +128,21 @@ public interface BrandingService {
*/
String getLoginBackgroundPath();

/**
* @return {@link Background} URL to retrieve page background
*/
String getPageBackgroundPath();

/**
* @return Page width
*/
String getPageWidth();

/**
* @return Page custom additional css
*/
String getCustomCss();

void updateTopBarTheme(String style);

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,35 @@ public class Branding implements Serializable {

@Getter
@Setter
private Map<String, String> themeStyle = new HashMap<>();
private Background pageBackground;

@Getter
@Setter
private String pageBackgroundColor;

@Getter
@Setter
private String pageBackgroundSize;

@Getter
@Setter
private String pageBackgroundRepeat;

@Getter
@Setter
private String pageBackgroundPosition;

@Getter
@Setter
private String pageWidth;

@Getter
@Setter
private String customCss;

@Getter
@Setter
private Map<String, String> themeStyle = new HashMap<>();

@Getter
@Setter
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/**
* This file is part of the Meeds project (https://meeds.io/).
*
* Copyright (C) 2020 - 2024 Meeds Association [email protected]
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.exoplatform.portal.config.model;

import java.io.Serializable;

import lombok.Getter;
import lombok.Setter;

@Setter
@Getter
public class ApplicationBackgroundStyle implements Serializable {

private String backgroundColor;

private String backgroundImage;

private String backgroundEffect;

private String backgroundPosition;

private String backgroundSize;

private String backgroundRepeat;

}
Original file line number Diff line number Diff line change
Expand Up @@ -29,42 +29,49 @@
import org.exoplatform.portal.pom.config.Utils;
import org.exoplatform.portal.pom.data.*;

import lombok.Getter;
import lombok.Setter;

/**
* @author Tuan Nguyen
**/
public class Container extends ModelObject implements Cloneable {

public static final String EVERYONE = "Everyone";
public static final String EVERYONE = "Everyone";

public static final List<String> DEFAULT_ACCESS_PERMISSIONS = Collections.singletonList(EVERYONE);

public static final List<String> DEFAULT_ACCESS_PERMISSIONS = Collections.singletonList(EVERYONE);
public static final List<String> DEFAULT_MOVE_APPLICATIONS_PERMISSIONS = Collections.singletonList(EVERYONE);

public static final List<String> DEFAULT_MOVE_APPLICATIONS_PERMISSIONS = Collections.singletonList(EVERYONE);
public static final List<String> DEFAULT_MOVE_CONTAINERS_PERMISSIONS = Collections.singletonList(EVERYONE);

public static final List<String> DEFAULT_MOVE_CONTAINERS_PERMISSIONS = Collections.singletonList(EVERYONE);
protected String id;

protected String id;
protected String name;

protected String name;
protected String icon;

protected String icon;
protected String template;

protected String template;
protected String factoryId;

protected String factoryId;
protected String title;

protected String title;
protected String description;

protected String description;
protected String profiles;

protected String profiles;
protected String[] accessPermissions;

protected String[] accessPermissions;
protected String[] moveAppsPermissions;

protected String[] moveAppsPermissions;
protected String[] moveContainersPermissions;

protected String[] moveContainersPermissions;
protected ArrayList<ModelObject> children;

protected ArrayList<ModelObject> children;
@Getter
@Setter
protected ApplicationBackgroundStyle appBackgroundStyle;

public Container() {
setDefaultPermissions();
Expand Down Expand Up @@ -93,6 +100,7 @@ public Container(ContainerData data) {
this.height = data.getHeight();
this.cssClass = data.getCssClass();
this.cssStyle = data.getCssStyle();
this.appBackgroundStyle = data.getAppBackgroundStyle();
this.profiles = data.getProfiles();
this.accessPermissions = data.getAccessPermissions().toArray(new String[data.getAccessPermissions().size()]);
List<String> permisssions = data.getMoveAppsPermissions();
Expand Down Expand Up @@ -226,6 +234,7 @@ public ContainerData build() {
getCssClass(),
getProfiles(),
getCssStyle(),
getAppBackgroundStyle(),
Utils.safeImmutableList(accessPermissions),
Utils.safeImmutableList(moveAppsPermissions),
Utils.safeImmutableList(moveContainersPermissions),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,38 @@ public class ModelStyle implements Serializable {

private String backgroundRepeat;

private String textTitleColor;

private String textTitleFontSize;

private String textTitleFontWeight;

private String textTitleFontStyle;

private String textHeaderColor;

private String textHeaderFontSize;

private String textHeaderFontWeight;

private String textHeaderFontStyle;

private String textColor;

private String textFontSize;

private String textFontWeight;

private String textFontStyle;

private String textSubtitleColor;

private String textSubtitleFontSize;

private String textSubtitleFontWeight;

private String textSubtitleFontStyle;

public String getCssClass() { // NOSONAR
StringBuilder cssClass = new StringBuilder();
if (marginTop != null && marginTop >= 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public PageData build() {
List<ComponentData> children = buildChildren();
return new PageData(storageId, id, name, icon, template, factoryId, title, description, width, height, cssClass, profiles,
Utils.safeImmutableList(accessPermissions), children, ownerType, ownerId, editPermission, showMaxWindow, hideSharedLayout,
cssStyle, Utils.safeImmutableList(moveAppsPermissions), Utils.safeImmutableList(moveContainersPermissions), type, link);
Utils.safeImmutableList(moveAppsPermissions), Utils.safeImmutableList(moveContainersPermissions), type, link);
}

public static class PageSet {
Expand Down
Loading

0 comments on commit 99243be

Please sign in to comment.