public class ERXGenericRecordHelper {
public String id(ERXGenericRecord eo) {
return eo.entityName() + "_" + eo.primaryKey();
}
public String save(ERXGenericRecord eo) {
return id(eo) + "Save()";
}
public String edit(ERXGenericRecord eo) {
return id(eo) + "Edit()";
}
public String cancel(ERXGenericRecord eo) {
return id(eo) + "Cancel()";
}
public String idPlus(ERXGenericRecord eo, String toAppend) {
return id(eo) + "_" + toAppend;
}
public String url(ERXGenericRecord eo, String action) {
WOContext context = ERXWOContext.currentContext();
return EntityLink.url(new EntityRouter.Action(action), eo, EntityRouter.HTML, null, context, UrlUtils.isRequestSecure(context.request()), context.hasSession() && context.session().storesIDsInURLs());
}
public String url(ERXGenericRecord eo, String action, String requestType) {
WOContext context = ERXWOContext.currentContext();
return EntityLink.url(new EntityRouter.Action(action), eo, new EntityRouter.RequestType(requestType), null, context, UrlUtils.isRequestSecure(context.request()), context.hasSession() && context.session().storesIDsInURLs());
}
}
(EntityRouter was from our internal framework that has partially turned into the rest routing stuff)