Embedded ckan-metadata widget and ignored target directory
git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/gcube-ckan-datacatalog@129079 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
d7a9786971
commit
cfe72fe3e1
17
.classpath
17
.classpath
|
@ -33,5 +33,22 @@
|
|||
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="lib" path="/home/costantino/Downloads/gwt-2.7.0/gwt-user.jar">
|
||||
<attributes>
|
||||
<attribute name="javadoc_location" value="file:/home/costantino/Downloads/gwt-2.7.0/doc/javadoc/"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="lib" path="/home/costantino/Downloads/gwt-2.7.0/gwt-codeserver.jar">
|
||||
<attributes>
|
||||
<attribute name="javadoc_location" value="file:/home/costantino/Downloads/gwt-2.7.0/doc/javadoc/"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="lib" path="/home/costantino/Downloads/gwt-2.7.0/gwt-dev.jar">
|
||||
<attributes>
|
||||
<attribute name="javadoc_location" value="file:/home/costantino/Downloads/gwt-2.7.0/doc/javadoc/"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="lib" path="/home/costantino/Downloads/gwt-2.7.0/validation-api-1.0.0.GA-sources.jar"/>
|
||||
<classpathentry kind="lib" path="/home/costantino/Downloads/gwt-2.7.0/validation-api-1.0.0.GA.jar" sourcepath="/home/costantino/Downloads/gwt-2.7.0/validation-api-1.0.0.GA-sources.jar"/>
|
||||
<classpathentry kind="output" path="target/gcube-ckan-datacatalog-1.0.0-SNAPSHOT/WEB-INF/classes"/>
|
||||
</classpath>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
eclipse.preferences.version=1
|
||||
jarsExcludedFromWebInfLib=
|
||||
lastWarOutDir=/home/francesco-mangiacrapa/wseclipseluna/gcube-ckan-datacatalog/target/gcube-ckan-datacatalog-1.0.0-SNAPSHOT
|
||||
lastWarOutDir=/home/costantino/workspace/gcube-ckan-datacatalog/target/gcube-ckan-datacatalog-1.0.0-SNAPSHOT
|
||||
warSrcDir=src/main/webapp
|
||||
warSrcDirIsOutput=false
|
||||
|
|
11
pom.xml
11
pom.xml
|
@ -57,8 +57,8 @@
|
|||
<dependency>
|
||||
<groupId>com.google.gwt</groupId>
|
||||
<artifactId>gwt-user</artifactId>
|
||||
<!-- <scope>provided</scope> -->
|
||||
<scope>compile</scope>
|
||||
<scope>provided</scope>
|
||||
<!-- <scope>compile</scope> -->
|
||||
<version>${gwtVersion}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
@ -84,6 +84,13 @@
|
|||
</dependency>
|
||||
<!-- END FWS -->
|
||||
|
||||
<!-- Metadata publisher widget -->
|
||||
<dependency>
|
||||
<groupId>org.gcube.portlets.widgets</groupId>
|
||||
<artifactId>ckan-metadata-publisher-widget</artifactId>
|
||||
<version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.gcube.common</groupId>
|
||||
<artifactId>authorization-client</artifactId>
|
||||
|
|
|
@ -17,6 +17,12 @@
|
|||
<entry-point
|
||||
class='org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.GCubeCkanDataCatalog' />
|
||||
|
||||
<!-- Inherits widget -->
|
||||
<inherits
|
||||
name='org.gcube.portlets.widgets.ckandatapublisherwidget.CKanMetadataPublisher' />
|
||||
|
||||
<inherits name='org.gcube.portlets.user.gcubewidgets.WidgetFactory' />
|
||||
|
||||
<!-- Specify the paths for translatable code -->
|
||||
<source path='client' />
|
||||
<source path='shared' />
|
||||
|
|
|
@ -3,7 +3,17 @@
|
|||
*/
|
||||
package org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client;
|
||||
|
||||
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.event.EditMetadataEvent;
|
||||
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.event.EditMetadataEventHandler;
|
||||
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.event.InsertMetadataEvent;
|
||||
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.event.InsertMetadataEventHandler;
|
||||
import org.gcube.portlets.widgets.ckandatapublisherwidget.client.ui.CreateDatasetForm;
|
||||
|
||||
import com.github.gwtbootstrap.client.ui.Modal;
|
||||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.event.shared.HandlerManager;
|
||||
import com.google.gwt.user.client.Window;
|
||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -20,6 +30,57 @@ public class CkanEventHandlerManager {
|
|||
*
|
||||
*/
|
||||
public CkanEventHandlerManager() {
|
||||
bind();
|
||||
}
|
||||
|
||||
|
||||
private void bind() {
|
||||
|
||||
// bind on insert metadata
|
||||
eventBus.addHandler(InsertMetadataEvent.TYPE, new InsertMetadataEventHandler() {
|
||||
|
||||
@Override
|
||||
public void onInsertMetadata(InsertMetadataEvent loadSelecteReleaseEvent) {
|
||||
|
||||
final Modal modal = new Modal(true);
|
||||
|
||||
// request who's doing the insert
|
||||
GCubeCkanDataCatalog.service.getUser(new AsyncCallback<String>() {
|
||||
|
||||
@Override
|
||||
public void onSuccess(String username) {
|
||||
|
||||
if(username != null){
|
||||
modal.setTitle("Insert Metadata");
|
||||
modal.addStyleName("insert-metadata-modal-style");
|
||||
modal.add(new CreateDatasetForm(username));
|
||||
modal.setCloseVisible(true);
|
||||
modal.show();
|
||||
}
|
||||
else
|
||||
Window.alert("Please, logout and login again then retry.");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
|
||||
Window.alert("Please, logout and login again then retry.");
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// bind on edit (TODO)
|
||||
eventBus.addHandler(EditMetadataEvent.TYPE, new EditMetadataEventHandler() {
|
||||
|
||||
@Override
|
||||
public void onEditMetadata(EditMetadataEvent editMetadataEvent) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
@ -29,4 +90,7 @@ public class CkanEventHandlerManager {
|
|||
public HandlerManager getEventBus() {
|
||||
return eventBus;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -18,4 +18,10 @@ public interface GcubeCkanDataCatalogService extends RemoteService {
|
|||
* @throws Exception
|
||||
*/
|
||||
CkanRole getMyRole() throws Exception;
|
||||
|
||||
/**
|
||||
* Asks who is the current user
|
||||
* @return
|
||||
*/
|
||||
String getUser();
|
||||
}
|
||||
|
|
|
@ -17,4 +17,6 @@ public interface GcubeCkanDataCatalogServiceAsync {
|
|||
void getCKanConnector(AsyncCallback<String> callback);
|
||||
|
||||
void getMyRole(AsyncCallback<CkanRole> callback);
|
||||
|
||||
void getUser(AsyncCallback<String> callback);
|
||||
}
|
||||
|
|
|
@ -39,6 +39,7 @@ public class CkanMetadataManagementPanel extends FlowPanel{
|
|||
// this.getElement().getStyle().setPaddingBottom(H_OFFSET, Unit.PX);
|
||||
insertMeta.setType(ButtonType.LINK);
|
||||
editMeta.setType(ButtonType.LINK);
|
||||
editMeta.setVisible(false); // hide for now (it is not supported yet)
|
||||
nav.add(insertMeta);
|
||||
nav.add(editMeta);
|
||||
nav.setClose(false);
|
||||
|
|
|
@ -151,4 +151,14 @@ public class GcubeCkanDataCatalogServiceImpl extends RemoteServiceServlet implem
|
|||
//TODO READ FROM IS
|
||||
return CkanRole.ADMIN;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUser() {
|
||||
|
||||
HttpSession httpSession = this.getThreadLocalRequest().getSession();
|
||||
|
||||
logger.debug("User in session is " + getASLSession(httpSession).getUsername());
|
||||
return getASLSession(httpSession).getUsername();
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,6 +17,12 @@
|
|||
<entry-point
|
||||
class='org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.GCubeCkanDataCatalog' />
|
||||
|
||||
<!-- Inherits widget -->
|
||||
<inherits
|
||||
name='org.gcube.portlets.widgets.ckandatapublisherwidget.CKanMetadataPublisher' />
|
||||
|
||||
<inherits name='org.gcube.portlets.user.gcubewidgets.WidgetFactory' />
|
||||
|
||||
<!-- Specify the paths for translatable code -->
|
||||
<source path='client' />
|
||||
<source path='shared' />
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
/** Add css rules here for your application. */
|
||||
|
||||
|
||||
body {
|
||||
padding-top: 0px !important; /** OVERRIDE GWT BOOTSTRAP PADDING TOP TO 50px*/
|
||||
padding-top: 0px !important;
|
||||
/** OVERRIDE GWT BOOTSTRAP PADDING TOP TO 50px*/
|
||||
}
|
||||
|
||||
|
||||
/** Example rules used by the template application (remove for your app) */
|
||||
h1 {
|
||||
font-size: 2em;
|
||||
|
@ -37,3 +35,14 @@ h1 {
|
|||
#closeButton {
|
||||
margin: 15px 6px 6px;
|
||||
}
|
||||
|
||||
/** For the modal **/
|
||||
.insert-metadata-modal-style {
|
||||
width: 1024px !important;
|
||||
margin-left: -500px !important;
|
||||
}
|
||||
|
||||
.modal-body {
|
||||
height: 600px;
|
||||
max-height: none !important;
|
||||
}
|
|
@ -17,11 +17,22 @@
|
|||
<servlet-class>org.gcube.portlets.gcubeckan.gcubeckandatacatalog.server.GcubeCkanDataCatalogServiceImpl</servlet-class>
|
||||
</servlet>
|
||||
|
||||
<servlet>
|
||||
<servlet-name>ckanpublisherservices</servlet-name>
|
||||
<servlet-class>org.gcube.portlets.widgets.ckandatapublisherwidget.server.CKANPublisherServicesImpl</servlet-class>
|
||||
</servlet>
|
||||
|
||||
|
||||
<servlet-mapping>
|
||||
<servlet-name>gcubeckandatacatalogservice</servlet-name>
|
||||
<url-pattern>/gCubeCkanDataCatalog/ckandatacatalogue</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
<servlet-mapping>
|
||||
<servlet-name>ckanpublisherservices</servlet-name>
|
||||
<url-pattern>/gCubeCkanDataCatalog/ckanservices</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
|
||||
|
||||
<!-- Default page to serve -->
|
||||
|
|
Loading…
Reference in New Issue