refs:3772: SAI - Create a github project importer

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

Fixed directory explorer

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/widgets/github-connector@129135 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2016-06-16 09:47:24 +00:00
parent d0918a9f60
commit a5cd17254d
7 changed files with 97 additions and 36 deletions

47
pom.xml
View File

@ -70,6 +70,11 @@
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>xerces</groupId>
<artifactId>xerces</artifactId>
<version>2.4.0</version>
</dependency>
<!-- Storage -->
<dependency>
@ -100,6 +105,7 @@
<scope>runtime</scope>
</dependency>
<!-- Authorization -->
<dependency>
<groupId>org.gcube.common</groupId>
<artifactId>common-authorization</artifactId>
@ -136,9 +142,13 @@
<groupId>javax.portlet</groupId>
<artifactId>portlet-api</artifactId>
</dependency>
<!-- PORTAL -->
<dependency>
<groupId>org.gcube.applicationsupportlayer</groupId>
<artifactId>accesslogger</artifactId>
<groupId>org.gcube.core</groupId>
<artifactId>common-scope-maps</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
@ -147,25 +157,17 @@
</dependency>
<dependency>
<groupId>org.gcube.core</groupId>
<artifactId>common-scope-maps</artifactId>
<scope>compile</scope>
<groupId>org.gcube.applicationsupportlayer</groupId>
<artifactId>aslcore</artifactId>
</dependency>
<dependency>
<groupId>org.gcube.applicationsupportlayer</groupId>
<artifactId>aslcore</artifactId>
<groupId>org.gcube.dvos</groupId>
<artifactId>usermanagement-core</artifactId>
<scope>provided</scope>
<exclusions>
<exclusion>
<artifactId>xalan</artifactId>
<groupId>xalan</groupId>
</exclusion>
</exclusions>
</dependency>
<!-- Authorization -->
<dependency>
<groupId>org.gcube.common</groupId>
@ -179,7 +181,7 @@
<scope>provided</scope>
</dependency>
<!-- GCube Widget -->
<!-- GCube Widgets -->
<dependency>
<groupId>org.gcube.portlets.user</groupId>
<artifactId>gcube-widgets</artifactId>
@ -193,16 +195,6 @@
<version>[0.0.0-SNAPSHOT,1.0.0-SNAPSHOT)</version>
</dependency>
<dependency>
<groupId>org.gcube.applicationsupportlayer</groupId>
<artifactId>aslsocial</artifactId>
</dependency>
<!-- Storage -->
<dependency>
<groupId>org.gcube.contentmanagement</groupId>
@ -267,7 +259,7 @@
<groupId>com.allen-sauer.gwt.log</groupId>
<artifactId>gwt-log</artifactId>
<version>${gwtLogVersion}</version>
</dependency>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
@ -384,6 +376,7 @@
</plugins>
</build>
<repositories>
<repository>
<id>gCubeExternal</id>
@ -400,7 +393,7 @@
<dependency>
<groupId>org.gcube.distribution</groupId>
<artifactId>maven-portal-bom</artifactId>
<version>2.6.0-SNAPSHOT</version>
<version>LATEST</version>
<type>pom</type>
<scope>import</scope>
</dependency>

View File

