文档存储库 (PHP)

发布于 2024-11-15 08:30:34 字数 907 浏览 1 评论 0 原文

这篇文章更多的是为了获得建议和想法,而不是解决问题。解释起来有点困难,但我会尽力的。

我有一个文档存储库,其中包含一个带有 PDF 的唯一目录,这些文档必须在“虚拟”文件夹中向最终用户显示,因为它们必须在其中许多文件夹中可见。我所说的虚拟文件夹是文件系统中正常的目录层次结构,但最终文档必须取自前面提到的 PDF 存储库。

示例:

repo/{dozens of PDF}
rootfolder/sub-folder1/sub-folder11/contracts1.php
          /sub-folder2/contracts1.php
          /sub_folder3/sub-folder31/contracts2.php
          /sub_folder4/sub-folder41/sub-folder42/sub-folder43/contracts3.php
          /sub-folder5/contracts5.php

这是一个我的老板希望很快准备好的项目,所以此时我一直在使用 php-file-tree 生成一个很好的树状方式来浏览文件夹,每个文件夹中的最终文件是一个带有 PDF 列表的 php 文件。它工作得很好,但是对于每一个更改,我都需要编辑这些 php 文件,将来这个任务应该由其他人(不具备 HTML/PHP 编辑知识的 Office 用户)以简单的方式完成。

你们会推荐我什么?

两件重要的事情是:

  1. PDF 必须在一个单独的文件中 位置,单个目录

  2. 最终用户必须看到树状页面

谢谢。

法比恩

This post is more to get advises and ideas rather than solving a problem. It's a bit difficult to explain, but I will try my best.

I have a document repository which consists of a unique directory with PDF, these documents have to be displayed to the end-user in "virtual" folders, as they must be visible in many of them. What I call virtual folders are a normal hierarchy of directories in the filesystem, but the final documents must be taken from the PDF repository mentioned previously.

Examples :

repo/{dozens of PDF}
rootfolder/sub-folder1/sub-folder11/contracts1.php
          /sub-folder2/contracts1.php
          /sub_folder3/sub-folder31/contracts2.php
          /sub_folder4/sub-folder41/sub-folder42/sub-folder43/contracts3.php
          /sub-folder5/contracts5.php

That was a project my boss wanted to be ready very quickly, so at this moment, I've been using php-file-tree that generates a nice tree-like way to navigate through the folders, the end file in each folder being a php file with the list of PDF. It works great, but for every changes, I need to edit those php files, and in the future this task should be done by someone else (an office user with no knowledge in HTML/PHP editing) in a easy way.

What would you guys recommend me?

The 2 important things are :

  1. the PDFs must be in one single
    location, single directory

  2. the end-user must see a tree-like page

Thank you.

fabien

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

魔法唧唧 2024-11-22 08:30:34

免责声明:这可能有点多,但也许它还是有用的。

他们的方式我会这样做:

  • 使用 ExtJsExt.tree.Panel (一棵树是 pdf 的来源,第二个是虚拟的目录)

  • 存储数据库或 xml 文件中的最终树

  • 为 Office 用户构建一个迷你管理 GUI

  • 为最终用户构建一个视图,仅显示虚拟目录树及其 pdf。

Disclaimer: This is probably a bit much, but maybe it's useful anyway.

They way I would do it:

  • use ExtJs with Ext.tree.Panel (with one tree being your source of pdfs, and the second the virtual directories)

  • store the final tree in a database or xml-file

  • build a mini admin gui for the office user

  • build a view for the enduser only displaying the tree of virtual directories with their pdfs.

不必你懂 2024-11-22 08:30:34

我将使目录树真正虚拟,即,我将在数据库中创建它,而不是在文件系统中创建它。文件列表也将在数据库中(即数据库中的文件名,文件系统上的文件)。另一个数据库表将用于将文件链接到目录。

create table file (
    id integer primary key,
    name varchar(64) not null
) engine = InnoDB;

create table directory (
    id integer primary key,
    parent_id integer,
    name varchar(64) not null
) engine = InnoDB;

create table file_in_directory (
    file_id integer not null,
    directory_id integer not null,
    primary key (file_id, directory_id)
) engine = InnoDB;

insert into directory (id, parent_id, name) values
    (1, null, 'rootfolder'),
    (2, 1, 'sub-folder1'),
    (3, 1, 'sub-folder2'),
    (4, 1, 'sub-folder3'),
    (5, 1, 'sub-folder4'),
    (6, 1, 'sub-folder5'),
    (7, 2, 'sub-folder11'),
    (8, 4, 'sub-folder31'),
    (9, 5, 'sub-folder41'),
    (10, 9, 'sub-folder42'),
    (11, 10, 'sub-folder43');

insert into file (id, name) values
    (1, 'contracts1.php'),
    (2, 'contracts2.php'),
    (3, 'contracts3.php'),
    (4, 'contracts5.php');

insert into file_in_directory (file_id, directory_id) values
    (1, 7), -- rootfolder/sub-folder1/sub-folder11/contracts1.php
    (1, 3), -- rootfolder/sub-folder2/contracts1.php
    (2, 8), -- rootfolder/sub_folder3/sub-folder31/contracts2.php
    (3, 11), -- rootfolder/sub_folder4/sub-folder41/sub-folder42/sub-folder43/contracts3.php
    (4, 6); -- rootfolder/sub-folder5/contracts5.php

I would make a directory tree really virtual, i.e., instead of creating it in file system, I would create it in DB. List of files would also be in DB (i.e., filenames in DB, files - on filesystem). Another DB table would be used for linking files to directories.

create table file (
    id integer primary key,
    name varchar(64) not null
) engine = InnoDB;

create table directory (
    id integer primary key,
    parent_id integer,
    name varchar(64) not null
) engine = InnoDB;

create table file_in_directory (
    file_id integer not null,
    directory_id integer not null,
    primary key (file_id, directory_id)
) engine = InnoDB;

insert into directory (id, parent_id, name) values
    (1, null, 'rootfolder'),
    (2, 1, 'sub-folder1'),
    (3, 1, 'sub-folder2'),
    (4, 1, 'sub-folder3'),
    (5, 1, 'sub-folder4'),
    (6, 1, 'sub-folder5'),
    (7, 2, 'sub-folder11'),
    (8, 4, 'sub-folder31'),
    (9, 5, 'sub-folder41'),
    (10, 9, 'sub-folder42'),
    (11, 10, 'sub-folder43');

insert into file (id, name) values
    (1, 'contracts1.php'),
    (2, 'contracts2.php'),
    (3, 'contracts3.php'),
    (4, 'contracts5.php');

insert into file_in_directory (file_id, directory_id) values
    (1, 7), -- rootfolder/sub-folder1/sub-folder11/contracts1.php
    (1, 3), -- rootfolder/sub-folder2/contracts1.php
    (2, 8), -- rootfolder/sub_folder3/sub-folder31/contracts2.php
    (3, 11), -- rootfolder/sub_folder4/sub-folder41/sub-folder42/sub-folder43/contracts3.php
    (4, 6); -- rootfolder/sub-folder5/contracts5.php
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文