diff --git a/.flake8 b/.flake8 index cd405d8af..ef042001c 100644 --- a/.flake8 +++ b/.flake8 @@ -20,4 +20,4 @@ ignore = E111,E114,E121,E122,E125,E126,E127,E131,E261,E265,E266 addopts = --failed-first -p no:random-order --cov=. --cov-report=term --cov-report=xml testpaths = ./lib_common ./lib_client ./test_utilities ./gmn ./client_cli ./client_onedrive python_files = test_*.py -DJANGO_SETTINGS_MODULE = gmn.settings_test +DJANGO_SETTINGS_MODULE = d1_gmn.settings_test diff --git a/.isort.cfg b/.isort.cfg index e26178ef3..69643694f 100644 --- a/.isort.cfg +++ b/.isort.cfg @@ -1,5 +1,5 @@ [settings] -forced_separate=d1_common,d1_client,django,gmn,d1_test +forced_separate=d1_common,d1_client,django,d1_gmn,d1_test indent=' ' line_length=80 #multi_line_output=3 diff --git a/.travis.yml b/.travis.yml index c738baceb..d5aa547cb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,7 +17,7 @@ install: script: # Travis clones the project to $TRAVIS_BUILD_DIR and cds there before running # the scripts. - - python ./dev_tools/setup_all.py $TRAVIS_BUILD_DIR develop + - python ./dev_tools/src/d1_dev/setup-all.py develop # Debug - pip freeze - pip check diff --git a/gmn/src/gmn/__init__.py b/gmn/src/d1_gmn/__init__.py similarity index 93% rename from gmn/src/gmn/__init__.py rename to gmn/src/d1_gmn/__init__.py index be4a98abd..52ea2788a 100644 --- a/gmn/src/gmn/__init__.py +++ b/gmn/src/d1_gmn/__init__.py @@ -18,4 +18,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -default_app_config = 'gmn.app.startup.GMNStartupChecks' +default_app_config = 'd1_gmn.app.startup.GMNStartupChecks' diff --git a/gmn/src/gmn/app/__init__.py b/gmn/src/d1_gmn/app/__init__.py similarity index 100% rename from gmn/src/gmn/app/__init__.py rename to gmn/src/d1_gmn/app/__init__.py diff --git a/gmn/src/gmn/app/auth.py b/gmn/src/d1_gmn/app/auth.py similarity index 95% rename from gmn/src/gmn/app/auth.py rename to gmn/src/d1_gmn/app/auth.py index f1fbf647f..91856f7ef 100644 --- a/gmn/src/gmn/app/auth.py +++ b/gmn/src/d1_gmn/app/auth.py @@ -27,13 +27,13 @@ import logging -import d1_common.const +import d1_gmn.app.models +import d1_gmn.app.node_registry + import d1_common.cert.subjects -import d1_common.types.exceptions +import d1_common.const import d1_common.types.dataoneTypes - -import gmn.app.models -import gmn.app.node_registry +import d1_common.types.exceptions import django.conf import django.core.cache @@ -90,7 +90,7 @@ def level_to_action(level): def get_trusted_subjects(): return ( - gmn.app.node_registry.get_cn_subjects() | + d1_gmn.app.node_registry.get_cn_subjects() | django.conf.settings.DATAONE_TRUSTED_SUBJECTS | {_get_client_side_certificate_subject()} ) @@ -168,14 +168,14 @@ def is_allowed(request, level, pid): # and when the ACL is updated. # - The permission must be for an action level that is the same or higher than # the requested action level. - return gmn.app.models.Permission.objects.filter( + return d1_gmn.app.models.Permission.objects.filter( sciobj__pid__did=pid, subject__subject__in=request.all_subjects_set, level__gte=level ).exists() def has_create_update_delete_permission(request): - return gmn.app.models.WhitelistForCreateUpdateDelete.objects.filter( + return d1_gmn.app.models.WhitelistForCreateUpdateDelete.objects.filter( subject__subject__in=request.all_subjects_set).exists() \ or is_trusted_subject(request) @@ -198,7 +198,7 @@ def assert_allowed(request, level, pid): Raise NotFound if object does not exist. Return NoneType if subject is allowed. """ - if not gmn.app.models.ScienceObject.objects.filter(pid__did=pid).exists(): + if not d1_gmn.app.models.ScienceObject.objects.filter(pid__did=pid).exists(): raise d1_common.types.exceptions.NotFound( 0, u'Attempted to perform operation on non-existing object. pid="{}"'. format(pid) diff --git a/gmn/src/gmn/app/db_filter.py b/gmn/src/d1_gmn/app/db_filter.py similarity index 88% rename from gmn/src/gmn/app/db_filter.py rename to gmn/src/d1_gmn/app/db_filter.py index 4076fb745..1caf2cae6 100644 --- a/gmn/src/gmn/app/db_filter.py +++ b/gmn/src/d1_gmn/app/db_filter.py @@ -39,19 +39,20 @@ import re +import d1_gmn.app.models +import d1_gmn.app.views.asserts +import d1_gmn.app.views.util + import d1_common.const import d1_common.date_time import d1_common.types.exceptions -import gmn.app.models -import gmn.app.views.asserts -import gmn.app.views.util - def add_access_policy_filter(query, request, column_name): q = ( - gmn.app.models.Subject.objects.filter(subject__in=request.all_subjects_set) - .values('permission__sciobj') + d1_gmn.app.models.Subject.objects.filter( + subject__in=request.all_subjects_set + ).values('permission__sciobj') ) filter_arg = '{}__in'.format(column_name) return query.filter(**{filter_arg: q}) @@ -62,8 +63,8 @@ def add_replica_filter(query, request): bool_val = request.GET.get(param_name, True) if bool_val is None: return query - gmn.app.views.asserts.is_bool_param(param_name, bool_val) - if gmn.app.views.util.is_false_param(bool_val): + d1_gmn.app.views.asserts.is_bool_param(param_name, bool_val) + if d1_gmn.app.views.util.is_false_param(bool_val): query = query.filter(pid__localreplica_pid__isnull=True) return query @@ -72,10 +73,10 @@ def add_bool_filter(query, request, column_name, param_name): bool_val = request.GET.get(param_name, None) if bool_val is None: return query - gmn.app.views.asserts.is_bool_param(param_name, bool_val) + d1_gmn.app.views.asserts.is_bool_param(param_name, bool_val) filter_arg = column_name return query.filter( - **{filter_arg: gmn.app.views.util.is_true_param(bool_val)} + **{filter_arg: d1_gmn.app.views.util.is_true_param(bool_val)} ) @@ -94,7 +95,7 @@ def add_datetime_filter(query, request, column_name, param_name, operator): 0, u'Invalid date format for parameter. parameter="{}" date="{}", ' u'parse_error="{}"'.format(param_name, date_str, str(e)) ) - gmn.app.views.asserts.date_is_utc(date) + d1_gmn.app.views.asserts.date_is_utc(date) date = d1_common.date_time.strip_timezone(date) filter_arg = '{}__{}'.format(column_name, operator) return query.filter(**{filter_arg: date}) diff --git a/gmn/src/gmn/app/event_log.py b/gmn/src/d1_gmn/app/event_log.py similarity index 84% rename from gmn/src/gmn/app/event_log.py rename to gmn/src/d1_gmn/app/event_log.py index 02d3d2261..35f274e21 100644 --- a/gmn/src/gmn/app/event_log.py +++ b/gmn/src/d1_gmn/app/event_log.py @@ -25,10 +25,10 @@ from __future__ import absolute_import -import d1_common.types.exceptions +import d1_gmn.app.auth +import d1_gmn.app.models -import gmn.app.auth -import gmn.app.models +import d1_common.types.exceptions def _log(pid, request, event, timestamp=None): @@ -36,13 +36,15 @@ def _log(pid, request, event, timestamp=None): """ ip_address = request.META['REMOTE_ADDR'] user_agent = request.META['HTTP_USER_AGENT'] - subject = gmn.app.auth.get_trusted_subjects_string() + subject = d1_gmn.app.auth.get_trusted_subjects_string() # Support logging events that are not associated with an object. object_model = None if pid is not None: try: - object_model = gmn.app.models.ScienceObject.objects.filter(pid__did=pid)[0] + object_model = d1_gmn.app.models.ScienceObject.objects.filter( + pid__did=pid + )[0] except IndexError: err_msg = u'Attempted to create event log for non-existing object. pid="{}"'\ .format(pid) @@ -62,12 +64,12 @@ def _log(pid, request, event, timestamp=None): def create_log_entry(object_model, event, ip_address, user_agent, subject): - event_log_model = gmn.app.models.EventLog() + event_log_model = d1_gmn.app.models.EventLog() event_log_model.sciobj = object_model - event_log_model.event = gmn.app.models.event(event) - event_log_model.ip_address = gmn.app.models.ip_address(ip_address) - event_log_model.user_agent = gmn.app.models.user_agent(user_agent) - event_log_model.subject = gmn.app.models.subject(subject) + event_log_model.event = d1_gmn.app.models.event(event) + event_log_model.ip_address = d1_gmn.app.models.ip_address(ip_address) + event_log_model.user_agent = d1_gmn.app.models.user_agent(user_agent) + event_log_model.subject = d1_gmn.app.models.subject(subject) event_log_model.save() return event_log_model diff --git a/gmn/src/gmn/app/local_replica.py b/gmn/src/d1_gmn/app/local_replica.py similarity index 86% rename from gmn/src/gmn/app/local_replica.py rename to gmn/src/d1_gmn/app/local_replica.py index 3dd2144e7..1ad256b1c 100644 --- a/gmn/src/gmn/app/local_replica.py +++ b/gmn/src/d1_gmn/app/local_replica.py @@ -22,12 +22,12 @@ from __future__ import absolute_import +import d1_gmn.app.models + import d1_common.checksum import d1_common.types.dataoneTypes import d1_common.types.exceptions -import gmn.app.models - import django.conf from django.db.models import Sum @@ -38,12 +38,12 @@ def is_local_replica(pid): """Includes unprocessed replication requests.""" - return gmn.app.models.LocalReplica.objects.filter(pid__did=pid).exists() + return d1_gmn.app.models.LocalReplica.objects.filter(pid__did=pid).exists() def is_unprocessed_local_replica(pid): """Is local replica with status "queued".""" - return gmn.app.models.LocalReplica.objects.filter( + return d1_gmn.app.models.LocalReplica.objects.filter( pid__did=pid, info__status__status='queued', ).exists() @@ -52,7 +52,7 @@ def is_unprocessed_local_replica(pid): def is_revision_chain_placeholder(pid): """For replicas, the PIDs referenced in revision chains are reserved for use by other replicas.""" - return gmn.app.models.ReplicaRevisionChainReference.objects.filter( + return d1_gmn.app.models.ReplicaRevisionChainReference.objects.filter( pid__did=pid ).exists() @@ -65,14 +65,14 @@ def get_total_size_of_replicas(): def get_total_size_of_completed_replicas(): """Return the total number of bytes of successfully processed replicas. """ - return gmn.app.models.LocalReplica.objects.aggregate( + return d1_gmn.app.models.LocalReplica.objects.aggregate( Sum('pid__scienceobject__size') )['pid__scienceobject__size__sum'] or 0 def get_total_size_of_queued_replicas(): """Return the total number of bytes of requested, unprocessed replicas.""" - return gmn.app.models.ReplicationQueue.objects.filter( + return d1_gmn.app.models.ReplicationQueue.objects.filter( local_replica__info__status__status='queued' ).aggregate(Sum('size'))['size__sum'] or 0 @@ -83,22 +83,22 @@ def add_to_replication_queue(source_node_urn, sysmeta_pyxb): Preconditions: - sysmeta_pyxb.identifier is verified not to exist. E.g., with - gmn.app.views.asserts.is_unused(pid). + d1_gmn.app.views.asserts.is_unused(pid). Postconditions: - The database is set up to track a new replica, with initial status, "queued". - The PID provided in the sysmeta_pyxb is reserved for the replica. """ - replica_info_model = gmn.app.models.replica_info( + replica_info_model = d1_gmn.app.models.replica_info( status_str='queued', source_node_urn=source_node_urn, ) - local_replica_model = gmn.app.models.local_replica( - pid=gmn.app.util.uvalue(sysmeta_pyxb.identifier), + local_replica_model = d1_gmn.app.models.local_replica( + pid=d1_gmn.app.util.uvalue(sysmeta_pyxb.identifier), replica_info_model=replica_info_model, ) - gmn.app.models.replication_queue( + d1_gmn.app.models.replication_queue( local_replica_model=local_replica_model, size=sysmeta_pyxb.size, ) @@ -140,7 +140,7 @@ def assert_request_complies_with_replication_policy(sysmeta_pyxb): raise d1_common.types.exceptions.InvalidRequest( 0, u'This node does not accept replicas from originating node. ' u'originating_node="{}"'. - format(gmn.app.util.uvalue(sysmeta_pyxb.originMemberNode)) + format(d1_gmn.app.util.uvalue(sysmeta_pyxb.originMemberNode)) ) if len(django.conf.settings.REPLICATION_ALLOWEDOBJECTFORMAT): @@ -148,5 +148,5 @@ def assert_request_complies_with_replication_policy(sysmeta_pyxb): ) not in django.conf.settings.REPLICATION_ALLOWEDOBJECTFORMAT: raise d1_common.types.exceptions.InvalidRequest( 0, u'This node does not accept objects of specified format. format="{}"' - .format(gmn.app.util.uvalue(sysmeta_pyxb.formatId)) + .format(d1_gmn.app.util.uvalue(sysmeta_pyxb.formatId)) ) diff --git a/gmn/src/gmn/app/management/__init__.py b/gmn/src/d1_gmn/app/management/__init__.py similarity index 100% rename from gmn/src/gmn/app/management/__init__.py rename to gmn/src/d1_gmn/app/management/__init__.py diff --git a/gmn/src/gmn/app/management/commands/__init__.py b/gmn/src/d1_gmn/app/management/commands/__init__.py similarity index 100% rename from gmn/src/gmn/app/management/commands/__init__.py rename to gmn/src/d1_gmn/app/management/commands/__init__.py diff --git a/gmn/src/gmn/app/management/commands/cert.py b/gmn/src/d1_gmn/app/management/commands/cert.py similarity index 89% rename from gmn/src/gmn/app/management/commands/cert.py rename to gmn/src/d1_gmn/app/management/commands/cert.py index 8f9604c6a..20c5a3baa 100644 --- a/gmn/src/gmn/app/management/commands/cert.py +++ b/gmn/src/d1_gmn/app/management/commands/cert.py @@ -35,13 +35,14 @@ import logging +import d1_gmn.app.management.commands.util +import d1_gmn.app.middleware.session_cert +import d1_gmn.app.models + import d1_common.types.exceptions import d1_common.util -import django.core.management.base -import gmn.app.management.commands.util -import gmn.app.middleware.session_cert -import gmn.app.models +import django.core.management.base # noinspection PyClassHasNoInit @@ -72,7 +73,7 @@ def add_arguments(self, parser): ) def handle(self, *args, **options): - gmn.app.management.commands.util.log_setup(options['debug']) + d1_gmn.app.management.commands.util.log_setup(options['debug']) if options['command'] not in ('view', 'whitelist'): logging.info(self.missing_args_message) return @@ -84,7 +85,7 @@ def handle(self, *args, **options): def _handle(self, command_str, cert_pem_path): cert_pem = self._read_pem_cert(cert_pem_path) primary_str, equivalent_set = ( - gmn.app.middleware.session_cert.get_authenticated_subjects(cert_pem) + d1_gmn.app.middleware.session_cert.get_authenticated_subjects(cert_pem) ) if command_str == 'view': self._view(primary_str, equivalent_set) @@ -103,14 +104,14 @@ def _view(self, primary_str, equivalent_set): logging.info(u' {}'.format(subject_str)) def _whitelist(self, primary_str): - if gmn.app.models.WhitelistForCreateUpdateDelete.objects.filter( - subject=gmn.app.models.subject(primary_str) + if d1_gmn.app.models.WhitelistForCreateUpdateDelete.objects.filter( + subject=d1_gmn.app.models.subject(primary_str) ).exists(): raise django.core.management.base.CommandError( u'Create, update and delete already enabled for subject: {}'. format(primary_str) ) - gmn.app.models.whitelist_for_create_update_delete(primary_str) + d1_gmn.app.models.whitelist_for_create_update_delete(primary_str) logging.info( u'Enabled create, update and delete for subject: {}'.format(primary_str) ) diff --git a/gmn/src/gmn/app/management/commands/export_object_list.py b/gmn/src/d1_gmn/app/management/commands/export_object_list.py similarity index 84% rename from gmn/src/gmn/app/management/commands/export_object_list.py rename to gmn/src/d1_gmn/app/management/commands/export_object_list.py index bbd741a4d..40b61ab7e 100644 --- a/gmn/src/gmn/app/management/commands/export_object_list.py +++ b/gmn/src/d1_gmn/app/management/commands/export_object_list.py @@ -25,10 +25,10 @@ import logging -import django.core.management.base +import d1_gmn.app.management.commands.util +import d1_gmn.app.models -import gmn.app.management.commands.util -import gmn.app.models +import django.core.management.base # noinspection PyClassHasNoInit @@ -51,22 +51,22 @@ def add_arguments(self, parser): parser.add_argument('path', type=str, help='path to export file') def handle(self, *args, **options): - gmn.app.management.commands.util.log_setup(options['debug']) + d1_gmn.app.management.commands.util.log_setup(options['debug']) logging.info( u'Running management command: {}'. - format(gmn.app.management.commands.util.get_command_name()) + format(d1_gmn.app.management.commands.util.get_command_name()) ) - gmn.app.management.commands.util.abort_if_other_instance_is_running() + d1_gmn.app.management.commands.util.abort_if_other_instance_is_running() self.export_object_list(options['path'], options['public']) logging.info(u'Exported object list to: {}'.format(options['path'])) def export_object_list(self, path, public_only): with open(path, 'w') as f: - for sciobj_model in gmn.app.models.ScienceObject.objects.all(): + for sciobj_model in d1_gmn.app.models.ScienceObject.objects.all(): # Permissions are cumulative, so if a subject has permissions for an # object, that permissions are guaranteed to include "read", the # lowest level permission. - for permission_model in gmn.app.models.Permission.objects.filter( + for permission_model in d1_gmn.app.models.Permission.objects.filter( sciobj=sciobj_model ): if public_only: diff --git a/gmn/src/gmn/app/management/commands/fix_chains.py b/gmn/src/d1_gmn/app/management/commands/fix_chains.py similarity index 79% rename from gmn/src/gmn/app/management/commands/fix_chains.py rename to gmn/src/d1_gmn/app/management/commands/fix_chains.py index 184db3372..8c3c19f0c 100644 --- a/gmn/src/gmn/app/management/commands/fix_chains.py +++ b/gmn/src/d1_gmn/app/management/commands/fix_chains.py @@ -28,15 +28,15 @@ import logging -import gmn.app.auth -import gmn.app.management.commands.util -import gmn.app.models -import gmn.app.node -import gmn.app.revision -import gmn.app.sysmeta -import gmn.app.util -import gmn.app.views.asserts -import gmn.app.views.diagnostics +import d1_gmn.app.auth +import d1_gmn.app.management.commands.util +import d1_gmn.app.models +import d1_gmn.app.node +import d1_gmn.app.revision +import d1_gmn.app.sysmeta +import d1_gmn.app.util +import d1_gmn.app.views.asserts +import d1_gmn.app.views.diagnostics import django.conf import django.core.management.base @@ -55,12 +55,12 @@ def add_arguments(self, parser): ) def handle(self, *args, **options): - gmn.app.management.commands.util.log_setup(options['debug']) + d1_gmn.app.management.commands.util.log_setup(options['debug']) logging.info( u'Running management command: {}'. - format(gmn.app.management.commands.util.get_command_name()) + format(d1_gmn.app.management.commands.util.get_command_name()) ) - gmn.app.management.commands.util.abort_if_other_instance_is_running() + d1_gmn.app.management.commands.util.abort_if_other_instance_is_running() fix_chains = obsoletedBy() fix_chains.run() @@ -70,7 +70,7 @@ def handle(self, *args, **options): class obsoletedBy(object): def __init__(self): - self._events = gmn.app.management.commands.util.EventCounter() + self._events = d1_gmn.app.management.commands.util.EventCounter() def run(self): try: @@ -88,7 +88,7 @@ def _check_debug_mode(self): ) def _add_revision_refs(self): - for sciobj_model in gmn.app.models.ScienceObject.objects.all(): + for sciobj_model in d1_gmn.app.models.ScienceObject.objects.all(): pid = sciobj_model.pid.did logging.debug('Checking. pid="{}"'.format(pid)) self._events.count('Total') @@ -99,7 +99,7 @@ def _add_revision_refs(self): def _set_obsoletes_if_missing(self, pid, obsoletes_pid): if not self._has_obsoletes(pid): - gmn.app.revision.set_revision( + d1_gmn.app.revision.set_revision( pid, obsoletes_pid=obsoletes_pid, ) @@ -111,7 +111,7 @@ def _set_obsoletes_if_missing(self, pid, obsoletes_pid): def _set_obsoleted_by_if_missing(self, pid, obsoleted_by_pid): if not self._has_obsoleted_by(pid): - gmn.app.revision.set_revision( + d1_gmn.app.revision.set_revision( pid, obsoleted_by_pid=obsoleted_by_pid, ) @@ -123,8 +123,8 @@ def _set_obsoleted_by_if_missing(self, pid, obsoleted_by_pid): def _has_obsoletes(self, pid): try: - return gmn.app.util.get_sci_model(pid).obsoletes is not None - except gmn.app.models.ScienceObject.DoesNotExist: + return d1_gmn.app.util.get_sci_model(pid).obsoletes is not None + except d1_gmn.app.models.ScienceObject.DoesNotExist: logging.debug( 'obsoletes ref to non-existing object. pid="{}"'.format(pid) ) @@ -133,8 +133,8 @@ def _has_obsoletes(self, pid): def _has_obsoleted_by(self, pid): try: - return gmn.app.util.get_sci_model(pid).obsoleted_by is not None - except gmn.app.models.ScienceObject.DoesNotExist: + return d1_gmn.app.util.get_sci_model(pid).obsoleted_by is not None + except d1_gmn.app.models.ScienceObject.DoesNotExist: logging.debug( 'obsoletedBy ref to non-existing object. pid="{}"'.format(pid) ) diff --git a/gmn/src/gmn/app/management/commands/fix_sysmeta.py b/gmn/src/d1_gmn/app/management/commands/fix_sysmeta.py similarity index 84% rename from gmn/src/gmn/app/management/commands/fix_sysmeta.py rename to gmn/src/d1_gmn/app/management/commands/fix_sysmeta.py index fa4ba3720..71b4795a1 100644 --- a/gmn/src/gmn/app/management/commands/fix_sysmeta.py +++ b/gmn/src/d1_gmn/app/management/commands/fix_sysmeta.py @@ -26,19 +26,19 @@ import logging +import d1_gmn.app.auth +import d1_gmn.app.management.commands.util +import d1_gmn.app.models +import d1_gmn.app.node +import d1_gmn.app.revision +import d1_gmn.app.sysmeta +import d1_gmn.app.util +import d1_gmn.app.views.asserts +import d1_gmn.app.views.diagnostics + import d1_client.cnclient import d1_client.iter.sysmeta_multi -import gmn.app.auth -import gmn.app.management.commands.util -import gmn.app.models -import gmn.app.node -import gmn.app.revision -import gmn.app.sysmeta -import gmn.app.util -import gmn.app.views.asserts -import gmn.app.views.diagnostics - import django.conf import django.core.management.base @@ -56,12 +56,12 @@ def add_arguments(self, parser): ) def handle(self, *args, **options): - gmn.app.management.commands.util.log_setup(options['debug']) + d1_gmn.app.management.commands.util.log_setup(options['debug']) logging.info( u'Running management command: {}'. - format(gmn.app.management.commands.util.get_command_name()) + format(d1_gmn.app.management.commands.util.get_command_name()) ) - gmn.app.management.commands.util.abort_if_other_instance_is_running() + d1_gmn.app.management.commands.util.abort_if_other_instance_is_running() fix_chains = FixSystemMetadata() fix_chains.run() @@ -71,7 +71,7 @@ def handle(self, *args, **options): class FixSystemMetadata(object): def __init__(self): - self._events = gmn.app.management.commands.util.EventCounter() + self._events = d1_gmn.app.management.commands.util.EventCounter() def run(self): try: @@ -98,16 +98,16 @@ def _fix_system_metadata_all(self): } ) for i, sysmeta_pyxb in enumerate(sysmeta_iter): - pid = gmn.app.util.uvalue(sysmeta_pyxb.identifier) - cn_submitter = gmn.app.util.uvalue(sysmeta_pyxb.submitter) - if not gmn.app.sysmeta.is_pid(pid): + pid = d1_gmn.app.util.uvalue(sysmeta_pyxb.identifier) + cn_submitter = d1_gmn.app.util.uvalue(sysmeta_pyxb.submitter) + if not d1_gmn.app.sysmeta.is_pid(pid): logging.warn(u'CN PID not on MN. pid="{}"'.format(pid)) self._events.count(u'CN PID not on MN') continue - sciobj_model = gmn.app.util.get_sci_model(pid) + sciobj_model = d1_gmn.app.util.get_sci_model(pid) mn_submitter = sciobj_model.submitter.subject if cn_submitter != mn_submitter: - sciobj_model.submitter = gmn.app.models.subject(cn_submitter) + sciobj_model.submitter = d1_gmn.app.models.subject(cn_submitter) sciobj_model.save() logging.info( u'Updated submitter. pid="{}" cn_submitter="{}" mn_submitter="{}"'. @@ -121,9 +121,9 @@ def _fix_system_metadata_all(self): ) self._events.count(u'Submitter already matches') - # num_total = gmn.app.models.ScienceObject.objects.count() + # num_total = d1_gmn.app.models.ScienceObject.objects.count() # num_checked = 0 - # for sciobj_model in gmn.app.models.ScienceObject.objects.all(): + # for sciobj_model in d1_gmn.app.models.ScienceObject.objects.all(): # num_checked += 1 # pid = sciobj_model.pid.did # logging.info( @@ -137,7 +137,7 @@ def _fix_system_metadata_all(self): # self._events.count('Failed') # # def _fix_system_metadata(self, pid): - # sciobj_model = gmn.app.util.get_sci_model(pid) + # sciobj_model = d1_gmn.app.util.get_sci_model(pid) # if not self._is_recent_system_metadata(sciobj_model.uploaded_timestamp): # logging.info('Skipped not recent dateUploaded. pid="{}"'.format(pid)) # self._events.count('Skipped not recent dateUploaded') diff --git a/gmn/src/gmn/app/management/commands/jwt.py b/gmn/src/d1_gmn/app/management/commands/jwt.py similarity index 88% rename from gmn/src/gmn/app/management/commands/jwt.py rename to gmn/src/d1_gmn/app/management/commands/jwt.py index bc08ce94b..965b3cbc8 100644 --- a/gmn/src/gmn/app/management/commands/jwt.py +++ b/gmn/src/d1_gmn/app/management/commands/jwt.py @@ -30,14 +30,16 @@ import logging +import jwt + +import d1_gmn.app.management.commands.util +import d1_gmn.app.middleware.session_jwt +import d1_gmn.app.models + import d1_common.types.exceptions import d1_common.util -import django.core.management.base -import jwt -import gmn.app.management.commands.util -import gmn.app.middleware.session_jwt -import gmn.app.models +import django.core.management.base # noinspection PyClassHasNoInit @@ -67,7 +69,7 @@ def add_arguments(self, parser): ) def handle(self, *args, **options): - gmn.app.management.commands.util.log_setup(options['debug']) + d1_gmn.app.management.commands.util.log_setup(options['debug']) if options['command'] not in ('view', 'whitelist'): logging.info(self.missing_args_message) return @@ -79,7 +81,7 @@ def handle(self, *args, **options): def _handle(self, command_str, jwt_path): jwt_base64 = self._read_jwt(jwt_path) try: - primary_list = gmn.app.middleware.session_jwt.get_subject_list_without_validate( + primary_list = d1_gmn.app.middleware.session_jwt.get_subject_list_without_validate( jwt_base64 ) if not primary_list: @@ -101,14 +103,14 @@ def _view(self, primary_str): logging.info(u' {}'.format(primary_str)) def _whitelist(self, primary_str): - if gmn.app.models.WhitelistForCreateUpdateDelete.objects.filter( - subject=gmn.app.models.subject(primary_str) + if d1_gmn.app.models.WhitelistForCreateUpdateDelete.objects.filter( + subject=d1_gmn.app.models.subject(primary_str) ).exists(): raise django.core.management.base.CommandError( u'Create, update and delete already enabled for subject: {}'. format(primary_str) ) - gmn.app.models.whitelist_for_create_update_delete(primary_str) + d1_gmn.app.models.whitelist_for_create_update_delete(primary_str) logging.info( u'Enabled create, update and delete for subject: {}'.format(primary_str) ) diff --git a/gmn/src/gmn/app/management/commands/migrate_v1_to_v2.py b/gmn/src/d1_gmn/app/management/commands/migrate_v1_to_v2.py similarity index 85% rename from gmn/src/gmn/app/management/commands/migrate_v1_to_v2.py rename to gmn/src/d1_gmn/app/management/commands/migrate_v1_to_v2.py index 0bff8dfa7..0286559f0 100644 --- a/gmn/src/gmn/app/management/commands/migrate_v1_to_v2.py +++ b/gmn/src/d1_gmn/app/management/commands/migrate_v1_to_v2.py @@ -31,22 +31,22 @@ import psycopg2 import psycopg2.extras +import d1_gmn.app.auth +import d1_gmn.app.management.commands.util +import d1_gmn.app.models +import d1_gmn.app.node +import d1_gmn.app.revision +import d1_gmn.app.sysmeta +import d1_gmn.app.util +import d1_gmn.app.views.asserts +import d1_gmn.app.views.diagnostics +import d1_gmn.app.views.util + import d1_common.types.exceptions import d1_common.url import d1_client.cnclient_2_0 -import gmn.app.auth -import gmn.app.management.commands.util -import gmn.app.models -import gmn.app.node -import gmn.app.revision -import gmn.app.sysmeta -import gmn.app.util -import gmn.app.views.asserts -import gmn.app.views.diagnostics -import gmn.app.views.util - import django.conf import django.core.management.base @@ -88,23 +88,23 @@ def add_arguments(self, parser): ) def handle(self, *args, **options): - gmn.app.management.commands.util.log_setup(options['debug']) + d1_gmn.app.management.commands.util.log_setup(options['debug']) logging.info( u'Running management command: {}'. - format(gmn.app.management.commands.util.get_command_name()) + format(d1_gmn.app.management.commands.util.get_command_name()) ) - gmn.app.management.commands.util.abort_if_other_instance_is_running() + d1_gmn.app.management.commands.util.abort_if_other_instance_is_running() m = V2Migration() if not options['force'] and not self._db_is_empty(): logging.error( u'There is already data in the v2 database. Use --force to overwrite.' ) return - gmn.app.views.diagnostics.delete_all_objects() + d1_gmn.app.views.diagnostics.delete_all_objects() m.migrate() def _db_is_empty(self): - q = gmn.app.models.IdNamespace.objects.all() + q = d1_gmn.app.models.IdNamespace.objects.all() return not len(q) @@ -114,7 +114,7 @@ def _db_is_empty(self): class V2Migration(object): def __init__(self): self._v1_cursor = self._create_v1_cursor() - self._events = gmn.app.management.commands.util.EventCounter() + self._events = d1_gmn.app.management.commands.util.EventCounter() def migrate(self): try: @@ -150,8 +150,8 @@ def _migrate_filesystem(self): for file_name in file_list: pid = d1_common.url.decodePathElement(file_name) old_file_path = os.path.join(dir_path, file_name) - new_file_path = gmn.app.util.sciobj_file_path(pid) - gmn.app.util.create_missing_directories(new_file_path) + new_file_path = d1_gmn.app.util.sciobj_file_path(pid) + d1_gmn.app.util.create_missing_directories(new_file_path) new_dir_path = os.path.dirname(new_file_path) if self._are_on_same_disk(old_file_path, new_dir_path): self._log('Creating SciObj hard link') @@ -213,23 +213,25 @@ def _create_sciobj(self, topo_revision_list): # "obsoletedBy" back references are fixed in a second pass. sysmeta_pyxb.obsoletedBy = None self._log_pid_info('Creating SciObj DB representation', i, n, pid) - gmn.app.sysmeta.create(sysmeta_pyxb, sciobj_row['url']) + d1_gmn.app.sysmeta.create(sysmeta_pyxb, sciobj_row['url']) def _update_obsoleted_by(self, obsoleted_by_pid_list): n = len(obsoleted_by_pid_list) for i, pid_tup in enumerate(obsoleted_by_pid_list): pid, obsoleted_by_pid = pid_tup if obsoleted_by_pid is not None: - if gmn.app.sysmeta.is_did(pid) and gmn.app.sysmeta.is_did( + if d1_gmn.app.sysmeta.is_did(pid) and d1_gmn.app.sysmeta.is_did( obsoleted_by_pid ): self._log_pid_info('Updating obsoletedBy', i, n, pid) - gmn.app.revision.set_revision(pid, obsoleted_by_pid=obsoleted_by_pid) + d1_gmn.app.revision.set_revision( + pid, obsoleted_by_pid=obsoleted_by_pid + ) def _identifiers(self, sysmeta_pyxb): - pid = gmn.app.util.get_value(sysmeta_pyxb, 'identifier') - obsoletes_pid = gmn.app.util.get_value(sysmeta_pyxb, 'obsoletes') - obsoleted_by_pid = gmn.app.util.get_value(sysmeta_pyxb, 'obsoletedBy') + pid = d1_gmn.app.util.get_value(sysmeta_pyxb, 'identifier') + obsoletes_pid = d1_gmn.app.util.get_value(sysmeta_pyxb, 'obsoletes') + obsoleted_by_pid = d1_gmn.app.util.get_value(sysmeta_pyxb, 'obsoletedBy') return pid, obsoletes_pid, obsoleted_by_pid def _topological_sort(self, unsorted_list): @@ -288,7 +290,7 @@ def _sysmeta_pyxb_by_sciobj_row(self, sciobj_row): ) try: with open(sysmeta_xml_ver_path, 'rb') as f: - return gmn.app.views.util.deserialize(f.read()) + return d1_gmn.app.views.util.deserialize(f.read()) except (EnvironmentError, d1_common.types.exceptions.DataONEException) as e: raise django.core.management.base.CommandError( 'Unable to read SysMeta. error="{}"'.format(str(e)) @@ -327,20 +329,22 @@ def _migrate_events(self): 'Processing event logs', i, self._v1_cursor.rowcount, '{} {}'.format(event_row['event'], event_row['pid']) ) - if gmn.app.sysmeta.is_did(event_row['pid']): - sciobj_model = gmn.app.models.ScienceObject.objects.get( + if d1_gmn.app.sysmeta.is_did(event_row['pid']): + sciobj_model = d1_gmn.app.models.ScienceObject.objects.get( pid__did=event_row['pid'] ) - event_log_model = gmn.app.models.EventLog() + event_log_model = d1_gmn.app.models.EventLog() event_log_model.sciobj = sciobj_model - event_log_model.event = gmn.app.models.event(event_row['event']) - event_log_model.ip_address = gmn.app.models.ip_address( + event_log_model.event = d1_gmn.app.models.event(event_row['event']) + event_log_model.ip_address = d1_gmn.app.models.ip_address( event_row['ip_address'] ) - event_log_model.user_agent = gmn.app.models.user_agent( + event_log_model.user_agent = d1_gmn.app.models.user_agent( event_row['user_agent'] ) - event_log_model.subject = gmn.app.models.subject(event_row['subject']) + event_log_model.subject = d1_gmn.app.models.subject( + event_row['subject'] + ) event_log_model.save() # Must update timestamp separately due to auto_now_add=True event_log_model.timestamp = event_row['date_logged'] @@ -349,7 +353,7 @@ def _migrate_events(self): # Whitelist def _migrate_whitelist(self): - gmn.app.models.WhitelistForCreateUpdateDelete.objects.all().delete() + d1_gmn.app.models.WhitelistForCreateUpdateDelete.objects.all().delete() # noinspection SqlResolve self._v1_cursor.execute( """ @@ -363,8 +367,8 @@ def _migrate_whitelist(self): logging.info( 'Migrating whitelist subject: {}'.format(whitelist_row['subject']) ) - w = gmn.app.models.WhitelistForCreateUpdateDelete() - w.subject = gmn.app.models.subject(whitelist_row['subject']) + w = d1_gmn.app.models.WhitelistForCreateUpdateDelete() + w.subject = d1_gmn.app.models.subject(whitelist_row['subject']) w.save() self._events.count('Whitelisted subject') @@ -389,7 +393,7 @@ def _update_node_doc(self): ) return client = self._create_cn_client() - node_pyxb = gmn.app.node.get_pyxb() + node_pyxb = d1_gmn.app.node.get_pyxb() try: success_bool = client.updateNodeCapabilities( django.conf.settings.NODE_IDENTIFIER, node_pyxb diff --git a/gmn/src/gmn/app/management/commands/node.py b/gmn/src/d1_gmn/app/management/commands/node.py similarity index 97% rename from gmn/src/gmn/app/management/commands/node.py rename to gmn/src/d1_gmn/app/management/commands/node.py index 192f46232..9a5d1c7cc 100644 --- a/gmn/src/gmn/app/management/commands/node.py +++ b/gmn/src/d1_gmn/app/management/commands/node.py @@ -26,15 +26,15 @@ import util +import d1_gmn.app.models +import d1_gmn.app.node + import d1_common.types.exceptions import d1_common.util import d1_common.xml import d1_client.cnclient_2_0 -import gmn.app.models -import gmn.app.node - import django.conf import django.core.management.base @@ -73,7 +73,7 @@ def handle(self, *args, **options): raise django.core.management.base.CommandError(str(e)) def _handle(self, command_str): - node_pyxb = gmn.app.node.get_pyxb() + node_pyxb = d1_gmn.app.node.get_pyxb() if command_str == 'view': logging.info(d1_common.xml.pretty_xml(node_pyxb.toxml('utf-8'))) elif command_str == 'register': diff --git a/gmn/src/gmn/app/management/commands/process_refresh_queue.py b/gmn/src/d1_gmn/app/management/commands/process_refresh_queue.py similarity index 86% rename from gmn/src/gmn/app/management/commands/process_refresh_queue.py rename to gmn/src/d1_gmn/app/management/commands/process_refresh_queue.py index ed3b82592..6e0e7096f 100644 --- a/gmn/src/gmn/app/management/commands/process_refresh_queue.py +++ b/gmn/src/d1_gmn/app/management/commands/process_refresh_queue.py @@ -25,16 +25,16 @@ import logging +import d1_gmn.app.auth +import d1_gmn.app.event_log +import d1_gmn.app.management.commands.util +import d1_gmn.app.models +import d1_gmn.app.sysmeta + import d1_client.cnclient import d1_client.d1client import d1_client.mnclient -import gmn.app.auth -import gmn.app.event_log -import gmn.app.management.commands.util -import gmn.app.models -import gmn.app.sysmeta - import django.conf import django.core.management.base from django.db import transaction @@ -53,13 +53,13 @@ def add_arguments(self, parser): ) def handle(self, *args, **options): - gmn.app.management.commands.util.log_setup(options['debug']) + d1_gmn.app.management.commands.util.log_setup(options['debug']) logging.info( u'Running management command: {}'. - format(gmn.app.management.commands.util.get_command_name()) + format(d1_gmn.app.management.commands.util.get_command_name()) ) - gmn.app.management.commands.util.abort_if_other_instance_is_running() - gmn.app.management.commands.util.abort_if_stand_alone_instance() + d1_gmn.app.management.commands.util.abort_if_other_instance_is_running() + d1_gmn.app.management.commands.util.abort_if_stand_alone_instance() p = SysMetaRefreshQueueProcessor() p.process_refresh_queue() @@ -72,7 +72,7 @@ def __init__(self): self.cn_client = self._create_cn_client() def process_refresh_queue(self): - queue_queryset = gmn.app.models.SystemMetadataRefreshQueue.objects.filter( + queue_queryset = d1_gmn.app.models.SystemMetadataRefreshQueue.objects.filter( status__status='queued' ) if not len(queue_queryset): @@ -118,12 +118,12 @@ def _refresh(self, queue_model): with transaction.atomic(): self._update_sysmeta(sysmeta_pyxb) self._update_request_status(queue_model, 'completed') - gmn.app.event_log.create_log_entry( + d1_gmn.app.event_log.create_log_entry( queue_model.sciobj, 'update', '0.0.0.0', '[refresh]', '[refresh]' ) def _update_request_status(self, queue_model, status_str): - queue_model.status = gmn.app.models.sysmeta_refresh_status(status_str) + queue_model.status = d1_gmn.app.models.sysmeta_refresh_status(status_str) queue_model.save() def _inc_and_get_failed_attempts(self, queue_model): @@ -135,7 +135,7 @@ def _inc_and_get_failed_attempts(self, queue_model): return queue_model.failed_attempts def _remove_completed_requests_from_queue(self): - gmn.app.models.SystemMetadataRefreshQueue.objects.filter( + d1_gmn.app.models.SystemMetadataRefreshQueue.objects.filter( status__status__in=('completed', 'failed') ).delete() @@ -159,17 +159,17 @@ def _update_sysmeta(self, sysmeta_pyxb): No sanity checking is done on the provided System Metadata. It comes from a CN and is implicitly trusted. """ - gmn.app.sysmeta.create_or_update(sysmeta_pyxb) + d1_gmn.app.sysmeta.create_or_update(sysmeta_pyxb) def _assert_is_pid_of_native_object(self, pid): - if not gmn.app.sysmeta.is_pid_of_existing_object(pid): + if not d1_gmn.app.sysmeta.is_pid_of_existing_object(pid): raise RefreshError( u'Object referenced by PID does not exist or is not valid target for' u'System Metadata refresh. pid="{}"'.format(pid) ) def _assert_pid_matches_request(self, sysmeta_pyxb, pid): - if gmn.app.util.uvalue(sysmeta_pyxb.identifier) != pid: + if d1_gmn.app.util.uvalue(sysmeta_pyxb.identifier) != pid: raise RefreshError( u'PID in retrieved System Metadata does not match the object for which ' u'refresh was requested. pid="{}"'.format(pid) diff --git a/gmn/src/gmn/app/management/commands/process_replication_queue.py b/gmn/src/d1_gmn/app/management/commands/process_replication_queue.py similarity index 86% rename from gmn/src/gmn/app/management/commands/process_replication_queue.py rename to gmn/src/d1_gmn/app/management/commands/process_replication_queue.py index a976493ed..16a5dc423 100644 --- a/gmn/src/gmn/app/management/commands/process_replication_queue.py +++ b/gmn/src/d1_gmn/app/management/commands/process_replication_queue.py @@ -29,6 +29,14 @@ import logging import shutil +import d1_gmn.app.event_log +import d1_gmn.app.local_replica +import d1_gmn.app.management.commands.util +import d1_gmn.app.models +import d1_gmn.app.sysmeta +import d1_gmn.app.util +import d1_gmn.app.views.util + import d1_common.const import d1_common.date_time import d1_common.types.exceptions @@ -39,14 +47,6 @@ import d1_client.d1client import d1_client.mnclient -import gmn.app.event_log -import gmn.app.local_replica -import gmn.app.management.commands.util -import gmn.app.models -import gmn.app.sysmeta -import gmn.app.util -import gmn.app.views.util - import django.conf import django.core.management.base import django.db.transaction @@ -65,13 +65,13 @@ def add_arguments(self, parser): ) def handle(self, *args, **options): - gmn.app.management.commands.util.log_setup(options['debug']) + d1_gmn.app.management.commands.util.log_setup(options['debug']) logging.info( u'Running management command: {}'. - format(gmn.app.management.commands.util.get_command_name()) + format(d1_gmn.app.management.commands.util.get_command_name()) ) - gmn.app.management.commands.util.abort_if_other_instance_is_running() - gmn.app.management.commands.util.abort_if_stand_alone_instance() + d1_gmn.app.management.commands.util.abort_if_other_instance_is_running() + d1_gmn.app.management.commands.util.abort_if_stand_alone_instance() p = ReplicationQueueProcessor() p.process_replication_queue() @@ -84,7 +84,7 @@ def __init__(self): self.cn_client = self._create_cn_client() def process_replication_queue(self): - queue_queryset = gmn.app.models.ReplicationQueue.objects.filter( + queue_queryset = d1_gmn.app.models.ReplicationQueue.objects.filter( local_replica__info__status__status='queued' ) if not len(queue_queryset): @@ -143,7 +143,7 @@ def _set_origin(self, queue_model, sysmeta_pyxb): sysmeta_pyxb.serialVersion = 1 def _inc_and_get_failed_attempts(self, queue_model): - replication_queue_model = gmn.app.models.ReplicationQueue.objects.get( + replication_queue_model = d1_gmn.app.models.ReplicationQueue.objects.get( local_replica=queue_model.local_replica ) replication_queue_model.failed_attempts += 1 @@ -155,7 +155,7 @@ def _update_request_status(self, queue_model, status_str, dataone_error=None): self._update_cn_request_status(queue_model, status_str, dataone_error) def _update_local_request_status(self, queue_model, status_str): - gmn.app.models.update_replica_status( + d1_gmn.app.models.update_replica_status( queue_model.local_replica.info, status_str ) @@ -168,7 +168,7 @@ def _update_cn_request_status( ) def _remove_completed_requests_from_queue(self): - gmn.app.models.ReplicationQueue.objects.filter( + d1_gmn.app.models.ReplicationQueue.objects.filter( local_replica__info__status__status='completed' ).delete() @@ -201,7 +201,7 @@ def _resolve_source_node_id_to_base_url(self, source_node): node_list = self._get_node_list() discovered_nodes = [] for node in node_list.node: - discovered_node_id = gmn.app.util.uvalue(node.identifier) + discovered_node_id = d1_gmn.app.util.uvalue(node.identifier) discovered_nodes.append(discovered_node_id) if discovered_node_id == source_node: return node.baseURL @@ -223,44 +223,44 @@ def _create_replica(self, sysmeta_pyxb, sciobj_stream): revision chains and SIDs. So this create sequence differs significantly from the regular one that is accessed through MNStorage.create(). """ - pid = gmn.app.util.uvalue(sysmeta_pyxb.identifier) + pid = d1_gmn.app.util.uvalue(sysmeta_pyxb.identifier) self._assert_is_pid_of_local_unprocessed_replica(pid) self._check_and_create_replica_revision(sysmeta_pyxb, 'obsoletes') self._check_and_create_replica_revision(sysmeta_pyxb, 'obsoletedBy') url = u'file:///{}'.format(d1_common.url.encodePathElement(pid)) - sciobj_model = gmn.app.sysmeta.create_or_update(sysmeta_pyxb, url) + sciobj_model = d1_gmn.app.sysmeta.create_or_update(sysmeta_pyxb, url) self._store_science_object_bytes(pid, sciobj_stream) - gmn.app.event_log.create_log_entry( + d1_gmn.app.event_log.create_log_entry( sciobj_model, 'create', '0.0.0.0', '[replica]', '[replica]' ) def _check_and_create_replica_revision(self, sysmeta_pyxb, attr_str): revision_attr = getattr(sysmeta_pyxb, attr_str) if revision_attr is not None: - pid = gmn.app.util.uvalue(revision_attr) + pid = d1_gmn.app.util.uvalue(revision_attr) self._assert_pid_is_unknown_or_replica(pid) self._create_replica_revision_reference(pid) def _create_replica_revision_reference(self, pid): - gmn.app.models.replica_revision_chain_reference(pid) + d1_gmn.app.models.replica_revision_chain_reference(pid) def _store_science_object_bytes(self, pid, sciobj_stream): - sciobj_path = gmn.app.util.sciobj_file_path(pid) - gmn.app.util.create_missing_directories(sciobj_path) + sciobj_path = d1_gmn.app.util.sciobj_file_path(pid) + d1_gmn.app.util.create_missing_directories(sciobj_path) with open(sciobj_path, 'wb') as f: shutil.copyfileobj(sciobj_stream, f) def _assert_is_pid_of_local_unprocessed_replica(self, pid): - if not gmn.app.local_replica.is_unprocessed_local_replica(pid): + if not d1_gmn.app.local_replica.is_unprocessed_local_replica(pid): raise ReplicateError( u'The identifier is already in use on the local Member Node. ' u'pid="{}"'.format(pid) ) def _assert_pid_is_unknown_or_replica(self, pid): - if gmn.app.sysmeta.is_did( + if d1_gmn.app.sysmeta.is_did( pid - ) and not gmn.app.local_replica.is_local_replica(pid): + ) and not d1_gmn.app.local_replica.is_local_replica(pid): raise ReplicateError( u'The identifier is already in use on the local Member Node. ' u'pid="{}"'.format(pid) diff --git a/gmn/src/gmn/app/management/commands/update_access_policy.py b/gmn/src/d1_gmn/app/management/commands/update_access_policy.py similarity index 76% rename from gmn/src/gmn/app/management/commands/update_access_policy.py rename to gmn/src/d1_gmn/app/management/commands/update_access_policy.py index d6a8a420e..d841ace94 100644 --- a/gmn/src/gmn/app/management/commands/update_access_policy.py +++ b/gmn/src/d1_gmn/app/management/commands/update_access_policy.py @@ -25,20 +25,20 @@ import logging import os +import d1_gmn.app.auth +import d1_gmn.app.management.commands.util +import d1_gmn.app.models +import d1_gmn.app.node +import d1_gmn.app.revision +import d1_gmn.app.sysmeta +import d1_gmn.app.util +import d1_gmn.app.views.asserts +import d1_gmn.app.views.diagnostics +import d1_gmn.app.views.util + import d1_common.types.exceptions import d1_common.url -import gmn.app.auth -import gmn.app.management.commands.util -import gmn.app.models -import gmn.app.node -import gmn.app.revision -import gmn.app.sysmeta -import gmn.app.util -import gmn.app.views.asserts -import gmn.app.views.diagnostics -import gmn.app.views.util - import django.conf import django.core.management.base @@ -60,12 +60,12 @@ def add_arguments(self, parser): ) def handle(self, *args, **options): - gmn.app.management.commands.util.log_setup(options['debug']) + d1_gmn.app.management.commands.util.log_setup(options['debug']) logging.info( u'Running management command: {}'. - format(gmn.app.management.commands.util.get_command_name()) + format(d1_gmn.app.management.commands.util.get_command_name()) ) - gmn.app.management.commands.util.abort_if_other_instance_is_running() + d1_gmn.app.management.commands.util.abort_if_other_instance_is_running() m = UpdateAccessPolicy() m.run(options['sysmeta_root_path']) @@ -75,7 +75,7 @@ def handle(self, *args, **options): class UpdateAccessPolicy(object): def __init__(self): - self._events = gmn.app.management.commands.util.EventCounter() + self._events = d1_gmn.app.management.commands.util.EventCounter() def run(self, sysmeta_root_path): try: @@ -101,28 +101,28 @@ def _update_access_policy(self, sysmeta_xml_path): try: sysmeta_pyxb = self._deserialize_sysmeta_xml_file(sysmeta_xml_path) self._access_policy_to_model( - gmn.app.util.uvalue(sysmeta_pyxb.identifier), sysmeta_pyxb + d1_gmn.app.util.uvalue(sysmeta_pyxb.identifier), sysmeta_pyxb ) except django.core.management.base.CommandError as e: logging.error(str(e)) self._events.count('Failed') else: - logging.info(gmn.app.util.uvalue(sysmeta_pyxb.identifier)) + logging.info(d1_gmn.app.util.uvalue(sysmeta_pyxb.identifier)) self._events.count('Updated') def _deserialize_sysmeta_xml_file(self, sysmeta_xml_path): try: with open(sysmeta_xml_path, 'rb') as f: - return gmn.app.views.util.deserialize(f) + return d1_gmn.app.views.util.deserialize(f) except (EnvironmentError, d1_common.types.exceptions.DataONEException) as e: raise django.core.management.base.CommandError( 'Unable to read SysMeta. error="{}"'.format(str(e)) ) def _access_policy_to_model(self, pid, sysmeta_pyxb): - if not gmn.app.sysmeta._has_access_policy_pyxb(sysmeta_pyxb): + if not d1_gmn.app.sysmeta._has_access_policy_pyxb(sysmeta_pyxb): return - if not gmn.app.sysmeta.is_pid(pid): + if not d1_gmn.app.sysmeta.is_pid(pid): return - sci_model = gmn.app.util.get_sci_model(pid) - gmn.app.sysmeta._access_policy_pyxb_to_model(sci_model, sysmeta_pyxb) + sci_model = d1_gmn.app.util.get_sci_model(pid) + d1_gmn.app.sysmeta._access_policy_pyxb_to_model(sci_model, sysmeta_pyxb) diff --git a/gmn/src/gmn/app/management/commands/util.py b/gmn/src/d1_gmn/app/management/commands/util.py similarity index 95% rename from gmn/src/gmn/app/management/commands/util.py rename to gmn/src/d1_gmn/app/management/commands/util.py index a2451ba8b..312f5303f 100644 --- a/gmn/src/gmn/app/management/commands/util.py +++ b/gmn/src/d1_gmn/app/management/commands/util.py @@ -22,13 +22,13 @@ from __future__ import absolute_import -import os -import sys import fcntl import logging +import os +import sys import tempfile -import gmn.app.models +import d1_gmn.app.models import django.conf import django.core.management.base @@ -81,8 +81,8 @@ def get_command_name(): def is_subject_in_whitelist(subject_str): - return gmn.app.models.WhitelistForCreateUpdateDelete.objects.filter( - subject=gmn.app.models.subject(subject_str) + return d1_gmn.app.models.WhitelistForCreateUpdateDelete.objects.filter( + subject=d1_gmn.app.models.subject(subject_str) ).exists() diff --git a/gmn/src/gmn/app/management/commands/whitelist.py b/gmn/src/d1_gmn/app/management/commands/whitelist.py similarity index 84% rename from gmn/src/gmn/app/management/commands/whitelist.py rename to gmn/src/d1_gmn/app/management/commands/whitelist.py index 0c2e8790e..35aba9fc9 100644 --- a/gmn/src/gmn/app/management/commands/whitelist.py +++ b/gmn/src/d1_gmn/app/management/commands/whitelist.py @@ -24,13 +24,14 @@ import logging +import d1_gmn.app.management.commands.util +import d1_gmn.app.middleware.session_cert +import d1_gmn.app.models + import d1_common.types.exceptions import d1_common.util -import django.core.management.base -import gmn.app.management.commands.util -import gmn.app.middleware.session_cert -import gmn.app.models +import django.core.management.base # noinspection PyClassHasNoInit @@ -64,7 +65,7 @@ def add_arguments(self, parser): ) def handle(self, *args, **options): - gmn.app.management.commands.util.log_setup(options['debug']) + d1_gmn.app.management.commands.util.log_setup(options['debug']) if options['command'] not in ('view', 'add', 'remove', 'bulk'): logging.info(self.missing_args_message) return @@ -87,7 +88,8 @@ def _handle(self, command_str, command_arg_str): def _view(self): logging.info(u'Subjects in whitelist:') - for whitelist_model in gmn.app.models.WhitelistForCreateUpdateDelete.objects.all(): + for whitelist_model in d1_gmn.app.models.WhitelistForCreateUpdateDelete.objects.all( + ): logging.info(' {}'.format(whitelist_model.subject.subject)) def _add(self, subject_str): @@ -95,11 +97,11 @@ def _add(self, subject_str): raise django.core.management.base.CommandError( u'Please specify a subject to add', ) - if gmn.app.management.commands.util.is_subject_in_whitelist(subject_str): + if d1_gmn.app.management.commands.util.is_subject_in_whitelist(subject_str): raise django.core.management.base.CommandError( u'Subject already in whitelist: {}'.format(subject_str) ) - gmn.app.models.whitelist_for_create_update_delete(subject_str) + d1_gmn.app.models.whitelist_for_create_update_delete(subject_str) logging.info(u'Added subject to whitelist: {}'.format(subject_str)) def _remove(self, subject_str): @@ -107,14 +109,14 @@ def _remove(self, subject_str): raise django.core.management.base.CommandError( u'Please specify a subject to remove', ) - if not gmn.app.management.commands.util.is_subject_in_whitelist( + if not d1_gmn.app.management.commands.util.is_subject_in_whitelist( subject_str ): raise django.core.management.base.CommandError( u'Subject is not in whitelist: {}'.format(subject_str) ) - gmn.app.models.WhitelistForCreateUpdateDelete.objects.filter( - subject=gmn.app.models.subject(subject_str) + d1_gmn.app.models.WhitelistForCreateUpdateDelete.objects.filter( + subject=d1_gmn.app.models.subject(subject_str) ).delete() logging.info(u'Removed subject from whitelist: {}'.format(subject_str)) @@ -125,11 +127,11 @@ def _bulk(self, whitelist_file_path): ) subject_cnt = 0 with open(whitelist_file_path) as f: - gmn.app.models.WhitelistForCreateUpdateDelete.objects.all().delete() + d1_gmn.app.models.WhitelistForCreateUpdateDelete.objects.all().delete() for subject_str in f: subject_str = subject_str.strip() if subject_str == '' or subject_str.startswith('#'): continue - gmn.app.models.whitelist_for_create_update_delete(subject_str) + d1_gmn.app.models.whitelist_for_create_update_delete(subject_str) subject_cnt += 1 logging.info(u'Created new whitelist with {} subjects'.format(subject_cnt)) diff --git a/gmn/src/gmn/app/middleware/__init__.py b/gmn/src/d1_gmn/app/middleware/__init__.py similarity index 100% rename from gmn/src/gmn/app/middleware/__init__.py rename to gmn/src/d1_gmn/app/middleware/__init__.py diff --git a/gmn/src/gmn/app/middleware/detail_codes.py b/gmn/src/d1_gmn/app/middleware/detail_codes.py similarity index 100% rename from gmn/src/gmn/app/middleware/detail_codes.py rename to gmn/src/d1_gmn/app/middleware/detail_codes.py diff --git a/gmn/src/gmn/app/middleware/exception_handler.py b/gmn/src/d1_gmn/app/middleware/exception_handler.py similarity index 98% rename from gmn/src/gmn/app/middleware/exception_handler.py rename to gmn/src/d1_gmn/app/middleware/exception_handler.py index 02c1da779..3fa22448b 100644 --- a/gmn/src/gmn/app/middleware/exception_handler.py +++ b/gmn/src/d1_gmn/app/middleware/exception_handler.py @@ -45,12 +45,12 @@ import sys import traceback +import d1_gmn.app.middleware.detail_codes + import d1_common.const import d1_common.ext.mimeparser import d1_common.types.exceptions -import gmn.app.middleware.detail_codes - import django.conf import django.http @@ -112,7 +112,7 @@ def _django_html_exception_page(self): def _wrap_internal_exception_in_dataone_exception(self, request): e = d1_common.types.exceptions.ServiceFailure(0, traceback.format_exc(), '') e.detailCode = str( - gmn.app.middleware.detail_codes.dataone_exception_to_detail_code() + d1_gmn.app.middleware.detail_codes.dataone_exception_to_detail_code() .detail_code(request, e) ) e.traceInformation = self._traceback_to_text() diff --git a/gmn/src/gmn/app/middleware/profiling_handler.py b/gmn/src/d1_gmn/app/middleware/profiling_handler.py similarity index 100% rename from gmn/src/gmn/app/middleware/profiling_handler.py rename to gmn/src/d1_gmn/app/middleware/profiling_handler.py diff --git a/gmn/src/gmn/app/middleware/request_handler.py b/gmn/src/d1_gmn/app/middleware/request_handler.py similarity index 100% rename from gmn/src/gmn/app/middleware/request_handler.py rename to gmn/src/d1_gmn/app/middleware/request_handler.py index 45cc49055..ef4ceb5f5 100644 --- a/gmn/src/gmn/app/middleware/request_handler.py +++ b/gmn/src/d1_gmn/app/middleware/request_handler.py @@ -28,8 +28,8 @@ import d1_common import d1_common.const import d1_common.types.exceptions -import django.conf +import django.conf import django.http diff --git a/gmn/src/gmn/app/middleware/response_handler.py b/gmn/src/d1_gmn/app/middleware/response_handler.py similarity index 91% rename from gmn/src/gmn/app/middleware/response_handler.py rename to gmn/src/d1_gmn/app/middleware/response_handler.py index 8bf934ab5..5743de361 100644 --- a/gmn/src/gmn/app/middleware/response_handler.py +++ b/gmn/src/d1_gmn/app/middleware/response_handler.py @@ -25,19 +25,19 @@ from __future__ import absolute_import -import logging import datetime +import logging + +import d1_gmn.app.views.util import d1_common.const import d1_common.type_conversions -import d1_common.types.exceptions import d1_common.types.dataoneTypes_v1_1 import d1_common.types.dataoneTypes_v2_0 +import d1_common.types.exceptions -import gmn.app.views.util - -import django.db import django.conf +import django.db import django.http from django.db.models import Max @@ -100,12 +100,13 @@ def _serialize_object(self, request, view_result): return response def _generate_object_list(self, request, db_query, start, total): - objectList = gmn.app.views.util.dataoneTypes(request).objectList() + objectList = d1_gmn.app.views.util.dataoneTypes(request).objectList() for row in db_query: - objectInfo = gmn.app.views.util.dataoneTypes(request).ObjectInfo() + objectInfo = d1_gmn.app.views.util.dataoneTypes(request).ObjectInfo() objectInfo.identifier = row.pid.did objectInfo.formatId = row.format.format - checksum = gmn.app.views.util.dataoneTypes(request).Checksum(row.checksum) + checksum = d1_gmn.app.views.util.dataoneTypes(request + ).Checksum(row.checksum) checksum.algorithm = row.checksum_algorithm.checksum_algorithm objectInfo.checksum = checksum objectInfo.dateSysMetadataModified = datetime.datetime.isoformat( @@ -119,9 +120,9 @@ def _generate_object_list(self, request, db_query, start, total): return objectList def _generate_log_records(self, request, db_query, start, total): - log = gmn.app.views.util.dataoneTypes(request).log() + log = d1_gmn.app.views.util.dataoneTypes(request).log() for row in db_query: - logEntry = gmn.app.views.util.dataoneTypes(request).LogEntry() + logEntry = d1_gmn.app.views.util.dataoneTypes(request).LogEntry() logEntry.entryId = str(row.id) logEntry.identifier = row.sciobj.pid.did logEntry.ipAddress = row.ip_address.ip_address @@ -137,7 +138,7 @@ def _generate_log_records(self, request, db_query, start, total): return log def _http_response_with_identifier_type(self, request, pid): - pid_pyxb = gmn.app.views.util.dataoneTypes(request).identifier(pid) + pid_pyxb = d1_gmn.app.views.util.dataoneTypes(request).identifier(pid) pid_xml = pid_pyxb.toxml('utf-8') return django.http.HttpResponse(pid_xml, d1_common.const.CONTENT_TYPE_XML) diff --git a/gmn/src/gmn/app/middleware/session_cert.py b/gmn/src/d1_gmn/app/middleware/session_cert.py similarity index 100% rename from gmn/src/gmn/app/middleware/session_cert.py rename to gmn/src/d1_gmn/app/middleware/session_cert.py diff --git a/gmn/src/gmn/app/middleware/session_jwt.py b/gmn/src/d1_gmn/app/middleware/session_jwt.py similarity index 100% rename from gmn/src/gmn/app/middleware/session_jwt.py rename to gmn/src/d1_gmn/app/middleware/session_jwt.py index 2a720572a..c90df0071 100644 --- a/gmn/src/gmn/app/middleware/session_jwt.py +++ b/gmn/src/d1_gmn/app/middleware/session_jwt.py @@ -22,15 +22,15 @@ from __future__ import absolute_import -import ssl -import socket import logging +import socket +import ssl import urlparse -import jwt -import httplib -import cryptography.x509 import cryptography.hazmat.backends +import cryptography.x509 +import httplib +import jwt import d1_common.const import d1_common.types.exceptions diff --git a/gmn/src/gmn/app/middleware/view_handler.py b/gmn/src/d1_gmn/app/middleware/view_handler.py similarity index 94% rename from gmn/src/gmn/app/middleware/view_handler.py rename to gmn/src/d1_gmn/app/middleware/view_handler.py index c2904b30a..e133d403a 100644 --- a/gmn/src/gmn/app/middleware/view_handler.py +++ b/gmn/src/d1_gmn/app/middleware/view_handler.py @@ -25,12 +25,12 @@ import logging import StringIO +import d1_gmn.app.middleware.session_cert +import d1_gmn.app.middleware.session_jwt + import d1_common import d1_common.const -import gmn.app.middleware.session_cert -import gmn.app.middleware.session_jwt - import django.conf @@ -73,10 +73,11 @@ def get_active_subject_set(self, request): # Add subjects from any provided certificate and JWT and store them in # the Django request obj. cert_primary_str, cert_equivalent_set = ( - gmn.app.middleware.session_cert.get_subjects(request) + d1_gmn.app.middleware.session_cert.get_subjects(request) ) jwt_subject_list = ( - gmn.app.middleware.session_jwt.validate_jwt_and_get_subject_list(request) + d1_gmn.app.middleware.session_jwt. + validate_jwt_and_get_subject_list(request) ) primary_subject_str = cert_primary_str all_subjects_set = ( diff --git a/gmn/src/gmn/app/migrations/0001_initial.py b/gmn/src/d1_gmn/app/migrations/0001_initial.py similarity index 100% rename from gmn/src/gmn/app/migrations/0001_initial.py rename to gmn/src/d1_gmn/app/migrations/0001_initial.py diff --git a/gmn/src/gmn/app/migrations/0002_scienceobject_filename.py b/gmn/src/d1_gmn/app/migrations/0002_scienceobject_filename.py similarity index 100% rename from gmn/src/gmn/app/migrations/0002_scienceobject_filename.py rename to gmn/src/d1_gmn/app/migrations/0002_scienceobject_filename.py diff --git a/gmn/src/gmn/app/migrations/0003_mediatype_mediatypeproperty.py b/gmn/src/d1_gmn/app/migrations/0003_mediatype_mediatypeproperty.py similarity index 100% rename from gmn/src/gmn/app/migrations/0003_mediatype_mediatypeproperty.py rename to gmn/src/d1_gmn/app/migrations/0003_mediatype_mediatypeproperty.py diff --git a/gmn/src/gmn/app/migrations/0004_auto_20170523_0137.py b/gmn/src/d1_gmn/app/migrations/0004_auto_20170523_0137.py similarity index 100% rename from gmn/src/gmn/app/migrations/0004_auto_20170523_0137.py rename to gmn/src/d1_gmn/app/migrations/0004_auto_20170523_0137.py diff --git a/gmn/src/gmn/app/migrations/0005_auto_20170527_1554.py b/gmn/src/d1_gmn/app/migrations/0005_auto_20170527_1554.py similarity index 100% rename from gmn/src/gmn/app/migrations/0005_auto_20170527_1554.py rename to gmn/src/d1_gmn/app/migrations/0005_auto_20170527_1554.py diff --git a/gmn/src/gmn/app/migrations/0006_chainidtopersistentid.py b/gmn/src/d1_gmn/app/migrations/0006_chainidtopersistentid.py similarity index 100% rename from gmn/src/gmn/app/migrations/0006_chainidtopersistentid.py rename to gmn/src/d1_gmn/app/migrations/0006_chainidtopersistentid.py diff --git a/gmn/src/gmn/app/migrations/0007_delete_chainidtopersistentid.py b/gmn/src/d1_gmn/app/migrations/0007_delete_chainidtopersistentid.py similarity index 100% rename from gmn/src/gmn/app/migrations/0007_delete_chainidtopersistentid.py rename to gmn/src/d1_gmn/app/migrations/0007_delete_chainidtopersistentid.py diff --git a/gmn/src/gmn/app/migrations/0008_chainidtopersistentid.py b/gmn/src/d1_gmn/app/migrations/0008_chainidtopersistentid.py similarity index 100% rename from gmn/src/gmn/app/migrations/0008_chainidtopersistentid.py rename to gmn/src/d1_gmn/app/migrations/0008_chainidtopersistentid.py diff --git a/gmn/src/gmn/app/migrations/0009_auto_20170603_0546.py b/gmn/src/d1_gmn/app/migrations/0009_auto_20170603_0546.py similarity index 100% rename from gmn/src/gmn/app/migrations/0009_auto_20170603_0546.py rename to gmn/src/d1_gmn/app/migrations/0009_auto_20170603_0546.py diff --git a/gmn/src/gmn/app/migrations/__init__.py b/gmn/src/d1_gmn/app/migrations/__init__.py similarity index 100% rename from gmn/src/gmn/app/migrations/__init__.py rename to gmn/src/d1_gmn/app/migrations/__init__.py diff --git a/gmn/src/gmn/app/models.py b/gmn/src/d1_gmn/app/models.py similarity index 100% rename from gmn/src/gmn/app/models.py rename to gmn/src/d1_gmn/app/models.py diff --git a/gmn/src/gmn/app/node.py b/gmn/src/d1_gmn/app/node.py similarity index 100% rename from gmn/src/gmn/app/node.py rename to gmn/src/d1_gmn/app/node.py diff --git a/gmn/src/gmn/app/node_registry.py b/gmn/src/d1_gmn/app/node_registry.py similarity index 97% rename from gmn/src/gmn/app/node_registry.py rename to gmn/src/d1_gmn/app/node_registry.py index 225e87b0b..da80c17ab 100644 --- a/gmn/src/gmn/app/node_registry.py +++ b/gmn/src/d1_gmn/app/node_registry.py @@ -28,9 +28,9 @@ import logging -import d1_client.cnclient +import d1_gmn.app.util -import gmn.app.util +import d1_client.cnclient import django.conf import django.core.cache @@ -96,7 +96,7 @@ def get_cn_subjects_from_dataone_root(): for service in services: if service.name == 'CNCore': for subject in node.subject: - cn_subjects.add(gmn.app.util.uvalue(subject)) + cn_subjects.add(d1_gmn.app.util.uvalue(subject)) break return cn_subjects diff --git a/gmn/src/gmn/app/psycopg_adapter.py b/gmn/src/d1_gmn/app/psycopg_adapter.py similarity index 100% rename from gmn/src/gmn/app/psycopg_adapter.py rename to gmn/src/d1_gmn/app/psycopg_adapter.py diff --git a/gmn/src/gmn/app/restrict_to_verb.py b/gmn/src/d1_gmn/app/restrict_to_verb.py similarity index 100% rename from gmn/src/gmn/app/restrict_to_verb.py rename to gmn/src/d1_gmn/app/restrict_to_verb.py diff --git a/gmn/src/gmn/app/revision.py b/gmn/src/d1_gmn/app/revision.py similarity index 73% rename from gmn/src/gmn/app/revision.py rename to gmn/src/d1_gmn/app/revision.py index 63c1a2e8b..907115a64 100644 --- a/gmn/src/gmn/app/revision.py +++ b/gmn/src/d1_gmn/app/revision.py @@ -22,10 +22,10 @@ from __future__ import absolute_import -import gmn.app -import gmn.app.auth -import gmn.app.models -import gmn.app.util +import d1_gmn.app +import d1_gmn.app.auth +import d1_gmn.app.models +import d1_gmn.app.util # PyXB @@ -35,7 +35,7 @@ def has_sid(sysmeta_pyxb): def get_sid(sysmeta_pyxb): - return gmn.app.util.get_value(sysmeta_pyxb, 'seriesId') + return d1_gmn.app.util.get_value(sysmeta_pyxb, 'seriesId') # DB updates @@ -47,17 +47,17 @@ def create_chain(sid, pid): Preconditions: - {sid} must either be None or be previously unused. - gmn.app.views.asserts.is_unused() + d1_gmn.app.views.asserts.is_unused() - {pid} must exist and be verified to be a PID. - gmn.app.views.asserts.is_pid() + d1_gmn.app.views.asserts.is_pid() """ - sid_model = gmn.app.models.did(sid) if sid else None - pid_model = gmn.app.models.did(pid) - chain_model = gmn.app.models.ChainIdToSeriesID( + sid_model = d1_gmn.app.models.did(sid) if sid else None + pid_model = d1_gmn.app.models.did(pid) + chain_model = d1_gmn.app.models.ChainIdToSeriesID( sid=sid_model, head_pid=pid_model ) chain_model.save() - pid_to_chain_model = gmn.app.models.PersistentIdToChainID( + pid_to_chain_model = d1_gmn.app.models.PersistentIdToChainID( chain=chain_model, pid=pid_model ) pid_to_chain_model.save() @@ -71,22 +71,22 @@ def add_pid_to_chain(sid, old_pid, new_pid): Preconditions: - {sid} must either be None or match the SID already assigned to the chain. - Both {old_pid} and {new_pid} must exist and be verified to be PIDs - gmn.app.views.asserts.is_pid() + d1_gmn.app.views.asserts.is_pid() """ - old_pid_to_chain_model = gmn.app.models.PersistentIdToChainID.objects.get( + old_pid_to_chain_model = d1_gmn.app.models.PersistentIdToChainID.objects.get( pid__did=old_pid ) - new_pid_to_chain_model = gmn.app.models.PersistentIdToChainID( + new_pid_to_chain_model = d1_gmn.app.models.PersistentIdToChainID( chain=old_pid_to_chain_model.chain, - pid=gmn.app.models.IdNamespace.objects.get(did=new_pid) + pid=d1_gmn.app.models.IdNamespace.objects.get(did=new_pid) ) new_pid_to_chain_model.save() if sid: - chain_model = gmn.app.models.ChainIdToSeriesID.objects.get(sid__did=sid) + chain_model = d1_gmn.app.models.ChainIdToSeriesID.objects.get(sid__did=sid) assert chain_model.sid is None or chain_model.sid.did == sid, \ 'Cannot change SID for existing chain' - chain_model.sid = gmn.app.models.did(sid) + chain_model.sid = d1_gmn.app.models.did(sid) chain_model.save() @@ -97,12 +97,12 @@ def update_sid_to_head_pid_map(pid): Preconditions: - {pid} must exist and be verified to be a PID. - gmn.app.views.asserts.is_pid() + d1_gmn.app.views.asserts.is_pid() """ - sci_model = gmn.app.util.get_sci_model(pid) + sci_model = d1_gmn.app.util.get_sci_model(pid) while sci_model.obsoleted_by is not None: - sci_model = gmn.app.util.get_sci_model(sci_model.obsoleted_by.did) - chain_model = gmn.app.models.PersistentIdToChainID.objects.get( + sci_model = d1_gmn.app.util.get_sci_model(sci_model.obsoleted_by.did) + chain_model = d1_gmn.app.models.PersistentIdToChainID.objects.get( pid__did=pid ).chain chain_model.head_pid = sci_model.pid @@ -111,32 +111,33 @@ def update_sid_to_head_pid_map(pid): def delete_chain(pid): """""" - pid_to_chain_model = gmn.app.models.PersistentIdToChainID.objects.get( + pid_to_chain_model = d1_gmn.app.models.PersistentIdToChainID.objects.get( pid__did=pid ) chain_model = pid_to_chain_model.chain pid_to_chain_model.delete() - if not gmn.app.models.PersistentIdToChainID.objects.filter( + if not d1_gmn.app.models.PersistentIdToChainID.objects.filter( chain=chain_model, ).exists(): if chain_model.sid: # Cascades back to chain_model. - gmn.app.models.IdNamespace.objects.filter(did=chain_model.sid.did).delete() + d1_gmn.app.models.IdNamespace.objects.filter(did=chain_model.sid.did + ).delete() else: chain_model.delete() def set_revision(pid, obsoletes_pid=None, obsoleted_by_pid=None): - sciobj_model = gmn.app.util.get_sci_model(pid) + sciobj_model = d1_gmn.app.util.get_sci_model(pid) set_revision_by_model(sciobj_model, obsoletes_pid, obsoleted_by_pid) sciobj_model.save() def set_revision_by_model(sciobj_model, obsoletes_pid, obsoleted_by_pid): if obsoletes_pid: - sciobj_model.obsoletes = gmn.app.models.did(obsoletes_pid) + sciobj_model.obsoletes = d1_gmn.app.models.did(obsoletes_pid) if obsoleted_by_pid: - sciobj_model.obsoleted_by = gmn.app.models.did(obsoleted_by_pid) + sciobj_model.obsoleted_by = d1_gmn.app.models.did(obsoleted_by_pid) # Cut @@ -149,8 +150,8 @@ def cut_from_chain(sciobj_model): - The object with the pid is verified to exist and to be a member of an revision chain. E.g., with: - gmn.app.views.asserts.is_pid(pid) - gmn.app.views.asserts.is_in_revision_chain(pid) + d1_gmn.app.views.asserts.is_pid(pid) + d1_gmn.app.views.asserts.is_in_revision_chain(pid) - The object can be at any location in the chain, including the head or tail. @@ -175,7 +176,7 @@ def cut_from_chain(sciobj_model): def _cut_head_from_chain(sciobj_model): - new_head_model = gmn.app.util.get_sci_model(sciobj_model.obsoletes.did) + new_head_model = d1_gmn.app.util.get_sci_model(sciobj_model.obsoletes.did) new_head_model.obsoleted_by = None sciobj_model.obsoletes = None sciobj_model.save() @@ -183,7 +184,7 @@ def _cut_head_from_chain(sciobj_model): def _cut_tail_from_chain(sciobj_model): - new_tail_model = gmn.app.util.get_sci_model(sciobj_model.obsoleted_by.did) + new_tail_model = d1_gmn.app.util.get_sci_model(sciobj_model.obsoleted_by.did) new_tail_model.obsoletes = None sciobj_model.obsoleted_by = None sciobj_model.save() @@ -191,8 +192,8 @@ def _cut_tail_from_chain(sciobj_model): def _cut_embedded_from_chain(sciobj_model): - prev_model = gmn.app.util.get_sci_model(sciobj_model.obsoletes.did) - next_model = gmn.app.util.get_sci_model(sciobj_model.obsoleted_by.did) + prev_model = d1_gmn.app.util.get_sci_model(sciobj_model.obsoletes.did) + next_model = d1_gmn.app.util.get_sci_model(sciobj_model.obsoleted_by.did) prev_model.obsoleted_by = next_model.pid next_model.obsoletes = prev_model.pid sciobj_model.obsoletes = None @@ -209,9 +210,11 @@ def resolve_sid(sid): """Get the PID to which the {sid} currently maps. Preconditions: - - {sid} is verified to exist. E.g., with gmn.app.views.asserts.is_sid(). + - {sid} is verified to exist. E.g., with d1_gmn.app.views.asserts.is_sid(). """ - return gmn.app.models.ChainIdToSeriesID.objects.get(sid__did=sid).head_pid.did + return d1_gmn.app.models.ChainIdToSeriesID.objects.get( + sid__did=sid + ).head_pid.did def get_sid_by_pid(pid): @@ -222,9 +225,9 @@ def get_sid_by_pid(pid): This is the reverse of resolve. Preconditions: - - {pid} is verified to exist. E.g., with gmn.app.views.asserts.is_pid(). + - {pid} is verified to exist. E.g., with d1_gmn.app.views.asserts.is_pid(). """ - sid_model = gmn.app.models.PersistentIdToChainID.objects.get( + sid_model = d1_gmn.app.models.PersistentIdToChainID.objects.get( pid__did=pid ).chain.sid if sid_model: @@ -237,12 +240,12 @@ def get_sid_by_pid(pid): # typically obtained by resolving a SID. If the given PID is not in a chain, a # list containing the single object is returned. # """ -# sci_model = gmn.app.util.get_sci_model(pid) +# sci_model = d1_gmn.app.util.get_sci_model(pid) # while sci_model.obsoletes: -# sci_model = gmn.app.util.get_sci_model(sci_model.obsoletes.pid.did) +# sci_model = d1_gmn.app.util.get_sci_model(sci_model.obsoletes.pid.did) # chain_pid_list = [sci_model.pid.did] # while sci_model.obsoleted_by: -# sci_model = gmn.app.util.get_sci_model( +# sci_model = d1_gmn.app.util.get_sci_model( # sci_model.obsoleted_by.pid.did # ) # chain_pid_list.append(sci_model.pid.did) @@ -250,11 +253,12 @@ def get_sid_by_pid(pid): def is_sid(did): - return gmn.app.models.ChainIdToSeriesID.objects.filter(sid__did=did).exists() + return d1_gmn.app.models.ChainIdToSeriesID.objects.filter(sid__did=did + ).exists() def is_obsoleted(pid): - return gmn.app.util.get_sci_model(pid).obsoleted_by is not None + return d1_gmn.app.util.get_sci_model(pid).obsoleted_by is not None def is_in_revision_chain(sciobj_model): @@ -274,7 +278,7 @@ def is_tail(sciobj_model): # {pid} belongs. # # Preconditions: -# - {sid} is verified to exist. E.g., with gmn.app.views.asserts.is_sid(). +# - {sid} is verified to exist. E.g., with d1_gmn.app.views.asserts.is_sid(). # """ # chain_pid_list = get_pids_in_revision_chain(pid) # resolved_pid = resolve_sid(sid) @@ -288,20 +292,20 @@ def is_tail(sciobj_model): # - {sid} is verified to be unused if creating a standalone object (that may later become # the first object in a chain). # - {sid} is verified to belong to the given chain updating. -# - {pid} is verified to exist. E.g., with gmn.app.views.asserts.is_pid(). +# - {pid} is verified to exist. E.g., with d1_gmn.app.views.asserts.is_pid(). # """ -# gmn.app.models.sid_to_pid(sid, pid) -# gmn.app.models.sid_to_head_pid(sid, pid) +# d1_gmn.app.models.sid_to_pid(sid, pid) +# d1_gmn.app.models.sid_to_head_pid(sid, pid) # def get_sid_by_pid(pid): # """Get the SID to which the {pid} maps. # Return None if there is no SID maps to {pid}. # """ # try: -# return gmn.app.models.SeriesIdToPersistentId.objects.get( +# return d1_gmn.app.models.SeriesIdToPersistentId.objects.get( # pid__did=pid # ).sid.did -# except gmn.app.models.SeriesIdToPersistentId.DoesNotExist: +# except d1_gmn.app.models.SeriesIdToPersistentId.DoesNotExist: # return None # def move_sid_to_last_object_in_chain(pid): @@ -315,7 +319,7 @@ def is_tail(sciobj_model): # database maintains the current mapping going forward. # # Preconditions: -# - PID is verified to exist. E.g., with gmn.app.views.asserts.is_pid(). +# - PID is verified to exist. E.g., with d1_gmn.app.views.asserts.is_pid(). # # Postconditions: # - The SID maps to the last object in the chain. diff --git a/gmn/src/gmn/app/startup.py b/gmn/src/d1_gmn/app/startup.py similarity index 96% rename from gmn/src/gmn/app/startup.py rename to gmn/src/d1_gmn/app/startup.py index ba8481589..13ef609c2 100644 --- a/gmn/src/gmn/app/startup.py +++ b/gmn/src/d1_gmn/app/startup.py @@ -26,16 +26,17 @@ import random import string +import d1_gmn.app.util + import d1_common.util + import django.apps import django.conf import django.core.exceptions -import gmn.app.util - class GMNStartupChecks(django.apps.AppConfig): - name = 'gmn.app.startup' + name = 'd1_gmn.app.startup' def ready(self): self._check_cert_file(django.conf.settings.CLIENT_CERT_PATH) @@ -63,7 +64,7 @@ def _check_cert_file(self, cert_pem_path): if cert_pem_path is None: return try: - gmn.app.util.assert_readable_file(cert_pem_path) + d1_gmn.app.util.assert_readable_file(cert_pem_path) except ValueError as e: raise django.core.exceptions.ImproperlyConfigured( u'Configuration error: Invalid certificate: {}'.format(str(e)) diff --git a/gmn/src/gmn/app/static/css/font-awesome.min.css b/gmn/src/d1_gmn/app/static/css/font-awesome.min.css similarity index 100% rename from gmn/src/gmn/app/static/css/font-awesome.min.css rename to gmn/src/d1_gmn/app/static/css/font-awesome.min.css diff --git a/gmn/src/gmn/app/static/images/d1_logo.png b/gmn/src/d1_gmn/app/static/images/d1_logo.png similarity index 100% rename from gmn/src/gmn/app/static/images/d1_logo.png rename to gmn/src/d1_gmn/app/static/images/d1_logo.png diff --git a/gmn/src/gmn/app/static/images/preface-wrapper-bg.png b/gmn/src/d1_gmn/app/static/images/preface-wrapper-bg.png similarity index 100% rename from gmn/src/gmn/app/static/images/preface-wrapper-bg.png rename to gmn/src/d1_gmn/app/static/images/preface-wrapper-bg.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/css/start/images/animated-overlay.gif b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/css/start/images/animated-overlay.gif similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/css/start/images/animated-overlay.gif rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/css/start/images/animated-overlay.gif diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/css/start/images/ui-bg_flat_55_999999_40x100.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/css/start/images/ui-bg_flat_55_999999_40x100.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/css/start/images/ui-bg_flat_55_999999_40x100.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/css/start/images/ui-bg_flat_55_999999_40x100.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/css/start/images/ui-bg_flat_75_aaaaaa_40x100.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/css/start/images/ui-bg_flat_75_aaaaaa_40x100.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/css/start/images/ui-bg_flat_75_aaaaaa_40x100.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/css/start/images/ui-bg_flat_75_aaaaaa_40x100.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/css/start/images/ui-bg_glass_45_0078ae_1x400.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/css/start/images/ui-bg_glass_45_0078ae_1x400.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/css/start/images/ui-bg_glass_45_0078ae_1x400.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/css/start/images/ui-bg_glass_45_0078ae_1x400.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/css/start/images/ui-bg_glass_55_f8da4e_1x400.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/css/start/images/ui-bg_glass_55_f8da4e_1x400.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/css/start/images/ui-bg_glass_55_f8da4e_1x400.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/css/start/images/ui-bg_glass_55_f8da4e_1x400.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/css/start/images/ui-bg_glass_75_79c9ec_1x400.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/css/start/images/ui-bg_glass_75_79c9ec_1x400.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/css/start/images/ui-bg_glass_75_79c9ec_1x400.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/css/start/images/ui-bg_glass_75_79c9ec_1x400.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/css/start/images/ui-bg_gloss-wave_45_e14f1c_500x100.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/css/start/images/ui-bg_gloss-wave_45_e14f1c_500x100.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/css/start/images/ui-bg_gloss-wave_45_e14f1c_500x100.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/css/start/images/ui-bg_gloss-wave_45_e14f1c_500x100.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/css/start/images/ui-bg_gloss-wave_50_6eac2c_500x100.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/css/start/images/ui-bg_gloss-wave_50_6eac2c_500x100.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/css/start/images/ui-bg_gloss-wave_50_6eac2c_500x100.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/css/start/images/ui-bg_gloss-wave_50_6eac2c_500x100.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/css/start/images/ui-bg_gloss-wave_75_2191c0_500x100.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/css/start/images/ui-bg_gloss-wave_75_2191c0_500x100.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/css/start/images/ui-bg_gloss-wave_75_2191c0_500x100.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/css/start/images/ui-bg_gloss-wave_75_2191c0_500x100.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/css/start/images/ui-bg_inset-hard_100_fcfdfd_1x100.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/css/start/images/ui-bg_inset-hard_100_fcfdfd_1x100.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/css/start/images/ui-bg_inset-hard_100_fcfdfd_1x100.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/css/start/images/ui-bg_inset-hard_100_fcfdfd_1x100.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/css/start/images/ui-icons_0078ae_256x240.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/css/start/images/ui-icons_0078ae_256x240.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/css/start/images/ui-icons_0078ae_256x240.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/css/start/images/ui-icons_0078ae_256x240.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/css/start/images/ui-icons_056b93_256x240.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/css/start/images/ui-icons_056b93_256x240.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/css/start/images/ui-icons_056b93_256x240.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/css/start/images/ui-icons_056b93_256x240.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/css/start/images/ui-icons_d8e7f3_256x240.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/css/start/images/ui-icons_d8e7f3_256x240.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/css/start/images/ui-icons_d8e7f3_256x240.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/css/start/images/ui-icons_d8e7f3_256x240.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/css/start/images/ui-icons_e0fdff_256x240.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/css/start/images/ui-icons_e0fdff_256x240.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/css/start/images/ui-icons_e0fdff_256x240.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/css/start/images/ui-icons_e0fdff_256x240.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/css/start/images/ui-icons_f5e175_256x240.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/css/start/images/ui-icons_f5e175_256x240.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/css/start/images/ui-icons_f5e175_256x240.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/css/start/images/ui-icons_f5e175_256x240.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/css/start/images/ui-icons_f7a50d_256x240.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/css/start/images/ui-icons_f7a50d_256x240.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/css/start/images/ui-icons_f7a50d_256x240.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/css/start/images/ui-icons_f7a50d_256x240.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/css/start/images/ui-icons_fcd113_256x240.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/css/start/images/ui-icons_fcd113_256x240.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/css/start/images/ui-icons_fcd113_256x240.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/css/start/images/ui-icons_fcd113_256x240.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/css/start/jquery-ui-1.10.4.custom.css b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/css/start/jquery-ui-1.10.4.custom.css similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/css/start/jquery-ui-1.10.4.custom.css rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/css/start/jquery-ui-1.10.4.custom.css diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/css/start/jquery-ui-1.10.4.custom.min.css b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/css/start/jquery-ui-1.10.4.custom.min.css similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/css/start/jquery-ui-1.10.4.custom.min.css rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/css/start/jquery-ui-1.10.4.custom.min.css diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/AUTHORS.txt b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/AUTHORS.txt similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/AUTHORS.txt rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/AUTHORS.txt diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/Gruntfile.js b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/Gruntfile.js similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/Gruntfile.js rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/Gruntfile.js diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/MIT-LICENSE.txt b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/MIT-LICENSE.txt similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/MIT-LICENSE.txt rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/MIT-LICENSE.txt diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/README.md b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/README.md similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/README.md rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/README.md diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/demos.css b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/demos.css similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/demos.css rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/demos.css diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/images/calendar.gif b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/images/calendar.gif similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/images/calendar.gif rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/images/calendar.gif diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/images/demo-config-on-tile.gif b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/images/demo-config-on-tile.gif similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/images/demo-config-on-tile.gif rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/images/demo-config-on-tile.gif diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/images/demo-config-on.gif b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/images/demo-config-on.gif similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/images/demo-config-on.gif rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/images/demo-config-on.gif diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/images/demo-spindown-closed.gif b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/images/demo-spindown-closed.gif similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/images/demo-spindown-closed.gif rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/images/demo-spindown-closed.gif diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/images/demo-spindown-open.gif b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/images/demo-spindown-open.gif similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/images/demo-spindown-open.gif rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/images/demo-spindown-open.gif diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/images/icon-docs-info.gif b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/images/icon-docs-info.gif similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/images/icon-docs-info.gif rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/images/icon-docs-info.gif diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/images/pbar-ani.gif b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/images/pbar-ani.gif similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/images/pbar-ani.gif rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/images/pbar-ani.gif diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/index.html b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/index.html similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/index.html rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/index.html diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/position/cycler.html b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/position/cycler.html similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/position/cycler.html rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/position/cycler.html diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/position/default.html b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/position/default.html similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/position/default.html rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/position/default.html diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/position/images/earth.jpg b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/position/images/earth.jpg similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/position/images/earth.jpg rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/position/images/earth.jpg diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/position/images/flight.jpg b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/position/images/flight.jpg similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/position/images/flight.jpg rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/position/images/flight.jpg diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/position/images/rocket.jpg b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/position/images/rocket.jpg similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/position/images/rocket.jpg rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/position/images/rocket.jpg diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/position/index.html b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/position/index.html similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/position/index.html rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/position/index.html diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/tabs/ajax.html b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/tabs/ajax.html similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/tabs/ajax.html rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/tabs/ajax.html diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/tabs/ajax/content1.html b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/tabs/ajax/content1.html similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/tabs/ajax/content1.html rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/tabs/ajax/content1.html diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/tabs/ajax/content2.html b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/tabs/ajax/content2.html similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/tabs/ajax/content2.html rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/tabs/ajax/content2.html diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/tabs/ajax/content3-slow.php b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/tabs/ajax/content3-slow.php similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/tabs/ajax/content3-slow.php rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/tabs/ajax/content3-slow.php diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/tabs/ajax/content4-broken.php b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/tabs/ajax/content4-broken.php similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/tabs/ajax/content4-broken.php rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/tabs/ajax/content4-broken.php diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/tabs/bottom.html b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/tabs/bottom.html similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/tabs/bottom.html rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/tabs/bottom.html diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/tabs/collapsible.html b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/tabs/collapsible.html similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/tabs/collapsible.html rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/tabs/collapsible.html diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/tabs/default.html b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/tabs/default.html similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/tabs/default.html rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/tabs/default.html diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/tabs/index.html b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/tabs/index.html similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/tabs/index.html rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/tabs/index.html diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/tabs/manipulation.html b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/tabs/manipulation.html similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/tabs/manipulation.html rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/tabs/manipulation.html diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/tabs/mouseover.html b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/tabs/mouseover.html similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/tabs/mouseover.html rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/tabs/mouseover.html diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/tabs/sortable.html b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/tabs/sortable.html similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/tabs/sortable.html rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/tabs/sortable.html diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/tabs/vertical.html b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/tabs/vertical.html similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/tabs/vertical.html rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/tabs/vertical.html diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/widget/default.html b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/widget/default.html similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/widget/default.html rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/widget/default.html diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/widget/index.html b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/widget/index.html similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/widget/index.html rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/demos/widget/index.html diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/docs/jQuery.widget.bridge.html b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/docs/jQuery.widget.bridge.html similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/docs/jQuery.widget.bridge.html rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/docs/jQuery.widget.bridge.html diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/docs/jQuery.widget.html b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/docs/jQuery.widget.html similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/docs/jQuery.widget.html rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/docs/jQuery.widget.html diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/docs/mouse.html b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/docs/mouse.html similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/docs/mouse.html rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/docs/mouse.html diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/docs/position.html b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/docs/position.html similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/docs/position.html rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/docs/position.html diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/docs/tabs.html b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/docs/tabs.html similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/docs/tabs.html rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/docs/tabs.html diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/external/globalize.culture.de-DE.js b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/external/globalize.culture.de-DE.js similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/external/globalize.culture.de-DE.js rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/external/globalize.culture.de-DE.js diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/external/globalize.culture.ja-JP.js b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/external/globalize.culture.ja-JP.js similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/external/globalize.culture.ja-JP.js rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/external/globalize.culture.ja-JP.js diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/external/globalize.js b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/external/globalize.js similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/external/globalize.js rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/external/globalize.js diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/external/jquery.mousewheel.js b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/external/jquery.mousewheel.js similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/external/jquery.mousewheel.js rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/external/jquery.mousewheel.js diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/external/jshint.js b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/external/jshint.js similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/external/jshint.js rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/external/jshint.js diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/external/qunit.css b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/external/qunit.css similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/external/qunit.css rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/external/qunit.css diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/external/qunit.js b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/external/qunit.js similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/external/qunit.js rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/external/qunit.js diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/jquery-1.10.2.js b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/jquery-1.10.2.js similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/jquery-1.10.2.js rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/jquery-1.10.2.js diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/package.json b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/package.json similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/package.json rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/package.json diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/images/animated-overlay.gif b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/images/animated-overlay.gif similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/images/animated-overlay.gif rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/images/animated-overlay.gif diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/images/ui-bg_flat_0_aaaaaa_40x100.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/images/ui-bg_flat_0_aaaaaa_40x100.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/images/ui-bg_flat_0_aaaaaa_40x100.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/images/ui-bg_flat_0_aaaaaa_40x100.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/images/ui-bg_flat_75_ffffff_40x100.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/images/ui-bg_flat_75_ffffff_40x100.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/images/ui-bg_flat_75_ffffff_40x100.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/images/ui-bg_flat_75_ffffff_40x100.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/images/ui-bg_glass_55_fbf9ee_1x400.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/images/ui-bg_glass_55_fbf9ee_1x400.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/images/ui-bg_glass_55_fbf9ee_1x400.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/images/ui-bg_glass_55_fbf9ee_1x400.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/images/ui-bg_glass_65_ffffff_1x400.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/images/ui-bg_glass_65_ffffff_1x400.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/images/ui-bg_glass_65_ffffff_1x400.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/images/ui-bg_glass_65_ffffff_1x400.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/images/ui-bg_glass_75_dadada_1x400.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/images/ui-bg_glass_75_dadada_1x400.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/images/ui-bg_glass_75_dadada_1x400.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/images/ui-bg_glass_75_dadada_1x400.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/images/ui-bg_glass_75_e6e6e6_1x400.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/images/ui-bg_glass_75_e6e6e6_1x400.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/images/ui-bg_glass_75_e6e6e6_1x400.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/images/ui-bg_glass_75_e6e6e6_1x400.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/images/ui-bg_glass_95_fef1ec_1x400.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/images/ui-bg_glass_95_fef1ec_1x400.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/images/ui-bg_glass_95_fef1ec_1x400.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/images/ui-bg_glass_95_fef1ec_1x400.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/images/ui-icons_222222_256x240.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/images/ui-icons_222222_256x240.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/images/ui-icons_222222_256x240.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/images/ui-icons_222222_256x240.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/images/ui-icons_2e83ff_256x240.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/images/ui-icons_2e83ff_256x240.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/images/ui-icons_2e83ff_256x240.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/images/ui-icons_2e83ff_256x240.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/images/ui-icons_454545_256x240.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/images/ui-icons_454545_256x240.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/images/ui-icons_454545_256x240.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/images/ui-icons_454545_256x240.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/images/ui-icons_888888_256x240.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/images/ui-icons_888888_256x240.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/images/ui-icons_888888_256x240.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/images/ui-icons_888888_256x240.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/images/ui-icons_cd0a0a_256x240.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/images/ui-icons_cd0a0a_256x240.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/images/ui-icons_cd0a0a_256x240.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/images/ui-icons_cd0a0a_256x240.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/jquery-ui.css b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/jquery-ui.css similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/jquery-ui.css rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/jquery-ui.css diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/jquery.ui.all.css b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/jquery.ui.all.css similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/jquery.ui.all.css rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/jquery.ui.all.css diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/jquery.ui.base.css b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/jquery.ui.base.css similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/jquery.ui.base.css rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/jquery.ui.base.css diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/jquery.ui.core.css b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/jquery.ui.core.css similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/jquery.ui.core.css rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/jquery.ui.core.css diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/jquery.ui.tabs.css b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/jquery.ui.tabs.css similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/jquery.ui.tabs.css rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/jquery.ui.tabs.css diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/jquery.ui.theme.css b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/jquery.ui.theme.css similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/jquery.ui.theme.css rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/jquery.ui.theme.css diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/images/animated-overlay.gif b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/images/animated-overlay.gif similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/images/animated-overlay.gif rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/images/animated-overlay.gif diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/images/ui-bg_flat_0_aaaaaa_40x100.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/images/ui-bg_flat_0_aaaaaa_40x100.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/images/ui-bg_flat_0_aaaaaa_40x100.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/images/ui-bg_flat_0_aaaaaa_40x100.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/images/ui-bg_flat_75_ffffff_40x100.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/images/ui-bg_flat_75_ffffff_40x100.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/images/ui-bg_flat_75_ffffff_40x100.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/images/ui-bg_flat_75_ffffff_40x100.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/images/ui-bg_glass_55_fbf9ee_1x400.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/images/ui-bg_glass_55_fbf9ee_1x400.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/images/ui-bg_glass_55_fbf9ee_1x400.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/images/ui-bg_glass_55_fbf9ee_1x400.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/images/ui-bg_glass_65_ffffff_1x400.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/images/ui-bg_glass_65_ffffff_1x400.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/images/ui-bg_glass_65_ffffff_1x400.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/images/ui-bg_glass_65_ffffff_1x400.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/images/ui-bg_glass_75_dadada_1x400.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/images/ui-bg_glass_75_dadada_1x400.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/images/ui-bg_glass_75_dadada_1x400.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/images/ui-bg_glass_75_dadada_1x400.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/images/ui-bg_glass_75_e6e6e6_1x400.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/images/ui-bg_glass_75_e6e6e6_1x400.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/images/ui-bg_glass_75_e6e6e6_1x400.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/images/ui-bg_glass_75_e6e6e6_1x400.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/images/ui-bg_glass_95_fef1ec_1x400.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/images/ui-bg_glass_95_fef1ec_1x400.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/images/ui-bg_glass_95_fef1ec_1x400.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/images/ui-bg_glass_95_fef1ec_1x400.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/images/ui-bg_highlight-soft_75_cccccc_1x100.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/images/ui-bg_highlight-soft_75_cccccc_1x100.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/images/ui-bg_highlight-soft_75_cccccc_1x100.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/images/ui-bg_highlight-soft_75_cccccc_1x100.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/images/ui-icons_222222_256x240.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/images/ui-icons_222222_256x240.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/images/ui-icons_222222_256x240.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/images/ui-icons_222222_256x240.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/images/ui-icons_2e83ff_256x240.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/images/ui-icons_2e83ff_256x240.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/images/ui-icons_2e83ff_256x240.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/images/ui-icons_2e83ff_256x240.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/images/ui-icons_454545_256x240.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/images/ui-icons_454545_256x240.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/images/ui-icons_454545_256x240.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/images/ui-icons_454545_256x240.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/images/ui-icons_888888_256x240.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/images/ui-icons_888888_256x240.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/images/ui-icons_888888_256x240.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/images/ui-icons_888888_256x240.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/images/ui-icons_cd0a0a_256x240.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/images/ui-icons_cd0a0a_256x240.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/images/ui-icons_cd0a0a_256x240.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/images/ui-icons_cd0a0a_256x240.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/jquery-ui.min.css b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/jquery-ui.min.css similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/jquery-ui.min.css rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/jquery-ui.min.css diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/jquery.ui.core.min.css b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/jquery.ui.core.min.css similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/jquery.ui.core.min.css rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/jquery.ui.core.min.css diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/jquery.ui.tabs.min.css b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/jquery.ui.tabs.min.css similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/jquery.ui.tabs.min.css rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/jquery.ui.tabs.min.css diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/jquery.ui.theme.min.css b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/jquery.ui.theme.min.css similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/jquery.ui.theme.min.css rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/base/minified/jquery.ui.theme.min.css diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/images/animated-overlay.gif b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/images/animated-overlay.gif similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/images/animated-overlay.gif rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/images/animated-overlay.gif diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/images/ui-bg_flat_55_999999_40x100.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/images/ui-bg_flat_55_999999_40x100.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/images/ui-bg_flat_55_999999_40x100.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/images/ui-bg_flat_55_999999_40x100.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/images/ui-bg_flat_75_aaaaaa_40x100.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/images/ui-bg_flat_75_aaaaaa_40x100.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/images/ui-bg_flat_75_aaaaaa_40x100.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/images/ui-bg_flat_75_aaaaaa_40x100.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/images/ui-bg_glass_45_0078ae_1x400.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/images/ui-bg_glass_45_0078ae_1x400.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/images/ui-bg_glass_45_0078ae_1x400.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/images/ui-bg_glass_45_0078ae_1x400.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/images/ui-bg_glass_55_f8da4e_1x400.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/images/ui-bg_glass_55_f8da4e_1x400.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/images/ui-bg_glass_55_f8da4e_1x400.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/images/ui-bg_glass_55_f8da4e_1x400.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/images/ui-bg_glass_75_79c9ec_1x400.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/images/ui-bg_glass_75_79c9ec_1x400.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/images/ui-bg_glass_75_79c9ec_1x400.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/images/ui-bg_glass_75_79c9ec_1x400.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/images/ui-bg_gloss-wave_45_e14f1c_500x100.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/images/ui-bg_gloss-wave_45_e14f1c_500x100.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/images/ui-bg_gloss-wave_45_e14f1c_500x100.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/images/ui-bg_gloss-wave_45_e14f1c_500x100.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/images/ui-bg_gloss-wave_50_6eac2c_500x100.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/images/ui-bg_gloss-wave_50_6eac2c_500x100.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/images/ui-bg_gloss-wave_50_6eac2c_500x100.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/images/ui-bg_gloss-wave_50_6eac2c_500x100.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/images/ui-bg_gloss-wave_75_2191c0_500x100.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/images/ui-bg_gloss-wave_75_2191c0_500x100.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/images/ui-bg_gloss-wave_75_2191c0_500x100.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/images/ui-bg_gloss-wave_75_2191c0_500x100.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/images/ui-bg_inset-hard_100_fcfdfd_1x100.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/images/ui-bg_inset-hard_100_fcfdfd_1x100.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/images/ui-bg_inset-hard_100_fcfdfd_1x100.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/images/ui-bg_inset-hard_100_fcfdfd_1x100.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/images/ui-icons_0078ae_256x240.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/images/ui-icons_0078ae_256x240.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/images/ui-icons_0078ae_256x240.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/images/ui-icons_0078ae_256x240.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/images/ui-icons_056b93_256x240.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/images/ui-icons_056b93_256x240.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/images/ui-icons_056b93_256x240.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/images/ui-icons_056b93_256x240.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/images/ui-icons_d8e7f3_256x240.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/images/ui-icons_d8e7f3_256x240.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/images/ui-icons_d8e7f3_256x240.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/images/ui-icons_d8e7f3_256x240.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/images/ui-icons_e0fdff_256x240.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/images/ui-icons_e0fdff_256x240.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/images/ui-icons_e0fdff_256x240.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/images/ui-icons_e0fdff_256x240.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/images/ui-icons_f5e175_256x240.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/images/ui-icons_f5e175_256x240.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/images/ui-icons_f5e175_256x240.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/images/ui-icons_f5e175_256x240.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/images/ui-icons_f7a50d_256x240.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/images/ui-icons_f7a50d_256x240.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/images/ui-icons_f7a50d_256x240.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/images/ui-icons_f7a50d_256x240.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/images/ui-icons_fcd113_256x240.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/images/ui-icons_fcd113_256x240.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/images/ui-icons_fcd113_256x240.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/images/ui-icons_fcd113_256x240.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/jquery-ui.css b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/jquery-ui.css similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/jquery-ui.css rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/jquery-ui.css diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/jquery.ui.all.css b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/jquery.ui.all.css similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/jquery.ui.all.css rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/jquery.ui.all.css diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/jquery.ui.base.css b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/jquery.ui.base.css similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/jquery.ui.base.css rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/jquery.ui.base.css diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/jquery.ui.core.css b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/jquery.ui.core.css similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/jquery.ui.core.css rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/jquery.ui.core.css diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/jquery.ui.tabs.css b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/jquery.ui.tabs.css similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/jquery.ui.tabs.css rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/jquery.ui.tabs.css diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/jquery.ui.theme.css b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/jquery.ui.theme.css similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/jquery.ui.theme.css rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/jquery.ui.theme.css diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/images/animated-overlay.gif b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/images/animated-overlay.gif similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/images/animated-overlay.gif rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/images/animated-overlay.gif diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/images/ui-bg_flat_55_999999_40x100.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/images/ui-bg_flat_55_999999_40x100.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/images/ui-bg_flat_55_999999_40x100.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/images/ui-bg_flat_55_999999_40x100.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/images/ui-bg_flat_75_aaaaaa_40x100.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/images/ui-bg_flat_75_aaaaaa_40x100.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/images/ui-bg_flat_75_aaaaaa_40x100.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/images/ui-bg_flat_75_aaaaaa_40x100.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/images/ui-bg_glass_45_0078ae_1x400.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/images/ui-bg_glass_45_0078ae_1x400.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/images/ui-bg_glass_45_0078ae_1x400.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/images/ui-bg_glass_45_0078ae_1x400.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/images/ui-bg_glass_55_f8da4e_1x400.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/images/ui-bg_glass_55_f8da4e_1x400.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/images/ui-bg_glass_55_f8da4e_1x400.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/images/ui-bg_glass_55_f8da4e_1x400.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/images/ui-bg_glass_75_79c9ec_1x400.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/images/ui-bg_glass_75_79c9ec_1x400.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/images/ui-bg_glass_75_79c9ec_1x400.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/images/ui-bg_glass_75_79c9ec_1x400.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/images/ui-bg_gloss-wave_45_e14f1c_500x100.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/images/ui-bg_gloss-wave_45_e14f1c_500x100.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/images/ui-bg_gloss-wave_45_e14f1c_500x100.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/images/ui-bg_gloss-wave_45_e14f1c_500x100.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/images/ui-bg_gloss-wave_50_6eac2c_500x100.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/images/ui-bg_gloss-wave_50_6eac2c_500x100.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/images/ui-bg_gloss-wave_50_6eac2c_500x100.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/images/ui-bg_gloss-wave_50_6eac2c_500x100.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/images/ui-bg_gloss-wave_75_2191c0_500x100.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/images/ui-bg_gloss-wave_75_2191c0_500x100.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/images/ui-bg_gloss-wave_75_2191c0_500x100.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/images/ui-bg_gloss-wave_75_2191c0_500x100.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/images/ui-bg_inset-hard_100_fcfdfd_1x100.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/images/ui-bg_inset-hard_100_fcfdfd_1x100.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/images/ui-bg_inset-hard_100_fcfdfd_1x100.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/images/ui-bg_inset-hard_100_fcfdfd_1x100.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/images/ui-icons_0078ae_256x240.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/images/ui-icons_0078ae_256x240.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/images/ui-icons_0078ae_256x240.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/images/ui-icons_0078ae_256x240.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/images/ui-icons_056b93_256x240.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/images/ui-icons_056b93_256x240.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/images/ui-icons_056b93_256x240.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/images/ui-icons_056b93_256x240.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/images/ui-icons_d8e7f3_256x240.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/images/ui-icons_d8e7f3_256x240.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/images/ui-icons_d8e7f3_256x240.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/images/ui-icons_d8e7f3_256x240.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/images/ui-icons_e0fdff_256x240.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/images/ui-icons_e0fdff_256x240.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/images/ui-icons_e0fdff_256x240.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/images/ui-icons_e0fdff_256x240.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/images/ui-icons_f5e175_256x240.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/images/ui-icons_f5e175_256x240.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/images/ui-icons_f5e175_256x240.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/images/ui-icons_f5e175_256x240.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/images/ui-icons_f7a50d_256x240.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/images/ui-icons_f7a50d_256x240.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/images/ui-icons_f7a50d_256x240.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/images/ui-icons_f7a50d_256x240.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/images/ui-icons_fcd113_256x240.png b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/images/ui-icons_fcd113_256x240.png similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/images/ui-icons_fcd113_256x240.png rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/images/ui-icons_fcd113_256x240.png diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/jquery-ui.min.css b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/jquery-ui.min.css similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/jquery-ui.min.css rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/jquery-ui.min.css diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/jquery.ui.core.min.css b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/jquery.ui.core.min.css similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/jquery.ui.core.min.css rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/jquery.ui.core.min.css diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/jquery.ui.tabs.min.css b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/jquery.ui.tabs.min.css similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/jquery.ui.tabs.min.css rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/jquery.ui.tabs.min.css diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/jquery.ui.theme.min.css b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/jquery.ui.theme.min.css similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/jquery.ui.theme.min.css rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/themes/start/minified/jquery.ui.theme.min.css diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/ui.core.jquery.json b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/ui.core.jquery.json similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/ui.core.jquery.json rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/ui.core.jquery.json diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/ui.mouse.jquery.json b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/ui.mouse.jquery.json similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/ui.mouse.jquery.json rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/ui.mouse.jquery.json diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/ui.position.jquery.json b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/ui.position.jquery.json similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/ui.position.jquery.json rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/ui.position.jquery.json diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/ui.tabs.jquery.json b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/ui.tabs.jquery.json similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/ui.tabs.jquery.json rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/ui.tabs.jquery.json diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/ui.widget.jquery.json b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/ui.widget.jquery.json similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/ui.widget.jquery.json rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/ui.widget.jquery.json diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/ui/jquery-ui.custom.js b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/ui/jquery-ui.custom.js similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/ui/jquery-ui.custom.js rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/ui/jquery-ui.custom.js diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/ui/jquery.ui.core.js b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/ui/jquery.ui.core.js similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/ui/jquery.ui.core.js rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/ui/jquery.ui.core.js diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/ui/jquery.ui.mouse.js b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/ui/jquery.ui.mouse.js similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/ui/jquery.ui.mouse.js rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/ui/jquery.ui.mouse.js diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/ui/jquery.ui.position.js b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/ui/jquery.ui.position.js similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/ui/jquery.ui.position.js rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/ui/jquery.ui.position.js diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/ui/jquery.ui.tabs.js b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/ui/jquery.ui.tabs.js similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/ui/jquery.ui.tabs.js rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/ui/jquery.ui.tabs.js diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/ui/jquery.ui.widget.js b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/ui/jquery.ui.widget.js similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/ui/jquery.ui.widget.js rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/ui/jquery.ui.widget.js diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/ui/minified/jquery-ui.custom.min.js b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/ui/minified/jquery-ui.custom.min.js similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/ui/minified/jquery-ui.custom.min.js rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/ui/minified/jquery-ui.custom.min.js diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/ui/minified/jquery.ui.core.min.js b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/ui/minified/jquery.ui.core.min.js similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/ui/minified/jquery.ui.core.min.js rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/ui/minified/jquery.ui.core.min.js diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/ui/minified/jquery.ui.mouse.min.js b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/ui/minified/jquery.ui.mouse.min.js similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/ui/minified/jquery.ui.mouse.min.js rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/ui/minified/jquery.ui.mouse.min.js diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/ui/minified/jquery.ui.position.min.js b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/ui/minified/jquery.ui.position.min.js similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/ui/minified/jquery.ui.position.min.js rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/ui/minified/jquery.ui.position.min.js diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/ui/minified/jquery.ui.tabs.min.js b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/ui/minified/jquery.ui.tabs.min.js similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/ui/minified/jquery.ui.tabs.min.js rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/ui/minified/jquery.ui.tabs.min.js diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/ui/minified/jquery.ui.widget.min.js b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/ui/minified/jquery.ui.widget.min.js similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/ui/minified/jquery.ui.widget.min.js rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/development-bundle/ui/minified/jquery.ui.widget.min.js diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/index.html b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/index.html similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/index.html rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/index.html diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/js/jquery-1.10.2.js b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/js/jquery-1.10.2.js similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/js/jquery-1.10.2.js rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/js/jquery-1.10.2.js diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/js/jquery-ui-1.10.4.custom.js b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/js/jquery-ui-1.10.4.custom.js similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/js/jquery-ui-1.10.4.custom.js rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/js/jquery-ui-1.10.4.custom.js diff --git a/gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/js/jquery-ui-1.10.4.custom.min.js b/gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/js/jquery-ui-1.10.4.custom.min.js similarity index 100% rename from gmn/src/gmn/app/static/jquery-ui-1.10.4.custom/js/jquery-ui-1.10.4.custom.min.js rename to gmn/src/d1_gmn/app/static/jquery-ui-1.10.4.custom/js/jquery-ui-1.10.4.custom.min.js diff --git a/gmn/src/gmn/app/static/robots.txt b/gmn/src/d1_gmn/app/static/robots.txt similarity index 100% rename from gmn/src/gmn/app/static/robots.txt rename to gmn/src/d1_gmn/app/static/robots.txt diff --git a/gmn/src/gmn/app/sysmeta.py b/gmn/src/d1_gmn/app/sysmeta.py similarity index 76% rename from gmn/src/gmn/app/sysmeta.py rename to gmn/src/d1_gmn/app/sysmeta.py index a5ef01259..416438ef3 100644 --- a/gmn/src/gmn/app/sysmeta.py +++ b/gmn/src/d1_gmn/app/sysmeta.py @@ -29,6 +29,13 @@ import pyxb +import d1_gmn.app +import d1_gmn.app.auth +import d1_gmn.app.local_replica +import d1_gmn.app.models +import d1_gmn.app.revision +import d1_gmn.app.util + import d1_common.date_time import d1_common.types import d1_common.types.dataoneTypes @@ -37,13 +44,6 @@ import d1_common.util import d1_common.xml -import gmn.app -import gmn.app.auth -import gmn.app.local_replica -import gmn.app.models -import gmn.app.revision -import gmn.app.util - def archive_object(pid): """Set the status of an object to archived. @@ -53,7 +53,7 @@ def archive_object(pid): - The object is not a replica. - The object is not archived. """ - sciobj_model = gmn.app.util.get_sci_model(pid) + sciobj_model = d1_gmn.app.util.get_sci_model(pid) sciobj_model.is_archived = True sciobj_model.save() _update_modified_timestamp(sciobj_model) @@ -81,18 +81,18 @@ def create_or_update(sysmeta_pyxb, url=None): Preconditions: - For Create, PID is verified not to exist. E.g., with - gmn.app.views.asserts.is_unused(pid). + d1_gmn.app.views.asserts.is_unused(pid). - Any supplied SID is verified to be valid for the given operation. E.g., with - gmn.app.views.asserts.is_valid_sid_for_chain(). + d1_gmn.app.views.asserts.is_valid_sid_for_chain(). """ - pid = gmn.app.util.uvalue(sysmeta_pyxb.identifier) + pid = d1_gmn.app.util.uvalue(sysmeta_pyxb.identifier) try: - sci_model = gmn.app.util.get_sci_model(pid) - except gmn.app.models.ScienceObject.DoesNotExist: - sci_model = gmn.app.models.ScienceObject() - sci_model.pid = gmn.app.models.did(pid) + sci_model = d1_gmn.app.util.get_sci_model(pid) + except d1_gmn.app.models.ScienceObject.DoesNotExist: + sci_model = d1_gmn.app.models.ScienceObject() + sci_model.pid = d1_gmn.app.models.did(pid) sci_model.url = url sci_model.serial_version = sysmeta_pyxb.serialVersion sci_model.uploaded_timestamp = sysmeta_pyxb.dateUploaded @@ -112,7 +112,7 @@ def create_or_update(sysmeta_pyxb, url=None): def is_did(did): - return gmn.app.models.IdNamespace.objects.filter(did=did).exists() + return d1_gmn.app.models.IdNamespace.objects.filter(did=did).exists() def is_pid(did): @@ -120,23 +120,23 @@ def is_pid(did): Includes unprocessed replicas and revision chain placeholders for remote objects. """ - return is_did(did) and not gmn.app.revision.is_sid(did) + return is_did(did) and not d1_gmn.app.revision.is_sid(did) def is_pid_of_existing_object(pid): """Excludes SIDs, unprocessed replicas and revision chain placeholders for remote objects. """ - return gmn.app.models.ScienceObject.objects.filter(pid__did=pid).exists() + return d1_gmn.app.models.ScienceObject.objects.filter(pid__did=pid).exists() def is_archived(pid): return is_pid_of_existing_object(pid) \ - and gmn.app.util.get_sci_model(pid).is_archived + and d1_gmn.app.util.get_sci_model(pid).is_archived def update_modified_timestamp(pid): - sci_model = gmn.app.util.get_sci_model(pid) + sci_model = d1_gmn.app.util.get_sci_model(pid) _update_modified_timestamp(sci_model) @@ -147,13 +147,13 @@ def model_to_pyxb(pid): def get_identifier_type(did): if not is_did(did): return u'unused on this Member Node' - elif gmn.app.revision.is_sid(did): + elif d1_gmn.app.revision.is_sid(did): return u'a Series ID (SID)' elif is_pid_of_existing_object(did): return u'a Persistent ID (PID) of an existing local object' - elif gmn.app.local_replica.is_local_replica(did): + elif d1_gmn.app.local_replica.is_local_replica(did): return u'a Persistent ID (PID) of a local replica' - elif gmn.app.local_replica.is_revision_chain_placeholder(did): + elif d1_gmn.app.local_replica.is_revision_chain_placeholder(did): return \ u'a Persistent ID (PID) that is reserved due to being referenced in ' \ u'the revision chain of a local replica' @@ -167,7 +167,7 @@ def get_identifier_type(did): def _model_to_pyxb(pid): - sciobj_model = gmn.app.util.get_sci_model(pid) + sciobj_model = d1_gmn.app.util.get_sci_model(pid) sysmeta_pyxb = _base_model_to_pyxb(sciobj_model) if _has_media_type_db(sciobj_model): sysmeta_pyxb.mediaType = _media_type_model_to_pyxb(sciobj_model) @@ -183,36 +183,36 @@ def _model_to_pyxb(pid): def _base_pyxb_to_model(sci_model, sysmeta_pyxb): sci_model.modified_timestamp = sysmeta_pyxb.dateSysMetadataModified - sci_model.format = gmn.app.models.format(sysmeta_pyxb.formatId) + sci_model.format = d1_gmn.app.models.format(sysmeta_pyxb.formatId) sci_model.filename = getattr(sysmeta_pyxb, 'fileName', None) - sci_model.checksum = gmn.app.util.uvalue(sysmeta_pyxb.checksum) - sci_model.checksum_algorithm = gmn.app.models.checksum_algorithm( + sci_model.checksum = d1_gmn.app.util.uvalue(sysmeta_pyxb.checksum) + sci_model.checksum_algorithm = d1_gmn.app.models.checksum_algorithm( sysmeta_pyxb.checksum.algorithm ) sci_model.size = sysmeta_pyxb.size if sysmeta_pyxb.submitter: - sci_model.submitter = gmn.app.models.subject( - gmn.app.util.uvalue(sysmeta_pyxb.submitter) + sci_model.submitter = d1_gmn.app.models.subject( + d1_gmn.app.util.uvalue(sysmeta_pyxb.submitter) ) - sci_model.rights_holder = gmn.app.models.subject( - gmn.app.util.uvalue(sysmeta_pyxb.rightsHolder) + sci_model.rights_holder = d1_gmn.app.models.subject( + d1_gmn.app.util.uvalue(sysmeta_pyxb.rightsHolder) ) - sci_model.origin_member_node = gmn.app.models.node( - gmn.app.util.uvalue(sysmeta_pyxb.originMemberNode) + sci_model.origin_member_node = d1_gmn.app.models.node( + d1_gmn.app.util.uvalue(sysmeta_pyxb.originMemberNode) ) - sci_model.authoritative_member_node = gmn.app.models.node( - gmn.app.util.uvalue(sysmeta_pyxb.authoritativeMemberNode) + sci_model.authoritative_member_node = d1_gmn.app.models.node( + d1_gmn.app.util.uvalue(sysmeta_pyxb.authoritativeMemberNode) ) - gmn.app.revision.set_revision_by_model( + d1_gmn.app.revision.set_revision_by_model( sci_model, - gmn.app.util.get_value(sysmeta_pyxb, 'obsoletes'), - gmn.app.util.get_value(sysmeta_pyxb, 'obsoletedBy'), + d1_gmn.app.util.get_value(sysmeta_pyxb, 'obsoletes'), + d1_gmn.app.util.get_value(sysmeta_pyxb, 'obsoletedBy'), ) sci_model.is_archived = sysmeta_pyxb.archived or False - # series_id = gmn.app.util.get_value(sysmeta_pyxb, 'seriesId') + # series_id = d1_gmn.app.util.get_value(sysmeta_pyxb, 'seriesId') # if series_id: - # gmn.app.sysmeta_revision.update_or_create_sid_to_pid_map( - # series_id, gmn.app.util.uvalue(sysmeta_pyxb.identifier) + # d1_gmn.app.sysmeta_revision.update_or_create_sid_to_pid_map( + # series_id, d1_gmn.app.util.uvalue(sysmeta_pyxb.identifier) # ) @@ -243,7 +243,7 @@ def sub_sciobj(sub_sciobj_model): base_pyxb.obsoletes = sub_sciobj(sciobj_model.obsoletes) base_pyxb.obsoletedBy = sub_sciobj(sciobj_model.obsoleted_by) base_pyxb.archived = sciobj_model.is_archived - base_pyxb.seriesId = gmn.app.revision.get_sid_by_pid(sciobj_model.pid.did) + base_pyxb.seriesId = d1_gmn.app.revision.get_sid_by_pid(sciobj_model.pid.did) return base_pyxb @@ -280,13 +280,13 @@ def _media_type_pyxb_to_model(sci_model, sysmeta_pyxb): def _delete_existing_media_type(sysmeta_pyxb): - gmn.app.models.MediaType.objects.filter( - sciobj__pid__did=gmn.app.util.uvalue(sysmeta_pyxb.identifier) + d1_gmn.app.models.MediaType.objects.filter( + sciobj__pid__did=d1_gmn.app.util.uvalue(sysmeta_pyxb.identifier) ).delete() def _insert_media_type_name_row(sci_model, media_type_pyxb): - media_type_model = gmn.app.models.MediaType( + media_type_model = d1_gmn.app.models.MediaType( sciobj=sci_model, name=media_type_pyxb.name ) media_type_model.save() @@ -295,22 +295,24 @@ def _insert_media_type_name_row(sci_model, media_type_pyxb): def _insert_media_type_property_rows(media_type_model, media_type_pyxb): for p in media_type_pyxb.property_: - media_type_property_model = gmn.app.models.MediaTypeProperty( - media_type=media_type_model, name=p.name, value=gmn.app.util.uvalue(p) + media_type_property_model = d1_gmn.app.models.MediaTypeProperty( + media_type=media_type_model, name=p.name, value=d1_gmn.app.util.uvalue(p) ) media_type_property_model.save() def _has_media_type_db(sciobj_model): - return gmn.app.models.MediaType.objects.filter(sciobj=sciobj_model).exists() + return d1_gmn.app.models.MediaType.objects.filter(sciobj=sciobj_model).exists() def _media_type_model_to_pyxb(sciobj_model): - media_type_model = gmn.app.models.MediaType.objects.get(sciobj=sciobj_model) + media_type_model = d1_gmn.app.models.MediaType.objects.get( + sciobj=sciobj_model + ) media_type_pyxb = d1_common.types.dataoneTypes.MediaType() media_type_pyxb.name = media_type_model.name - for media_type_property_model in gmn.app.models.MediaTypeProperty.objects.filter( + for media_type_property_model in d1_gmn.app.models.MediaTypeProperty.objects.filter( media_type=media_type_model ): media_type_property_pyxb = d1_common.types.dataoneTypes.MediaTypeProperty( @@ -354,11 +356,11 @@ def _access_policy_pyxb_to_model(sci_model, sysmeta_pyxb): # Add an implicit allow rule with all permissions for the rights holder. allow_rights_holder = d1_common.types.dataoneTypes.AccessRule() permission = d1_common.types.dataoneTypes.Permission( - gmn.app.auth.CHANGEPERMISSION_STR + d1_gmn.app.auth.CHANGEPERMISSION_STR ) allow_rights_holder.permission.append(permission) allow_rights_holder.subject.append( - gmn.app.util.uvalue(sysmeta_pyxb.rightsHolder) + d1_gmn.app.util.uvalue(sysmeta_pyxb.rightsHolder) ) top_level = _get_highest_level_action_for_rule(allow_rights_holder) _insert_permission_rows(sci_model, allow_rights_holder, top_level) @@ -370,7 +372,8 @@ def _access_policy_pyxb_to_model(sci_model, sysmeta_pyxb): def _has_access_policy_db(sciobj_model): - return gmn.app.models.Permission.objects.filter(sciobj=sciobj_model).exists() + return d1_gmn.app.models.Permission.objects.filter(sciobj=sciobj_model + ).exists() def _has_access_policy_pyxb(sysmeta_pyxb): @@ -380,15 +383,15 @@ def _has_access_policy_pyxb(sysmeta_pyxb): def _delete_existing_access_policy(sysmeta_pyxb): - gmn.app.models.Permission.objects.filter( - sciobj__pid__did=gmn.app.util.uvalue(sysmeta_pyxb.identifier) + d1_gmn.app.models.Permission.objects.filter( + sciobj__pid__did=d1_gmn.app.util.uvalue(sysmeta_pyxb.identifier) ).delete() def _get_highest_level_action_for_rule(allow_rule): top_level = 0 for permission in allow_rule.permission: - level = gmn.app.auth.action_to_level(permission) + level = d1_gmn.app.auth.action_to_level(permission) if level > top_level: top_level = level return top_level @@ -396,8 +399,9 @@ def _get_highest_level_action_for_rule(allow_rule): def _insert_permission_rows(sci_model, allow_rule, top_level): for s in allow_rule.subject: - permission_model = gmn.app.models.Permission( - sciobj=sci_model, subject=gmn.app.models.subject(gmn.app.util.uvalue(s)), + permission_model = d1_gmn.app.models.Permission( + sciobj=sci_model, + subject=d1_gmn.app.models.subject(d1_gmn.app.util.uvalue(s)), level=top_level ) permission_model.save() @@ -405,7 +409,7 @@ def _insert_permission_rows(sci_model, allow_rule, top_level): def _access_policy_model_to_pyxb(sciobj_model): access_policy_pyxb = d1_common.types.dataoneTypes.AccessPolicy() - for permission_model in gmn.app.models.Permission.objects.filter( + for permission_model in d1_gmn.app.models.Permission.objects.filter( sciobj=sciobj_model ): # Skip implicit permissions for rightsHolder. @@ -413,7 +417,7 @@ def _access_policy_model_to_pyxb(sciobj_model): continue access_rule_pyxb = d1_common.types.dataoneTypes.AccessRule() permission_pyxb = d1_common.types.dataoneTypes.Permission( - gmn.app.auth.level_to_action(permission_model.level) + d1_gmn.app.auth.level_to_action(permission_model.level) ) access_rule_pyxb.permission.append(permission_pyxb) access_rule_pyxb.subject.append(permission_model.subject.subject) @@ -437,7 +441,7 @@ def _access_policy_model_to_pyxb(sciobj_model): def _replication_policy_pyxb_to_model(sciobj_model, sysmeta_pyxb): _delete_existing_replication_policy(sciobj_model) - replication_policy_model = gmn.app.models.ReplicationPolicy() + replication_policy_model = d1_gmn.app.models.ReplicationPolicy() replication_policy_model.sciobj = sciobj_model replication_policy_model.replication_is_allowed = ( sysmeta_pyxb.replicationPolicy.replicationAllowed @@ -449,10 +453,12 @@ def _replication_policy_pyxb_to_model(sciobj_model, sysmeta_pyxb): def add(node_ref_pyxb, rep_node_model): for rep_node_urn in node_ref_pyxb: - # node_urn_model = gmn.app.models.Node.objects.get_or_create( + # node_urn_model = d1_gmn.app.models.Node.objects.get_or_create( # urn=rep_node_urn.value() # )[0] - node_urn_model = gmn.app.models.node(gmn.app.util.uvalue(rep_node_urn)) + node_urn_model = d1_gmn.app.models.node( + d1_gmn.app.util.uvalue(rep_node_urn) + ) rep_node_obj = rep_node_model() rep_node_obj.node = node_urn_model rep_node_obj.replication_policy = replication_policy_model @@ -460,23 +466,25 @@ def add(node_ref_pyxb, rep_node_model): add( sysmeta_pyxb.replicationPolicy.preferredMemberNode, - gmn.app.models.PreferredMemberNode + d1_gmn.app.models.PreferredMemberNode ) add( sysmeta_pyxb.replicationPolicy.blockedMemberNode, - gmn.app.models.BlockedMemberNode + d1_gmn.app.models.BlockedMemberNode ) return replication_policy_model def _has_replication_policy_db(sciobj_model): - return gmn.app.models.ReplicationPolicy.objects.filter(sciobj=sciobj_model - ).exists() + return d1_gmn.app.models.ReplicationPolicy.objects.filter( + sciobj=sciobj_model + ).exists() def _delete_existing_replication_policy(sciobj_model): - gmn.app.models.ReplicationPolicy.objects.filter(sciobj=sciobj_model).delete() + d1_gmn.app.models.ReplicationPolicy.objects.filter(sciobj=sciobj_model + ).delete() def _has_replication_policy_pyxb(sysmeta_pyxb): @@ -486,7 +494,7 @@ def _has_replication_policy_pyxb(sysmeta_pyxb): def _replication_policy_model_to_pyxb(sciobj_model): - replication_policy_model = gmn.app.models.ReplicationPolicy.objects.get( + replication_policy_model = d1_gmn.app.models.ReplicationPolicy.objects.get( sciobj=sciobj_model ) replication_policy_pyxb = d1_common.types.dataoneTypes.ReplicationPolicy() @@ -501,10 +509,11 @@ def add(rep_pyxb, rep_node_model): add( replication_policy_pyxb.preferredMemberNode, - gmn.app.models.PreferredMemberNode + d1_gmn.app.models.PreferredMemberNode ) add( - replication_policy_pyxb.blockedMemberNode, gmn.app.models.BlockedMemberNode + replication_policy_pyxb.blockedMemberNode, + d1_gmn.app.models.BlockedMemberNode ) return replication_policy_pyxb @@ -527,12 +536,12 @@ def replica_pyxb_to_model(sciobj_model, sysmeta_pyxb): def _register_remote_replica(sciobj_model, replica_pyxb): - replica_info_model = gmn.app.models.replica_info( + replica_info_model = d1_gmn.app.models.replica_info( status_str=replica_pyxb.replicationStatus, - source_node_urn=gmn.app.util.uvalue(replica_pyxb.replicaMemberNode), + source_node_urn=d1_gmn.app.util.uvalue(replica_pyxb.replicaMemberNode), timestamp=replica_pyxb.replicaVerified, ) - gmn.app.models.remote_replica( + d1_gmn.app.models.remote_replica( sciobj_model=sciobj_model, replica_info_model=replica_info_model, ) @@ -540,7 +549,7 @@ def _register_remote_replica(sciobj_model, replica_pyxb): def replica_model_to_pyxb(sciobj_model): replica_pyxb_list = [] - for replica_model in gmn.app.models.RemoteReplica.objects.filter( + for replica_model in d1_gmn.app.models.RemoteReplica.objects.filter( sciobj=sciobj_model ): replica_pyxb = d1_common.types.dataoneTypes.Replica() diff --git a/gmn/src/gmn/app/templates/404.html b/gmn/src/d1_gmn/app/templates/404.html similarity index 100% rename from gmn/src/gmn/app/templates/404.html rename to gmn/src/d1_gmn/app/templates/404.html diff --git a/gmn/src/gmn/app/templates/500.html b/gmn/src/d1_gmn/app/templates/500.html similarity index 100% rename from gmn/src/gmn/app/templates/500.html rename to gmn/src/d1_gmn/app/templates/500.html diff --git a/gmn/src/gmn/app/templates/diag.html b/gmn/src/d1_gmn/app/templates/diag.html similarity index 100% rename from gmn/src/gmn/app/templates/diag.html rename to gmn/src/d1_gmn/app/templates/diag.html diff --git a/gmn/src/gmn/app/templates/echo_session.xhtml b/gmn/src/d1_gmn/app/templates/echo_session.xhtml similarity index 100% rename from gmn/src/gmn/app/templates/echo_session.xhtml rename to gmn/src/d1_gmn/app/templates/echo_session.xhtml diff --git a/gmn/src/gmn/app/templates/home.html b/gmn/src/d1_gmn/app/templates/home.html similarity index 100% rename from gmn/src/gmn/app/templates/home.html rename to gmn/src/d1_gmn/app/templates/home.html diff --git a/gmn/src/gmn/app/templates/object_permissions.xhtml b/gmn/src/d1_gmn/app/templates/object_permissions.xhtml similarity index 100% rename from gmn/src/gmn/app/templates/object_permissions.xhtml rename to gmn/src/d1_gmn/app/templates/object_permissions.xhtml diff --git a/gmn/src/gmn/app/templates/replicate_get_queue.xml b/gmn/src/d1_gmn/app/templates/replicate_get_queue.xml similarity index 100% rename from gmn/src/gmn/app/templates/replicate_get_queue.xml rename to gmn/src/d1_gmn/app/templates/replicate_get_queue.xml diff --git a/gmn/src/gmn/app/templates/test_slash.html b/gmn/src/d1_gmn/app/templates/test_slash.html similarity index 100% rename from gmn/src/gmn/app/templates/test_slash.html rename to gmn/src/d1_gmn/app/templates/test_slash.html diff --git a/gmn/src/gmn/app/templates/trusted_subjects.xhtml b/gmn/src/d1_gmn/app/templates/trusted_subjects.xhtml similarity index 100% rename from gmn/src/gmn/app/templates/trusted_subjects.xhtml rename to gmn/src/d1_gmn/app/templates/trusted_subjects.xhtml diff --git a/gmn/src/gmn/app/urls.py b/gmn/src/d1_gmn/app/urls.py similarity index 74% rename from gmn/src/gmn/app/urls.py rename to gmn/src/d1_gmn/app/urls.py index 2947ec6e3..267dc16ec 100644 --- a/gmn/src/gmn/app/urls.py +++ b/gmn/src/d1_gmn/app/urls.py @@ -22,10 +22,11 @@ from __future__ import absolute_import +import d1_gmn.app.views.diagnostics +import d1_gmn.app.views.external +import d1_gmn.app.views.internal + import django.conf -import gmn.app.views.diagnostics -import gmn.app.views.external -import gmn.app.views.internal # Django from django.conf.urls import url @@ -39,43 +40,43 @@ # MNCore.ping() - GET /monitor/ping url( r'^v[12]/monitor/ping/?$', - gmn.app.views.external.get_monitor_ping, + d1_gmn.app.views.external.get_monitor_ping, name='get_monitor_ping', ), # MNCore.getLogRecords() - GET /log url( r'^v[12]/log/?$', - gmn.app.views.external.get_log, + d1_gmn.app.views.external.get_log, name='get_log', ), # MNCore.getCapabilities() - GET / and GET /node url( r'^v[12]/?$', - gmn.app.views.external.get_node, + d1_gmn.app.views.external.get_node, name='get_node', ), url( r'^v[12]/node/?$', - gmn.app.views.external.get_node, + d1_gmn.app.views.external.get_node, ), # Tier 1: Read API (MNRead) # MNRead.get() - GET /object/{did} url( r'^v[12]/object/(.+)$', - gmn.app.views.external.dispatch_object, + d1_gmn.app.views.external.dispatch_object, name='dispatch_object', ), # MNRead.getSystemMetadata() - GET /meta/{did} url( r'^v[12]/meta/(.+)$', - gmn.app.views.external.get_meta, + d1_gmn.app.views.external.get_meta, name='get_meta', ), # MNStorage.updateSystemMetadata() - PUT /meta url( r'^v2/meta$', - gmn.app.views.external.put_meta, + d1_gmn.app.views.external.put_meta, name='put_meta', ), # MNRead.describe() - HEAD /object/{did} @@ -83,25 +84,25 @@ # MNRead.getChecksum() - GET /checksum/{did} url( r'^v[12]/checksum/(.+)$', - gmn.app.views.external.get_checksum, + d1_gmn.app.views.external.get_checksum, name='get_checksum', ), # MNRead.listObjects() - GET /object url( r'^v[12]/object/?$', - gmn.app.views.external.dispatch_object_list, + d1_gmn.app.views.external.dispatch_object_list, name='dispatch_object_list', ), # MNRead.synchronizationFailed() - POST /error url( r'^v[12]/error/?$', - gmn.app.views.external.post_error, + d1_gmn.app.views.external.post_error, name='post_error', ), # MNRead.getReplica() - GET /replica/{did} url( r'^v[12]/replica/(.+)/?$', - gmn.app.views.external.get_replica, + d1_gmn.app.views.external.get_replica, name='get_replica', ), @@ -109,13 +110,13 @@ # MNAuthorization.isAuthorized() - GET /isAuthorized/{did} url( r'^v[12]/isAuthorized/(.+)/?$', - gmn.app.views.external.get_is_authorized, + d1_gmn.app.views.external.get_is_authorized, name='get_is_authorized', ), # MNStorage.systemMetadataChanged() - POST /refreshSystemMetadata/{did} url( r'^v[12]/dirtySystemMetadata/?$', - gmn.app.views.external.post_refresh_system_metadata, + d1_gmn.app.views.external.post_refresh_system_metadata, name='post_refresh_system_metadata', ), @@ -127,7 +128,7 @@ # MNStorage.generateIdentifier() url( r'^v[12]/generate/?$', - gmn.app.views.external.post_generate_identifier, + d1_gmn.app.views.external.post_generate_identifier, name='post_generate_identifier', ), # MNStorage.delete() - DELETE /object/{did} @@ -135,19 +136,21 @@ # MNStorage.archive() - PUT /archive/{did} url( r'^v[12]/archive/(.+)/?$', - gmn.app.views.external.put_archive, + d1_gmn.app.views.external.put_archive, name='put_archive', ), # Tier 4: Replication API (MNReplication) # MNReplication.replicate() - POST /replicate url( r'^v[12]/replicate/?$', - gmn.app.views.external.post_replicate, + d1_gmn.app.views.external.post_replicate, name='post_replicate', ), ] -urlpatterns.extend([url(r'^home/?$', gmn.app.views.internal.home, name='home')]) +urlpatterns.extend( + [url(r'^home/?$', d1_gmn.app.views.internal.home, name='home')] +) # Diagnostic APIs that can be made available in production. @@ -156,24 +159,24 @@ # Replication. url( r'^diag/get_replication_queue/?$', - gmn.app.views.diagnostics.get_replication_queue, + d1_gmn.app.views.diagnostics.get_replication_queue, name='get_replication_queue', ), # Authentication. url( r'^diag/echo_session/?$', - gmn.app.views.diagnostics.echo_session, + d1_gmn.app.views.diagnostics.echo_session, name='echo_session', ), # Misc. url( r'^diag/echo_request_object/?$', - gmn.app.views.diagnostics.echo_request_object, + d1_gmn.app.views.diagnostics.echo_request_object, name='echo_request_object', ), url( r'^diag/echo_raw_post_data/?$', - gmn.app.views.diagnostics.echo_raw_post_data, + d1_gmn.app.views.diagnostics.echo_raw_post_data, name='echo_raw_post_data', ), ]) @@ -185,69 +188,69 @@ # Diagnostics portal url( r'^diag$', - gmn.app.views.diagnostics.diagnostics, + d1_gmn.app.views.diagnostics.diagnostics, name='diag', ), # Replication. url( r'^diag/get_replication_queue$', - gmn.app.views.diagnostics.get_replication_queue, + d1_gmn.app.views.diagnostics.get_replication_queue, name='get_replication_queue', ), url( r'^diag/clear_replication_queue$', - gmn.app.views.diagnostics.clear_replication_queue, + d1_gmn.app.views.diagnostics.clear_replication_queue, name='clear_replication_queue', ), # Misc. url( r'^diag/create/(.+)$', - gmn.app.views.diagnostics.create, + d1_gmn.app.views.diagnostics.create, name='create', ), url( r'^diag/slash/(.+?)/(.+?)/(.+?)$', - gmn.app.views.diagnostics.slash, + d1_gmn.app.views.diagnostics.slash, name='slash', ), url( - r'^diag/exception/(.+?)$', gmn.app.views.diagnostics.exception, + r'^diag/exception/(.+?)$', d1_gmn.app.views.diagnostics.exception, name='exception' ), url( r'^diag/delete_all_objects$', - gmn.app.views.diagnostics.delete_all_objects_view, + d1_gmn.app.views.diagnostics.delete_all_objects_view, name='delete_all_objects_view', ), url( r'^diag/trusted_subjects$', - gmn.app.views.diagnostics.trusted_subjects, + d1_gmn.app.views.diagnostics.trusted_subjects, name='trusted_subjects', ), url( r'^diag/whitelist_subject$', - gmn.app.views.diagnostics.whitelist_subject, + d1_gmn.app.views.diagnostics.whitelist_subject, name='whitelist_subject', ), url( r'^diag/object_permissions/(.+?)$', - gmn.app.views.diagnostics.object_permissions, + d1_gmn.app.views.diagnostics.object_permissions, name='object_permissions', ), url( r'^diag/get_setting/(.+)$', - gmn.app.views.diagnostics.get_setting, + d1_gmn.app.views.diagnostics.get_setting, name='get_setting', ), # Event Log. url( r'^diag/delete_event_log$', - gmn.app.views.diagnostics.delete_event_log, + d1_gmn.app.views.diagnostics.delete_event_log, name='delete_event_log', ), url( r'^diag/inject_fictional_event_log$', - gmn.app.views.diagnostics.inject_fictional_event_log, + d1_gmn.app.views.diagnostics.inject_fictional_event_log, name='inject_fictional_event_log', ), ]) diff --git a/gmn/src/gmn/app/util.py b/gmn/src/d1_gmn/app/util.py similarity index 97% rename from gmn/src/gmn/app/util.py rename to gmn/src/d1_gmn/app/util.py index c5e01ff21..9f74f7fe7 100644 --- a/gmn/src/gmn/app/util.py +++ b/gmn/src/d1_gmn/app/util.py @@ -30,7 +30,7 @@ import traceback import urlparse -import gmn.app +import d1_gmn.app import django.conf @@ -168,7 +168,7 @@ def is_proxy_url(url): def get_sci_model(pid): - return gmn.app.models.ScienceObject.objects.get(pid__did=pid) + return d1_gmn.app.models.ScienceObject.objects.get(pid__did=pid) def get_value(sysmeta_pyxb, sysmeta_attr): @@ -197,7 +197,7 @@ def delete_unused_subjects(): as any unused subjects will automatically be reused if needed in the future. """ # This causes Django to create a single join (check with query.query) - query = gmn.app.models.Subject.objects.all() + query = d1_gmn.app.models.Subject.objects.all() query = query.filter(scienceobject_submitter__isnull=True) query = query.filter(scienceobject_rights_holder__isnull=True) query = query.filter(eventlog__isnull=True) diff --git a/gmn/src/gmn/app/views/__init__.py b/gmn/src/d1_gmn/app/views/__init__.py similarity index 100% rename from gmn/src/gmn/app/views/__init__.py rename to gmn/src/d1_gmn/app/views/__init__.py diff --git a/gmn/src/gmn/app/views/asserts.py b/gmn/src/d1_gmn/app/views/asserts.py similarity index 87% rename from gmn/src/gmn/app/views/asserts.py rename to gmn/src/d1_gmn/app/views/asserts.py index 24933e006..b6dfb2b03 100644 --- a/gmn/src/gmn/app/views/asserts.py +++ b/gmn/src/d1_gmn/app/views/asserts.py @@ -30,21 +30,21 @@ import requests +import d1_gmn.app.db_filter +import d1_gmn.app.event_log +import d1_gmn.app.local_replica +import d1_gmn.app.models +import d1_gmn.app.psycopg_adapter +import d1_gmn.app.revision +import d1_gmn.app.sysmeta +import d1_gmn.app.util + import d1_common.checksum import d1_common.const import d1_common.date_time import d1_common.types import d1_common.types.exceptions -import gmn.app.db_filter -import gmn.app.event_log -import gmn.app.local_replica -import gmn.app.models -import gmn.app.psycopg_adapter -import gmn.app.revision -import gmn.app.sysmeta -import gmn.app.util - import django.conf # ------------------------------------------------------------------------------ @@ -61,10 +61,10 @@ def is_unused(did): - Must not have been accepted for replication. - Must not be referenced as obsoletes or obsoleted_by in any object """ - if gmn.app.sysmeta.is_did(did): + if d1_gmn.app.sysmeta.is_did(did): raise d1_common.types.exceptions.IdentifierNotUnique( 0, u'Identifier is already in use as {}. id="{}"' - .format(gmn.app.sysmeta.get_identifier_type(did), did), identifier=did + .format(d1_gmn.app.sysmeta.get_identifier_type(did), did), identifier=did ) @@ -72,7 +72,7 @@ def is_valid_for_update(pid): """Assert that the System Metadata for the object with the given {pid} can be updated. """ - gmn.app.sysmeta.is_pid_of_existing_object(pid) + d1_gmn.app.sysmeta.is_pid_of_existing_object(pid) is_not_replica(pid) is_not_archived(pid) @@ -86,7 +86,7 @@ def is_valid_sid_for_chain(pid, sid): """ if not sid: return - existing_sid = gmn.app.revision.get_sid_by_pid(pid) + existing_sid = d1_gmn.app.revision.get_sid_by_pid(pid) if existing_sid is None: is_unused(sid) else: @@ -109,8 +109,8 @@ def does_not_contain_replica_sections(sysmeta_pyxb): raise d1_common.types.exceptions.InvalidSystemMetadata( 0, u'A replica section was included. A new object object created via ' u'create() or update() cannot already have replicas. pid="{}"'. - format(gmn.app.util.uvalue(sysmeta_pyxb.identifier)), - identifier=gmn.app.util.uvalue(sysmeta_pyxb.identifier) + format(d1_gmn.app.util.uvalue(sysmeta_pyxb.identifier)), + identifier=d1_gmn.app.util.uvalue(sysmeta_pyxb.identifier) ) @@ -122,38 +122,39 @@ def sysmeta_is_not_archived(sysmeta_pyxb): 0, u'Archived flag was set. A new object created via create() or update() ' u'cannot already be archived. pid="{}"'.format( - gmn.app.util.uvalue(sysmeta_pyxb.identifier) - ), identifier=gmn.app.util.uvalue(sysmeta_pyxb.identifier) + d1_gmn.app.util.uvalue(sysmeta_pyxb.identifier) + ), identifier=d1_gmn.app.util.uvalue(sysmeta_pyxb.identifier) ) def is_did(did): - if gmn.app.sysmeta.is_did(did): + if d1_gmn.app.sysmeta.is_did(did): raise d1_common.types.exceptions.NotFound( 0, u'Unknown identifier. id="{}"'.format(did), identifier=did ) def is_pid_of_existing_object(did): - if not gmn.app.sysmeta.is_pid_of_existing_object(did): + if not d1_gmn.app.sysmeta.is_pid_of_existing_object(did): raise d1_common.types.exceptions.NotFound( 0, u'Identifier is {}. Expected a Persistent ID (PID) for an existing ' - u'object. id="{}"'.format(gmn.app.sysmeta.get_identifier_type(did), did), - identifier=did + u'object. id="{}"'.format( + d1_gmn.app.sysmeta.get_identifier_type(did), did + ), identifier=did ) def is_sid(did): - if not gmn.app.revision.is_sid(did): + if not d1_gmn.app.revision.is_sid(did): raise d1_common.types.exceptions.InvalidRequest( 0, u'Identifier is {}. Expected a Series ID (SID). id="{}"'.format( - gmn.app.sysmeta.get_identifier_type(did), did + d1_gmn.app.sysmeta.get_identifier_type(did), did ), identifier=did ) def is_not_replica(pid): - if gmn.app.local_replica.is_local_replica(pid): + if d1_gmn.app.local_replica.is_local_replica(pid): raise d1_common.types.exceptions.InvalidRequest( 0, u'Object is a replica and cannot be updated on this Member Node. ' u'The operation must be performed on the authoritative Member Node. ' @@ -162,7 +163,7 @@ def is_not_replica(pid): def is_not_archived(pid): - if gmn.app.sysmeta.is_archived(pid): + if d1_gmn.app.sysmeta.is_archived(pid): raise d1_common.types.exceptions.InvalidRequest( 0, u'The object has been archived and cannot be updated. ' u'pid="{}"'.format(pid), identifier=pid @@ -170,8 +171,8 @@ def is_not_archived(pid): def has_matching_modified_timestamp(new_sysmeta_pyxb): - pid = gmn.app.util.uvalue(new_sysmeta_pyxb.identifier) - old_sysmeta_model = gmn.app.util.get_sci_model(pid) + pid = d1_gmn.app.util.uvalue(new_sysmeta_pyxb.identifier) + old_sysmeta_model = d1_gmn.app.util.get_sci_model(pid) old_ts = old_sysmeta_model.modified_timestamp new_ts = new_sysmeta_pyxb.dateSysMetadataModified if old_ts != new_ts: @@ -184,7 +185,7 @@ def has_matching_modified_timestamp(new_sysmeta_pyxb): def is_bool_param(param_name, bool_val): - if not gmn.app.views.util.is_bool_param(bool_val): + if not d1_gmn.app.views.util.is_bool_param(bool_val): raise d1_common.types.exceptions.InvalidRequest( 0, u'Invalid boolean value for parameter. parameter="{}" value="{}"'.format( @@ -214,12 +215,12 @@ def obsoletes_not_specified(sysmeta_pyxb): def obsoletes_matches_pid_if_specified(sysmeta_pyxb, old_pid): if sysmeta_pyxb.obsoletes is not None: - if gmn.app.util.uvalue(sysmeta_pyxb.obsoletes) != old_pid: + if d1_gmn.app.util.uvalue(sysmeta_pyxb.obsoletes) != old_pid: raise d1_common.types.exceptions.InvalidSystemMetadata( 0, u'Persistent ID (PID) specified in System Metadata "obsoletes" ' u'field does not match PID specified in URL. ' u'sysmeta_pyxb="{}", url="{}"'.format( - gmn.app.util.uvalue(sysmeta_pyxb.obsoletes), old_pid + d1_gmn.app.util.uvalue(sysmeta_pyxb.obsoletes), old_pid ) ) @@ -230,7 +231,7 @@ def revision_references_existing_objects_if_specified(sysmeta_pyxb): def is_in_revision_chain(pid): - if not gmn.app.revision.is_in_revision_chain(pid): + if not d1_gmn.app.revision.is_in_revision_chain(pid): raise d1_common.types.exceptions.InvalidRequest( 0, u'Object is not in a revision chain. pid="{}"'.format(pid), identifier=pid @@ -238,10 +239,10 @@ def is_in_revision_chain(pid): def _check_pid_exists_if_specified(sysmeta_pyxb, sysmeta_attr): - pid = gmn.app.util.get_value(sysmeta_pyxb, sysmeta_attr) + pid = d1_gmn.app.util.get_value(sysmeta_pyxb, sysmeta_attr) if pid is None: return - if not gmn.app.models.ScienceObject.objects.filter(pid__did=pid).exists(): + if not d1_gmn.app.models.ScienceObject.objects.filter(pid__did=pid).exists(): raise d1_common.types.exceptions.InvalidSystemMetadata( 0, u'System Metadata field references non-existing object. ' u'field="{}", pid="{}"'.format(sysmeta_attr, pid) @@ -249,7 +250,7 @@ def _check_pid_exists_if_specified(sysmeta_pyxb, sysmeta_attr): def is_not_obsoleted(pid): - if gmn.app.revision.is_obsoleted(pid): + if d1_gmn.app.revision.is_obsoleted(pid): raise d1_common.types.exceptions.InvalidRequest( 0, u'Object has already been obsoleted. pid="{}"'.format(pid), identifier=pid @@ -348,7 +349,7 @@ def url_is_retrievable(url): def url_pid_matches_sysmeta(sysmeta_pyxb, pid): - sysmeta_pid = gmn.app.util.uvalue(sysmeta_pyxb.identifier) + sysmeta_pid = d1_gmn.app.util.uvalue(sysmeta_pyxb.identifier) if sysmeta_pid != pid: raise d1_common.types.exceptions.InvalidSystemMetadata( 0, diff --git a/gmn/src/gmn/app/views/create.py b/gmn/src/d1_gmn/app/views/create.py similarity index 79% rename from gmn/src/gmn/app/views/create.py rename to gmn/src/d1_gmn/app/views/create.py index a9660ebda..65409e74c 100644 --- a/gmn/src/gmn/app/views/create.py +++ b/gmn/src/d1_gmn/app/views/create.py @@ -21,12 +21,12 @@ """ from __future__ import absolute_import -import d1_common.url +import d1_gmn.app.event_log +import d1_gmn.app.sysmeta +import d1_gmn.app.util +import d1_gmn.app.views.asserts -import gmn.app.event_log -import gmn.app.sysmeta -import gmn.app.util -import gmn.app.views.asserts +import d1_common.url import django.core.files.move @@ -36,7 +36,7 @@ def create(request, sysmeta_pyxb): Preconditions: - PID is verified not to be unused, E.g., with - gmn.app.views.asserts.is_unused(). + d1_gmn.app.views.asserts.is_unused(). Postconditions: - Files and database rows are added as necessary to add a new object. @@ -44,17 +44,17 @@ def create(request, sysmeta_pyxb): # Proxy object vendor specific extension. if 'HTTP_VENDOR_GMN_REMOTE_URL' in request.META: url = request.META['HTTP_VENDOR_GMN_REMOTE_URL'] - gmn.app.views.asserts.url_is_http_or_https(url) - gmn.app.views.asserts.url_is_retrievable(url) + d1_gmn.app.views.asserts.url_is_http_or_https(url) + d1_gmn.app.views.asserts.url_is_retrievable(url) else: # http://en.wikipedia.org/wiki/File_URI_scheme - pid = gmn.app.util.uvalue(sysmeta_pyxb.identifier) + pid = d1_gmn.app.util.uvalue(sysmeta_pyxb.identifier) url = u'file:///{}'.format(d1_common.url.encodePathElement(pid)) _object_pid_post_store_local(request, pid) - gmn.app.sysmeta.create_or_update(sysmeta_pyxb, url) + d1_gmn.app.sysmeta.create_or_update(sysmeta_pyxb, url) # Log the create event for this object. - gmn.app.event_log.create( - gmn.app.util.uvalue(sysmeta_pyxb.identifier), request + d1_gmn.app.event_log.create( + d1_gmn.app.util.uvalue(sysmeta_pyxb.identifier), request ) @@ -66,8 +66,8 @@ def _object_pid_post_store_local(request, pid): temporary to the final location. Django automatically handles this when using the file related fields in the models. """ - sciobj_path = gmn.app.util.sciobj_file_path(pid) - gmn.app.util.create_missing_directories(sciobj_path) + sciobj_path = d1_gmn.app.util.sciobj_file_path(pid) + d1_gmn.app.util.create_missing_directories(sciobj_path) try: django.core.files.move.file_move_safe( request.FILES['object'].temporary_file_path(), sciobj_path diff --git a/gmn/src/gmn/app/views/decorators.py b/gmn/src/d1_gmn/app/views/decorators.py similarity index 85% rename from gmn/src/gmn/app/views/decorators.py rename to gmn/src/d1_gmn/app/views/decorators.py index 3d3576644..9a3969c6f 100644 --- a/gmn/src/gmn/app/views/decorators.py +++ b/gmn/src/d1_gmn/app/views/decorators.py @@ -23,17 +23,17 @@ import functools +import d1_gmn.app.auth +import d1_gmn.app.revision +import d1_gmn.app.sysmeta +import d1_gmn.app.views.asserts +import d1_gmn.app.views.util + import d1_common.const import d1_common.types import d1_common.types.exceptions import d1_common.url -import gmn.app.auth -import gmn.app.revision -import gmn.app.sysmeta -import gmn.app.views.asserts -import gmn.app.views.util - import django.conf # ------------------------------------------------------------------------------ @@ -59,14 +59,14 @@ def wrapper(request, did, *args, **kwargs): def resolve_sid_func(request, did): - if gmn.app.views.util.is_v1_api(request): - gmn.app.views.asserts.is_pid_of_existing_object(did) + if d1_gmn.app.views.util.is_v1_api(request): + d1_gmn.app.views.asserts.is_pid_of_existing_object(did) return did - elif gmn.app.views.util.is_v2_api(request): - if gmn.app.sysmeta.is_pid(did): + elif d1_gmn.app.views.util.is_v2_api(request): + if d1_gmn.app.sysmeta.is_pid(did): return did - elif gmn.app.revision.is_sid(did): - return gmn.app.revision.resolve_sid(did) + elif d1_gmn.app.revision.is_sid(did): + return d1_gmn.app.revision.resolve_sid(did) else: raise d1_common.types.exceptions.NotFound( 0, u'Unknown identifier. id="{}"'.format(did), identifier=did @@ -143,12 +143,12 @@ def wrapper(request, *args, **kwargs): def trusted(request): - if not gmn.app.auth.is_trusted_subject(request): + if not d1_gmn.app.auth.is_trusted_subject(request): raise d1_common.types.exceptions.NotAuthorized( 0, u'Access allowed only for trusted subjects. active_subjects="{}", ' u'trusted_subjects="{}"'.format( - gmn.app.auth.format_active_subjects(request), - gmn.app.auth.get_trusted_subjects_string() + d1_gmn.app.auth.format_active_subjects(request), + d1_gmn.app.auth.get_trusted_subjects_string() ) ) @@ -160,7 +160,7 @@ def assert_create_update_delete_permission(f): @functools.wraps(f) def wrapper(request, *args, **kwargs): - gmn.app.auth.assert_create_update_delete_permission(request) + d1_gmn.app.auth.assert_create_update_delete_permission(request) return f(request, *args, **kwargs) return wrapper @@ -177,7 +177,7 @@ def wrapper(request, *args, **kwargs): 0, u'Access allowed only for authenticated subjects. Please reconnect with ' u'a valid DataONE session certificate. active_subjects="{}"'. - format(gmn.app.auth.format_active_subjects(request)) + format(d1_gmn.app.auth.format_active_subjects(request)) ) return f(request, *args, **kwargs) @@ -196,7 +196,7 @@ def wrapper(request, *args, **kwargs): u'Access allowed only for verified accounts. Please reconnect with a ' u'valid DataONE session certificate in which the identity of the ' u'primary subject has been verified. active_subjects="{}"' - .format(gmn.app.auth.format_active_subjects(request)) + .format(d1_gmn.app.auth.format_active_subjects(request)) ) return f(request, *args, **kwargs) @@ -209,7 +209,7 @@ def required_permission(f, level): @functools.wraps(f) def wrapper(request, pid, *args, **kwargs): - gmn.app.auth.assert_allowed(request, level, pid) + d1_gmn.app.auth.assert_allowed(request, level, pid) return f(request, pid, *args, **kwargs) return wrapper @@ -218,16 +218,16 @@ def wrapper(request, pid, *args, **kwargs): def changepermission_permission(f): """Assert that subject has changePermission or high for object. """ - return required_permission(f, gmn.app.auth.CHANGEPERMISSION_LEVEL) + return required_permission(f, d1_gmn.app.auth.CHANGEPERMISSION_LEVEL) def write_permission(f): """Assert that subject has write permission or higher for object. """ - return required_permission(f, gmn.app.auth.WRITE_LEVEL) + return required_permission(f, d1_gmn.app.auth.WRITE_LEVEL) def read_permission(f): """Assert that subject has read permission or higher for object. """ - return required_permission(f, gmn.app.auth.READ_LEVEL) + return required_permission(f, d1_gmn.app.auth.READ_LEVEL) diff --git a/gmn/src/gmn/app/views/diagnostics.py b/gmn/src/d1_gmn/app/views/diagnostics.py similarity index 75% rename from gmn/src/gmn/app/views/diagnostics.py rename to gmn/src/d1_gmn/app/views/diagnostics.py index 46f4ad166..b4bab97ed 100644 --- a/gmn/src/gmn/app/views/diagnostics.py +++ b/gmn/src/d1_gmn/app/views/diagnostics.py @@ -33,24 +33,24 @@ import shutil import urlparse +import d1_gmn.app.auth +import d1_gmn.app.db_filter +import d1_gmn.app.event_log +import d1_gmn.app.models +import d1_gmn.app.node_registry +import d1_gmn.app.psycopg_adapter +import d1_gmn.app.restrict_to_verb +import d1_gmn.app.sysmeta +import d1_gmn.app.util +import d1_gmn.app.views.asserts +import d1_gmn.app.views.create +import d1_gmn.app.views.util + import d1_common.const import d1_common.date_time import d1_common.types.dataoneTypes import d1_common.types.exceptions -import gmn.app.auth -import gmn.app.db_filter -import gmn.app.event_log -import gmn.app.models -import gmn.app.node_registry -import gmn.app.psycopg_adapter -import gmn.app.restrict_to_verb -import gmn.app.sysmeta -import gmn.app.util -import gmn.app.views.asserts -import gmn.app.views.create -import gmn.app.views.util - import django.apps import django.conf from django.db.models import Q @@ -64,7 +64,7 @@ # ------------------------------------------------------------------------------ -@gmn.app.restrict_to_verb.get +@d1_gmn.app.restrict_to_verb.get def diagnostics(request): if 'clear_db' in request.GET: delete_all_objects() @@ -82,11 +82,11 @@ def diagnostics(request): # ------------------------------------------------------------------------------ -@gmn.app.restrict_to_verb.get +@d1_gmn.app.restrict_to_verb.get def get_replication_queue(request): - q = gmn.app.models.ReplicationQueue.objects.all() + q = d1_gmn.app.models.ReplicationQueue.objects.all() if 'excludecompleted' in request.GET: - q = gmn.app.models.ReplicationQueue.objects.filter( + q = d1_gmn.app.models.ReplicationQueue.objects.filter( ~Q(local_replica__info__status__status='completed') ) return render_to_response( @@ -96,12 +96,12 @@ def get_replication_queue(request): # noinspection PyUnusedLocal -@gmn.app.restrict_to_verb.get +@d1_gmn.app.restrict_to_verb.get def clear_replication_queue(request): - for rep_queue_model in gmn.app.models.ReplicationQueue.objects.filter( + for rep_queue_model in d1_gmn.app.models.ReplicationQueue.objects.filter( local_replica__info__status__status='queued' ): - gmn.app.models.IdNamespace.objects.filter( + d1_gmn.app.models.IdNamespace.objects.filter( did=rep_queue_model.local_replica.pid.did ).delete() return redirect('diag') @@ -112,7 +112,7 @@ def clear_replication_queue(request): # ------------------------------------------------------------------------------ -@gmn.app.restrict_to_verb.get +@d1_gmn.app.restrict_to_verb.get def echo_session(request): return render_to_response( 'echo_session.xhtml', {'subjects': sorted(request.all_subjects_set)}, @@ -121,27 +121,27 @@ def echo_session(request): # noinspection PyUnusedLocal -@gmn.app.restrict_to_verb.get +@d1_gmn.app.restrict_to_verb.get def trusted_subjects(request): return render_to_response( 'trusted_subjects.xhtml', { 'subjects': sorted( - gmn.app.node_registry.get_cn_subjects() | + d1_gmn.app.node_registry.get_cn_subjects() | django.conf.settings.DATAONE_TRUSTED_SUBJECTS ) }, content_type=d1_common.const.CONTENT_TYPE_XHTML ) -@gmn.app.restrict_to_verb.post +@d1_gmn.app.restrict_to_verb.post def whitelist_subject(request): """Add a subject to the whitelist""" - subject_model = gmn.app.models.subject(request.POST['subject']) - whitelist_model = gmn.app.models.WhitelistForCreateUpdateDelete() + subject_model = d1_gmn.app.models.subject(request.POST['subject']) + whitelist_model = d1_gmn.app.models.WhitelistForCreateUpdateDelete() whitelist_model.subject = subject_model whitelist_model.save() - return gmn.app.views.util.http_response_with_boolean_true_type() + return d1_gmn.app.views.util.http_response_with_boolean_true_type() # ------------------------------------------------------------------------------ @@ -151,42 +151,44 @@ def whitelist_subject(request): def create(request, pid): """Minimal version of create() used for inserting test objects.""" - sysmeta_pyxb = gmn.app.views.util.deserialize(request.FILES['sysmeta']) - gmn.app.views.create.create(request, sysmeta_pyxb) - return gmn.app.views.util.http_response_with_boolean_true_type() + sysmeta_pyxb = d1_gmn.app.views.util.deserialize(request.FILES['sysmeta']) + d1_gmn.app.views.create.create(request, sysmeta_pyxb) + return d1_gmn.app.views.util.http_response_with_boolean_true_type() # noinspection PyUnusedLocal -@gmn.app.restrict_to_verb.get +@d1_gmn.app.restrict_to_verb.get def slash(request, p1, p2, p3): """Correctly handles arguments separated by slashes""" return render_to_response('test_slash.html', {'p1': p1, 'p2': p2, 'p3': p3}) # noinspection PyUnusedLocal -@gmn.app.restrict_to_verb.get +@d1_gmn.app.restrict_to_verb.get def exception(request, exception_type): """Correctly catches and serializes exceptions raised by views""" if exception_type == 'python': raise Exception("Test Python Exception") elif exception_type == 'dataone': raise d1_common.types.exceptions.InvalidRequest(0, 'Test DataONE Exception') - return gmn.app.views.util.http_response_with_boolean_true_type() + return d1_gmn.app.views.util.http_response_with_boolean_true_type() -@gmn.app.restrict_to_verb.get +@d1_gmn.app.restrict_to_verb.get def echo_request_object(request): pp = pprint.PrettyPrinter(indent=2) return HttpResponse(u'
{}'.format(cgi.escape(pp.pformat(request)))) -@gmn.app.restrict_to_verb.get +@d1_gmn.app.restrict_to_verb.get def object_permissions(request, pid): - gmn.app.views.asserts.is_pid_of_existing_object(pid) + d1_gmn.app.views.asserts.is_pid_of_existing_object(pid) subjects = [] - permissions = gmn.app.models.Permission.objects.filter(sciobj__pid__did=pid) + permissions = d1_gmn.app.models.Permission.objects.filter( + sciobj__pid__did=pid + ) for permission in permissions: - action = gmn.app.auth.LEVEL_ACTION_MAP[permission.level] + action = d1_gmn.app.auth.LEVEL_ACTION_MAP[permission.level] subjects.append((permission.subject.subject, action)) return render_to_response( 'object_permissions.xhtml', @@ -195,7 +197,7 @@ def object_permissions(request, pid): # noinspection PyUnusedLocal -@gmn.app.restrict_to_verb.get +@d1_gmn.app.restrict_to_verb.get def get_setting(request, setting_str): """Get a value from django.conf.settings.py or settings.py""" setting_obj = getattr(django.conf.settings, setting_str, '