Revision 60588
Added by Konstantina Galouni over 3 years ago
modules/uoa-admin-tools-library/trunk/src/main/java/eu/dnetlib/uoaadmintoolslibrary/dao/DivHelpContentDAO.java | ||
---|---|---|
14 | 14 |
List<DivHelpContent> findByPortalAndIsActive(String portalId, boolean isActive); |
15 | 15 |
List<DivHelpContent> findByDivIdAndIsActive(String divId, boolean isActive); |
16 | 16 |
List<DivHelpContent> findByPortalAndDivIdAndIsActive(String portalId, String divId, boolean isActive); |
17 |
List<DivHelpContent> findByPortalAndPage(String portalId, String page); |
|
17 |
// List<DivHelpContent> findByPortalAndPage(String portalId, String page);
|
|
18 | 18 |
|
19 | 19 |
DivHelpContent findById(String Id); |
20 | 20 |
|
modules/uoa-admin-tools-library/trunk/src/main/java/eu/dnetlib/uoaadmintoolslibrary/dao/MongoDBDAOs/MongoDBDivHelpContentDAO.java | ||
---|---|---|
17 | 17 |
List<DivHelpContent> findByPortalAndIsActive(String portalId, boolean isActive); |
18 | 18 |
List<DivHelpContent> findByDivIdAndIsActive(String divId, boolean isActive); |
19 | 19 |
List<DivHelpContent> findByPortalAndDivIdAndIsActive(String portalId, String divId, boolean isActive); |
20 |
List<DivHelpContent> findByPortalAndPage(String portalId, String page); |
|
20 |
// List<DivHelpContent> findByPortalAndPage(String portalId, String page);
|
|
21 | 21 |
|
22 | 22 |
DivHelpContent findById(String Id); |
23 | 23 |
|
modules/uoa-admin-tools-library/trunk/src/main/java/eu/dnetlib/uoaadmintoolslibrary/services/DivHelpContentService.java | ||
---|---|---|
12 | 12 |
import org.springframework.stereotype.Service; |
13 | 13 |
|
14 | 14 |
import java.util.ArrayList; |
15 |
import java.util.Iterator; |
|
15 | 16 |
import java.util.List; |
16 | 17 |
|
17 | 18 |
@Service |
... | ... | |
104 | 105 |
} |
105 | 106 |
} |
106 | 107 |
|
107 |
if(pid != null && pageId != null) { |
|
108 |
divHelpContents = divHelpContentDAO.findByPortalAndPage(portalId, pageId); |
|
109 |
} else if(pid != null) { |
|
108 |
if(pid != null) { |
|
110 | 109 |
divHelpContents = divHelpContentDAO.findByPortal(portalId); |
111 | 110 |
} else { |
112 | 111 |
divHelpContents = divHelpContentDAO.findAll(); |
113 | 112 |
} |
114 | 113 |
|
114 |
if(pageId != null) { |
|
115 |
Iterator<DivHelpContent> divHelpContentsIterator = divHelpContents.iterator(); |
|
116 |
while (divHelpContentsIterator.hasNext()) { |
|
117 |
DivHelpContent divHelpContent = divHelpContentsIterator.next(); |
|
118 |
|
|
119 |
String divIdId = divHelpContent.getDivId(); |
|
120 |
DivId divId = divIdService.getDivId(divIdId); |
|
121 |
|
|
122 |
Boolean remove = true; |
|
123 |
for (String pageIdInDivId : divId.getPages()) { |
|
124 |
if (pageId.equals(pageIdInDivId)) { |
|
125 |
remove = false; |
|
126 |
break; |
|
127 |
} |
|
128 |
} |
|
129 |
if(remove) { |
|
130 |
divHelpContentsIterator.remove(); |
|
131 |
} |
|
132 |
} |
|
133 |
} |
|
134 |
|
|
115 | 135 |
return divHelpContents; |
116 | 136 |
} |
117 | 137 |
|
modules/uoa-admin-tools-library/trunk/src/main/java/eu/dnetlib/uoaadmintoolslibrary/controllers/AdminPortalRelationsController.java | ||
---|---|---|
200 | 200 |
public List<PortalPage> getPagesForPortalByType(@PathVariable PortalType portalType, |
201 | 201 |
@PathVariable(value = "pid") String pid, |
202 | 202 |
@RequestParam(value="page_type", required=false) String page_type, |
203 |
//@RequestParam(value="page_route", required=false) String page_route,
|
|
203 |
@RequestParam(value="page_route", required=false) String page_route, |
|
204 | 204 |
@RequestParam(value="div", required = false) String div, |
205 | 205 |
@RequestParam(value="with_positions", required = false) String with_positions) { |
206 |
return portalService.getPagesForPortalByType(pid, page_type, null, div, with_positions);
|
|
206 |
return portalService.getPagesForPortalByType(pid, page_type, page_route, div, with_positions);
|
|
207 | 207 |
} |
208 | 208 |
|
209 | 209 |
// not used by portals |
Also available in: Unified diff
[Trunk | Admin Tools Library]:
1. DivHelpContentDAO.java & MongoDBDivHelpContentDAO.java: [Bug fix] Remove method "findByPortalAndPage()" as there is no "page" field in "DivHelpContent" class.
2. DivHelpContentService.java: [Bug fix] In method "getDivHelpContentsBasic()" change the way parameter "pageId" is used to filter results - find page in "DivId" not "DivHelpContent".
3. AdminPortalRelationsController.java: In method "getPagesForPortalByType()" add again optional parameter "page_route".