diff --git a/apps/icons/literals.py b/apps/icons/literals.py index bd77238c04..2afea26592 100644 --- a/apps/icons/literals.py +++ b/apps/icons/literals.py @@ -35,6 +35,7 @@ PILL = 'pill' PLUGIN = 'plugin' RAINBOW = 'rainbow' SCRIPT = 'script' +STORAGE = 'storage' TABLE = 'table' TICK = 'tick' USER = 'user' diff --git a/apps/icons/sets/fat_cow.py b/apps/icons/sets/fat_cow.py index d9738e32f2..ce011db2f2 100644 --- a/apps/icons/sets/fat_cow.py +++ b/apps/icons/sets/fat_cow.py @@ -37,6 +37,7 @@ DICTIONARY = { PLUGIN: 'plugin.png', RAINBOW: 'rainbow.png', SCRIPT: 'script.png', + STORAGE: 'storage.png', TABLE: 'table.png', TICK: 'tick.png', USER: 'user.png', diff --git a/apps/storage/__init__.py b/apps/storage/__init__.py index e69de29bb2..8b13789179 100644 --- a/apps/storage/__init__.py +++ b/apps/storage/__init__.py @@ -0,0 +1 @@ + diff --git a/apps/storage/backends/filebasedstorage.py b/apps/storage/backends/filebasedstorage.py index 833fa0186f..160c64dfa4 100644 --- a/apps/storage/backends/filebasedstorage.py +++ b/apps/storage/backends/filebasedstorage.py @@ -2,12 +2,13 @@ import os from django.core.files.storage import FileSystemStorage -from storage.conf.settings import FILESTORAGE_LOCATION +from storage import FILESTORAGE_LOCATION class FileBasedStorage(FileSystemStorage): - '''Simple wrapper for the stock Django FileSystemStorage class - ''' + """ + Simple wrapper for the stock Django FileSystemStorage class + """ separator = os.path.sep def __init__(self, *args, **kwargs): diff --git a/apps/storage/conf/__init__.py b/apps/storage/conf/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/apps/storage/conf/settings.py b/apps/storage/conf/settings.py deleted file mode 100644 index 2e65534236..0000000000 --- a/apps/storage/conf/settings.py +++ /dev/null @@ -1,38 +0,0 @@ -"""Configuration options for the storage app""" -import os - -from django.utils.translation import ugettext_lazy as _ -from django.conf import settings - -from smart_settings.api import Setting, SettingNamespace - -namespace = SettingNamespace('storage', _(u'Storage'), module='storage.conf.settings') - -Setting( - namespace=namespace, - name='GRIDFS_HOST', - global_name='STORAGE_GRIDFS_HOST', - default=u'localhost', -) - -Setting( - namespace=namespace, - name='GRIDFS_PORT', - global_name='STORAGE_GRIDFS_PORT', - default=27017, -) - -Setting( - namespace=namespace, - name='GRIDFS_DATABASE_NAME', - global_name='STORAGE_GRIDFS_DATABASE_NAME', - default='document_storage', -) - -Setting( - namespace=namespace, - name='FILESTORAGE_LOCATION', - global_name='STORAGE_FILESTORAGE_LOCATION', - default=os.path.join(settings.PROJECT_ROOT, u'document_storage'), - exists=True -) diff --git a/apps/storage/icons.py b/apps/storage/icons.py new file mode 100644 index 0000000000..be22ccd004 --- /dev/null +++ b/apps/storage/icons.py @@ -0,0 +1,7 @@ +from __future__ import absolute_import + +from icons.literals import STORAGE +from icons import Icon + +icon_storage = Icon(STORAGE) + diff --git a/apps/storage/registry.py b/apps/storage/registry.py new file mode 100644 index 0000000000..e2c3fdc161 --- /dev/null +++ b/apps/storage/registry.py @@ -0,0 +1,39 @@ +from __future__ import absolute_import + +import os + +from django.utils.translation import ugettext_lazy as _ +from django.conf import settings + +from smart_settings import LocalScope + +from .icons import icon_storage + +name = 'storage' +label = _(u'Storage') +description = _(u'Handles actual storage of files by means of specialized backends.') +icon = icon_storage +dependencies = ['app_registry'] +settings = [ + { + 'name': 'GRIDFS_HOST', + 'default': u'localhost', + 'scopes': [LocalScope()] + }, + { + 'name': 'GRIDFS_PORT', + 'default': 27017, + 'scopes': [LocalScope()] + }, + { + 'name': 'GRIDFS_DATABASE_NAME', + 'default': 'document_storage', + 'scopes': [LocalScope()] + }, + { + 'name': 'FILESTORAGE_LOCATION', + 'default': os.path.join(settings.PROJECT_ROOT, u'document_storage'), + 'exists': True, + 'scopes': [LocalScope()] + }, +] diff --git a/settings.py b/settings.py index 11f809aec7..d95ed120a9 100644 --- a/settings.py +++ b/settings.py @@ -30,7 +30,7 @@ DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. 'NAME': os.path.join(PROJECT_ROOT, '%s.sqlite' % PROJECT_NAME), # Or path to database file if using sqlite3. - 'USER': '', # Not used with sqlite3. + 'GROUP': '', # Not used with sqlite3. 'PASSWORD': '', # Not used with sqlite3. 'HOST': '', # Set to empty string for localhost. Not used with sqlite3. 'PORT': '', # Set to empty string for default. Not used with sqlite3. @@ -104,15 +104,15 @@ TEMPLATE_LOADERS = ( ) MIDDLEWARE_CLASSES = ( - 'common.middleware.strip_spaces_widdleware.SpacelessMiddleware', + #'common.middleware.strip_spaces_widdleware.SpacelessMiddleware', 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.locale.LocaleMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', - 'common.middleware.login_required_middleware.LoginRequiredMiddleware', - 'permissions.middleware.permission_denied_middleware.PermissionDeniedMiddleware', + #'common.middleware.login_required_middleware.LoginRequiredMiddleware', + #'permissions.middleware.permission_denied_middleware.PermissionDeniedMiddleware', 'pagination.middleware.PaginationMiddleware', ) @@ -147,55 +147,55 @@ INSTALLED_APPS = ( 'compressor', 'djangorestframework', # Base generic - 'app_registry', 'permissions', + 'acls', + 'navigation', + 'icons', 'project_setup', 'project_tools', - 'smart_settings', - 'navigation', 'lock_manager', + 'app_registry', + 'smart_settings', 'web_theme', + 'common', # pagination needs to go after web_theme so that the pagination template is found 'pagination', - 'common', - 'django_gpg', - 'acls', + #'django_gpg', 'converter', - 'trash', + #'trash', 'user_management', - 'mimetype', - 'clustering', - 'scheduler', - 'job_processor', - 'icons', + #'mimetype', + #'clustering', + #'scheduler', + #'job_processor', # Mayan EDMS 'diagnostics', 'maintenance', 'storage', - 'documents', - 'tags', - 'folders', - 'dynamic_search', - 'document_comments', - 'document_signatures', - 'linking', - 'metadata', - 'ocr', + #'documents', + #'tags', + #'folders', + #'dynamic_search', + #'document_comments', + #'document_signatures', + #'linking', + #'metadata', + #'ocr', 'main', - 'installation', - 'document_indexing', - 'sources', - 'mailer', - 'document_acls', + #'installation', + #'document_indexing', + #'sources', + #'mailer', + #'document_acls', 'history', - 'workflows', - 'checkouts', - 'rest_api', - 'bootstrap', + #'workflows', + #'checkouts', + #'rest_api', + #'bootstrap', 'statistics', # Has to be last so the other apps can register it's signals - 'signaler', + #'signaler', ) TEMPLATE_CONTEXT_PROCESSORS = ( diff --git a/urls.py b/urls.py index 996798c638..43ebe088d5 100644 --- a/urls.py +++ b/urls.py @@ -5,45 +5,45 @@ from django.conf import settings admin.autodiscover() urlpatterns = patterns('', - (r'^', include('common.urls')), (r'^', include('main.urls')), - (r'^documents/', include('documents.urls')), - (r'^folders/', include('folders.urls')), - (r'^search/', include('dynamic_search.urls')), - (r'^ocr/', include('ocr.urls')), + (r'^apps/', include('app_registry.urls')),#, namespace='user_blogs')), + (r'^common/', include('common.urls')), (r'^permissions/', include('permissions.urls')), - (r'^tags/', include('tags.urls')), - (r'^admin/doc/', include('django.contrib.admindocs.urls')), - (r'^admin/', include(admin.site.urls)), - (r'^comments/', include('document_comments.urls')), - (r'^user_management/', include('user_management.urls')), + (r'^setup/', include('project_setup.urls')), + (r'^tools/', include('project_tools.urls')), (r'^settings/', include('smart_settings.urls')), - (r'^metadata/', include('metadata.urls')), - (r'^linking/', include('linking.urls')), - (r'^document_indexing/', include('document_indexing.urls')), + #(r'^documents/', include('documents.urls')), + #(r'^folders/', include('folders.urls')), + #(r'^search/', include('dynamic_search.urls')), + #(r'^ocr/', include('ocr.urls')), + #(r'^tags/', include('tags.urls')), + #(r'^comments/', include('document_comments.urls')), + (r'^user_management/', include('user_management.urls')), + #(r'^metadata/', include('metadata.urls')), + #(r'^linking/', include('linking.urls')), + #(r'^document_indexing/', include('document_indexing.urls')), (r'^history/', include('history.urls')), (r'^converter/', include('converter.urls')), - (r'^sources/', include('sources.urls')), - (r'^project_setup/', include('project_setup.urls')), - (r'^project_tools/', include('project_tools.urls')), + #(r'^sources/', include('sources.urls')), (r'^acls/', include('acls.urls')), - (r'^document_acls/', include('document_acls.urls')), - (r'^api/', include('rest_api.urls')), - (r'^gpg/', include('django_gpg.urls')), - (r'^documents/signatures/', include('document_signatures.urls')), - (r'^mailer/', include('mailer.urls')), - (r'^workflows/', include('workflows.urls')), - (r'^checkouts/', include('checkouts.urls')), - (r'^installation/', include('installation.urls')), - (r'^scheduler/', include('scheduler.urls')), - (r'^job_processing/', include('job_processor.urls')), - (r'^bootstrap/', include('bootstrap.urls')), + #(r'^document_acls/', include('document_acls.urls')), + #(r'^api/', include('rest_api.urls')), + #(r'^gpg/', include('django_gpg.urls')), + #(r'^documents/signatures/', include('document_signatures.urls')), + #(r'^mailer/', include('mailer.urls')), + #(r'^workflows/', include('workflows.urls')), + #(r'^checkouts/', include('checkouts.urls')), + #(r'^installation/', include('installation.urls')), + #(r'^scheduler/', include('scheduler.urls')), + #(r'^job_processing/', include('job_processor.urls')), + #(r'^bootstrap/', include('bootstrap.urls')), (r'^diagnostics/', include('diagnostics.urls')), (r'^maintenance/', include('maintenance.urls')), (r'^statistics/', include('statistics.urls')), - (r'^clustering/', include('clustering.urls')), - (r'^trash/', include('trash.urls')), - (r'^apps/', include('app_registry.urls')),#, namespace='user_blogs')), + #(r'^clustering/', include('clustering.urls')), + #(r'^trash/', include('trash.urls')), + #(r'^admin/doc/', include('django.contrib.admindocs.urls')), + #(r'^admin/', include(admin.site.urls)), )