-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Move Application Registry from Portal and implement Portlet Ins…
…tances - MEED-6903 - Meeds-io/MIPs#139 (#79) This change will move the definition of JPA entity and Table of ApplicationRegistry renamed to Portlet Instances. In addition, this will implement all needed Backend features for MIPs#139 with notion of Categories, Portlets and instances defined with portlet preferences.
- Loading branch information
Showing
86 changed files
with
6,092 additions
and
322 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
layout-service/src/main/java/io/meeds/layout/dao/PortletInstanceCategoryDAO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/** | ||
* 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 io.meeds.layout.entity.PortletInstanceCategoryEntity; | ||
|
||
public interface PortletInstanceCategoryDAO extends JpaRepository<PortletInstanceCategoryEntity, Long> { | ||
} |
31 changes: 31 additions & 0 deletions
31
layout-service/src/main/java/io/meeds/layout/dao/PortletInstanceDAO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/** | ||
* 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 java.util.List; | ||
|
||
import org.springframework.data.jpa.repository.JpaRepository; | ||
|
||
import io.meeds.layout.entity.PortletInstanceEntity; | ||
|
||
public interface PortletInstanceDAO extends JpaRepository<PortletInstanceEntity, Long> { | ||
|
||
List<PortletInstanceEntity> findByCategoryId(long categoryId); | ||
|
||
} |
63 changes: 63 additions & 0 deletions
63
layout-service/src/main/java/io/meeds/layout/entity/PortletInstanceCategoryEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/** | ||
* 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 java.io.Serializable; | ||
import java.util.List; | ||
|
||
import org.exoplatform.commons.utils.StringListConverter; | ||
|
||
import jakarta.persistence.Column; | ||
import jakarta.persistence.Convert; | ||
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 = "LayoutApplicationCategory") | ||
@Table(name = "PORTAL_APP_CATEGORIES") | ||
@Data | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class PortletInstanceCategoryEntity implements Serializable { | ||
|
||
private static final long serialVersionUID = 8772040309317091459L; | ||
|
||
@Id | ||
@SequenceGenerator(name = "SEQ_GTN_APPLICATION_CAT_ID", sequenceName = "SEQ_GTN_APPLICATION_CAT_ID", allocationSize = 1) | ||
@GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ_GTN_APPLICATION_CAT_ID") | ||
@Column(name = "ID") | ||
private Long id; | ||
|
||
@Convert(converter = StringListConverter.class) | ||
@Column(name = "PERMISSIONS", nullable = false) | ||
private List<String> permissions; | ||
|
||
@Column(name = "ICON") | ||
private String icon; | ||
|
||
@Column(name = "IS_SYSTEM") | ||
private boolean system; | ||
|
||
} |
78 changes: 78 additions & 0 deletions
78
layout-service/src/main/java/io/meeds/layout/entity/PortletInstanceEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
/** | ||
* 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 java.io.Serializable; | ||
import java.util.List; | ||
|
||
import org.exoplatform.commons.utils.StringListConverter; | ||
|
||
import jakarta.persistence.Column; | ||
import jakarta.persistence.Convert; | ||
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 = "LayoutApplication") | ||
@Table(name = "PORTAL_APPLICATIONS") | ||
@Data | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class PortletInstanceEntity implements Serializable { | ||
|
||
private static final long serialVersionUID = 4955770436068594917L; | ||
|
||
@Id | ||
@SequenceGenerator(name = "SEQ_GTN_APPLICATION_ID", sequenceName = "SEQ_GTN_APPLICATION_ID", allocationSize = 1) | ||
@GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ_GTN_APPLICATION_ID") | ||
@Column(name = "ID") | ||
private Long id; | ||
|
||
@Column(name = "CATEGORY_ID") | ||
private long categoryId; | ||
|
||
@Column(name = "CONTENT_ID") | ||
private String contentId; | ||
|
||
@Convert(converter = StringListConverter.class) | ||
@Column(name = "PERMISSIONS") | ||
private List<String> permissions; | ||
|
||
@Column(name = "PREFERENCES") | ||
private String preferences; | ||
|
||
@Column(name = "IS_SYSTEM") | ||
private boolean system; | ||
|
||
@Column(name = "IS_SPACE_APPLICATION") | ||
private boolean spaceApplication; | ||
|
||
@Column(name = "IS_DISABLED") | ||
private boolean disabled; | ||
|
||
@Column(name = "FOOTPRINT") | ||
private long footprint; | ||
|
||
} |
46 changes: 46 additions & 0 deletions
46
layout-service/src/main/java/io/meeds/layout/model/PortletDescriptor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.List; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Data | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
public class PortletDescriptor { | ||
|
||
private String name; | ||
|
||
private String description; | ||
|
||
private String applicationName; | ||
|
||
private String portletName; | ||
|
||
private List<String> supportedModes; | ||
|
||
public String getContentId() { | ||
return applicationName + "/" + portletName; | ||
} | ||
|
||
} |
56 changes: 56 additions & 0 deletions
56
layout-service/src/main/java/io/meeds/layout/model/PortletInstance.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/** | ||
* 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.List; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Data | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
public class PortletInstance { | ||
|
||
private long id; | ||
|
||
private String name; | ||
|
||
private String description; | ||
|
||
private long categoryId; | ||
|
||
private String contentId; | ||
|
||
private List<PortletInstancePreference> preferences; | ||
|
||
private long illustrationId; | ||
|
||
private List<String> permissions; | ||
|
||
private List<String> supportedModes; | ||
|
||
private boolean system; | ||
|
||
private boolean disabled; | ||
|
||
private boolean spaceApplication; | ||
|
||
} |
45 changes: 45 additions & 0 deletions
45
layout-service/src/main/java/io/meeds/layout/model/PortletInstanceCategory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/** | ||
* 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.ArrayList; | ||
import java.util.List; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Data | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
public class PortletInstanceCategory { | ||
|
||
private long id; | ||
|
||
private String name; | ||
|
||
private String description; | ||
|
||
private String icon; | ||
|
||
private boolean system; | ||
|
||
private List<String> permissions = new ArrayList<>(); | ||
|
||
} |
45 changes: 45 additions & 0 deletions
45
layout-service/src/main/java/io/meeds/layout/model/PortletInstanceCategoryDescriptor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/** | ||
* 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.List; | ||
import java.util.Map; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Data | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class PortletInstanceCategoryDescriptor { | ||
|
||
private String nameId; | ||
|
||
private Map<String, String> names; | ||
|
||
private Map<String, String> descriptions; | ||
|
||
private String icon; | ||
|
||
private List<String> permissions; | ||
|
||
private boolean system; | ||
|
||
} |
Oops, something went wrong.