Skip to content

Commit

Permalink
Ui Integration
Browse files Browse the repository at this point in the history
Issue #449
  • Loading branch information
rsoika committed Jun 16, 2021
1 parent 86b2fec commit f540a2b
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ EMAIL_ALREADY_TAKEN=Die von Ihnen gewählte Emailadresse wurde bereits vergeben.
USERNAME_ALREADY_TAKEN=Die von Ihnen gewählte User-ID wurde bereits vergeben.
BIC_INVALID=Bitte geben Sie eine gültige BIC ein
IBAN_INVALID=Bitte geben Sie eine gültige IBAN ein
WOPI_CONFIRM_CHANGES=Sollen die Änderungen im Dokument gespeichert werden?
#########################
# Error Messages
#########################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ EMAIL_ALREADY_TAKEN=The email address you selected is already taken.
USERNAME_ALREADY_TAKEN=The chosen user ID has already been assigned.
BIC_INVALID=Please enter a valid BIC.
IBAN_INVALID=Please enter a valid IBAN.
WOPI_CONFIRM_CHANGES=Do you want to save the changes in the document?
#########################
# Error Messages
#########################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,29 @@ IMIXS.org.imixs.workflow.workitem = (function() {
},


saveWorkitemHandler=function (confirmMessage,confirmWopiMessage,uiWorkflowAction) {

if (confirmMessage) {
if (confirm(confirmMessage)==false) {
return false;
}
}

// wopi Callback?
if (imixsWopi.isModified) {
if (confirm(confirmWopiMessage)) {
imixsWopi.save();
wopiLastWorkflowEvent=uiWorkflowAction;
//alert(wopiLastWorkflowEvent);
return false;
} else {
// workflow wird fortgeseztt
}
}

return true;
},

/**
* Opens a popup window with the QR-Code to print
*/
Expand Down Expand Up @@ -411,6 +434,7 @@ IMIXS.org.imixs.workflow.workitem = (function() {
minimizeDocumentPreview : minimizeDocumentPreview,
maximizeDocumentPreview : maximizeDocumentPreview,
closeDocumentPreview : closeDocumentPreview,
saveWorkitemHandler: saveWorkitemHandler,
onFileUploadChange : onFileUploadChange
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Imixs-Adapters-Wopi Integration


var wopiLastWorkflowEvent; // stores the last workfow UI action button
/**
* Init Method for the wop document integration
*
Expand Down Expand Up @@ -28,22 +28,38 @@ function openWopiViewer(url,filename) {

function uiSaveCallback(filename) {
// we can do a ui update based on the filename
// ....

// ....
//console.log("uiSaveCallback");
closeWopiViewer();

// if we have a last wopi action buttion than click it
if (wopiLastWorkflowEvent) {
//console.log("processing wopiLastWorkflowEvent");
wopiLastWorkflowEvent.click();
}
}

// close the wopi viewer
function closeWopiViewer(confirmMessage) {

// if document was modifed without save then ask the user....
if (imixsWopi.isModified) {
imixsWopi.isModified=false;
if (confirm(confirmMessage)) {
imixsWopi.save(); return false;
imixsWopi.save();
return false;
} else {
imixsWopi.isModified=false;
}
}
console.log("close ");
//console.log("close ");
$('#wopi_controlls').hide();
imixsWopi.closeViewer();
// show workflow form
$('#imixs_workitem_form_id').show();
}
}





Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,9 @@

#wopi_controlls {
margin-bottom: 3px;
padding:0;
}

.wopi-action-bar {
float:right;
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@
<ui:fragment rendered="#{wopiController!=null}">
<div style="display: none;" class="imixs-form" id="wopi_controlls">
<h1 id="wopi_header_filename_id"></h1>
<input type="button" onclick="imixsWopi.save(); return false;" class="imixs-workflow-action" value="#{message.update}" /><input type="button" onclick="closeWopiViewer('#{message.confirm_update}'); return false;" class="imixs-workflow-action" value="#{message.close}" /><input type="button" onclick="imixsWopi.switchToFullScreen(); return false;" class="imixs-workflow-action" value="#{message.fullscreen}" />
<div class="wopi-action-bar">
<input type="button" onclick="imixsWopi.save(); return false;" style="display:none;" class="imixs-workflow-action" value="#{message.update}" /><input type="button" onclick="closeWopiViewer('#{message.confirm_update}'); return false;" class="imixs-workflow-action" value="#{message.close}" /><input type="button" onclick="imixsWopi.switchToFullScreen(); return false;" class="imixs-workflow-action" value="#{message.fullscreen}" />
</div>
</div>
<div id="wopi_canvas" style="display: none;"></div>
</ui:fragment>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
xmlns:i="http://xmlns.jcp.org/jsf/composite/imixs">

<h1>#{message.workflow}</h1>

<c:choose>
<c:when
test="#{workflowController.workitem.item['$isAuthor'] or workflowController.newWorkitem}">
Expand All @@ -17,10 +16,10 @@
<!-- we do not use i:imixsWorkflowActions here because of customization -->
<c:forEach items="#{workflowController.events}" var="event">
<ui:param name="confirmMessage" value="#{validationController.getConfirmMessage(event)}" />
<ui:param name="confirmScript" value="return confirm('#{confirmMessage}');" />
<h:commandButton action="#{workflowController.process}" id="imixs_workflow_eventid_#{event.item['numactivityid']}"
<ui:param name="confirmWopiMessage" value="#{wopiController!=null?wopiController.confirmMessage:''}" />
<h:commandButton action="#{workflowController.process}" id="imixs_workflow_eventid_#{event.item['numactivityid']}"
class="imixs-workflow-action" title=""
onclick="#{! empty confirmMessage?confirmScript:''}"
onclick="return imixsOfficeWorkitem.saveWorkitemHandler('#{confirmMessage}','#{confirmWopiMessage}',this);"
value="#{event.item['txtname']}">
<f:setPropertyActionListener
target="#{workflowController.workitem.item['$eventid']}"
Expand All @@ -31,9 +30,7 @@
</h:panelGroup>
</h:commandButton>
</c:forEach>

</h:panelGroup>

</c:when>

<!-- ReadOnly Modus -->
Expand Down

0 comments on commit f540a2b

Please sign in to comment.