office-alexander-logistics/office-alexander-logistics-app/src/main/webapp/pages/admin/zoho.xhtml

232 lines
No EOL
6.7 KiB
HTML

<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:i="http://java.sun.com/jsf/composite/imixs" xmlns:c="http://java.sun.com/jsp/jstl/core"
xmlns:marty="http://java.sun.com/jsf/composite/marty" template="/layout/template.xhtml">
<ui:define name="content">
<f:view>
<script type="text/javascript">
/*<![CDATA[*/
function updateStatustPanel(data) {
//initUserInput($('#userselector_id'));
if (data.status === 'success') {
// select with wildcard operator
$('[id$=status_panel]').imixsLayout();
}
}
/*]]>*/
</script>
<h:form id="import_form_id" autocomplete="off">
<div class="imixs-form">
<div class="imixs-header">
<h1>ZOHO - API </h1>
<!-- ########## Error ########## -->
</div>
<div class="imixs-body">
<div class="imixs-tabs">
<ul>
<li><a href="#tab-1">Access Token </a></li>
</ul>
<div id="tab-1">
<!-- **** Export Buchunsstapel ***** -->
<div class="imixs-form-section">
<!-- API Tokens -->
<div class="imixs-form-section-2">
<dl>
<dt>API OAuth URL <span class="imixs-required">*</span>
</dt>
<dd>
<span><strong>Default:</strong>
https://accounts.zoho.com/oauth/v2/token</span><br />
<h:inputText required="true"
value="#{zohoController.workitem.item['zoho.oauth.uri']}">
</h:inputText>
</dd>
</dl>
<dl>
<dt>API Base URL <span class="imixs-required">*</span></dt>
<dd>
<span><strong>Default:</strong>
https://www.zohoapis.&lt;YOUR-DOMAIN&gt;com/books/v3/</span><br />
<h:inputText required="true"
value="#{zohoController.workitem.item['zoho.uri']}">
</h:inputText>
</dd>
</dl>
<dl>
<dt>Organization <span class="imixs-required">*</span></dt>
<dd>
<h:inputText required="true"
value="#{zohoController.workitem.item['zoho.organization']}">
</h:inputText>
</dd>
</dl>
<dl>
<dt>Costs Account ID <span class="imixs-required">*</span></dt>
<dd>
<h:inputText required="true"
value="#{zohoController.workitem.item['zoho.accountID']}">
</h:inputText>
</dd>
</dl>
<dl>
<dt>Client ID <span class="imixs-required">*</span></dt>
<dd>
<h:inputText required="false"
value="#{zohoController.workitem.item['zoho.clientid']}">
</h:inputText>
</dd>
</dl>
<dl>
<dt>Client Secret <span class="imixs-required">*</span></dt>
<dd>
<h:inputSecret required="false" redisplay="true"
value="#{zohoController.workitem.item['zoho.clientsecret']}">
</h:inputSecret>
</dd>
</dl>
</div>
<!-- Grant Token -->
<div class="imixs-form-section-2">
<dl>
<dt>Access Code <span class="imixs-required">*</span> </dt>
<dd>
<h:inputSecret required="false" redisplay="true"
value="#{zohoController.workitem.item['zoho.code']}">
</h:inputSecret>
</dd>
</dl>
<p>
<span class="typcn typcn-lightbulb"></span> Fordern Sie einen ZOHO API COde
an
<ol>
<li>Melden Sie sich auf der <a href="https://api-console.zoho.com/"
target="_blank">ZOHO API Console</a> an</li>
<li>
Legen Sie einen API Self Client an
</li>
<li>
Kopieren Sie Client ID und Client Secret sowie die Organization ID
</li>
<li>
Generieren Sie einen neuen Access Code
<br />
Scope:
<code>ZohoBooks.contacts.ALL,ZohoBooks.invoices.ALL,ZohoBooks.bills.ALL,ZohoBooks.debitnotes.ALL,ZohoBooks.settings.READ</code>
</li>
<li>
Code über den Button "Create" anfordern und in das Feld "Access Code"
übertragen
</li>
<li>
Access Token über den Button "Access Token Generieren" speichern
</li>
</ol>
<h:commandButton actionListener="#{zohoController.updateAccessToken()}"
value="Token generieren">
</h:commandButton>
<h:commandButton actionListener="#{zohoController.refreshAccessToken()}"
value="Refresh Access Token">
</h:commandButton>
</p>
</div>
<div class="imixs-form-section-2">
<h3>Status:
<h:outputText value="#{zohoController.workitem.item['message']}" />
</h3>
<table>
<tr>
<td><strong>API Domain: </strong></td>
<td>
<h:outputText
value="#{zohoController.workitem.item['zoho.apiDomain']}" />
</td>
</tr>
<tr>
<td><strong>Scope: </strong></td>
<td>
<h:outputText
value="#{zohoController.workitem.item['zoho.scope']}" />
</td>
</tr>
<tr>
<td><strong>AccessToken: </strong></td>
<td>
<h:outputText
value="#{!empty zohoController.workitem.item['zoho.accesstoken']?'OK':'NOK'}" />
</td>
</tr>
<tr>
<td>
<strong>RefreshToken: </strong>
</td>
<td>
<h:outputText
value="#{!empty zohoController.workitem.item['zoho.refreshtoken']?'OK':'NOK'}" />
</td>
</tr>
<tr>
<td>
<strong>Expires: </strong>
</td>
<td>
<h:outputText
value="#{zohoController.workitem.item['zoho.expires']}" />
</td>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>
<div class="imixs-footer">
<h:outputLabel value="#{message.modified}: " />
<h:outputText value="#{zohoController.workitem.item['$modified']}">
<f:convertDateTime timeZone="#{message.timeZone}" type="both"
pattern="#{message.dateTimePattern}" />
</h:outputText>
<br />
<h:commandButton actionListener="#{zohoController.save}" value="#{message.save}">
</h:commandButton>
<h:commandButton value="#{message.close}" action="notes" />
</div>
</div>
</h:form>
</f:view>
</ui:define>
</ui:composition>