onModuleLoad()
.
*/
public class GeoPortalDataEntryApp implements EntryPoint {
- /**
- * The message displayed to the user when the server cannot be reached or
- * returns an error.
- */
- private static final String SERVER_ERROR = "An error occurred while "
- + "attempting to contact the server. Please check your network "
- + "connection and try again.";
+ /**
+ * The message displayed to the user when the server cannot be reached or
+ * returns an error.
+ */
+ private static final String SERVER_ERROR = "An error occurred while "
+ + "attempting to contact the server. Please check your network " + "connection and try again.";
- /**
- * Create a remote service proxy to talk to the server-side Greeting service.
- */
- private final GreetingServiceAsync greetingService = GWT.create(GreetingService.class);
+ private static final String DIV_PORTLET_ID = "geoportal-data-entry";
- private final Messages messages = GWT.create(Messages.class);
+ /**
+ * Create a remote service proxy to talk to the server-side Greeting service.
+ */
+ private final GreetingServiceAsync greetingService = GWT.create(GreetingService.class);
- /**
- * This is the entry point method.
- */
- public void onModuleLoad() {
- final Button sendButton = new Button( messages.sendButton() );
- final TextBox nameField = new TextBox();
- nameField.setText( messages.nameField() );
- final Label errorLabel = new Label();
+ private final Messages messages = GWT.create(Messages.class);
- // We can add style names to widgets
- sendButton.addStyleName("sendButton");
+ /**
+ * This is the entry point method.
+ */
+ public void onModuleLoad() {
- // Add the nameField and sendButton to the RootPanel
- // Use RootPanel.get() to get the entire body element
- RootPanel.get("nameFieldContainer").add(nameField);
- RootPanel.get("sendButtonContainer").add(sendButton);
- RootPanel.get("errorLabelContainer").add(errorLabel);
+ String scope = "/gcube/devsec/devVRE";
+ String secondaryType = "GeoNaMetadata";
+ HandlerManager eventBus = new HandlerManager(null);
+ CreateMetadataForm baseForm = new CreateMetadataForm(scope, secondaryType, eventBus);
+ RootPanel.get(DIV_PORTLET_ID).add(baseForm);
- // Focus the cursor on the name field when the app loads
- nameField.setFocus(true);
- nameField.selectAll();
-
- // Create the popup dialog box
- final DialogBox dialogBox = new DialogBox();
- dialogBox.setText("Remote Procedure Call");
- dialogBox.setAnimationEnabled(true);
- final Button closeButton = new Button("Close");
- // We can set the id of a widget by accessing its Element
- closeButton.getElement().setId("closeButton");
- final Label textToServerLabel = new Label();
- final HTML serverResponseLabel = new HTML();
- VerticalPanel dialogVPanel = new VerticalPanel();
- dialogVPanel.addStyleName("dialogVPanel");
- dialogVPanel.add(new HTML("Sending name to the server:"));
- dialogVPanel.add(textToServerLabel);
- dialogVPanel.add(new HTML("Please enter your name: | -|
- | - |
- |