Custom Home button in Orbeon Form Builder Summary page - orbeon

I have a task to change the behavior of 'Home' button in Form Builder Summary page.
When user click home button, it will navigate to the website that I want (example here: https://google.com)
Ref: https://doc.orbeon.com/configuration/properties/form-builder#action-buttons-on-the-form-builder-summary-page
I tried this code below but it didn't work. It still back to Form Runner Summary page.
*properties-local.xml
<property as="xs:string" name="oxf.fr.summary.process.home.orbeon.builder">
navigate(uri = "https://google.com")
</property>

Currently that URL is not configurable. The only thing you can do is omit the Home button.
It would be nice to able to do that and I added RFE #5214.

Related

Can I custom the process for 'Publish' button in Publish dialog in properties-local.xml?

In document I see that we can custom the flow in properties-local.xml, but it is only available for Publish button outside (not publish button in dialog)
The flow I intend to do:
In Form builder, user click publish
Publish dialog showed, user click publish button in dialog.
Then it will call api from my server to send info.
In properties-local.xml, I modified inside this part:
<property as="xs:string" name="oxf.fr.detail.process.publish.orbeon.builder"> </property>
with this code:
<!-- show publish dialog -->
xf:show(
dialog = "fb-publish-dialog",
app = "{xxf:instance('fb-form-instance')/xh:head/xf:model[#id = 'fr-form-model']/xf:instance[#id = 'fr-form-metadata']/*/application-name}",
form = "{xxf:instance('fb-form-instance')/xh:head/xf:model[#id = 'fr-form-model']/xf:instance[#id = 'fr-form-metadata']/*/form-name}"
)
<!-- expect when user click publish button in dialog will execute this code -->
then save
then send(
uri = "http://localhost:8000/api/getFormBuilderInfo",
replace = "all"
method = "POST",
content = "xml")
The problem I don't know how to hook into publish button in dialog. Because I want to make sure that it has stored in orbeon database in order to creating new in form runner with appName and formName (which I get through api: http://localhost:8000/api/getFormBuilderInfo).
As of this writing, it isn't possible to invoke code after the form is published.
As a workaround, you could hook your code in the publish process, but this process runs before the form is being published, specifically before the Form Builder user is presented with a dialog asking them for a confirmation to publish the form. So, there will be delay between the time your code is invoked and the time the form is actually published, and of course there is a chance the user closes the dialog without going ahead with the publication of the form.
So, in practice, to use this workaround, you would need to apply some kind of heuristic, like "when your code is invoked, register some a listener to run, say in 5 minutes; when that time has passed, check if the form was actually published, and if so do the action that you needed to perform".

How to set a form readonly (how to avoid the stay - leave popup)

We have the requirement that users, after terminating the input of a form, can only see the data; only authorized users can modify the data, see question
intermediate save and readonly after termination.
The first idea was to use the permission: owner can read the data.
This works smootly : afer saving, in the summary page the form is marked as readonly.
But there was also the requirement: users must be able to interrupt the input of the form and resume it later.
So in the permissions we had to set that the owner can read and update the data, and we use a field of the form to set the section to readonly.
The save-final button sets this field.
We have renamed this button to FINISH, and the save-draft button to intermediate save.
Clicking save-final also makes invisible the save buttons, so the user after clicking this button cannot change anymore the data.
Before clicking FINISH:
After clicking FINISH:
Selecting the form in the summary page and choosing review works smootly: the form is opened in view mode.
But clicking in the created or modified field opens the form in edit. And although all form fields are readonly, clicking at the summary button a window "Leave page Stay on page" is shown. I suppose, because of the vars of the database service the form results as a modified page.
After clicking leave Page, in the summary page a new draft form is shown. This draft form only an Administrator can delete. Because the user haven't the permission to delete.
So the question is:
is there a possibility to set the form read-only when the user clicks the FINISH button? So that in the summary page the form is marked as read only?
Or as another option: is there a possibility to disable the columns Created and Modified" in the summary page, so that only the first column in the summary page is clickable?
Link to the test code
Many thanks
I found as a possibility:
Inhibit the edit in the summary page
add an edit button to the detail page and associate it with the edit
action
Change the description of the Review button to Review/Edit
to 1) I inserted in the custom summary css the lines:
.orbeon .fr-summary-table-div td a,
.orbeon .fr-summary-table-div th a {
pointer-events: none;
}
to 2) Lines added in the properties-local.xml:
Add an edit button to the buttons of the detail page
<property as="xs:string" name="oxf.fr.detail.buttons.view.*.*" value="summary edit pdf"/>
Add the edit process to the edit button
<property as="xs:string" name="oxf.fr.detail.process.edit.apptest.*" value="edit"/>
Add descriptions to the edit key
<property as="xs:string" name="oxf.fr.resource.apptest.*.en.buttons.edit" value="EDIT"/>
<property as="xs:string" name="oxf.fr.resource.apptest.*.de.buttons.edit" value="Ă„ndern"/>
<property as="xs:string" name="oxf.fr.resource.apptest.*.it.buttons.edit" value="Aggiorna"/>
Show the edit button only if the input phase isn't terminated
<property as="xs:string" name="oxf.fr.detail.button.edit.visible.apptest.*">
//datenOK = false()
</property>
Summary page with review/edit button
Detail page with edit button (because the input phase isn't yet terminated)
Detail page without edit button (the input phase is already terminated)
In the test code was the action: Run action when the form loads
I changed the action in Run action when the control appears or changes its value
and now the popup page: stay on page - leave page appears anymore.

How can we add popup in FitNesse?

I want to add an hyperlink or a button in my FitNesse page.
On click of this link or button a popup window with some HTML content should open.
Please let me know if this is possible in FitNesse? If yes, how to achieve this?
I tried to search on FitNesse website but could not get information.
Adding a link to a wiki page is easy: just type the link, or use [[word or phrase][url]]. But this will not open a pop-up. I don't know how to achieve that by just using the wiki.
In a Slim fixture's result you can return any HTML (sometimes you will have to surround it with <div></div>), so you can return ... and in the test result there will be a hyperlink that will open in a new tab...

Orbeon: creating my own delete button

2/28: Seems the Go uri is only if you create your own persisten layer. I'm going to try and use a link on my form to do this. If I can figure out how to find the form_id of the current form.
Original Question:
I'm trying to restrict who can delete a form instance. It seems if people can get to the form-runner summary page, they can click the delete button and delete a form (even if they are not allowed to do any "/orbeon/fr/hr/expense-report/edit/*" options.
Anyone found a way around this issue. I wonder if we could use the GO button on the form /edit/ view to build our own delete feature.
If I look at the page source from the hr/expense-report/edit/f36b446c3ddbf7c63ec033d5c6fa7ce4 view, that the from does have the details to the actual form instance.
Example:
form id="xforms-form" class="xforms-form xforms-initially-hidden xforms-layout-nospan" action="/orbeon/fr/Test/Hidden_Search/edit/f36b446c3ddbf7c63ec033d5c6fa7ce4"
I wonder if that information could be passed to the "GO" button, if I have that on my page?
Right now, if users can access the Form Runner summary page, they can also access the "delete" button. Showing the "delete" button on the summary page for some users but not others, requires a change to Form Runner, which shouldn't very complicated.
For instance, if you only want the "delete" button to be shown for users with the role can-delete, on this xforms:bind of fr/summary/view.xhtml add the attribute:
relevant="xxforms:is-user-in-role('can-delete')"

How to redirect user back to list item form when list item is edited in SharePoint 2007?

Out of the box, I've noticed the following user experience in SharePoint 2007:
User navigates to a list.
User opens list item for display.
User selects "Edit Item" link.
User changes the list item, presses Submit.
User is redirected back to list.
Is it possible to change the last step so the user is redirected back to the list item display form? If so, how is it done?
You can create a custom form by with SharePoint Designer then customize the OK Button to save and redirect to the display view.
To create custom edit form using SharePoint Designer here is a full instructions on how to do thi http://office.microsoft.com/en-ca/sharepoint-designer-help/create-a-custom-list-form-HA010119111.aspx
Once you done this then find this line on the source code of you new page
<xsl:decimal-format NaN=""/>
<xsl:param name="dvt_apos">'</xsl:param>
<xsl:variable name="dvt_1_automode">0</xsl:variable>
and append this line below
<xsl:param name="ListItemId">0</xsl:param>
"this will make the id of the current item accessible by the button"
replace both of your OK buttons
<SharePoint:SaveButton runat="server" ControlMode="Edit" id="savebutton1"/>
whit this one
<input type="button" value="OK" name="btnSave" onclick="javascript: {ddwrt:GenFireServerEvent(concat('__commit;__redirect={dispform.aspx?id=',$ListItemId,'}'))}" />
Save and test :).
You don't necessarily have to replace your OK buttons for this one you can also add this extra button and instead of calling it OK call it something like Save and display and let the user decide what to do (just and idea)
Hope this helps!

Resources