Map<String, String> urlParams = new HashMap<String, String>();
urlParams.put("tab", Session.getInstance().getParameterValue("tab"));
urlParams.put("galleryTab", "Themes");
this.setPreviousPage(new CreateUrlRequest(Page.GALLERY, urlParams), "< Return to Configure Page");
String title = "Add Theme";
FormBuilder.Method method = Method.INSERT;
if (Session.getInstance().getParameterValue("action").equals("editTheme"))
{
title = "Edit Theme";
method = Method.UPDATE;
defaultUrl = Session.getInstance().getParameterValue("url");
defaultCategory = Session.getInstance().getParameterValue("category");
id = Session.getInstance().getParameterValue("id");
}
this.setPageTitle(title);
FormBuilder form = new FormBuilder("", ThemeModel.getInstance(), method);
if (method.equals(Method.UPDATE))
{
form.setSubmitButtonClass(StaticResourceBundle.INSTANCE.coreCss().formUpdateButton());
}
form.setOnCancelHistoryToken(Session.getInstance().generateUrl(new CreateUrlRequest(Page.GALLERY, urlParams)));
form.addFormElement(new ValueOnlyFormElement("id", id));
form.addWidget(new HTML("<em class='gallery-upload-note'><strong>Please Note:</strong><br />"
+ "Please be sure your XML file includes the "
+ "<a href='http://docs.eurekastreams.org/Technical-Specification/1.1/Theme%20Format.html' "
+ "target='_blank'>required fields</a>. "