use of org.jaffa.presentation.portlet.FormKey in project jaffa-framework by jaffa-projects.
the class RiaWrapperComponent method display.
/**
* Returns a FormKey, which has the componentId & the formName to which control should be passed
*
* @return the FormKey object
* @throws FrameworkException if any framework error occurs.
* @throws ApplicationExceptions if any application error occurs.
*/
public FormKey display() throws FrameworkException, ApplicationExceptions {
String url = getRiaUrl();
if (!url.startsWith("/"))
url = "/" + url;
for (Map.Entry e : parameters.entrySet()) try {
url += (url.indexOf("?") < 0 ? "?" : "&") + e.getKey() + "=" + URLEncoder.encode((e.getValue() == null) ? "" : e.getValue().toString(), "UTF-8");
} catch (java.io.UnsupportedEncodingException ex) {
log.error("Ignored request parameter " + e.getKey() + " = " + e.getValue(), ex);
}
log.debug("Forward to Web 2.0 URL - " + url);
quit();
return new FormKey(url, null, null, true);
}
use of org.jaffa.presentation.portlet.FormKey in project jaffa-framework by jaffa-projects.
the class ItemFinderResultsAction method do_Refresh_Clicked.
// .//GEN-END:_do_ModifySearch_Clicked_4_be
// .//GEN-BEGIN:_do_Refresh_Clicked_1_be
/**
* Re-executes the search, using the same criteria as used before.
* @return The FormKey for the Results screen.
*/
public FormKey do_Refresh_Clicked() {
FormKey fk = null;
// .//GEN-END:_do_Refresh_Clicked_1_be
// Add custom code before processing the action //GEN-FIRST:_do_Refresh_Clicked_1
// .//GEN-LAST:_do_Refresh_Clicked_1
// .//GEN-BEGIN:_do_Refresh_Clicked_2_be
ItemFinderResultsForm myForm = (ItemFinderResultsForm) form;
ItemFinderComponent myComp = (ItemFinderComponent) myForm.getComponent();
try {
// .//GEN-END:_do_Refresh_Clicked_2_be
// Add custom code before invoking the component //GEN-FIRST:_do_Refresh_Clicked_2
// .//GEN-LAST:_do_Refresh_Clicked_2
// .//GEN-BEGIN:_do_Refresh_Clicked_3_be
fk = myComp.displayResults();
} catch (ApplicationExceptions e) {
log.error(null, e);
myForm.raiseError(request, ActionMessages.GLOBAL_MESSAGE, e);
} catch (FrameworkException e) {
log.error(null, e);
myForm.raiseError(request, ActionMessages.GLOBAL_MESSAGE, "error.framework.general");
}
// Direct User back to current form
if (fk == null)
fk = new FormKey(myForm.NAME, myComp.getComponentId());
return fk;
}
use of org.jaffa.presentation.portlet.FormKey in project jaffa-framework by jaffa-projects.
the class Page1Action method do_Button1_Clicked.
/**
* This button is protected by 'Function1'
*/
public FormKey do_Button1_Clicked() {
System.out.println("Trying to do something protected by Function1");
SecurityManager.runFunction("Function1", new PrivilegedAction() {
public Object run() {
String msg = "Doing Something Protected By Function1";
((Page1Form) form).setMessage(msg);
System.out.println(msg);
return null;
}
});
return new FormKey(Page1Form.NAME, component != null ? component.getComponentId() : null);
}
use of org.jaffa.presentation.portlet.FormKey in project jaffa-framework by jaffa-projects.
the class UserTimeEntryFinderAction method do_Rows_Delete_Clicked.
// .//GEN-END:_do_Rows_Update_Clicked_4_be
// .//GEN-BEGIN:_do_Rows_Delete_Clicked_1_be
/**
* Invokes the deleteObject() method on the component.
* @param rowNum The selected row on the Results screen.
* @return The FormKey for the Delete screen.
*/
public FormKey do_Rows_Delete_Clicked(String rowNum) {
FormKey fk = null;
// .//GEN-END:_do_Rows_Delete_Clicked_1_be
// Add custom code before processing the action //GEN-FIRST:_do_Rows_Delete_Clicked_1
// .//GEN-LAST:_do_Rows_Delete_Clicked_1
// .//GEN-BEGIN:_do_Rows_Delete_Clicked_2_be
UserTimeEntryFinderForm myForm = (UserTimeEntryFinderForm) form;
UserTimeEntryFinderComponent myComp = (UserTimeEntryFinderComponent) myForm.getComponent();
try {
// This will stop double submits
performTokenValidation(request);
GridModel model = (GridModel) myForm.getRowsWM();
GridModelRow selectedRow = model.getRow(Integer.parseInt(rowNum));
if (selectedRow != null) {
// .//GEN-END:_do_Rows_Delete_Clicked_2_be
// Add custom code before invoking the component //GEN-FIRST:_do_Rows_Delete_Clicked_2
// .//GEN-LAST:_do_Rows_Delete_Clicked_2
// .//GEN-BEGIN:_do_Rows_Delete_Clicked_3_be
fk = myComp.deleteObject((java.lang.String) selectedRow.get("userName"), (java.lang.String) selectedRow.get("projectCode"), (java.lang.String) selectedRow.get("task"), (org.jaffa.datatypes.DateTime) selectedRow.get("periodStart"), (org.jaffa.datatypes.DateTime) selectedRow.get("periodEnd"));
}
} catch (ApplicationExceptions e) {
if (log.isDebugEnabled())
log.debug("Delete Failed");
myForm.raiseError(request, ActionMessages.GLOBAL_MESSAGE, e);
} catch (FrameworkException e) {
log.error(null, e);
myForm.raiseError(request, ActionMessages.GLOBAL_MESSAGE, "error.framework.general");
}
// Direct User back to current form
if (fk == null)
fk = myComp.getResultsFormKey();
return fk;
}
use of org.jaffa.presentation.portlet.FormKey in project jaffa-framework by jaffa-projects.
the class UserTimeEntryFinderAction method do_CreateFromResults_Clicked.
// .//GEN-END:_do_CreateFromCriteria_Clicked_4_be
// .//GEN-BEGIN:_do_CreateFromResults_Clicked_1_be
/**
* Invokes the createFromResults() method on the component.
* @return The FormKey for the Create screen.
*/
public FormKey do_CreateFromResults_Clicked() {
FormKey fk = null;
// .//GEN-END:_do_CreateFromResults_Clicked_1_be
// Add custom code before processing the action //GEN-FIRST:_do_CreateFromResults_Clicked_1
// .//GEN-LAST:_do_CreateFromResults_Clicked_1
// .//GEN-BEGIN:_do_CreateFromResults_Clicked_2_be
UserTimeEntryFinderForm myForm = (UserTimeEntryFinderForm) form;
UserTimeEntryFinderComponent myComp = (UserTimeEntryFinderComponent) myForm.getComponent();
try {
// .//GEN-END:_do_CreateFromResults_Clicked_2_be
// Add custom code before invoking the component //GEN-FIRST:_do_CreateFromResults_Clicked_2
// .//GEN-LAST:_do_CreateFromResults_Clicked_2
// .//GEN-BEGIN:_do_CreateFromResults_Clicked_3_be
fk = myComp.createFromResults();
} catch (ApplicationExceptions e) {
if (log.isDebugEnabled())
log.debug("Create Failed");
myForm.raiseError(request, ActionMessages.GLOBAL_MESSAGE, e);
} catch (FrameworkException e) {
log.error(null, e);
myForm.raiseError(request, ActionMessages.GLOBAL_MESSAGE, "error.framework.general");
}
// Direct User back to current form
if (fk == null)
fk = myComp.getResultsFormKey();
return fk;
}
Aggregations