[JBoss JIRA] Created: (GTNPORTAL-1179) Provide an option in NewPortalConfigListener allowing to override portal navigation metadata from the XML configuration files each time the server restarts
by Trong Tran (JIRA)
Provide an option in NewPortalConfigListener allowing to override portal navigation metadata from the XML configuration files each time the server restarts
-----------------------------------------------------------------------------------------------------------------------------------------------------------
Key: GTNPORTAL-1179
URL: https://jira.jboss.org/jira/browse/GTNPORTAL-1179
Project: GateIn Portal
Issue Type: Task
Security Level: Public (Everyone can see)
Affects Versions: 3.0.0-GA
Reporter: Trong Tran
Assignee: Trong Tran
This is a very useful feature for developpement because it allows to change portal navigation without dumping the whole JCR. It dramatically shortcuts the developpement/deploy cycle.
The logic contained within the ExtendedPortalConfigListener can be merged in the NewPortalConfigListener also.
{code}
public class ExtendedPortalConfigListener extends NewPortalConfigListener {
private UserPortalConfigService portalConfigService;
List<NewPortalConfig> configs;
boolean override;
@SuppressWarnings("unchecked")
public ExtendedPortalConfigListener(UserPortalConfigService portalConfigService, DataStorage pdcService,
ConfigurationManager cmanager, InitParams params) throws Exception {
super(pdcService, cmanager, params);
this.portalConfigService = portalConfigService;
configs = params.getObjectParamValues(NewPortalConfig.class);
ValueParam param = params.getValueParam("override");
if (param != null) {
override = Boolean.parseBoolean(param.getValue());
}
}
@Override
public void run() throws Exception {
if (override) {
for (NewPortalConfig config : configs) {
Set<String> users = config.getPredefinedOwner();
for (String user : users) {
try {
portalConfigService.removeUserPortalConfig(user);
} catch (Exception e) {
System.err.println(e.getMessage());
}
}
}
}
super.run();
}
}
{code}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years, 5 months
[JBoss JIRA] Created: (GTNPORTAL-1110) Optimize recursive method in searching node
by Minh Hoang TO (JIRA)
Optimize recursive method in searching node
-------------------------------------------
Key: GTNPORTAL-1110
URL: https://jira.jboss.org/jira/browse/GTNPORTAL-1110
Project: GateIn Portal
Issue Type: Task
Reporter: Minh Hoang TO
Assignee: Minh Hoang TO
Priority: Minor
public static PageNode[] searchPageNodesByUri(PageNode node, String uri)
{
if (node.getUri().equals(uri))
return new PageNode[]{null, node};
if (node.getChildren() == null)
return null;
List<PageNode> children = node.getChildren();
for (PageNode ele : children)
{
PageNode[] returnNodes = searchPageNodesByUri(ele, uri);
if (returnNodes != null)
{
if (returnNodes[0] == null)
returnNodes[0] = node;
return returnNodes;
}
}
return null;
}
I see that this method (in PageNavigationUtils ) has been used quite oftenly, but it's not optimal in term of algorithm. Searching a node under a tree with a given path ( array of String parsed as argument, or created by splitting the node uri ) is faster.
Consider an example where we need to find the node /a/b/c/x/y/z in the navigation N. Assume that in the navigation N there is also the nodes
/a/b1/c1/...
/a/b2/c2/...
/a/b3/c3/...
.....
/a/b/c/x/y/z
The current naive uri comparing will force us to make the comparision in all nodes in branches /a/b1 , /a/b2,....
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years, 5 months