ref 12119:AccountingDashboard - Create a new Accounting Dashboard

https://support.d4science.org/issues/12119

Updated Tree

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/accounting-dashboard@169714 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2018-07-09 13:00:51 +00:00
parent bc89cfa1de
commit 4dc461cfac
5 changed files with 17 additions and 6 deletions

10
pom.xml
View File

@ -225,6 +225,8 @@
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<!-- Authorization --> <!-- Authorization -->
<dependency> <dependency>
<groupId>org.gcube.common</groupId> <groupId>org.gcube.common</groupId>
@ -252,6 +254,14 @@
<version>[0.0.1-SNAPSHOT,2.0.0-SNAPSHOT)</version> <version>[0.0.1-SNAPSHOT,2.0.0-SNAPSHOT)</version>
</dependency> </dependency>
<!-- Portal Service -->
<dependency>
<groupId>com.liferay.portal</groupId>
<artifactId>portal-service</artifactId>
<scope>provided</scope>
</dependency>
<!-- LOGGING --> <!-- LOGGING -->
<dependency> <dependency>
<groupId>com.allen-sauer.gwt.log</groupId> <groupId>com.allen-sauer.gwt.log</groupId>

View File

@ -67,7 +67,7 @@ public class AccountingDashboardServiceImpl extends RemoteServiceServlet impleme
@SuppressWarnings("unused") @SuppressWarnings("unused")
ServiceCredentials serviceCredentials = SessionUtil.getServiceCredentials(this.getThreadLocalRequest()); ServiceCredentials serviceCredentials = SessionUtil.getServiceCredentials(this.getThreadLocalRequest());
AccountingService as = new AccountingService(AccountingServiceType.PortalContex); AccountingService as = new AccountingService(AccountingServiceType.PortalContex);
ScopeData scopeData = as.getTree(); ScopeData scopeData = as.getTree(this.getThreadLocalRequest());
return scopeData; return scopeData;
} catch (ServiceException e) { } catch (ServiceException e) {

View File

@ -2,6 +2,8 @@ package org.gcube.portlets.user.accountingdashboard.server.accounting;
import java.util.ArrayList; import java.util.ArrayList;
import javax.servlet.http.HttpServletRequest;
import org.gcube.data.access.accounting.summary.access.AccountingDao; import org.gcube.data.access.accounting.summary.access.AccountingDao;
import org.gcube.data.access.accounting.summary.access.model.ScopeDescriptor; import org.gcube.data.access.accounting.summary.access.model.ScopeDescriptor;
import org.gcube.portlets.user.accountingdashboard.shared.data.ScopeData; import org.gcube.portlets.user.accountingdashboard.shared.data.ScopeData;
@ -48,10 +50,10 @@ public class AccountingService {
} }
public ScopeData getTree() throws ServiceException { public ScopeData getTree(HttpServletRequest httpServletRequest) throws ServiceException {
try { try {
logger.debug("AccountingService GetTree()"); logger.debug("AccountingService GetTree()");
ScopeDescriptor scopeDescriptor = dao.getTree(null); ScopeDescriptor scopeDescriptor = dao.getTree(httpServletRequest);
logger.debug("ScopeDescriptor: " + scopeDescriptor); logger.debug("ScopeDescriptor: " + scopeDescriptor);
ScopeData scopeData = getScopeData(scopeDescriptor); ScopeData scopeData = getScopeData(scopeDescriptor);
return scopeData; return scopeData;

View File

@ -14,8 +14,6 @@ import org.gcube.common.portal.PortalContext;
import org.gcube.data.access.accounting.summary.access.impl.ContextTreeProvider; import org.gcube.data.access.accounting.summary.access.impl.ContextTreeProvider;
import org.gcube.data.access.accounting.summary.access.model.ScopeDescriptor; import org.gcube.data.access.accounting.summary.access.model.ScopeDescriptor;
import org.gcube.vomanagement.usermanagement.GroupManager; import org.gcube.vomanagement.usermanagement.GroupManager;
import org.gcube.vomanagement.usermanagement.exception.GroupRetrievalFault;
import org.gcube.vomanagement.usermanagement.exception.UserManagementSystemException;
import org.gcube.vomanagement.usermanagement.impl.LiferayGroupManager; import org.gcube.vomanagement.usermanagement.impl.LiferayGroupManager;
import org.gcube.vomanagement.usermanagement.model.GCubeGroup; import org.gcube.vomanagement.usermanagement.model.GCubeGroup;
import org.gcube.vomanagement.usermanagement.model.GCubeUser; import org.gcube.vomanagement.usermanagement.model.GCubeUser;
@ -113,6 +111,7 @@ public class PortalContextTreeProvider implements ContextTreeProvider {
} }
PortalContext pContext = PortalContext.getConfiguration(); PortalContext pContext = PortalContext.getConfiguration();
@SuppressWarnings("unused")
List<GCubeGroup> currUserGroups = new ArrayList<GCubeGroup>(); List<GCubeGroup> currUserGroups = new ArrayList<GCubeGroup>();
GCubeUser currUser = pContext.getCurrentUser(request); GCubeUser currUser = pContext.getCurrentUser(request);
if (currUser != null) { if (currUser != null) {

View File

@ -28,7 +28,7 @@ public class AccountingServiceTest extends TestCase {
try { try {
AuthTest.setToken(); AuthTest.setToken();
AccountingService accountingService = new AccountingService(AccountingServiceType.CurrentScope); AccountingService accountingService = new AccountingService(AccountingServiceType.CurrentScope);
accountingService.getTree(); //accountingService.getTree();
assertTrue("Success", true); assertTrue("Success", true);
} catch (Throwable e) { } catch (Throwable e) {