Does anyone have a JSF based file manager recommendation?

UI Components for JSF
Post Reply
RElliott
Posts: 94
Joined: 07 Feb 2014, 00:39

27 Feb 2017, 18:19

I need a way to manage files on my Glassfish server so that my users can integrate pictures, videos, etc into CKEditor content. For example, when my user selects the note button on my application, he sees a window containing a CKEditor. He can enter the information that he wants to record into CKEditor and then save the note for future generations. On some notes, he may want to integrate a picture or video into the CKEditor content so he needs a way to upload and manage files on the server specifically for that note.

It would not be difficult to create a file manager using the PrimeFaces tools, but I was hoping to save myself some time and use an existing tool.

I performed a quick web search this morning and discovered the following tools:
  • CKFinder
  • elFinder
  • KCFinder
elFinder and KCFinder are PHP based. CKFinder has a Java version but reports the following on their web page:
CKFinder 2 is currently the latest version of CKFinder for ASP, ColdFusion and Java. The ASP/Java/ColdFusion distributions of CKFinder will not be upgraded to version 3, however will still receive patches (including security fixes) until 2019.
Does anyone have a JSF based file manager solution?

Developing a suite of commonly used tools like a file manager on top of their components might be another way for PrimeTek to monetize their good work. If PrimeTek offered a file manager today that integrated with their premium themes such as Modena, I wouldn't hesitate to pay $50 to $100 to save me the hours that it will take me to develop a custom solution.
PrimeFaces 7.0.1, Glassfish 5.1.0, Oracle JDK 8, Eclipse 2016-02

tandraschko
PrimeFaces Core Developer
Posts: 3979
Joined: 03 Dec 2010, 14:11
Location: Bavaria, DE
Contact:

27 Feb 2017, 22:19

There is none - but you can develop one for PFE or sponser it e.g. ;)
Thomas Andraschko

PrimeFaces | PrimeFaces Extensions

Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE

Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko

RElliott
Posts: 94
Joined: 07 Feb 2014, 00:39

28 Feb 2017, 04:07

I created a simple file manager based on a p:dialog containing a p:dataTable and a p:fileUpload this afternoon that allows me to view the files in a folder and upload new files to the folder. After I add a few more features, it will be good enough for my purposes.

I don't have the skills or the time at the moment to develop a file manager that would be appropriate for PFE but I might be interested in sponsoring a solution. What is involved in sponsoring a PFE component?
PrimeFaces 7.0.1, Glassfish 5.1.0, Oracle JDK 8, Eclipse 2016-02

tandraschko
PrimeFaces Core Developer
Posts: 3979
Joined: 03 Dec 2010, 14:11
Location: Bavaria, DE
Contact:

28 Feb 2017, 12:51

You can try to contact primtek for a PF file manager. Oleg and i did some sponsored components in the past but Oleg isn't active in PE anymore and i don't have time currently.
Thomas Andraschko

PrimeFaces | PrimeFaces Extensions

Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE

Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko

raho
Posts: 27
Joined: 05 Feb 2016, 21:08

18 Jul 2017, 07:22

RElliott wrote:
28 Feb 2017, 04:07
I created a simple file manager based on a p:dialog containing a p:dataTable and a p:fileUpload this afternoon that allows me to view the files in a folder and upload new files to the folder. After I add a few more features, it will be good enough for my purposes.

I don't have the skills or the time at the moment to develop a file manager that would be appropriate for PFE but I might be interested in sponsoring a solution. What is involved in sponsoring a PFE component?
Hi, I am also interested in such a file manager, so I wanted to ask you, whether you would share your code?
PF 12.0.4
WildFly 23.0.2.Final

RElliott
Posts: 94
Joined: 07 Feb 2014, 00:39

19 Jul 2017, 00:35

It is not very impressive but the following is my composite component code that supports uploading files to a folder on the server. For example, I have a Notes page that uses CKEditor and includes the following composite component. When the user selects the [File Manager] button on the Notes page, the dialog displays and shows the files in the folder in a datatable and allows the user to delete a file or upload a new file.

Code: Select all

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html>
<html
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:cc="http://xmlns.jcp.org/jsf/composite"
    xmlns:h="http://xmlns.jcp.org/jsf/html"
    xmlns:c="http://java.sun.com/jsp/jstl/core"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:p="http://primefaces.org/ui">
<!-- Interface -->
<cc:interface>
    <cc:attribute
        name="title"
        required="true" />
    <cc:attribute
        name="entityType"
        required="true" />
    <cc:attribute
        name="entityID"
        required="true" />
</cc:interface>
<!-- Implementation -->
<cc:implementation>
    <c:set
        target="#{fileDialog}"
        property="entityType"
        value="#{cc.attrs.entityType}" />
    <c:if test="#{not empty cc.attrs.entityID}">
        <c:set
            target="#{fileDialog}"
            property="entityID"
            value="#{cc.attrs.entityID}" />
    </c:if>
    <p:dialog
        id="#{cc.clientId}-dialog"
        header="#{cc.attrs.title}"
        widgetVar="#{cc.clientId}-dialog"
        width="calc(100% - 100px)"
        modal="true"
        responsive="true"
        onShow="positionDialog('#{cc.clientId}:#{cc.clientId}-dialog')">
        <p:messages
            showSummary="fale"
            showDetail="true"
            autoUpdate="true"
            closable="true" />
        <p:dataTable
            id="file-table"
            value="#{fileDialog.files}"
            var="file">
            <p:column
                headerText="Image"
                styleClass="elis-dt-name"
                style="vertical-align: top;">
                <p:graphicImage
                    value="/files/#{cc.attrs.entityType}/#{cc.attrs.entityID}/#{file.name}"
                    style="height: 100px; width: auto;" />,
            </p:column>
            <p:column
                headerText="Name"
                style="vertical-align: top;">
                <h:outputText value="#{file.name}" />
            </p:column>
            <p:column
                headerText="Path"
                style="vertical-align: top;">
                <h:outputText
                    value="http://<server ip>:8080/elis-wa/files/#{cc.attrs.entityType}/#{cc.attrs.entityID}/#{file.name}" />
            </p:column>
            <p:column
                styleClass="elis-dt-1button"
                style="vertical-align: top;">
                <p:commandButton
                    icon="fa fa-trash Fs16 White"
                    title="Delete file"
                    actionListener="#{fileDialog.deleteFile(file)}"
                    update="file-table"
                    immediate="true" />
            </p:column>
        </p:dataTable>
        <div class="EmptyBox10"></div>
        <h:form
            id="file-form"
            enctype="multipart/form-data">
            <p:fileUpload
                rendered="#{not empty cc.attrs.entityID}"
                fileUploadListener="#{fileDialog.handleFileUpload}"
                mode="advanced"
                multiple="true"
                sizeLimt="10485760"
                fileLimit="5"
                skinSimple="true"
                label="Upload File(s)"
                required="false"
                update="#{cc.clientId}:file-table" />
        </h:form>
    </p:dialog>
</cc:implementation>
</html>
PrimeFaces 7.0.1, Glassfish 5.1.0, Oracle JDK 8, Eclipse 2016-02

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 9 guests