Skip to content

Commit

Permalink
Merge Meed Layout Editor - Meeds-io/MIPs#120 (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
boubaker authored Apr 26, 2024
2 parents 60eeaf1 + 7930fef commit e92efa2
Show file tree
Hide file tree
Showing 532 changed files with 14,498 additions and 21,411 deletions.
33 changes: 17 additions & 16 deletions layout-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,28 +35,29 @@
<properties>
<rest.api.doc.title>Layout Rest APIs</rest.api.doc.title>
<rest.api.doc.version>1.0</rest.api.doc.version>
<rest.api.doc.description>Layout addon used Rest endpoints</rest.api.doc.description>
<rest.api.doc.description>Layout Rest endpoints</rest.api.doc.description>

<exo.test.coverage.ratio>0.60</exo.test.coverage.ratio>
</properties>
<dependencies>
<dependency>
<groupId>org.exoplatform.commons</groupId>
<artifactId>commons-component-common</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.exoplatform.gatein.portal</groupId>
<artifactId>exo.portal.component.api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.exoplatform.social</groupId>
<artifactId>social-component-core</artifactId>
<scope>provided</scope>
<artifactId>social-component-service</artifactId>
</dependency>

<dependency>
<groupId>org.exoplatform.social</groupId>
<artifactId>social-component-service</artifactId>
<scope>provided</scope>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>com.vaadin.external.google</groupId>
<artifactId>android-json</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/**
* 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 io.meeds.layout.dao;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import io.meeds.layout.entity.PageTemplateEntity;

@Repository
public interface PageTemplateDAO extends JpaRepository<PageTemplateEntity, Long> {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/**
* 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 io.meeds.layout.entity;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.SequenceGenerator;
import jakarta.persistence.Table;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Entity(name = "LayoutPageTemplate")
@Table(name = "LAYOUT_PAGE_TEMPLATES")
@Data
@NoArgsConstructor
@AllArgsConstructor
public class PageTemplateEntity {

@Id
@SequenceGenerator(name = "SEQ_PAGE_TEMPLATE_ID", sequenceName = "SEQ_PAGE_TEMPLATE_ID", allocationSize = 1)
@GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ_PAGE_TEMPLATE_ID")
@Column(name = "ID")
protected Long id;

@Column(name = "CONTENT")
private String content;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/**
* 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 io.meeds.layout.model;

import java.util.Map;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class NavigationCreateModel {

private Long parentNodeId;

private Long previousNodeId;

private String nodeLabel;

private String nodeId;

private boolean visible;

private boolean scheduled;

private boolean draft;

private Long startScheduleDate;

private Long endScheduleDate;

private String pageRef;

private String target;

private boolean isPasteMode;

private String icon;

private Map<String, String> labels;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/**
* 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 io.meeds.layout.model;

import java.util.Map;

import lombok.Data;

@Data
public class NavigationUpdateModel {

private String nodeLabel;

private String pageRef;

private String target;

private boolean visible;

private boolean scheduled;

private Long startScheduleDate;

private Long endScheduleDate;

private String icon;

private Map<String, String> labels;

}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package io.meeds.layout.rest.model;
package io.meeds.layout.model;

import java.util.Map;

Expand All @@ -28,10 +28,12 @@
@Data
@NoArgsConstructor
@AllArgsConstructor
public class NodeLabelRestEntity {
public class NodeLabel {

private Map<String, String> supportedLanguages;

private Map<String, String> labels;

private String defaultLanguage;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/**
* 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 io.meeds.layout.model;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class PageCreateModel {

private String pageName;

private String pageTitle;

private String pageSiteType;

private String pageSiteName;

private String pageType;

private String link;

private Long pageTemplateId;

private String editPermission;

private String[] accessPermissions;
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
* 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
Expand All @@ -17,18 +16,19 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package io.meeds.layout.rest.model;
package io.meeds.layout.model;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class ImageRestEntity {
@Data
public class PageModel {

private String pageRef;

private String fileId;
private String displayName;

private String imageUrl;
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
* 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
Expand All @@ -17,21 +16,30 @@
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package io.meeds.layout.utils;
package io.meeds.layout.model;

import org.gatein.api.Util;
import org.gatein.api.site.Site;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import org.exoplatform.commons.utils.CommonsUtils;
import org.exoplatform.portal.config.UserACL;
@Data
@NoArgsConstructor
@AllArgsConstructor
public class PageTemplate {

public class SiteManagementUtils {
private long id;

private SiteManagementUtils() {
}
private String content;

private String name;

public static boolean canEditSite(Site site) {
UserACL userACL = CommonsUtils.getService(UserACL.class);
return userACL.hasPermission(Util.from(site.getEditPermission())[0]);
private String description;

private long illustrationId;

public PageTemplate(long id, String content) {
this.id = id;
this.content = content;
}

}
Loading

0 comments on commit e92efa2

Please sign in to comment.