merged bennis changes
This commit is contained in:
commit
db7261af56
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -343,7 +343,6 @@ public static DocumentDTO toDTO(Document document){};
|
|||
\subsubsection{Beschreibe ein konkretes Anwendungsbeispiel}
|
||||
\begin{itemize}
|
||||
\item Java Server Faces (bei Java Server Faces enthält das File zwar keinen Java Code, interagiert aber direkt mit Java Code einer Backing Bean)
|
||||
\item
|
||||
\end{itemize}
|
||||
\begin{minted}[linenos,breaklines=true]{xml}
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
@ -457,6 +456,64 @@ public static DocumentDTO toDTO(Document document){};
|
|||
</login-config>
|
||||
</web-app>
|
||||
\end{minted}
|
||||
|
||||
\subsubsection{Anwendung im Projekt}
|
||||
JavaServer Faces: mächtiges Framework, wo das MVC Pattern verwendet wird. Auf der einen Seite
|
||||
stehen die reinen Views (XHTML Seiten) und auf der anderen Seite Java Beans (Java Klassen), die als
|
||||
View Helper fungieren können. Beispiel: layered/MVC-JSF
|
||||
Primefaces ist eine konkrete Implementierung der JavaServer Faces (siehe POM.XML).
|
||||
|
||||
\begin{minted}[linenos,breaklines=true]{xml}
|
||||
<?xml version='1.0' encoding='UTF-8' ?>
|
||||
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
|
||||
xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
|
||||
xmlns:h="http://xmlns.jcp.org/jsf/html"
|
||||
xmlns:p="http://primefaces.org/ui"
|
||||
xmlns:f="http://xmlns.jcp.org/jsf/core"
|
||||
template="communityTemplate.xhtml">
|
||||
<ui:define name="communityContent">
|
||||
<h1>#{msg.document_manage_title}</h1>
|
||||
<f:metadata>
|
||||
<f:viewAction action="#{documentListController.loadDocumentsFromCommunity()}" />
|
||||
</f:metadata>
|
||||
|
||||
<h:form id="doclistform">
|
||||
<p:commandButton value="Refresh list" actionListener="#{documentListController.loadDocumentsFromCommunity()}" update="@form doclistform"></p:commandButton>
|
||||
<p:dataTable id="doclisttable" value="#{documentListController.communityDocuments}" var="docs">
|
||||
<p:column class="documenttimecolumn" headerText="#{msg.document_uploaded}">#{docs.createdTimestamp}</p:column>
|
||||
<p:column class="documenttimecolumn" headerText="#{msg.label_userid}">#{docs.user.userId}</p:column>
|
||||
<p:column headerText="#{msg.label_filename}">#{docs.filename}</p:column>
|
||||
<p:column headerText="" class="documentbuttoncolumn">
|
||||
<p:commandButton value="#{msg.button_download}" ajax="false"
|
||||
onclick="PrimeFaces.monitorDownload(start, stop);">
|
||||
<p:fileDownload value="#{documentController.downloadDocument(docs.id)}"/>
|
||||
</p:commandButton>
|
||||
</p:column>
|
||||
<p:column headerText="" class="documentbuttoncolumn">
|
||||
<p:commandButton id="btnDel" value="#{msg.button_delete}"
|
||||
actionListener="#{documentController.removeDocument(docs.id)}"
|
||||
update="@form doclistform">
|
||||
</p:commandButton>
|
||||
</p:column>
|
||||
</p:dataTable>
|
||||
</h:form>
|
||||
<h:form id="formdocupload" enctype="multipart/form-data">
|
||||
<p:fileUpload id="fileupload"
|
||||
dragDropSupport="false"
|
||||
update="@form doclistform"
|
||||
fileUploadListener="#{documentController.uploadDocument}"
|
||||
allowTypes="/(\.|\/)(pdf|jpe?g|docx)$/" sizeLimit="5000000"
|
||||
mode="advanced" label="Add document (.pdf .jpg .docx)">
|
||||
</p:fileUpload>
|
||||
</h:form>
|
||||
<p:messages id="feedbackBox" severity="info,error" showDetail="true" showSummary="false">
|
||||
<p:autoUpdate/>
|
||||
</p:messages>
|
||||
</ui:define>
|
||||
</ui:composition>
|
||||
\end{minted}
|
||||
|
||||
\subsubsection{Nenne die Konsequenzen der Anwendung}
|
||||
\begin{itemize}
|
||||
\item es muss nur EIN (Front) Controller konfiguriert werden
|
||||
|
|
Loading…
Reference in New Issue