Skip to content

Commit

Permalink
feat: Move Application Registry from Portal and implement Portlet Ins…
Browse files Browse the repository at this point in the history
…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
boubaker committed Jun 4, 2024
1 parent 55cf700 commit 580efd9
Show file tree
Hide file tree
Showing 88 changed files with 6,131 additions and 348 deletions.
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> {
}
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);

}
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;

}
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;

}
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;
}

}
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;

}
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<>();

}
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;

}
Loading

0 comments on commit 580efd9

Please sign in to comment.