Skip to content

Commit

Permalink
exporters and Procfile warmup
Browse files Browse the repository at this point in the history
  • Loading branch information
Tadeo Rivera committed Nov 4, 2019
1 parent e378c55 commit 19c0a1c
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Procfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
web: java -jar lib/payara-micro-5.193.jar --deploy target/tadeocrud.war --port $PORT
web: bin/warmup & java -jar lib/payara-micro-5.193.jar --deploy target/tadeocrud.war --port $PORT
8 changes: 8 additions & 0 deletions bin/warmup
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
until $(curl -o /dev/null -s -I -f http://localhost:$PORT); do
sleep 5
done

for ROUTE in $WARMUP_ROUTES; do
echo "[warmup] calling $ROUTE"
curl -L "http://localhost:$PORT$ROUTE" >/dev/null 2>&1
done
67 changes: 58 additions & 9 deletions src/main/webapp/app/main.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<p:panelGrid columns="2" columnClasses="label, value">
<h:outputText value="#{bundle.app_main_fn}" />
<p:inputText id="fn" value="#{mainBean.formUser.firstname}" required="true" requiredMessage="#{bundle.app_main_fnreq}"/>

<h:outputText value="#{bundle.app_main_mn}" />
<p:inputText id="mn" value="#{mainBean.formUser.middlename}"/>

Expand Down Expand Up @@ -92,33 +92,82 @@
<h:form id="form">
<p:growl id="msgs" showDetail="true"/>

<p:dataTable id="users" var="user" value="#{mainBean.users}" selectionMode="single" selection="#{mainBean.selectedUser}" rowKey="#{user.userid}" style="margin-bottom:20px">
<p:dataTable id="users" var="user" value="#{mainBean.users}"
selectionMode="single" selection="#{mainBean.selectedUser}"
rowKey="#{user.userid}" style="margin-bottom:20px"
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink}"
paginator="true" rows="10">
<f:facet name="header">
<p:outputLabel>#{bundle.app_main_theader}</p:outputLabel>
</f:facet>

<p:ajax event="rowSelect" listener="#{mainBean.onRowSelect}" update=":form:msgs,myForm" />
<p:ajax event="rowUnselect" listener="#{mainBean.onRowUnselect}" update=":form:msgs,myForm" />

<p:column headerText="#{bundle.app_main_id}" width="25">
<p:column>
<f:facet name="header">
<h:outputText value="#{bundle.app_main_id}" />
</f:facet>
<h:outputText value="#{user.userid}" />
</p:column>
<p:column headerText="#{bundle.app_main_email}" width="100" style="align-content: center ">
<p:column>
<f:facet name="header">
<h:outputText value="#{bundle.app_main_email}"/>
</f:facet>
<h:outputText value="#{user.email}" />
</p:column>
<p:column headerText="#{bundle.app_main_fn}" width="75">
<p:column>
<f:facet name="header">
<h:outputText value="#{bundle.app_main_fn}"/>
</f:facet>
<h:outputText value="#{user.firstname}" />
</p:column>
<p:column headerText="#{bundle.app_main_mn}" width="75">
<p:column>
<f:facet name="header">
<h:outputText value="#{bundle.app_main_mn}"/>
</f:facet>
<h:outputText value="#{user.middlename}" />
</p:column>
<p:column headerText="#{bundle.app_main_ln}" width="100">
<p:column>
<f:facet name="header">
<h:outputText value="#{bundle.app_main_ln}"/>
</f:facet>
<h:outputText value="#{user.lastname}" />
</p:column>
<p:column headerText="#{bundle.app_main_rol}" width="50">
<p:column>
<f:facet name="header">
<h:outputText value="#{bundle.app_main_rol}"/>
</f:facet>
<h:outputText value="#{user.wrole}" />
</p:column>
<f:facet name="footer">
<p:commandButton id="delete" action="#{mainBean.delete}" value="#{bundle.app_main_bdel}" update="form:msgs,form:users,myForm"/>

<p:panelGrid columns="5">

<p:commandButton id="delete" action="#{mainBean.delete}" value="#{bundle.app_main_bdel}" update="form:msgs,form:users,myForm"/>

<h:commandLink>
<p:graphicImage name="/images/excel.png" width="24"/>
<p:dataExporter type="xls" target="users" fileName="users" />
</h:commandLink>

<h:commandLink>
<p:graphicImage name="/images/pdf.png" width="24"/>
<p:dataExporter type="pdf" target="users" fileName="users"/>
</h:commandLink>

<h:commandLink>
<p:graphicImage name="/images/csv.png" width="24"/>
<p:dataExporter type="csv" target="users" fileName="users" />
</h:commandLink>

<h:commandLink>
<p:graphicImage name="/images/xml.png" width="24"/>
<p:dataExporter type="xml" target="users" fileName="users" />
</h:commandLink>
</p:panelGrid>


</f:facet>
</p:dataTable>
</h:form>
Expand Down
Binary file added src/main/webapp/resources/images/csv.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/main/webapp/resources/images/excel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/main/webapp/resources/images/pdf.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/main/webapp/resources/images/xml.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 19c0a1c

Please sign in to comment.