LRML Search is a web application for storing, viewing and searching LegalRuleML documents, developed as part of the LegalRuleMLParl project. Under the hood, it is a PHP 7.0 Laravel web app which uses BaseX for XML storage and querying, and PostgreSQL for all other data storage.
LRML Search was written by Radostin Stoyanov and Andrea Faulds. Copyright © 2017 University of Aberdeen.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Documentation in Markdown format can be found in src/resources/help/usersguide.md, and also within the app itself.
This is a Laravel application. Therefore, its best practice should be adhered to in maintenance, e.g. database changes should have their own migrations.
If you are modifying LRMLToHTMLConverter, bear in mind that in production, it is only run once for each document at the point of upload, and then the HTML version is cached in the PostgreSQL database. Therefore, changes made to the converter will only affect existing documents if they are reuploaded. By contrast, in debug mode it is run every time a document is viewed, allowing for rapid iteration.
Install Docker and docker-compose
docker-compose up -d
docker-compose run web bash -c 'php artisan migrate && php artisan db:seed --class=UsersTableSeeder'By default (see src/database/seeds/UsersTableSeeder.php), a user account with the email address user@localhost and the password lrmlsearch is created. With this account, you can log in and upload or delete documents, as well as create other user accounts.
For security reasons it is not a good idea to keep this initial account around; delete it or change its password. (Unfortunately, neither can be done directly through the interface right now.)
Special
src/app/LRMLToHTMLConverter.phpLegalRuleML to HTML converter
Routes
src/routes/web.phpThis file contains the routes of the application
Views
-
src/resources/views/index.blade.phpHome Page -
src/resources/views/dashboard.blade.phpThis view appears after user has logged in successfully. -
src/resources/views/search.blade.phpThis view is used for the search functionality. -
src/resources/views/documents/index.blade.phpShow a list of all documents. -
src/resources/views/documents/show.blade.phpShow a HTML content of a document. -
src/resources/views/documents/upload.blade.phpUpload new document. -
src/resources/views/layouts/app.blade.phpThe layout file - contains the code which appears on every page -
src/resources/views/inc/navbar.blade.phpNavigation bar -
src/resources/views/inc/messages.blade.phpSuccess/Error messages shown on the top of a page -
src/resources/views/auth/login.blade.phpLogin page -
src/resources/views/auth/register.blade.phpRegistration page -
src/resources/views/auth/passwords/email.blade.phpRequest reset password -
src/resources/views/auth/passwords/email.blade.phpConfirm reset password
Controllers
src/app/Http/Controllers/Auth/ForgotPasswordController.phpThis controller is responsible for handling password reset emails.src/app/Http/Controllers/Auth/LoginController.phpThis controller handles authenticating users.src/app/Http/Controllers/Auth/RegisterController.phpThis controller handles the registration of new users.src/app/Http/Controllers/Auth/ResetPasswordController.phpThis controller is responsible for handling password reset requests.src/app/Http/Controllers/BaseXController.phpThis controller is responsible for the interaction with BaseX.src/app/Http/Controllers/DashboardController.phpController for the Dashboard shown after successful user login.src/app/Http/Controllers/DocumentsController.phpThis controller is responsible Upload/Delete/Show/Download of documents.src/app/Http/Controllers/PagesController.phpThis controller handles requests to the Home Page.src/app/Http/Controllers/SearchController.phpThis controller handles search requests.
Models
src/app/Document.phpStore Title, File name and HTML version of documents.src/app/User.phpStore user credentials used for authentication.
Assets
src/public/css/app.cssCompiled CSS which includes JQuery and Bootstrap.src/public/css/custom.cssCustom CSS rules. They overwriteapp.css.src/public/css/lrml.cssStyle for LegalRuleML elementssrc/public/js/app.jsCompacted JavaScript which includes JQuery and Bootstrap.