Commit Graph

7140 Commits

Author SHA1 Message Date
Roberto Rosario
8d31a0f155 Add the zh-cn locale to the process languages script 2014-10-01 05:32:28 -04:00
Roberto Rosario
437c74a024 Merge branch 'master' into development 2014-10-01 05:19:51 -04:00
Roberto Rosario
5a7e09c876 Reset the local.py settings file 2014-10-01 05:17:41 -04:00
Roberto Rosario
d03801d444 Merge remote-tracking branch 'origin/master' 2014-10-01 05:17:08 -04:00
Roberto Rosario
32b3ae7267 Merge branch 'feature/optimize_thumbnails' into development
Conflicts:
	mayan/apps/main/templates/base.html
2014-10-01 05:16:28 -04:00
Roberto Rosario
7bc2da97ef Change the data attribute used to avoid javascript mime warnings, remove duplicated $(this) lookup 2014-10-01 05:10:31 -04:00
Roberto Rosario
3eab590b49 Remove unused variables, remove unused parent lookup, remove unused logging, remove lazy load class after loading 2014-10-01 05:00:12 -04:00
Roberto Rosario
470eb299b6 Issue #49, add scrollstop event support and use it to optimize document page image loading 2014-10-01 04:56:42 -04:00
Roberto Rosario
c5d7e4075d Merge pull request #54 from fordguo/master
add the zh_CN support
2014-10-01 03:11:28 -04:00
Roberto Rosario
7090fb8859 Merge branch 'hotfix/fix_anonymous_search' into development 2014-09-30 17:29:05 -04:00
Roberto Rosario
f1cbc44db9 Issue #51, Don't try to display the recent searches template for anonymous users. 2014-09-30 17:28:02 -04:00
Roberto Rosario
5f6438ac55 Merge branch 'feature/polish_PR_52' into development 2014-09-30 15:48:42 -04:00
Roberto Rosario
4968051b6d Don't silence OCR errors even if Tesseract is optional otherwise the user won't know happened.
Catch the OSError generic exception and return a friendlier "Tesseract not found" exception
2014-09-30 15:41:00 -04:00
Roberto Rosario
f434720617 Don't silence OCR errors at the API high level, at this layer we don't know what really happened in the backend.
Move exception handling to the backend.
2014-09-30 15:39:36 -04:00
Roberto Rosario
3effc58ab0 Fix the way we try for missing binary dependencies in the installations app
Issue #50. Thanks to Ford Guo (@fordguo) for the reporting.
2014-09-30 15:21:21 -04:00
Mathias Behrle
1cbd54dad7 Do not fail, when ocr backend is missing (#50).
- Since tesseract (i.e. an ocr backend) is an optional requiremnt of mayan, we
  shouldn't fail, if it is not found.
- S.a https://github.com/mayan-edms/mayan-edms/issues/50
2014-09-30 15:14:38 -04:00
Roberto Rosario
b70611de90 Merge pull request #52 from mbehrle/feature/unfail_ocr_backend
Do not fail, when ocr backend is missing (#50).
2014-09-30 15:10:36 -04:00
Roberto Rosario
c95b088cd8 Merge branch 'hotfix/test_for_issue_46' into development
Conflicts:
	mayan/apps/documents/tests.py
2014-09-30 14:47:17 -04:00
Roberto Rosario
07dd6a87ef Add test to make sure the page issue is fixed, issue #46 2014-09-30 14:45:22 -04:00
Roberto Rosario
03e5c7732a Ignore the 'page' key when recreating the advanced search string 2014-09-30 14:43:46 -04:00
Mathias Behrle
0b153f0c7e Skip page key in advanced search (#46). 2014-09-30 13:57:21 -04:00
Roberto Rosario
36990ec818 Add document accesor method to display a document folders 2014-09-30 09:58:42 -04:00
Ford Guo
306c528665 update zh_CN po mo 2014-09-30 12:07:57 +08:00
Ford Guo
fa78a30413 change zh_CN po mo 2014-09-30 11:00:39 +08:00
Ford Guo
5d10eab278 update zh_CN 2014-09-29 14:28:50 +08:00
Ford Guo
930ae94856 update zh_CN po,mo 2014-09-28 12:06:34 +08:00
Ford Guo
bc31899d9e update zh_CN po,mo 2014-09-28 11:41:36 +08:00
Ford Guo
e4cdc69ca1 add zh_CN mo files 2014-09-26 13:54:49 +08:00
Ford Guo
b15100c2ea add zh_CN language 2014-09-26 11:43:53 +08:00
Mathias Behrle
034875a88a Do not fail, when ocr backend is missing (#50).
- Since tesseract (i.e. an ocr backend) is an optional requiremnt of mayan, we
  shouldn't fail, if it is not found.
- S.a https://github.com/mayan-edms/mayan-edms/issues/50
2014-09-25 19:31:46 +02:00
Roberto Rosario
389143a8b7 Merge pull request #48 from mbehrle/feature/fix_advanced_search
Skip page key in advanced search (#46).
2014-09-23 01:57:12 -04:00
Mathias Behrle
73e1650554 Skip page key in advanced search (#46). 2014-09-23 00:28:25 +02:00
Gary Walborn
9cd3753746 Adds ability to validate and normalize metadata.
I felt that it would be very handy to be able to validate
user-supplied metadata.  It occurred to me that if a metadata
type had an explicit list of options, it would need no validation.
Therefore, the "lookup" field of a metadata type could be overloaded
to provide EITHER a list of items that could be selected by the user
OR a function to provide data validation.  The system, therefore,
would need to be able to discriminate between a lookup function
and a validation function.

    To this end, I created a global variable
('METADATA_AVAILABLE_VALIDATORS') to contain a dictionary of
available validation functions.  If the name specified in
'metadata_type.lookup' is present in METADATA_AVAILABLE_VALIDATORS,
the system treats the function as a validator.  Otherwise, the
function is treated as a generator of an iterable value providing
the choices for the user.

  Django contains a pre-existing mechanism to support field
validation.  A validator has a single argument (the data to
be validated).  If the argument to the validator is valid,
the validator simply returns.  If there is a problem with
the data, the validator raises a 'ValidationError' exception
and passes an error message which is then displayed by Django
as a mouseover tip in the browser. Validators to be used
with Mayan-EDMS may follow this convention (i.e., take a
single argument and raise an exception if the validation
fails).  The validators in Mayan-EDMS, however, may actually
do more!

  If a validator function RETURNS a value, that value is used
in place of the original data.  This allows the validator to
make data conform to a valid value or to "normalize" a value
before it is stored in the database.  This allows for more
uniform metadata and improves the ability to index on the
metadata values.  Lets take at a look at an example of this
functionality.

  Assume that a document requires a date (perhaps, an
"original posting date").  We can have a 'metadata_type" of
"original_posting_date", and we can create a validator with
the name "is_valid_posting_date".  The validator function
(which is placed in a module read by the settings routine),
contains the function:

def is_valid_posting_date(value):
   from dateutil import parser
   import datetime
   from django.core.exceptions import ValidationError

   try:
      dt = parser.parse(value)
   except ValueError:
      raise ValidationError('Invalid date')
   return dt.date().isoformat()

This is placed in a dictionary in the user's
settings file, thus:

import my_settings
METADATA_AVAILABLE_VALIDATORS = {
  'is_valid_posting_date':my_settings.is_valid_posting_date }

The user creates a metadata type called "original_posting_date"
with a label of "Original Posting Date" and a 'lookup' value
of "is_valid_posting_date".  When the metadata form is filled
in and submitted, the date value is validated by our validator.
Since the python 'parser' function accepts many kinds of input,
the user can enter (for example) '9/1/2014', '2014/10/2',
or even 'Feb 4, 2001'.  If the user enters something that
does not (as far as python is concerned) represent a valid date,
the system will raise a "ValidationError" and the form will
be re-displayed with an appropriate error message.  If, however,
the data is valid, the valid of the field (and, hence, stored
in the database) will be "normalized" to ISO format YYYY-MM-DD.
This allows consistent lookup and indexing regardless of the
users particular idiosyncracies.
2014-09-22 12:30:15 -04:00
Roberto Rosario
def792790c A beautiful hack for an unknown problem: hidden imports. Hide the import for DocumentSerializer otherwise an unexplained ImportError is raised 2014-09-21 23:17:10 -04:00
Roberto Rosario
b709426043 Add id to the document serializer, add required=False to the document type <-> document serialierz relation 2014-09-21 23:15:55 -04:00
Roberto Rosario
f29aeabcfb Add folder app API endpoint 2014-09-21 19:24:00 -04:00
Roberto Rosario
942ad7b93e Add user model API endpoints 2014-09-21 19:23:37 -04:00
Roberto Rosario
364376f04a Specify document type fields and add the id field 2014-09-21 19:22:48 -04:00
Roberto Rosario
eb3e7a10c9 Abstract the way tag documents are retrieved 2014-09-21 16:38:52 -04:00
Roberto Rosario
e522da3632 Add retrieving all documents of document type via API 2014-09-21 15:22:12 -04:00
Roberto Rosario
97de4f615c Add Document model related name to the Document Type model to allow retrieving all documents of a document type 2014-09-21 15:21:39 -04:00
Roberto Rosario
050ae8c168 Add Document type list API view and endpoint 2014-09-21 15:21:19 -04:00
Roberto Rosario
2e4cd173c6 Add document type detail API endpoint 2014-09-21 15:13:56 -04:00
Roberto Rosario
e9f733e266 Fix typo 2014-09-21 14:59:43 -04:00
Roberto Rosario
2878bac07d Add CORS support to allow cross origin API requests 2014-09-21 14:59:11 -04:00
Roberto Rosario
bc663cb882 Remove literal Folder column declaration and convert to model column registration 2014-09-14 14:39:26 -04:00
Roberto Rosario
4793a64a7f Convert folder_list view to a Mayan generic class based view 2014-09-14 14:33:26 -04:00
Roberto Rosario
b8fe8639ec If an user has a global permission then return entire queryset 2014-09-14 14:32:46 -04:00
Roberto Rosario
d264aac97e Update tests 2014-09-14 08:51:23 -04:00
Roberto Rosario
0fde78558a Merge pull request #43 from mbehrle/feature/mimetypes
Adding more office MIME types to office_converter.
2014-09-14 08:42:21 -04:00