@ -0,0 +1,65 @@
package org.gcube.portlets.widgets.githubconnector.client.util;
import com.google.gwt.core.client.Callback;
import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.DialogBox;
import com.google.gwt.user.client.ui.DockPanel;
import com.google.gwt.user.client.ui.HTML;
/**
*
* @author Giancarlo Panichi email: <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class ProgressDialog extends DialogBox implements ClickHandler {
private Callback<Void, Void> callback;
protected HTML msg;
protected double msgMinWidth=200;
protected double msgMinHeight=30;
public ProgressDialog(String title, String text) {
init(title, text);
}
public ProgressDialog(String title, String text, Callback<Void, Void> callback) {
init(title, text);
}
private void init(String title, String text) {
setText(title);
Button closeButton = new Button("Close", this);
msg = new HTML(text, true);
msg.getElement().getStyle().setProperty("minWidth", msgMinWidth, Unit.PX);
msg.getElement().getStyle().setProperty("minHeight",msgMinHeight, Unit.PX);
DockPanel dock = new DockPanel();
dock.setSpacing(4);
dock.add(closeButton, DockPanel.SOUTH);
dock.add(msg, DockPanel.CENTER);
dock.setCellHorizontalAlignment(closeButton, DockPanel.ALIGN_CENTER);
dock.setWidth("100%");
setWidget(dock);
center();
}
@Override
public void onClick(ClickEvent event) {
if(callback!=null){
callback.onSuccess(null);
}
hide();
}
}

View File

@ -47,6 +47,7 @@ public class GitHubConnectorServiceImpl extends RemoteServiceServlet implements
try {
HttpSession session = this.getThreadLocalRequest().getSession();
ASLSession aslSession = SessionUtil.getASLSession(session);
SessionUtil.getToken(aslSession);
logger.debug("hello()");
UserInfo userInfo = new UserInfo(aslSession.getUsername(),
aslSession.getGroupId(), aslSession.getGroupName(),
@ -72,6 +73,7 @@ public class GitHubConnectorServiceImpl extends RemoteServiceServlet implements
try {
HttpSession session = this.getThreadLocalRequest().getSession();
ASLSession aslSession = SessionUtil.getASLSession(session);
SessionUtil.getToken(aslSession);
logger.debug("getRepository(): " + gitHubCredential);
GitConnectorService gitConnectorService = new GitConnectorService(
aslSession.getUsername(), gitHubCredential);
@ -92,6 +94,7 @@ public class GitHubConnectorServiceImpl extends RemoteServiceServlet implements
try {
HttpSession session = this.getThreadLocalRequest().getSession();
ASLSession aslSession = SessionUtil.getASLSession(session);
SessionUtil.getToken(aslSession);
logger.debug("cloneRepository(): " + gitHubCloneSession);
GitConnectorService gitConnectorService = new GitConnectorService(
aslSession.getUsername(),

View File

@ -167,10 +167,10 @@ public class GitConnectorService {
+ destinationFolderId + ", folderName="
+ contents.getName() + ", folderDescription="
+ contents.getName() + "]");
StorageUtil.createFolderOnWorkspace(userName, destinationFolderId,
String internalFolderId=StorageUtil.createFolderOnWorkspace(userName, destinationFolderId,
contents.getName(), contents.getName());
createContent(destinationFolderId, repository, contents.getPath());
createContent(internalFolderId, repository, contents.getPath());
} catch (ServiceException e) {
throw e;
} catch (Throwable e) {

View File

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<!DOCTYPE display PUBLIC "-//Liferay//DTD Display 5.2.0//EN" "http://www.liferay.com/dtd/liferay-display_5_2_0.dtd">
<!DOCTYPE display PUBLIC "-//Liferay//DTD Display 6.2.0//EN"
"http://www.liferay.com/dtd/liferay-display_6_2_0.dtd">
<display>
<category name="gCube Applications">
<portlet id="GitHubConnector" />

View File

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<!DOCTYPE liferay-portlet-app PUBLIC "-//Liferay//DTD Portlet Application 5.2.0//EN" "http://www.liferay.com/dtd/liferay-portlet-app_5_2_0.dtd">
<!DOCTYPE liferay-portlet-app PUBLIC "-//Liferay//DTD Portlet Application 6.2.0//EN"
"http://www.liferay.com/dtd/liferay-portlet-app_6_2_0.dtd">
<liferay-portlet-app>
<portlet>
<portlet-name>GitHubConnector</portlet-name>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="3.0">
<servlet>
<servlet-name>GitHubConnectorServlet</servlet-name>