[Trunk - Admin tools library Service]: Rename Porrtal > "alias" to "type" and Page/ DivId > "dashboardAlias" to "portalType".
This commit is contained in:
parent
41bf82277f
commit
9f65227b39
|
@ -14,7 +14,7 @@ public interface DivIdDAO {
|
|||
|
||||
DivId findById(String Id);
|
||||
|
||||
List<DivId> findByDashboardAlias(String dashboardAlias);
|
||||
List<DivId> findByPortalType(String portalType);
|
||||
|
||||
DivId save(DivId divId);
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ public interface MongoDBDivIdDAO extends DivIdDAO, MongoRepository<DivId, String
|
|||
|
||||
DivId findById(String Id);
|
||||
|
||||
List<DivId> findByDashboardAlias(String dashboardAlias);
|
||||
List<DivId> findByPortalType(String portalType);
|
||||
|
||||
DivId save(DivId divId);
|
||||
|
||||
|
|
|
@ -9,10 +9,10 @@ import eu.dnetlib.uoaadmintoolslibrary.entities.Page;
|
|||
|
||||
public interface MongoDBPageDAO extends PageDAO, MongoRepository<Page, String> {
|
||||
List<Page> findAll();
|
||||
List<Page> findByDashboardAlias(String dashboardAlias);
|
||||
List<Page> findByPortalType(String portalType);
|
||||
List<Page> findByRoute(String route);
|
||||
|
||||
Page findByDashboardAliasAndRoute(String dashboardAlias, String route);
|
||||
Page findByPortalTypeAndRoute(String portalType, String route);
|
||||
Page findById(String Id);
|
||||
|
||||
Page save(Page page);
|
||||
|
|
|
@ -6,10 +6,10 @@ import eu.dnetlib.uoaadmintoolslibrary.entities.Page;
|
|||
|
||||
public interface PageDAO {
|
||||
List<Page> findAll();
|
||||
List<Page> findByDashboardAlias(String dashboardAlias);
|
||||
List<Page> findByPortalType(String portalType);
|
||||
List<Page> findByRoute(String route);
|
||||
|
||||
Page findByDashboardAliasAndRoute(String dashboardAlias, String route);
|
||||
Page findByPortalTypeAndRoute(String portalType, String route);
|
||||
Page findById(String Id);
|
||||
|
||||
Page save(Page page);
|
||||
|
|
|
@ -12,7 +12,7 @@ public class DivId {
|
|||
|
||||
private String name;
|
||||
private List<String> pages;
|
||||
private String dashboardAlias; // explore, connect, community, monitor
|
||||
private String portalType; // explore, connect, community, monitor
|
||||
|
||||
// private Boolean connect;
|
||||
// private Boolean communities;
|
||||
|
@ -23,7 +23,7 @@ public class DivId {
|
|||
public DivId(DivId divId) {
|
||||
setName(divId.getName());
|
||||
setPages(divId.getPages());
|
||||
setDashboardAlias(divId.getDashboardAlias());
|
||||
setPortalType(divId.getPortalType());
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
|
@ -50,7 +50,7 @@ public class DivId {
|
|||
this.pages = pages;
|
||||
}
|
||||
|
||||
public String getDashboardAlias() { return dashboardAlias; }
|
||||
public String getPortalType() { return portalType; }
|
||||
|
||||
public void setDashboardAlias(String dashboardAlias) { this.dashboardAlias = dashboardAlias; }
|
||||
public void setPortalType(String portalType) { this.portalType = portalType; }
|
||||
}
|
|
@ -14,7 +14,7 @@ public class Page {
|
|||
private String name;
|
||||
private String type;
|
||||
private List<String> entities;
|
||||
private String dashboardAlias; // explore, connect, community, monitor
|
||||
private String portalType; // explore, connect, community, monitor
|
||||
|
||||
// private Boolean connect;
|
||||
// private Boolean communities;
|
||||
|
@ -64,9 +64,9 @@ public class Page {
|
|||
|
||||
public void setEntities(List<String> entities) { this.entities = entities; }
|
||||
|
||||
public String getDashboardAlias() { return dashboardAlias; }
|
||||
public String getPortalType() { return portalType; }
|
||||
|
||||
public void setDashboardAlias(String dashboardAlias) { this.dashboardAlias = dashboardAlias; }
|
||||
public void setPortalType(String portalType) { this.portalType = portalType; }
|
||||
|
||||
public Boolean getTop() {
|
||||
return top;
|
||||
|
|
|
@ -13,7 +13,7 @@ public class Portal {
|
|||
|
||||
private String pid;
|
||||
private String name;
|
||||
private String alias; // explore, connect, community, monitor
|
||||
private String type; // explore, connect, community, monitor
|
||||
private Map<String, Boolean> pages;
|
||||
private Map<String, Boolean> entities;
|
||||
private String layout;
|
||||
|
@ -44,12 +44,12 @@ public class Portal {
|
|||
this.name = name;
|
||||
}
|
||||
|
||||
public String getAlias() {
|
||||
return alias;
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setAlias(String alias) {
|
||||
this.alias = alias;
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public Map<String, Boolean> getPages() { return pages; }
|
||||
|
|
|
@ -15,7 +15,7 @@ public class DivIdResponse {
|
|||
|
||||
private String name;
|
||||
private List<Page> pages;
|
||||
private String dashboardAlias; // explore, connect, community, monitor
|
||||
private String portalType; // explore, connect, community, monitor
|
||||
|
||||
// private Boolean connect;
|
||||
// private Boolean communities;
|
||||
|
@ -26,7 +26,7 @@ public class DivIdResponse {
|
|||
public DivIdResponse(DivId divId) {
|
||||
setId(divId.getId());
|
||||
setName(divId.getName());
|
||||
setDashboardAlias(divId.getDashboardAlias());
|
||||
setPortalType(divId.getPortalType());
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
|
@ -53,7 +53,7 @@ public class DivIdResponse {
|
|||
this.pages = pages;
|
||||
}
|
||||
|
||||
public String getDashboardAlias() { return dashboardAlias; }
|
||||
public String getPortalType() { return portalType; }
|
||||
|
||||
public void setDashboardAlias(String dashboardAlias) { this.dashboardAlias = dashboardAlias; }
|
||||
public void setPortalType(String portalType) { this.portalType = portalType; }
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ public class PortalPage {
|
|||
private String type;
|
||||
private List<Entity> entities;
|
||||
private Boolean isEnabled;
|
||||
private String dashboardAlias; // explore, connect, community, monitor
|
||||
private String portalType; // explore, connect, community, monitor
|
||||
|
||||
// private Boolean connect;
|
||||
// private Boolean communities;
|
||||
|
@ -38,7 +38,7 @@ public class PortalPage {
|
|||
this.setRoute(page.getRoute());
|
||||
this.setName(page.getName());
|
||||
this.setType(page.getType());
|
||||
this.setDashboardAlias(page.getDashboardAlias());
|
||||
this.setPortalType(page.getPortalType());
|
||||
this.setTop(page.getTop());
|
||||
this.setBottom(page.getBottom());
|
||||
this.setLeft(page.getLeft());
|
||||
|
@ -85,9 +85,9 @@ public class PortalPage {
|
|||
|
||||
public void setIsEnabled(Boolean isEnabled) { this.isEnabled = isEnabled; }
|
||||
|
||||
public String getDashboardAlias() { return dashboardAlias; }
|
||||
public String getPortalType() { return portalType; }
|
||||
|
||||
public void setDashboardAlias(String dashboardAlias) { this.dashboardAlias = dashboardAlias; }
|
||||
public void setPortalType(String portalType) { this.portalType = portalType; }
|
||||
|
||||
public Boolean getTop() {
|
||||
return top;
|
||||
|
|
|
@ -14,6 +14,7 @@ public class PortalResponse {
|
|||
|
||||
private String pid;
|
||||
private String name;
|
||||
private String type; // explore, connect, community, monitor
|
||||
private List<PortalPage> pages;
|
||||
private List<PortalEntity> entities;
|
||||
//private Layout layout;
|
||||
|
@ -24,6 +25,7 @@ public class PortalResponse {
|
|||
this.setId(portal.getId());
|
||||
this.setPid(portal.getPid());
|
||||
this.setName(portal.getName());
|
||||
this.setType(portal.getType());
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
|
@ -50,6 +52,14 @@ public class PortalResponse {
|
|||
this.name = name;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public List<PortalPage> getPages() { return pages; }
|
||||
|
||||
public void setPages(List<PortalPage> pages) { this.pages = pages; }
|
||||
|
|
|
@ -119,7 +119,7 @@ public class DivHelpContentService {
|
|||
|
||||
public void addDivHelpContentsInPortal(String pid, String portalId, String divIdName) {
|
||||
Portal portal = portalService.getPortal(pid);
|
||||
String dashboardAlias = portal.getAlias();
|
||||
String portalType = portal.getType();
|
||||
|
||||
//String organizations_class_content = "<div> <p>Here you can write more details about the organizations related to your portal.</p> </div>";
|
||||
String link_context_form_content = "<div> <div><span class=\"uk-text-bold\"><span uk-icon=\"icon: info\"> </span> Information:</span> Select a research portal and/or a category and search for a portal concept, or browse to the portal tree through the categories</div> </div>";
|
||||
|
@ -131,7 +131,7 @@ public class DivHelpContentService {
|
|||
List<DivId> divIds = divIdService.getDivIds(null, divIdName, null);
|
||||
|
||||
for( DivId div : divIds ) {
|
||||
if (div != null && div.getDashboardAlias().equals(dashboardAlias) ) {
|
||||
if (div != null && div.getPortalType().equals(portalType) ) {
|
||||
// (div.getOpenaire() && pid.equals("openaire")) ||
|
||||
// (div.getConnect() && pid.equals("connect")) ||
|
||||
// (div.getCommunities() && !pid.equals("openaire") && !pid.equals("connect"))
|
||||
|
|
|
@ -32,7 +32,7 @@ public class DivIdService {
|
|||
|
||||
public List<DivId> getDivIds(String page, String name, String pid) {
|
||||
Portal portal = portalService.getPortal(pid);
|
||||
String dashboardAlias = portal.getAlias();
|
||||
String portalType = portal.getType();
|
||||
|
||||
List<DivId> divIds = null;
|
||||
|
||||
|
@ -54,11 +54,11 @@ public class DivIdService {
|
|||
divIds = divIdDAO.findAll();
|
||||
}
|
||||
|
||||
if(dashboardAlias != null) {
|
||||
if(portalType != null) {
|
||||
Iterator<DivId> iteratorDivIds = divIds.iterator();
|
||||
while(iteratorDivIds.hasNext()) {
|
||||
DivId divId = iteratorDivIds.next();
|
||||
if (!dashboardAlias.equals(divId.getDashboardAlias())) {
|
||||
if (!portalType.equals(divId.getPortalType())) {
|
||||
iteratorDivIds.remove();
|
||||
}
|
||||
}
|
||||
|
@ -126,7 +126,7 @@ public class DivIdService {
|
|||
DivId divId = new DivId();
|
||||
divId.setId(divIdResponse.getId());
|
||||
divId.setName(divIdResponse.getName());
|
||||
divId.setDashboardAlias(divIdResponse.getDashboardAlias());
|
||||
divId.setPortalType(divIdResponse.getPortalType());
|
||||
|
||||
List<Page> fullPages = divIdResponse.getPages();
|
||||
List<String> pages = new ArrayList<String>();
|
||||
|
@ -224,13 +224,13 @@ public class DivIdService {
|
|||
|
||||
public Set<String> getDivIdsPages(String pid) {
|
||||
Portal portal = portalService.getPortal(pid);
|
||||
String dashboardAlias = portal.getAlias();
|
||||
String portalType = portal.getType();
|
||||
|
||||
List<DivId> divIds = null;
|
||||
Set<String> hasPortalPageDivIds = new HashSet<>();
|
||||
|
||||
if(dashboardAlias != null) {
|
||||
divIds = divIdDAO.findByDashboardAlias(dashboardAlias);
|
||||
if(portalType != null) {
|
||||
divIds = divIdDAO.findByPortalType(portalType);
|
||||
} else {
|
||||
divIds = divIdDAO.findAll();
|
||||
}
|
||||
|
|
|
@ -69,13 +69,13 @@ public class PageService {
|
|||
List<Page> pages;
|
||||
if (pid != null) {
|
||||
Portal portal = portalService.getPortal(pid);
|
||||
String dashboardAlias = portal.getAlias();
|
||||
String portalType = portal.getType();
|
||||
|
||||
if (page_route != null) {
|
||||
pages = new ArrayList<Page>();
|
||||
pages.add(pageDAO.findByDashboardAliasAndRoute(dashboardAlias, page_route));
|
||||
pages.add(pageDAO.findByPortalTypeAndRoute(portalType, page_route));
|
||||
} else {
|
||||
pages = pageDAO.findByDashboardAlias(dashboardAlias);
|
||||
pages = pageDAO.findByPortalType(portalType);
|
||||
}
|
||||
} else if (page_route != null) {
|
||||
pages = pageDAO.findByRoute(page_route);
|
||||
|
@ -143,7 +143,7 @@ public class PageService {
|
|||
page.setRoute(portalPage.getRoute());
|
||||
page.setName(portalPage.getName());
|
||||
page.setType(portalPage.getType());
|
||||
page.setDashboardAlias(portalPage.getDashboardAlias());
|
||||
page.setPortalType(portalPage.getPortalType());
|
||||
page.setTop(portalPage.getTop());
|
||||
page.setBottom(portalPage.getBottom());
|
||||
page.setLeft(portalPage.getLeft());
|
||||
|
|
|
@ -268,7 +268,7 @@ public class PortalService {
|
|||
|
||||
while (divIdIterator.hasNext()) {
|
||||
DivId divId = divIdIterator.next();
|
||||
if(!portal.getAlias().equals(divId.getDashboardAlias())) {
|
||||
if(!portal.getType().equals(divId.getPortalType())) {
|
||||
divIdIterator.remove();
|
||||
}
|
||||
}
|
||||
|
@ -280,7 +280,7 @@ public class PortalService {
|
|||
|
||||
Page p = pageService.getPage(page.getKey());
|
||||
|
||||
if(portal.getAlias().equals(p.getDashboardAlias())) {
|
||||
if(portal.getType().equals(p.getPortalType())) {
|
||||
if ((page_type == null && page_route == null) || (page_route == null && p.getType().equals(page_type))
|
||||
|| p.getRoute().equals(page_route)) {
|
||||
PortalPage portalPage = new PortalPage(p);
|
||||
|
|
Loading…
Reference in New Issue