removed Software Upload Wizard as it was dismissed

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/admin/resource-management@129500 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Massimiliano Assante 2016-06-28 12:14:48 +00:00
parent d174c9b75a
commit 55aaca975d
5 changed files with 0 additions and 279 deletions

62
pom.xml
View File

@ -89,22 +89,6 @@
<artifactId>aslcore</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gcube.common</groupId>
<artifactId>home-library</artifactId>
<scope>provided</scope>
<exclusions>
<exclusion>
<artifactId>asm-all</artifactId>
<groupId>asm</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.gcube.common</groupId>
<artifactId>home-library-jcr</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gcube.dvos</groupId>
<artifactId>usermanagement-core</artifactId>
@ -167,58 +151,12 @@
<artifactId>resource-sweeper-widget</artifactId>
<version>[2.2.0-SNAPSHOT, 3.0.0-SNAPSHOT)</version>
</dependency>
<dependency>
<groupId>org.gcube.portlets.admin</groupId>
<artifactId>software-upload-wizard</artifactId>
<version>[1.1.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
</dependency>
<!-- guice guava -->
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<version>${guice.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.google.inject.extensions</groupId>
<artifactId>guice-servlet</artifactId>
<version>${guice.version}</version>
<scope>compile</scope>
</dependency>
<!-- gwt-dispatch -->
<dependency>
<groupId>net.customware.gwt.dispatch</groupId>
<artifactId>gwt-dispatch</artifactId>
<version>1.2.0</version>
</dependency>
<!-- Liferay, Servlets Etc -->
<dependency>
<groupId>javax.mail</groupId>
<artifactId>javax.mail-api</artifactId>
<version>1.4.5</version>
</dependency>
<dependency>
<groupId>com.liferay.portal</groupId>
<artifactId>portal-service</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.liferay.portal</groupId>
<artifactId>util-bridges</artifactId>
<version>${liferay.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.liferay.portal</groupId>
<artifactId>util-taglib</artifactId>
<version>${liferay.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.liferay.portal</groupId>
<artifactId>util-java</artifactId>

View File

@ -25,8 +25,6 @@ import org.gcube.portlets.admin.resourcemanagement.client.utils.OpCommands;
import org.gcube.portlets.admin.resourcemanagement.client.widgets.console.ConsoleMessageBroker;
import org.gcube.portlets.admin.resourcemanagement.client.widgets.registry.UIIdentifiers;
import org.gcube.portlets.admin.resourcemanagement.client.widgets.registry.WidgetsRegistry;
import org.gcube.portlets.admin.software_upload_wizard.client.AppController;
//import org.gcube.portlets.admin.software_upload_wizard.client.AppController;
import org.gcube.resourcemanagement.support.client.utils.StatusHandler;
import org.gcube.resourcemanagement.support.client.views.ResourceTypeDecorator;
import org.gcube.resourcemanagement.support.shared.operations.SupportedOperations;
@ -36,7 +34,6 @@ import com.extjs.gxt.ui.client.data.ModelData;
import com.extjs.gxt.ui.client.event.BaseEvent;
import com.extjs.gxt.ui.client.event.ComponentEvent;
import com.extjs.gxt.ui.client.event.Events;
import com.extjs.gxt.ui.client.event.GridEvent;
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.store.GroupingStore;
import com.extjs.gxt.ui.client.store.ListStore;
@ -53,7 +50,6 @@ import com.extjs.gxt.ui.client.widget.toolbar.SeparatorToolItem;
import com.extjs.gxt.ui.client.widget.toolbar.ToolBar;
import com.google.gwt.core.client.GWT;
import com.google.gwt.core.client.RunAsyncCallback;
import com.google.gwt.event.shared.HandlerManager;
import com.google.gwt.user.client.Window;
/**
@ -317,37 +313,6 @@ public class ResourceDetailsPanel {
doDeploy.setToolTip("Get report for submitted deployment");
this.getToolBar().add(doDeploy);
}
// Adds toolbar button for software upload wizard (SUW)
if (resType.equals(ResourceTypeDecorator.Service.name()) &&
SupportedOperations.SERVICE_DEPLOY.isAllowed(StatusHandler.getStatus().getCredentials())) {
this.getToolBar().add(new SeparatorToolItem());
ToolButton doAddSoftware = new ToolButton("add-software-icon") {
protected void onClick(final ComponentEvent be) {
super.onClick(be);
GWT.runAsync(AppController.class, new RunAsyncCallback() {
@Override
public void onSuccess() {
String currentScope = StatusHandler.getStatus().getCurrentScope();
HandlerManager eventBus = new HandlerManager(null);
AppController appViewer = new AppController(eventBus, currentScope);
//AppController appViewer = new AppController(eventBus);
appViewer.go();
}
public void onFailure(Throwable reason) {
Window.alert("There are networks problem, please check your connection.");
}
});
};
};
doAddSoftware.setToolTip("Upload software");
this.getToolBar().add(doAddSoftware);
this.getToolBar().add(new SeparatorToolItem());
}
}
public final void setGrid(final Grid<ModelData> grid, final boolean groupingEnabled) {

View File

@ -1,165 +0,0 @@
/****************************************************************************
* This software is part of the gCube Project.
* Site: http://www.gcube-system.org/
****************************************************************************
* The gCube/gCore software is licensed as Free Open Source software
* conveying to the EUPL (http://ec.europa.eu/idabc/eupl).
* The software and documentation is provided by its authors/distributors
* "as is" and no expressed or
* implied warranty is given for its use, quality or fitness for a
* particular case.
****************************************************************************
* Filename: MailSender.java
****************************************************************************
* @author <a href="mailto:daniele.strollo@isti.cnr.it">Daniele Strollo</a>
***************************************************************************/
package org.gcube.portlets.admin.resourcemanagement.server.gcube.services;
import java.io.File;
import java.util.Date;
import java.util.List;
import java.util.Properties;
import java.util.StringTokenizer;
import java.util.Vector;
import javax.activation.DataHandler;
import javax.activation.FileDataSource;
import javax.mail.Authenticator;
import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.Multipart;
import javax.mail.NoSuchProviderException;
import javax.mail.PasswordAuthentication;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.AddressException;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeBodyPart;
import javax.mail.internet.MimeMessage;
import javax.mail.internet.MimeMultipart;
import org.gcube.resourcemanagement.support.server.utils.ServerConsole;
/**
* @author Daniele Strollo (ISTI-CNR)
*
*/
public class MailSender {
private static final String LOG_PREFIX = "[RPM-SENDMAIL]";
/**
* Given a list of addresses in the form addr1;addr2...
* builds the list of InternetAddress to use to send mail.
* @param toParse a string of email addresses of the form addr1;addr2...
* @return the array of converted valid email addresses
*/
private static InternetAddress[] buildAddress(final String toParse) {
if (toParse == null || toParse.trim().length() == 0) {
return null;
}
List<InternetAddress> toReturn = new Vector<InternetAddress>();
StringTokenizer parser = new StringTokenizer(toParse, ";");
while (parser.hasMoreTokens()) {
try {
toReturn.add(new InternetAddress(parser.nextToken()));
} catch (AddressException e) {
ServerConsole.error(LOG_PREFIX, e);
}
}
return toReturn.toArray(new InternetAddress[]{});
}
public static void sendMail(
final String sender,
final String target,
final String cc,
final String subject,
final String bodyText,
final String[] attachments) throws Exception {
if ((target == null || target.trim().length() == 0)
&& (cc == null || cc.trim().length() == 0)) {
ServerConsole.warn(LOG_PREFIX, "No valid mail recipients specified.");
return;
}
Properties properties = new Properties();
properties.setProperty("mail.transport.protocol", "smtp");
properties.put("mail.host", "smtp.isti.cnr.it");
properties.put("mail.port", "587");
properties.put("mail.auth", "true");
properties.put("mail.smtps.auth", "true");
properties.put("mail.smtp.auth", "true");
Session session = Session.getDefaultInstance(properties,
new Authenticator() {
public PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication("smtp-user", "UiBe7chae7eh");
}
});
Transport transport = null;
try {
transport = session.getTransport();
} catch (NoSuchProviderException e) {
throw e;
}
try {
MimeMessage message = new MimeMessage(session);
message.setFrom(new InternetAddress(sender));
// MAIL - TO
InternetAddress[] addressTo = MailSender.buildAddress(target);
if (addressTo != null) {
message.setRecipients(Message.RecipientType.TO, addressTo);
}
// MAIL - CC
InternetAddress[] addressCC = MailSender.buildAddress(cc);
if (addressCC != null) {
message.setRecipients(Message.RecipientType.CC, addressCC);
}
message.setSubject(subject);
message.setSentDate(new Date());
//
// Set the email message text.
//
MimeBodyPart messagePart = new MimeBodyPart();
messagePart.setText(bodyText);
//
// Set the email attachment file
//
Multipart multipart = new MimeMultipart();
multipart.addBodyPart(messagePart);
for (String filename : attachments) {
MimeBodyPart attachmentPart = new MimeBodyPart();
FileDataSource fileDataSource = new FileDataSource(filename) {
@Override
public String getContentType() {
return "application/octet-stream";
}
};
attachmentPart.setDataHandler(new DataHandler(fileDataSource));
attachmentPart.setFileName(new File(filename).getName());
multipart.addBodyPart(attachmentPart);
}
message.setContent(multipart);
transport.connect();
// FIXME waiting new mail implementation (skipping liferay mail.jar) with CC support.
transport.sendMessage(message,
message.getRecipients(Message.RecipientType.TO));
transport.close();
} catch (MessagingException e) {
e.printStackTrace();
}
}
}

View File

@ -9,9 +9,6 @@
<!-- Other module inherits -->
<inherits name='com.extjs.gxt.ui.GXT' />
<inherits name='com.google.gwt.query.Query' />
<!-- inherits Software Uplad Widget -->
<inherits
name='org.gcube.portlets.admin.software_upload_wizard.SoftwareUploadWizard' />
<!-- inherits Resource Sweeper Widget -->
<inherits name='org.gcube.portlets.admin.resourcesweeper.Resource_sweeper' />

View File

@ -26,20 +26,6 @@
<url-pattern>/resourcemanagementportlet/sweeper</url-pattern>
</servlet-mapping>
<!-- SUW -->
<filter>
<filter-name>guiceFilter</filter-name>
<filter-class>com.google.inject.servlet.GuiceFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>guiceFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<listener>
<listener-class>org.gcube.portlets.admin.software_upload_wizard.server.BootstrapListener</listener-class>
</listener>
<!-- AuthZ -->
<filter>
<filter-name>AuthFilter</filter-name>