Compare commits
No commits in common. "e777db3382e935871d773c84f4960c8f023094cb" and "6f1988df6ec584e8ca3d3032a2e112cb01124257" have entirely different histories.
e777db3382
...
6f1988df6e
|
@ -1,46 +1,40 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<wb-module deploy-name="PerformFISH-Apps-portlet">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
|
||||
|
||||
|
||||
<dependent-module archiveName="storagehub-client-wrapper-1.1.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/storagehub-client-wrapper/storagehub-client-wrapper">
|
||||
<dependency-type>uses</dependency-type>
|
||||
</dependent-module>
|
||||
|
||||
|
||||
|
||||
<property name="java-output-path" value="/PerformFISH-Apps/target/classes"/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<property name="context-root" value="PerformFISH-Apps-portlet"/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</wb-module>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</project-modules>
|
||||
|
|
|
@ -3,16 +3,9 @@
|
|||
All notable changes to this project will be documented in this file.
|
||||
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
|
||||
## [v1-5-0] - 2022-02-01
|
||||
|
||||
- Feature #21319 revised and ported to the new auth framework
|
||||
|
||||
- New creations and removal of companies is not allowed in this new version.
|
||||
|
||||
## [v1-4-0] - 2021-06-14
|
||||
|
||||
- [Feature #21319] (https://support.d4science.org/issues/21319) Removed Home Library dependency and Ported to StorageHub
|
||||
- [Feature #21319](https://support.d4science.org/issues/21319) Removed Home Library dependency and Ported to StorageHub
|
||||
|
||||
## [v1-3-1] - 2019-10-09
|
||||
|
||||
|
|
16
pom.xml
16
pom.xml
|
@ -14,7 +14,7 @@
|
|||
<artifactId>PerformFISH-Apps-portlet</artifactId>
|
||||
<packaging>war</packaging>
|
||||
<name>PerformFISH-Apps Portlet</name>
|
||||
<version>1.5.0-SNAPSHOT</version>
|
||||
<version>1.4.0</version>
|
||||
<description>
|
||||
PerformFISH Apps is a set of portlet for the implementation of the Form Submission useful to calculate KPIs
|
||||
</description>
|
||||
|
@ -40,23 +40,13 @@
|
|||
<dependency>
|
||||
<groupId>org.gcube.distribution</groupId>
|
||||
<artifactId>maven-portal-bom</artifactId>
|
||||
<version>3.6.3-SNAPSHOT</version>
|
||||
<version>3.6.2</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.gcube.portal</groupId>
|
||||
<artifactId>oidc-library-portal</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.gcube.common</groupId>
|
||||
<artifactId>oidc-library</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.gcube.common</groupId>
|
||||
<artifactId>storagehub-client-wrapper</artifactId>
|
||||
|
@ -106,7 +96,7 @@
|
|||
<dependency>
|
||||
<groupId>org.gcube.common</groupId>
|
||||
<artifactId>storagehub-client-library</artifactId>
|
||||
<!-- <version>1.2.2</version> -->
|
||||
<!-- <version>1.2.2</version> -->
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.gcube.common</groupId>
|
||||
|
|
|
@ -14,7 +14,6 @@ import javax.portlet.PortletRequestDispatcher;
|
|||
import javax.portlet.RenderRequest;
|
||||
import javax.portlet.RenderResponse;
|
||||
|
||||
import org.gcube.common.storagehub.model.items.SharedFolder;
|
||||
import org.gcube.common.storagehubwrapper.server.tohl.Workspace;
|
||||
import org.gcube.common.storagehubwrapper.shared.ACLType;
|
||||
import org.gcube.common.storagehubwrapper.shared.tohl.WorkspaceFolder;
|
||||
|
@ -83,11 +82,9 @@ public class AssociateUsersToCompany extends MVCPortlet {
|
|||
LiferayRoleManager rm = new LiferayRoleManager();
|
||||
LiferayUserManager um = new LiferayUserManager();
|
||||
GCubeTeam team = rm.getTeam(teamId);
|
||||
Utils utils = new Utils(currentUsername, context, actionRequest);
|
||||
SharedFolder theCompanyFolder = utils.getWSCompanyFolder(team, actionRequest);
|
||||
WorkspaceFolder wsFolder = (WorkspaceFolder) utils.getWS().getItem(theCompanyFolder.getId());
|
||||
WorkspaceFolder wsFolder = Utils.getWSCompanyFolder(currentUsername, context, team);
|
||||
if (wsFolder.isShared()) {
|
||||
Workspace ws = utils.getWS();
|
||||
Workspace ws = Utils.getWS(currentUsername, context);
|
||||
WorkspaceSharedFolder sharedFolder = (WorkspaceSharedFolder) wsFolder;
|
||||
List<String> usersToShareWith = Arrays.asList(usernamesToAssociateToCompany);
|
||||
Set<String> usersSetToShareWith = new HashSet<>();
|
||||
|
|
|
@ -34,7 +34,6 @@ import javax.servlet.http.HttpServletRequest;
|
|||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.gcube.common.authorization.library.provider.AccessTokenProvider;
|
||||
import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
|
||||
import org.gcube.common.storagehub.client.StreamDescriptor;
|
||||
import org.gcube.common.storagehub.client.dsl.StorageHubClient;
|
||||
|
@ -47,8 +46,6 @@ import org.gcube.common.storagehubwrapper.shared.tohl.WorkspaceFolder;
|
|||
import org.gcube.common.storagehubwrapper.shared.tohl.WorkspaceItem;
|
||||
import org.gcube.common.storagehubwrapper.shared.tohl.impl.WorkspaceFileVersion;
|
||||
import org.gcube.common.storagehubwrapper.shared.tohl.items.FileItem;
|
||||
import org.gcube.oidc.rest.JWTToken;
|
||||
import org.gcube.portal.oidc.lr62.OIDCUmaUtil;
|
||||
import org.gcube.portlets.user.performfish.bean.PublishAnonymisedJob;
|
||||
import org.gcube.portlets.user.performfish.bean.SubmittedForm;
|
||||
import org.gcube.portlets.user.performfish.util.ImportedBatchChecker;
|
||||
|
@ -120,12 +117,13 @@ public class CompanyFarmRepository extends MVCPortlet {
|
|||
|
||||
String context = Utils.getCurrentContext(request);
|
||||
String username = Utils.getCurrentUser(request).getUsername();
|
||||
Utils utils = new Utils(username, context, request);
|
||||
|
||||
if (theFarm != null ) {
|
||||
if (theFarm != null ) {
|
||||
//check folder exists
|
||||
WorkspaceFolder sharedFolder = utils.getWSFarmFolder(theCompany, theFarm);
|
||||
Workspace ws = utils.getWS();
|
||||
WorkspaceFolder sharedFolder = Utils.getWSFarmFolder(
|
||||
username,
|
||||
context,
|
||||
theCompany, theFarm);
|
||||
Workspace ws = Utils.getWS(username, context);
|
||||
List<? extends WorkspaceItem> companyFiles = ws.getChildren(sharedFolder.getId(), true);
|
||||
|
||||
Collections.sort(companyFiles, new WSItemComparator());
|
||||
|
@ -249,8 +247,7 @@ public class CompanyFarmRepository extends MVCPortlet {
|
|||
HttpServletRequest httpReq = PortalUtil.getHttpServletRequest(request);
|
||||
GCubeUser currentUser = Utils.getCurrentUser(httpReq);
|
||||
String context = Utils.getCurrentContext(httpReq);
|
||||
Utils utils = new Utils(currentUser.getUsername(), context, request);
|
||||
Workspace ws = utils.getWS() ;
|
||||
Workspace ws = Utils.getWS(currentUser.getUsername(), context) ;
|
||||
WorkspaceItem theItem = ws.getItem(itemId);
|
||||
if (theItem instanceof FileItem) {
|
||||
FileItem file = (FileItem) theItem;
|
||||
|
@ -296,8 +293,7 @@ public class CompanyFarmRepository extends MVCPortlet {
|
|||
else if (versionDownloadItemId != null && versionDownloadName != null) { //check if download version
|
||||
GCubeUser currentUser = Utils.getCurrentUser(resourceRequest);
|
||||
String context = Utils.getCurrentContext(resourceRequest);
|
||||
Utils utils = new Utils(currentUser.getUsername(), context, resourceRequest);
|
||||
Workspace ws = utils.getWS();
|
||||
Workspace ws = Utils.getWS(currentUser.getUsername(), context) ;
|
||||
WorkspaceItem theItem;
|
||||
try {
|
||||
theItem = ws.getItem(versionDownloadItemId);
|
||||
|
|
|
@ -70,8 +70,7 @@ public class CompanyPrivateRepository extends MVCPortlet {
|
|||
GCubeUser currentUser = Utils.getCurrentUser(request);
|
||||
RoleManager rm = new LiferayRoleManager();
|
||||
//check folder exists
|
||||
Utils utils = new Utils(currentUser.getUsername(), currentContext, request);
|
||||
utils.getWSCompanyFolder(theCompany, request);
|
||||
Utils.getWSCompanyFolder(currentUser.getUsername(), currentContext, theCompany);
|
||||
//look for company farms
|
||||
Connection conn = DatabaseConnection.getInstance(Utils.getCurrentContext(groupId)).getConnection();
|
||||
List<Farm> companyFarms = DBUtil.listFarmsByCompanyId(conn, theCompany.getTeamId());
|
||||
|
@ -79,8 +78,11 @@ public class CompanyPrivateRepository extends MVCPortlet {
|
|||
for (Farm farm : companyFarms) {
|
||||
GCubeTeam theFarm = rm.getTeam(farm.getFarmId());
|
||||
farm.setName(theFarm.getTeamName());
|
||||
Workspace ws = utils.getWS() ;
|
||||
WorkspaceFolder farmFolder = utils.getWSFarmFolder(theCompany, theFarm);
|
||||
Workspace ws = Utils.getWS(currentUser.getUsername(), currentContext) ;
|
||||
WorkspaceFolder farmFolder = Utils.getWSFarmFolder(
|
||||
currentUser.getUsername(),
|
||||
currentContext,
|
||||
theCompany, theFarm);
|
||||
List<? extends WorkspaceItem> farmItems = ws.getChildren(farmFolder.getId(), true);
|
||||
Collections.sort(farmItems, new WSItemComparator());
|
||||
List<FileItem> farmFiles = new ArrayList<>();
|
||||
|
@ -117,8 +119,7 @@ public class CompanyPrivateRepository extends MVCPortlet {
|
|||
HttpServletRequest httpReq = PortalUtil.getHttpServletRequest(request);
|
||||
GCubeUser currentUser = Utils.getCurrentUser(httpReq);
|
||||
String context = Utils.getCurrentContext(httpReq);
|
||||
Utils utils = new Utils(currentUser.getUsername(), context, request);
|
||||
Workspace ws = utils.getWS() ;
|
||||
Workspace ws = Utils.getWS(currentUser.getUsername(), context) ;
|
||||
WorkspaceItem theItem = ws.getItem(itemId);
|
||||
if (theItem instanceof FileItem) {
|
||||
FileItem file = (FileItem) theItem;
|
||||
|
@ -159,8 +160,7 @@ public class CompanyPrivateRepository extends MVCPortlet {
|
|||
else if (versionDownloadItemId != null && versionDownloadName != null) { //check if download version
|
||||
GCubeUser currentUser = Utils.getCurrentUser(resourceRequest);
|
||||
String context = Utils.getCurrentContext(resourceRequest);
|
||||
Utils utils = new Utils(currentUser.getUsername(), context, resourceRequest);
|
||||
Workspace ws = utils.getWS() ;
|
||||
Workspace ws = Utils.getWS(currentUser.getUsername(), context) ;
|
||||
WorkspaceItem theItem;
|
||||
try {
|
||||
theItem = ws.getItem(versionDownloadItemId);
|
||||
|
|
|
@ -89,8 +89,7 @@ public class EmptyFormsDocumentsDisplay extends MVCPortlet {
|
|||
if (folderId != null && !folderId.equals("")) {
|
||||
String context = Utils.getCurrentContext(request);
|
||||
String username = Utils.getCurrentUser(request).getUsername();
|
||||
Utils utils = new Utils(username, context, request);
|
||||
Workspace ws = utils.getWS() ;
|
||||
Workspace ws = Utils.getWS(username, context) ;
|
||||
String selectedPhase = GetterUtil.getString(portletPreferences.getValue(PFISHConstants.PHASE_PREFERENCE_ATTR_NAME, StringPool.BLANK));
|
||||
//in theChildren expected to find 3 subfolders: Utils.SHOW_HATCHERY, SHOW_PRE_ONGROWING ..
|
||||
|
||||
|
@ -156,8 +155,7 @@ public class EmptyFormsDocumentsDisplay extends MVCPortlet {
|
|||
String authorizationToken = Utils.getCurrentUserToken(context, username );
|
||||
SecurityTokenProvider.instance.set(authorizationToken);
|
||||
ScopeProvider.instance.set(context);
|
||||
Utils utils = new Utils(username, context, resourceRequest);
|
||||
Workspace workspace = utils.getWS() ;
|
||||
Workspace workspace = Utils.getWS(username, context) ;
|
||||
String wsItemId = uploadToUserWorkspace(workspace, fileName, contentType, new ByteArrayInputStream(FileUtil.getBytes(multipartFile)));
|
||||
|
||||
String toReturn = workspace.getPublicLinkForFile(wsItemId).toString();
|
||||
|
@ -174,8 +172,7 @@ public class EmptyFormsDocumentsDisplay extends MVCPortlet {
|
|||
//if download file
|
||||
String fileToDownloadId = ParamUtil.getString(resourceRequest, "fileToDownloadId", null);
|
||||
String context = Utils.getCurrentContext(resourceRequest);
|
||||
Utils utils = new Utils("guest", context, resourceRequest);
|
||||
Workspace ws = utils.getWS() ;
|
||||
Workspace ws = Utils.getWS("guest", context) ;
|
||||
WorkspaceItem theItem;
|
||||
try {
|
||||
theItem = ws.getItem(fileToDownloadId);
|
||||
|
|
|
@ -41,9 +41,8 @@ public class ManageCompanyAdmins extends MVCPortlet {
|
|||
request.setAttribute("theTeam", TeamLocalServiceUtil.getTeam(theTeam.getTeamId()));
|
||||
RoleManager rm = new LiferayRoleManager();
|
||||
if (theTeam != null && Utils.isCompanyAdmin(Utils.getCurrentUser(request), groupId, theTeam)) { //check is Admin
|
||||
// //check folder exists
|
||||
// Utils utils = new Utils(Utils.getCurrentUser(request).getUsername(), Utils.getCurrentContext(request));
|
||||
// utils.getWSCompanyFolder(theTeam);
|
||||
//check folder exists
|
||||
Utils.getWSCompanyFolder(Utils.getCurrentUser(request).getUsername(), Utils.getCurrentContext(request), theTeam);
|
||||
|
||||
List<CompanyMember> companyAdmins = Utils.getCompanyAdminTeamMembers(theTeam.getTeamId(), theTeam.getGroupId());
|
||||
for (CompanyMember member : companyAdmins) { //anonymising email
|
||||
|
|
|
@ -13,7 +13,6 @@ import javax.portlet.PortletRequestDispatcher;
|
|||
import javax.portlet.RenderRequest;
|
||||
import javax.portlet.RenderResponse;
|
||||
|
||||
import org.gcube.common.storagehub.model.items.SharedFolder;
|
||||
import org.gcube.common.storagehubwrapper.server.tohl.Workspace;
|
||||
import org.gcube.common.storagehubwrapper.shared.tohl.WorkspaceFolder;
|
||||
import org.gcube.common.storagehubwrapper.shared.tohl.WorkspaceSharedFolder;
|
||||
|
@ -51,9 +50,8 @@ public class ManageCompanyUsers extends MVCPortlet {
|
|||
request.setAttribute("theTeam", TeamLocalServiceUtil.getTeam(theTeam.getTeamId()));
|
||||
RoleManager rm = new LiferayRoleManager();
|
||||
if (theTeam != null && Utils.isCompanyAdmin(Utils.getCurrentUser(request), groupId, theTeam)) { //check is Admin
|
||||
// //check folder exists
|
||||
// Utils utils = new Utils(Utils.getCurrentUser(request).getUsername(), Utils.getCurrentContext(request));
|
||||
// utils.getWSCompanyFolder(theTeam);
|
||||
//check folder exists
|
||||
Utils.getWSCompanyFolder(Utils.getCurrentUser(request).getUsername(), Utils.getCurrentContext(request), theTeam);
|
||||
List<CompanyMember> companyMembers = Utils.getRegularCompanyMembers(theTeam.getTeamId(), theTeam.getGroupId());
|
||||
for (CompanyMember member : companyMembers) { //anonymising email
|
||||
member.setEmail(member.getUser().getEmail());
|
||||
|
@ -87,43 +85,40 @@ public class ManageCompanyUsers extends MVCPortlet {
|
|||
*/
|
||||
public void removeCompanUsers(ActionRequest actionRequest,ActionResponse actionResponse) throws Exception {
|
||||
try {
|
||||
// String[] usernamesToRemoveFromCompany = ParamUtil.getParameterValues(actionRequest, "removeUserIds");
|
||||
// long teamId = ParamUtil.getLong(actionRequest, "teamId");
|
||||
// String currentUsername = ParamUtil.getString(actionRequest, "currentUsername");
|
||||
// long currentGroupId = ParamUtil.getLong(actionRequest, "currentGroupId");
|
||||
// String context = Utils.getCurrentContext(currentGroupId);
|
||||
// _log.info(currentUsername + " has requested the deletion of some user(s) from company having id="+teamId + " in context="+context);
|
||||
// LiferayRoleManager rm = new LiferayRoleManager();
|
||||
// LiferayUserManager um = new LiferayUserManager();
|
||||
// GCubeTeam team = rm.getTeam(teamId);
|
||||
// Utils utils = new Utils(currentUsername, context, actionRequest);
|
||||
// SharedFolder theCompanyFolder = utils.getWSCompanyFolder(team, actionRequest);
|
||||
// WorkspaceFolder wsFolder = (WorkspaceFolder) utils.getWS().getItem(theCompanyFolder.getId());
|
||||
//
|
||||
// if (wsFolder.isShared()) {
|
||||
// WorkspaceSharedFolder sharedFolder = (WorkspaceSharedFolder) wsFolder;
|
||||
// Workspace ws = utils.getWS();
|
||||
// for (int i = 0; i < usernamesToRemoveFromCompany.length; i++) {
|
||||
// _log.info("Unsharing user =>"+usernamesToRemoveFromCompany[i]);
|
||||
// Set<String> userNamesToUnshare = new HashSet<>();
|
||||
// userNamesToUnshare.add(usernamesToRemoveFromCompany[i]);
|
||||
// ws.unshareFolder(sharedFolder.getId(), userNamesToUnshare);
|
||||
// _log.info("Unsharing OK removing user from team =>"+usernamesToRemoveFromCompany[i]);
|
||||
// long userId = um.getUserByUsername(usernamesToRemoveFromCompany[i]).getUserId();
|
||||
// TeamLocalServiceUtil.deleteUserTeam(userId, team.getTeamId());
|
||||
// List<Farm> thePossibleFarms = Utils.getFarmsByUserId(userId, teamId, currentGroupId);
|
||||
// if (thePossibleFarms != null && !thePossibleFarms.isEmpty()) {
|
||||
// for (Farm farm : thePossibleFarms) {
|
||||
// removeFromFarm(farm.getFarmId(), currentGroupId, userId);
|
||||
// }
|
||||
// }
|
||||
// _log.info("removing user from team Done");
|
||||
// }
|
||||
// }
|
||||
// else {
|
||||
// SessionErrors.add(actionRequest.getPortletSession(), "operation-error");
|
||||
// actionResponse.setRenderParameter("mvcPath", "/html/error_pages/operation-error.jsp");
|
||||
// }
|
||||
String[] usernamesToRemoveFromCompany = ParamUtil.getParameterValues(actionRequest, "removeUserIds");
|
||||
long teamId = ParamUtil.getLong(actionRequest, "teamId");
|
||||
String currentUsername = ParamUtil.getString(actionRequest, "currentUsername");
|
||||
long currentGroupId = ParamUtil.getLong(actionRequest, "currentGroupId");
|
||||
String context = Utils.getCurrentContext(currentGroupId);
|
||||
_log.info(currentUsername + " has requested the deletion of some user(s) from company having id="+teamId + " in context="+context);
|
||||
LiferayRoleManager rm = new LiferayRoleManager();
|
||||
LiferayUserManager um = new LiferayUserManager();
|
||||
GCubeTeam team = rm.getTeam(teamId);
|
||||
WorkspaceFolder wsFolder = Utils.getWSCompanyFolder(currentUsername, context, team);
|
||||
if (wsFolder.isShared()) {
|
||||
WorkspaceSharedFolder sharedFolder = (WorkspaceSharedFolder) wsFolder;
|
||||
Workspace ws = Utils.getWS(currentUsername, context);
|
||||
for (int i = 0; i < usernamesToRemoveFromCompany.length; i++) {
|
||||
_log.info("Unsharing user =>"+usernamesToRemoveFromCompany[i]);
|
||||
Set<String> userNamesToUnshare = new HashSet<>();
|
||||
userNamesToUnshare.add(usernamesToRemoveFromCompany[i]);
|
||||
ws.unshareFolder(sharedFolder.getId(), userNamesToUnshare);
|
||||
_log.info("Unsharing OK removing user from team =>"+usernamesToRemoveFromCompany[i]);
|
||||
long userId = um.getUserByUsername(usernamesToRemoveFromCompany[i]).getUserId();
|
||||
TeamLocalServiceUtil.deleteUserTeam(userId, team.getTeamId());
|
||||
List<Farm> thePossibleFarms = Utils.getFarmsByUserId(userId, teamId, currentGroupId);
|
||||
if (thePossibleFarms != null && !thePossibleFarms.isEmpty()) {
|
||||
for (Farm farm : thePossibleFarms) {
|
||||
removeFromFarm(farm.getFarmId(), currentGroupId, userId);
|
||||
}
|
||||
}
|
||||
_log.info("removing user from team Done");
|
||||
}
|
||||
}
|
||||
else {
|
||||
SessionErrors.add(actionRequest.getPortletSession(), "operation-error");
|
||||
actionResponse.setRenderParameter("mvcPath", "/html/error_pages/operation-error.jsp");
|
||||
}
|
||||
}
|
||||
catch (Exception e) {
|
||||
SessionErrors.add(actionRequest.getPortletSession(),"operation-error");
|
||||
|
|
|
@ -72,9 +72,8 @@ public class ManageFarmAdministrators extends MVCPortlet {
|
|||
if (theCompany != null && Utils.isFarmAdmin(Utils.getCurrentUser(request), groupId, theCompany)) { //check is Admin
|
||||
Boolean isCompanyAdministrator = Utils.isCompanyAdmin(Utils.getCurrentUser(request), groupId, theCompany);
|
||||
request.setAttribute("isCompanyAdministrator", isCompanyAdministrator);
|
||||
// //check folder exists
|
||||
// Utils utils = new Utils(Utils.getCurrentUser(request).getUsername(), Utils.getCurrentContext(request));
|
||||
// utils.getWSCompanyFolder(theCompany);
|
||||
//check folder exists
|
||||
Utils.getWSCompanyFolder(Utils.getCurrentUser(request).getUsername(), Utils.getCurrentContext(request), theCompany);
|
||||
|
||||
List<GCubeUser> farmAdmins = Utils.getFarmAdminTeamMembers(theCompany, theFarm);
|
||||
request.setAttribute("farmAdmins", farmAdmins); //pass to the JSP
|
||||
|
|
|
@ -72,8 +72,7 @@ public class ManageFarmUsers extends MVCPortlet {
|
|||
if (theFarm != null && Utils.isFarmAdmin(Utils.getCurrentUser(request), groupId, theFarm)) { //check is Admin
|
||||
request.setAttribute("theFarm", TeamLocalServiceUtil.getTeam(theFarm.getTeamId()));
|
||||
//check folder exists
|
||||
Utils utils = new Utils(Utils.getCurrentUser(request).getUsername(), Utils.getCurrentContext(request), request);
|
||||
utils.getWSCompanyFolder(theCompany, request);
|
||||
Utils.getWSCompanyFolder(Utils.getCurrentUser(request).getUsername(), Utils.getCurrentContext(request), theCompany);
|
||||
List<GCubeUser> farmMembers = Utils.getRegularFarmMembers(theFarm.getTeamId(), theFarm.getGroupId());
|
||||
for (GCubeUser member : farmMembers) { //anonymising email
|
||||
int n = member.getEmail().indexOf("@");
|
||||
|
|
|
@ -99,9 +99,8 @@ public class ManageFarms extends MVCPortlet {
|
|||
GCubeTeam theFarm = RM.getTeam(farmId);
|
||||
GCubeTeam theCompany = RM.getTeam(companyId);
|
||||
_log.info("Trying Delete Farm with name " + theFarm.getTeamName() + " of Company: " + theCompany.getTeamName());
|
||||
Utils utils = new Utils(username, context, actionRequest);
|
||||
WorkspaceFolder farmFolder = utils.getWSFarmFolder(theCompany, theFarm);
|
||||
utils.getWS().deleteItem(farmFolder.getId());
|
||||
WorkspaceFolder farmFolder = Utils.getWSFarmFolder(username, context, theCompany, theFarm);
|
||||
Utils.getWS(username, context).deleteItem(farmFolder.getId());
|
||||
_log.info(username + " Deleted Farm Folder with Id = "+farmId + " deleting farm row DB now ");
|
||||
boolean resultDeleteFarmDB = DBUtil.deleteFarm(conn, farmId);
|
||||
if (!resultDeleteFarmDB) {
|
||||
|
|
|
@ -39,9 +39,8 @@ public class PromoteCompanyAdministrators extends MVCPortlet {
|
|||
GCubeTeam theTeam = Utils.checkBelongingToOneCompanyOnly(request, response, this);
|
||||
request.setAttribute("theTeam", TeamLocalServiceUtil.getTeam(theTeam.getTeamId()));
|
||||
if (theTeam != null && Utils.isCompanyAdmin(Utils.getCurrentUser(request), groupId, theTeam)) { //check is Admin
|
||||
// //check folder exists
|
||||
// Utils utils = new Utils(Utils.getCurrentUser(request).getUsername(), Utils.getCurrentContext(request));
|
||||
// utils.getWSCompanyFolder(theTeam);
|
||||
//check folder exists
|
||||
Utils.getWSCompanyFolder(Utils.getCurrentUser(request).getUsername(), Utils.getCurrentContext(request), theTeam);
|
||||
|
||||
List<CompanyMember> companyAdmins = Utils.getCompanyAdminTeamMembers(theTeam.getTeamId(), theTeam.getGroupId());
|
||||
request.setAttribute("companyAdmins", companyAdmins); //pass to the JSP
|
||||
|
|
|
@ -51,9 +51,8 @@ public class PromoteFarmAdministrators extends MVCPortlet {
|
|||
theFarm = (GCubeTeam) request.getPortletSession().getAttribute("theFarm");
|
||||
}
|
||||
if (theFarm != null && Utils.isFarmAdmin(Utils.getCurrentUser(request), groupId, theFarm)) { //check is a Farm Admin
|
||||
// //check folder exists
|
||||
// Utils utils = new Utils(Utils.getCurrentUser(request).getUsername(), Utils.getCurrentContext(request));
|
||||
// utils.getWSCompanyFolder(theFarm);
|
||||
//check folder exists
|
||||
Utils.getWSCompanyFolder(Utils.getCurrentUser(request).getUsername(), Utils.getCurrentContext(request), theFarm);
|
||||
|
||||
List<GCubeUser> companyAdmins = Utils.getFarmAdminTeamMembers(theCompany, theFarm);
|
||||
request.setAttribute("companyAdmins", companyAdmins); //pass to the JSP
|
||||
|
|
|
@ -140,7 +140,7 @@ public class SubmittedFormValidation extends MVCPortlet {
|
|||
if (result.isSuccess()) {
|
||||
try {
|
||||
String decodedURL = new java.net.URI(inputFileLink).getPath();
|
||||
uploadToCompanyRepository(resourceRequest, username, context, companyId, farmId, fileName, new URL(decodedURL).openConnection().getInputStream());
|
||||
uploadToCompanyRepository(username, context, companyId, farmId, fileName, new URL(decodedURL).openConnection().getInputStream());
|
||||
Connection conn = DatabaseConnection.getInstance(Utils.getCurrentContext(groupId)).getConnection();
|
||||
java.sql.Date lastActivity = new java.sql.Date(new Date().getTime());
|
||||
DBUtil.updateFarmLastSubmissionActivity(conn, farmId, lastActivity);
|
||||
|
@ -155,13 +155,11 @@ public class SubmittedFormValidation extends MVCPortlet {
|
|||
resourceResponse.getWriter().println(fileObject);
|
||||
}
|
||||
|
||||
private String uploadToCompanyRepository(ResourceRequest resourceRequest, String username, String context, long companyId, long farmId, String fileName, InputStream fileData) throws Exception {
|
||||
private String uploadToCompanyRepository(String username, String context, long companyId, long farmId, String fileName, InputStream fileData) throws Exception {
|
||||
GCubeTeam theCompany = new LiferayRoleManager().getTeam(companyId);
|
||||
GCubeTeam theFarm = new LiferayRoleManager().getTeam(farmId);
|
||||
//check folder exists
|
||||
Utils utils = new Utils(username, context, resourceRequest);
|
||||
Workspace ws = utils.getWS();
|
||||
WorkspaceFolder companyRepoFolder = utils.getWSFarmFolder(theCompany, theFarm);
|
||||
Workspace ws = Utils.getWS(username, context);
|
||||
WorkspaceFolder companyRepoFolder = Utils.getWSFarmFolder(username, context, theCompany, theFarm);
|
||||
String toReturn = "";
|
||||
WorkspaceItem item = ws.uploadFile(companyRepoFolder.getId(), fileData, fileName, "User form submission on " + new Date());
|
||||
//ExternalFile item = companyRepoFolder.createExternalFileItem(fileName, "User form submission on " + new Date(), XSLX_MIME, fileData);
|
||||
|
|
|
@ -17,7 +17,6 @@ import java.util.List;
|
|||
import java.util.Set;
|
||||
|
||||
import javax.portlet.PortletException;
|
||||
import javax.portlet.PortletRequest;
|
||||
import javax.portlet.PortletRequestDispatcher;
|
||||
import javax.portlet.RenderRequest;
|
||||
import javax.portlet.RenderResponse;
|
||||
|
@ -25,7 +24,6 @@ import javax.portlet.ResourceRequest;
|
|||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.gcube.common.authorization.client.exceptions.ObjectNotFound;
|
||||
import org.gcube.common.authorization.library.provider.AccessTokenProvider;
|
||||
import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
|
||||
import org.gcube.common.authorization.library.provider.UserInfo;
|
||||
import org.gcube.common.portal.PortalContext;
|
||||
|
@ -33,18 +31,11 @@ import org.gcube.common.resources.gcore.GCoreEndpoint;
|
|||
import org.gcube.common.resources.gcore.GCoreEndpoint.Profile.Endpoint;
|
||||
import org.gcube.common.resources.gcore.ServiceEndpoint;
|
||||
import org.gcube.common.scope.api.ScopeProvider;
|
||||
import org.gcube.common.storagehub.client.dsl.FolderContainer;
|
||||
import org.gcube.common.storagehub.client.dsl.StorageHubClient;
|
||||
import org.gcube.common.storagehub.model.items.Item;
|
||||
import org.gcube.common.storagehub.model.items.SharedFolder;
|
||||
import org.gcube.common.storagehubwrapper.server.StorageHubWrapper;
|
||||
import org.gcube.common.storagehubwrapper.server.tohl.Workspace;
|
||||
import org.gcube.common.storagehubwrapper.shared.ACLType;
|
||||
import org.gcube.common.storagehubwrapper.shared.tohl.WorkspaceFolder;
|
||||
import org.gcube.common.storagehubwrapper.shared.tohl.WorkspaceItem;
|
||||
import org.gcube.oidc.rest.JWTToken;
|
||||
import org.gcube.portal.oidc.lr62.JWTTokenUtil;
|
||||
import org.gcube.portal.oidc.lr62.OIDCUmaUtil;
|
||||
import org.gcube.portlets.user.performfish.bean.Association;
|
||||
import org.gcube.portlets.user.performfish.bean.Company;
|
||||
import org.gcube.portlets.user.performfish.bean.CompanyMember;
|
||||
|
@ -81,7 +72,7 @@ import com.liferay.util.bridges.mvc.MVCPortlet;
|
|||
*/
|
||||
public class Utils {
|
||||
private static Log _log = LogFactoryUtil.getLog(Utils.class);
|
||||
|
||||
|
||||
private static String SERVICE_ENDPOINT_CATEGORY = "DataAnalysis";
|
||||
private static String SERVICE_ENDPOINT_NAME = "DataMiner";
|
||||
public static final String ENCODED_FARM_PARAM = "ZmFybUlk";
|
||||
|
@ -103,133 +94,6 @@ public class Utils {
|
|||
private static UserManager UM = new LiferayUserManager();
|
||||
private static RoleManager RM = new LiferayRoleManager();
|
||||
|
||||
private String currentUsername;
|
||||
private String context;
|
||||
private StorageHubWrapper shubWrapper;
|
||||
private Workspace ws;
|
||||
private PortletRequest request;
|
||||
|
||||
public Utils(String currentUsername, String context, PortletRequest request) {
|
||||
super();
|
||||
this.currentUsername = currentUsername;
|
||||
this.context = context;
|
||||
this.request = request;
|
||||
String authorizationToken = PortalContext.getConfiguration().getCurrentUserToken(context, currentUsername);
|
||||
SecurityTokenProvider.instance.set(authorizationToken);
|
||||
ScopeProvider.instance.set(context);
|
||||
HttpServletRequest httpReq = PortalUtil.getOriginalServletRequest(PortalUtil.getHttpServletRequest(request));
|
||||
JWTToken umaToken = null;
|
||||
try {
|
||||
umaToken = OIDCUmaUtil.getUMAToken(httpReq, currentUsername, context);
|
||||
provideTokensInThreadlocal(umaToken);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
try {
|
||||
shubWrapper = new StorageHubWrapper(context, authorizationToken);
|
||||
ws = shubWrapper.getWorkspace();
|
||||
}
|
||||
catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static void provideTokensInThreadlocal(JWTToken umaToken) {
|
||||
_log.debug("Setting UMA token with jti in AccessToken provider: " + umaToken.getJti());
|
||||
AccessTokenProvider.instance.set(JWTTokenUtil.getAccessTokenString(umaToken));
|
||||
}
|
||||
|
||||
public Workspace getWS() {
|
||||
return ws;
|
||||
}
|
||||
/**
|
||||
* check whether the company folder exists and it creates it when not.
|
||||
* @param currentUsername
|
||||
* @param context
|
||||
* @return
|
||||
*/
|
||||
public SharedFolder getWSCompanyFolder(GCubeTeam team, PortletRequest request) {
|
||||
String username = currentUsername;
|
||||
String authorizationToken = PortalContext.getConfiguration().getCurrentUserToken(context, username);
|
||||
SecurityTokenProvider.instance.set(authorizationToken);
|
||||
ScopeProvider.instance.set(context);
|
||||
HttpServletRequest httpReq = PortalUtil.getOriginalServletRequest(PortalUtil.getHttpServletRequest(request));
|
||||
JWTToken umaToken = null;
|
||||
try {
|
||||
umaToken = OIDCUmaUtil.getUMAToken(httpReq, currentUsername, context);
|
||||
provideTokensInThreadlocal(umaToken);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
SharedFolder folder = null;
|
||||
String companyName = team.getTeamName();
|
||||
try {
|
||||
_log.info(companyName + " company folder exists, returning id and setting hidden?... " + PFISHConstants.HIDE_COMPANY_SHARED_FOLDER);
|
||||
String name2Look = companyName+PFISHConstants.COMPANY_WS_FOLDER_SUFFIX;
|
||||
StorageHubClient shClient = new StorageHubClient();
|
||||
FolderContainer rootFolder = shClient.getWSRoot();
|
||||
List<? extends Item> items = rootFolder.list().includeHidden().getItems();
|
||||
for (Item item : items) {
|
||||
if (item instanceof SharedFolder) {
|
||||
System.out.println("folder name:" + item.getTitle());
|
||||
if (item.getTitle().compareTo(name2Look) == 0) {
|
||||
return (SharedFolder) item;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
return folder;
|
||||
}
|
||||
|
||||
/**
|
||||
* check whether the farm folder exists and it creates it when not.
|
||||
* @param currentUsername
|
||||
* @param context
|
||||
* @return
|
||||
*/
|
||||
public WorkspaceFolder getWSFarmFolder(GCubeTeam company, GCubeTeam farm) {
|
||||
String username = currentUsername;
|
||||
String authorizationToken = PortalContext.getConfiguration().getCurrentUserToken(context, username);
|
||||
SecurityTokenProvider.instance.set(authorizationToken);
|
||||
ScopeProvider.instance.set(context);
|
||||
WorkspaceFolder folder = null;
|
||||
String companyName = company.getTeamName();
|
||||
try {
|
||||
SharedFolder theCompanyFolder = getWSCompanyFolder(company, request);
|
||||
String destinationFolderId = theCompanyFolder.getId();
|
||||
String name = Long.toString(farm.getTeamId()); //the farm folder is the unique id of the farm
|
||||
String description = new StringBuilder("Forms submitted by farm ")
|
||||
.append(farm.getTeamName())
|
||||
.append(" belonging to company ").append(companyName).toString();
|
||||
if (!ws.exists(name, destinationFolderId)) {
|
||||
_log.info(companyName + " farm folder does not exists, triggering creation ... ");
|
||||
folder = ws.createFolder(name, description, destinationFolderId);
|
||||
ws.setFolderAsHidden(folder.getId(), PFISHConstants.HIDE_COMPANY_SHARED_FOLDER);
|
||||
_log.info("Farm folder created succesfully for " + companyName);
|
||||
}
|
||||
else {
|
||||
_log.info(farm.getTeamName() + " farm folder exists, returning id ... ");
|
||||
SecurityTokenProvider.instance.set(authorizationToken);
|
||||
ScopeProvider.instance.set(context);
|
||||
List<WorkspaceItem> folders = ws.find(name, destinationFolderId);
|
||||
folder = (WorkspaceFolder) folders.get(0);
|
||||
ws.setFolderAsHidden(folder.getId(), PFISHConstants.HIDE_COMPANY_SHARED_FOLDER);
|
||||
_log.info(farm.getTeamName() + " farm folder id = " + folder.getId());
|
||||
}
|
||||
}
|
||||
catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
return folder;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* For being a Company admin in PerformFISHKPIs VRE you should have the Site Role defined in COMPANY_ADMIN_SITE_ROLE constant.
|
||||
|
@ -357,7 +221,7 @@ public class Utils {
|
|||
return null;
|
||||
} else
|
||||
return associationChecker.get(0);
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -434,7 +298,7 @@ public class Utils {
|
|||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static List<GCubeTeam> getUserFarms(RenderRequest request, RenderResponse response, MVCPortlet instance) throws PortletException, IOException {
|
||||
|
||||
GCubeUser currentUser = getCurrentUser(request);
|
||||
|
@ -822,6 +686,113 @@ public class Utils {
|
|||
return false;
|
||||
}
|
||||
|
||||
public static Workspace getWS(String currentUsername, String context) {
|
||||
String username = currentUsername;
|
||||
String authorizationToken = PortalContext.getConfiguration().getCurrentUserToken(context, username);
|
||||
SecurityTokenProvider.instance.set(authorizationToken);
|
||||
ScopeProvider.instance.set(context);
|
||||
try {
|
||||
StorageHubWrapper wrap = new StorageHubWrapper(context, authorizationToken);
|
||||
return wrap.getWorkspace();
|
||||
}
|
||||
catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* check whether the company folder exists and it creates it when not.
|
||||
* @param currentUsername
|
||||
* @param context
|
||||
* @return
|
||||
*/
|
||||
public static synchronized WorkspaceFolder getWSCompanyFolder(String currentUsername, String context, GCubeTeam team) {
|
||||
String username = currentUsername;
|
||||
String authorizationToken = PortalContext.getConfiguration().getCurrentUserToken(context, username);
|
||||
SecurityTokenProvider.instance.set(authorizationToken);
|
||||
ScopeProvider.instance.set(context);
|
||||
Workspace ws = null;
|
||||
WorkspaceFolder folder = null;
|
||||
String companyName = team.getTeamName();
|
||||
try {
|
||||
ws = getWS(username, context);
|
||||
String destinationFolderId = ws.getRoot().getId();
|
||||
String name = companyName+PFISHConstants.COMPANY_WS_FOLDER_SUFFIX;
|
||||
String description = "Data belonging to " + companyName;
|
||||
|
||||
if (!ws.exists(name, destinationFolderId)) {
|
||||
_log.info(companyName + " company folder does not exists, triggering creation ... ");
|
||||
folder = ws.createFolder(name, description, destinationFolderId);
|
||||
String folderId = folder.getId();
|
||||
ws.setFolderAsHidden(folderId, PFISHConstants.HIDE_COMPANY_SHARED_FOLDER);
|
||||
_log.info("Company folder created succesfully for " + companyName + " adding other company users (if any)");
|
||||
Set<String> users = new HashSet<>();
|
||||
for (GCubeUser member : UM.listUsersByTeam(team.getTeamId())) {
|
||||
users.add(member.getUsername());
|
||||
}
|
||||
|
||||
ws.shareFolder(folderId, users, ACLType.WRITE_ALL);
|
||||
_log.info("company folder created ...");
|
||||
}
|
||||
else {
|
||||
_log.info(companyName + " company folder exists, returning id and setting hidden?... " + PFISHConstants.HIDE_COMPANY_SHARED_FOLDER);
|
||||
List<WorkspaceItem> folders = ws.find(name, destinationFolderId);
|
||||
folder = (WorkspaceFolder) folders.get(0);
|
||||
ws.setFolderAsHidden(folder.getId(), PFISHConstants.HIDE_COMPANY_SHARED_FOLDER);
|
||||
}
|
||||
}
|
||||
catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
return folder;
|
||||
}
|
||||
|
||||
/**
|
||||
* check whether the farm folder exists and it creates it when not.
|
||||
* @param currentUsername
|
||||
* @param context
|
||||
* @return
|
||||
*/
|
||||
public static synchronized WorkspaceFolder getWSFarmFolder(String currentUsername, String context, GCubeTeam company, GCubeTeam farm) {
|
||||
String username = currentUsername;
|
||||
String authorizationToken = PortalContext.getConfiguration().getCurrentUserToken(context, username);
|
||||
SecurityTokenProvider.instance.set(authorizationToken);
|
||||
ScopeProvider.instance.set(context);
|
||||
Workspace ws = null;
|
||||
WorkspaceFolder folder = null;
|
||||
String companyName = company.getTeamName();
|
||||
try {
|
||||
WorkspaceFolder companyFolder = getWSCompanyFolder(currentUsername, context, company);
|
||||
ws = getWS(currentUsername, context);
|
||||
String destinationFolderId = companyFolder.getId();
|
||||
String name = Long.toString(farm.getTeamId()); //the farm folder is the unique id of the farm
|
||||
String description = new StringBuilder("Forms submitted by farm ")
|
||||
.append(farm.getTeamName())
|
||||
.append(" belonging to company ").append(companyName).toString();
|
||||
if (!ws.exists(name, destinationFolderId)) {
|
||||
_log.info(companyName + " farm folder does not exists, triggering creation ... ");
|
||||
folder = ws.createFolder(name, description, destinationFolderId);
|
||||
ws.setFolderAsHidden(folder.getId(), PFISHConstants.HIDE_COMPANY_SHARED_FOLDER);
|
||||
_log.info("Farm folder created succesfully for " + companyName);
|
||||
}
|
||||
else {
|
||||
_log.info(farm.getTeamName() + " farm folder exists, returning id ... ");
|
||||
SecurityTokenProvider.instance.set(authorizationToken);
|
||||
ScopeProvider.instance.set(context);
|
||||
List<WorkspaceItem> folders = ws.find(name, destinationFolderId);
|
||||
folder = (WorkspaceFolder) folders.get(0);
|
||||
ws.setFolderAsHidden(folder.getId(), PFISHConstants.HIDE_COMPANY_SHARED_FOLDER);
|
||||
_log.info(farm.getTeamName() + " farm folder id = " + folder.getId());
|
||||
}
|
||||
}
|
||||
catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
return folder;
|
||||
}
|
||||
|
||||
public static GCubeUser getCurrentUser(RenderRequest request) {
|
||||
long userId;
|
||||
try {
|
||||
|
@ -946,7 +917,7 @@ public class Utils {
|
|||
|
||||
return userToken;
|
||||
}
|
||||
|
||||
|
||||
public static String maskId(long idToMask) {
|
||||
String toMask = ""+idToMask;
|
||||
try {
|
||||
|
@ -956,7 +927,7 @@ public class Utils {
|
|||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public static String maskId(String toMask) {
|
||||
try {
|
||||
return URLEncoder.encode(Base64.getEncoder().encodeToString(toMask.getBytes("utf-8")), "UTF-8");
|
||||
|
@ -965,13 +936,13 @@ public class Utils {
|
|||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public static long unmaskId(String idToUnmask) {
|
||||
String unmasked = new String(Base64.getDecoder().decode(idToUnmask));
|
||||
return Long.parseLong(unmasked);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public static List<GCoreEndpoint> getAnalyticalToolkitServiceInstance(String context) throws Exception {
|
||||
String currScope = ScopeProvider.instance.get();
|
||||
ScopeProvider.instance.set(context);
|
||||
|
@ -983,7 +954,7 @@ public class Utils {
|
|||
ScopeProvider.instance.set(currScope);
|
||||
return toReturn;
|
||||
}
|
||||
|
||||
|
||||
public static String getAnalyticalToolkitEndpoint(String context) {
|
||||
List<GCoreEndpoint> analyticalServices = null;
|
||||
try {
|
||||
|
@ -1009,7 +980,7 @@ public class Utils {
|
|||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public static List<ServiceEndpoint> getDataMinerInstance(String scope) throws Exception {
|
||||
String currScope = ScopeProvider.instance.get();
|
||||
ScopeProvider.instance.set(scope);
|
||||
|
@ -1051,7 +1022,7 @@ public class Utils {
|
|||
else
|
||||
return PFISHConstants.SHOW_GROW_OUT;
|
||||
}
|
||||
|
||||
|
||||
public static String getBatchTypeName(String phase, String fileName) {
|
||||
switch (phase) {
|
||||
case PFISHConstants.SHOW_PRE_ONGROWING:
|
||||
|
|
Loading…
Reference in New Issue