Commit 5919d6dd authored by Rachana's avatar Rachana

Conflicts resolved with master

parents ce550ee5 23fb8b14
......@@ -12,12 +12,12 @@
[1] Installing required following packages and its dependencies:
> sudo apt-get install python-setuptools git build-essential python-dev rcs mongodb emacs24 python-virtualenv ipython libjpeg-dev memcached libevent-dev libfreetype6-dev zlib1g-dev ffmpeg2theora rabbitmq-server
> sudo apt-get install python-setuptools git build-essential python-dev rcs mongodb python-virtualenv ipython libjpeg-dev memcached libevent-dev libfreetype6-dev zlib1g-dev ffmpeg2theora rabbitmq-server
[2] Get latest version of gstudio-mongokit using one of the following commands:
[2] Get latest version of gstudio using one of the following commands:
(1) git clone https://github.com/gnowledge/gstudio.git
(2) git clone git@github.com:gnowledge/gstudio.git
(2) git clone git@github.com:gnowledge/gstudio.git
[3] Use following commands to install ffmpeg package:
......@@ -25,48 +25,15 @@
(2) sudo apt-get update
(3) sudo apt-get install ffmpeg gstreamer0.10-ffmpeg
[4] In case your distribution of GNU/Linux is not latest, you may not
find emacs24 in your repositories. In that case, satisfy the requirement
by following these instructions:
(1) sudo add-apt-repository ppa:cassou/emacs
(2) sudo apt-get update
(3) sudo apt-get install emacs24 emacs24-el emacs24-common-non-dfsg
[5] Setting up Emacs working environment:
Create an init file in your user directory with filename as '.emacs'
(i.e., /home/<username>/.emacs) to store default settings for emacs
, which includes following lines of code:
NOTE: How to get org-version?
(1) Open emacs editor
(2) Press Alt+X
(3) Enter following command: org-version [Then Press Enter]
(a) For org-version < 8.0: Copy following lines of code in above specified file and save it
(custom-set-variables
'(inhibit-startup-screen t)
'(org-export-html-preamble nil)
'(org-export-html-postamble nil)
)
(b) For org-version >= 8.0: : Copy following lines of code in above specified file and save it
(custom-set-variables
'(inhibit-startup-screen t)
'(org-html-preamble nil)
'(org-html-postamble nil)
)
[6] Set up virtual environment for gstudio-mongokit:
[4] Set up virtual environment for gstudio:
(1) cd gstudio
(2) virtualenv --system-site-packages . # NOTE: Here '.' indicates current directory
(3) source bin/activate # Activates virtual environment
(4) ./bin/pip install -r requirements.txt # NOTE: Here '.' indicates current directory
[7] SMTP configuration for notifications:
[5] SMTP configuration for notifications:
To make SMTP server ready for sending mail (development purpose only), you can use
either of the following methods:
......@@ -79,20 +46,20 @@
(a) Go to settings.py file and search for "#SMTP setting for
sending mail" and uncomment gmail smtp setting and comment
default python smtp settings.
default python smtp settings.
(b) Edit following with your gmail credentials and save
settings.py file:-
EMAIL_HOST_USER = 'yourcompleteemailid'
EMAIL_HOST_PASSWORD = 'yourpassword'
[8] Install JS/CSS dependencies using Bower:
[6] Install JS/CSS dependencies using Bower:
(1) Activate your virtual environment:
(1) Activate your virtual environment:
> source bin/activate
(2) A tool to create isolated node.js environment which is integrated
with environment built by python virtualenv:
(2) A tool to create isolated node.js environment which is integrated
with environment built by python virtualenv:
> sudo apt-get install curl
> pip install nodeenv
......@@ -101,7 +68,7 @@
> nodeenv --python-virtualenv
If above step gives an error, install NodeJS at root level with
following commands:
following commands:
(a) sudo add-apt-repository ppa:chris-lea/node.js
(b) sudo apt-get update
(c) sudo apt-get install python-software-properties python g++ make nodejs
......@@ -113,7 +80,7 @@
> cd gstudio/gnowsys-ndf # Navigate to project-root
> bower install # Install depenedencies
[9] Install Search Dependencies:
[7] Install Search Dependencies:
(1) Run following command:
> pip install -U pyyaml nltk
......@@ -156,7 +123,7 @@
> cd gstudio/gnowsys-ndf
(3) Start mongodb server:
> sudo service mongodb start
> sudo service mongodb start
(4) Run following management commands:
......@@ -170,7 +137,7 @@
refer following file: gstudio/doc/schema_setup.og
(5) Now point your browser to http://localhost:8000 to see
gstudio on your browser. Enjoy.
gstudio on your browser. Enjoy.
* Follow gstudio UPDATE(s)
......@@ -179,8 +146,8 @@
from project's git repository. After each update run above specified
management commands in the given order.
> git pull https://github.com/gnowledge/gstudio.git mongokit
> git pull origin mongokit # Or Simply
> git pull https://github.com/gnowledge/gstudio.git master
> git pull origin master # Or Simply
* For 'Replication' and 'mail-client' features refer: doc/Mailclient
......@@ -196,7 +163,7 @@
(b) Running compass:
(1) Navigate to project-root directory (where your "manage.py" file resides), i.e.
> cd gstudio/gnowsys-ndf
> cd gstudio/gnowsys-ndf
(2) Run following command (to start compass) and then edit scss stylesheets:
> compass watch
......
# This Script will delete all mp4 files if it has webm and will replace mp4 objects with webm objects
from gnowsys_ndf.ndf.models import *
video_files_cur = node_collection.find({
'if_file.mime_type': {'$regex': str('video'), '$options': "i"}
})
if video_files_cur:
print "\n All Video files count: ", video_files_cur.count()
for each in video_files_cur:
each_mid_url = each.if_file.mid.relurl
each_original_url = each.if_file.original.relurl
# `if_file.mid.relurl` contains converted (webm) file.
if each_mid_url and (each_original_url != each_mid_url):
print "\n\nUpdating " + each.name + str(each._id)
# following will delete filehive instance as well as file from hashFS.
Filehive.delete_file_from_filehive(each.if_file.original.id, each_original_url)
# TODO: but one additional check needs to be added to check if this particular file is not reference anywhere else.
each.if_file.original.relurl = each_mid_url
each.if_file.original.id = each.if_file.mid.id
each.save()
import sys
from gnowsys_ndf.ndf.models import *
from gnowsys_ndf.ndf.views.methods import *
copy_files = False
move_files = False
clone_files = False
hard_clone_files = False
source_group_id = raw_input("Enter source group _id: ")
destination_group_id = raw_input("Enter destination group _id: ")
resource_type_input = raw_input("\nChoose Resource type:\n 1. File\n 2. Page\nEnter option no. (1 or 2): ")
resource_type_input = raw_input("\nChoose Resource type:\n 1. File\n 2. Page\n 3. Cancel\nEnter option no. (1 or 2 or 3): ")
if resource_type_input == '1':
resource_type_name = 'File'
elif resource_type_input == '2':
resource_type_name = 'Page'
elif resource_type_input == '3':
sys.exit()
else:
print '\nYou have choosen wrong option. "File" will be default option selected in this case.'
resource_type_name = 'File'
print '\nYou have choosen resource type: ', resource_type_name, '\n'
copy_or_move = raw_input("Enter c/C to copy the files OR m/M to move the files :")
operation_choice = raw_input("\nChoose Operation type:\n 1. Copy\n 2. Move\n 3. Clone (Does NOT Clone GAttribute and GRelations)\n 4. Hard Clone (Clones GAttribute and GRelations)\n 5. Cancel\nEnter option no. (1 or 2 or 3 or 4 or 5): ")
if copy_or_move == 'c' or copy_or_move == 'C':
if operation_choice == '1':
copy_files = True
elif copy_or_move == 'm' or copy_or_move == 'M':
elif operation_choice == '2':
move_files = True
elif operation_choice == '3':
clone_files = True
elif operation_choice == '4':
hard_clone_files = True
elif operation_choice == '5':
sys.exit()
else:
print "\nInvalid option."
try:
source_group_obj = node_collection.one({'_id': ObjectId(source_group_id)})
destination_group_obj = node_collection.one({'_id': ObjectId(destination_group_id)})
......@@ -39,9 +50,6 @@ try:
'_type': 'GSystem',
'group_set': source_group_obj._id,
'member_of': {'$in': [member_of_gst._id]}
# 'if_file.mime_type': {
# '$exists': True, '$ne': None
# }
})
if source_grp_files.count():
......@@ -51,28 +59,33 @@ try:
if copy_move_confirmation == 'y' or copy_move_confirmation == 'Y':
for each_source_file in source_grp_files:
if copy_files and not move_files:
if copy_files:
if destination_group_obj._id not in each_source_file.group_set:
each_source_file.group_set.append(destination_group_obj._id)
each_source_file.save()
elif move_files and not copy_files:
elif move_files:
# Remove source_group_id and add destination_group_id
# This is to prevent file that are cross-published
# to multiple groups other than source_group
each_source_file.group_set.remove(source_group_obj._id)
if destination_group_obj._id not in each_source_file.group_set:
each_source_file.group_set.append(destination_group_obj._id)
each_source_file.save()
# after doing copy/move (update of group_set), save object:
each_source_file.save()
elif clone_files:
print "\n Preparing to Clone object. Please wait."
each_new_file = create_clone(1, each_source_file, destination_group_obj._id)
elif hard_clone_files:
print "\n Preparing to Hard Clone object. Please wait."
each_new_file = replicate_resource(None, each_source_file, destination_group_obj._id)
# after doing copy/move/object (update of group_set), save object:
else:
print "\n No files found in source group."
else:
print "\n Either source/destination group does not exist."
print "\n Either source or destination group does not exist."
except Exception as copy_move_files_err:
print "\n Error occurred!!!! ", copy_move_files_err
......@@ -4,8 +4,9 @@ COURSE
total_modules : No. of modules in the course
total_units : No. of units in the course
units_completed : No. of Units the user has completed.
Completion is calculated on viewing/visiting the activities under a unit.
modules_completed : No. of Modules the user has completed. If all the units falling under a module are marked as completed, the module is then considered to be completed.
Completion is calculated on viewing/visiting the activities under a unit.
modules_completed : No. of Modules the user has completed. If all the units falling under a module are marked as
completed, the module is then considered to be completed.
module_progress_meter : Completed Modules/ Total Modules
unit_progress_meter : Completed Units/ Total Units
===============================================================
......@@ -15,13 +16,13 @@ user_files : No. of files uploaded by user
other_viewing_my_files : No. of other(unique) users who viewed user's files
total_rating_rcvd_on_files : Average of all user's files ratings. [(Sum of rating of 'N' files)/ 'N']
total_files_viewed_by_user : No. of other's files viewed by the user.
If a single file is viewed more than once, it will be considered/counted as 1 file view.
If a single file is viewed more than once, it will be considered/counted as 1 file view.
===============================================================
NOTES
user_notes : No. of notes created by user
total_notes_read_by_user : No. of other's notes read by the user.
If a single note is read more than once, it will be considered/counted as 1 note read.
If a single note is read more than once, it will be considered/counted as 1 note read.
total_rating_rcvd_on_notes : Average of all user's notes ratings [(Sum of rating of 'N' notes)/ 'N'].
others_reading_my_notes : No. of other(unique) users who read user's notes.
===============================================================
......@@ -85,7 +86,7 @@ Module Completion Logic:
But, since Activity_7 is not viewed, Unit_6 and Session_4 will be marked as 'Incomplete' and hence,
Module_2 is also 'Incomplete'.
An Activity may contain:
An Activity is one of the following:
1. Page
- requires viewing/visiting it to mark complete
2. File
......
Create New GSystem
1.The new GSystem can be create from the Admin Designer tab.
1.1. The user is required to select a GSystemType depending on which a corressponding GSystem template would be loaded.
1.2. Here there are two possible cases:
1.2.1. If the GSystemType select, has its own .html page (eg. The GSystemType Page has its own
page.html ) then that page would be loaded.
1.2.2. If the GSystemType selected does not have its own .html page,then a dynamic
page is loaded having the fields based on :
1.2.2.1. attribute_type_set of the GSystemType selected
1.2.2.2. relation_type_set of the GSystemType selected
1.2.2.3. get_possible_attributes of the GSystemType selected, fetched by using the
method in models.py
1.2.2.4. get_possible_relations of the GSystemType selected, fetched by using the
method in models.py
(NOTE: In case, there is any duplicity between attribute_type_set and get_possible_attributes, then the duplicate fields from get_possible_attributed are removed.)
1.2.2.5. Default fields of GSystem class.
1.3. After the form is saved, the corressponding GAttribute's and GRelation's are added.
2. The form saved can be edited from the admin/data/GSystem or admin/designer/GSystem drawer.
3. The Graphs: Concept Graph, Collection Graph, Dependency Graph can be viewed from admin/data/GSystem
and admin/designer/GSystem drawer.
......@@ -85,6 +85,6 @@ quizitem_max_attempts,QuizItem Maximum Attempts,int,[],"[""QuizItem"",""QuizItem
quizitem_check_answer,QuizItem Check Answer,bool,[],"[""QuizItem"",""QuizItemEvent""]",FALSE,TRUE,[],[],
quizitempost_user_submitted_ans,QuizItemPost User Submitted Answer,list,[],"[""QuizItemPost""]",TRUE,TRUE,[],[],
quizitempost_user_checked_ans,QuizItemPost User Checked Answer,list,[],"[""QuizItemPost""]",TRUE,TRUE,[],[],
discussion_enable,Discussion Enable,bool,[],"[""Page"", ""File"",""E-Book"",""QuizItemEvent""]",TRUE,TRUE,[],[],
discussion_enable,Discussion Enable,bool,[],"[""Page"", ""File"",""E-Book"",""QuizItemEvent"", ""Jsmol"", ""TurtleBlocks"", ""PoliceSquad"", ""OpenStoryTool"", ""BioMechanics""]",TRUE,TRUE,[],[],
is_bigbluebutton,Online Meeting,bool,[],"[""Event""]",TRUE,TRUE,[],[],
open_event,Open Event (All group members can join the event),bool,[],"[""Event""]",TRUE,TRUE,[],[],
......@@ -43,6 +43,6 @@ subject_type,member_of,name,altnames,inverse_name,object_type,object_cardinality
"[""StudentCourseEnrollment"",""Page"",""File""]","[""Binary""]",has_current_approval_task,Approval Task;Enrollment,task_for_enrollment_approval,"[""Task""]",1
"[""Event""]","[""Binary""]",event_has_batch,Batch;Event,batch_for_event,"[""Batch""]",1
"[""CourseEventGroup""]","[""Binary""]",group_has_course_event,CourseEventGroup;Course,course_event_for_group,"[""Course""]",1
"[""Course"",""Group"",""ProgramEventGroup"",""PartnerGroup""]","[""Binary""]",has_logo,Course;File,logo_of,"[""File""]",1
"[""Course"",""BaseCourseGroup"",""Group"",""ProgramEventGroup"",""PartnerGroup""]","[""Binary""]",has_logo,Course;File,logo_of,"[""File""]",1
"[""QuizItemEvent"",""Page"",""File""]","[""Binary""]",clone_of,QuizItemEvent;QuizItem,has_clone,"[""QuizItem"",""Page"",""File""]",1
"[""QuizItem"",""QuizItemEvent"",""Page"",""File"",""Forum""]","[""Binary""]",has_thread,QuizItemEvent;Twist,thread_of,"[""Twist""]",100
"[""QuizItem"",""QuizItemEvent"",""Page"",""File"",""Forum"",""Jsmol"", ""TurtleBlocks"", ""PoliceSquad"", ""OpenStoryTool"", ""BioMechanics""]","[""Binary""]",has_thread,QuizItemEvent;Twist,thread_of,"[""Twist""]",100
......@@ -44,4 +44,11 @@ CourseSectionEvent,[],"[""factory_types""]",[],[],[]
CourseSubSectionEvent,[],"[""factory_types""]",[],[],[]
CourseUnitEvent,[],"[""factory_types""]",[],[],[]
QuizItemEvent,"[""QuizItem""]","[""factory_types""]",[],[],[]
Jhapp,[],"[""factory_types""]",[],[],[]
QuizItemPost,"[""Reply""]","[""factory_types""]",[],[],[]
Jsmol,"[""Jhapp""]","[""factory_types""]",[],[],[]
TurtleBlocks,"[""Jhapp""]","[""factory_types""]",[],[],[]
PoliceSquad,"[""Jhapp""]","[""factory_types""]",[],[],[]
OpenStoryTool,"[""Jhapp""]","[""factory_types""]",[],[],[]
BioMechanics,"[""Jhapp""]","[""factory_types""]",[],[],[]
Template,"[""Page""]","[""factory_types""]",[],[],[]
......@@ -45,3 +45,10 @@ CourseSubSectionEvent,[],"[""factory_types""]","[""course_structure_minutes"", "
CourseUnitEvent,[],"[""factory_types""]",[],[],[]
QuizItemEvent,"[""QuizItem""]","[""factory_types""]","[""quizitem_show_correct_ans"",""quizitem_problem_weight"" ,""quizitem_max_attempts"" ]","[""clone_of""]",[]
QuizItemPost,"[""Reply""]","[""factory_types""]","[""quizitempost_user_submitted_ans"", ""quizitempost_user_checked_ans""]",[],[]
Jhapp,[],"[""factory_types""]",[],[],[]
Jsmol,"[""Jhapp""]","[""factory_types""]",[],[],[]
TurtleBlocks,"[""Jhapp""]","[""factory_types""]",[],[],[]
PoliceSquad,"[""Jhapp""]","[""factory_types""]",[],[],[]
OpenStoryTool,"[""Jhapp""]","[""factory_types""]",[],[],[]
BioMechanics,"[""Jhapp""]","[""factory_types""]",[],[],[]
Template,"[""Page""]","[""factory_types""]",[],[],[]
......@@ -29,7 +29,6 @@
"jqtree": "#0.21.0",
"jquery-legacy": "jquery#1.10.2",
"jquery.transit": "#0.9.12",
"MathJax": "#2.4.0",
"d3": "#3.4.11",
"FileSaver": "#879b3c228c",
"underscore": "#1.6.0",
......@@ -52,7 +51,8 @@
"handlebars": "#4.0.5",
"pace": "#1.0.2",
"jquery": "#2.2.1",
"blueimp-canvas-to-blob" :"#3.3.0"
"blueimp-canvas-to-blob" :"#3.3.0",
"jsmol" :"#1.1.0"
},
"resolutions": {
"jquery": "2.2.1"
......
from fabric.api import local
def copy_schema_csvs():
local('cp -v ../doc/schema_directory/* gnowsys_ndf/ndf/management/commands/schema_files/')
def update_data():
copy_schema_csvs()
local('python manage.py filldb')
local('python manage.py create_schema STs_run1.csv')
local('python manage.py create_schema ATs.csv')
local('python manage.py create_schema RTs.csv')
local('python manage.py create_schema STs_run2.csv')
local('python manage.py sync_existing_documents')
def install_requirements():
local('pip install -r ../requirements.txt')
def purge_group():
local('python manage.py purge_group')
from datetime import timedelta
from gnowsys_ndf.local_settings import SYNCDATA_DURATION
BROKER_URL = 'amqp://'
CELERYBEAT_SCHEDULE = {
'do-every-fixed-seconds': {
'task': 'gnowsys_ndf.tasks.run_syncdata_script',
'schedule': timedelta(seconds=SYNCDATA_DURATION),
#'args': (16, 16)
},
}
# from datetime import timedelta
# from gnowsys_ndf.local_settings import SYNCDATA_DURATION
# CELERYBEAT_SCHEDULE = {
# 'do-every-fixed-seconds': {
# 'task': 'gnowsys_ndf.tasks.run_syncdata_script',
# 'schedule': timedelta(seconds=SYNCDATA_DURATION),
# #'args': (16, 16)
# },
# }
CELERY_TIMEZONE = 'UTC'
......@@ -38,7 +38,8 @@ factory_gsystem_types = [{'name':'Twist','meta_type':'factory_types'},
{'name':'ModeratingGroup','meta_type':'factory_types'},
{'name':'Info page','meta_type':'factory_types'},
{'name':'Blog page','meta_type':'factory_types'},
{'name':'Wiki page','meta_type':'factory_types'}
{'name':'Wiki page','meta_type':'factory_types'},
{'name':'BaseCourseGroup','meta_type':'factory_types'}
]
......@@ -79,52 +80,52 @@ factory_attribute_types = [{'start_time':{'gsystem_names_list':['QuizItem','Foru
{'Estimated_time':{'gsystem_names_list':['Task'],
'data_type':'float',
'meta_type':'factory_types'}},
{'age_range':{'gsystem_names_list':['Quiz','Topic','File','Page','Pandora_video', 'E-Book'],
{'age_range':{'gsystem_names_list':['Quiz','Topic','File','Page','Pandora_video', 'E-Book','Jsmol'],
'data_type':'basestring',
'meta_type':'factory_types'}},
{'audience':{'gsystem_names_list':['Quiz','Topic','File','Page','Pandora_video', 'E-Book'],
{'audience':{'gsystem_names_list':['Quiz','Topic','File','Page','Pandora_video', 'E-Book','Jsmol'],
'data_type':'list',
'meta_type':'factory_types'}},
{'creator':{'gsystem_names_list':['Quiz','Topic','File','Page','Pandora_video', 'E-Book'],
{'creator':{'gsystem_names_list':['Quiz','Topic','File','Page','Pandora_video', 'E-Book','Jsmol'],
'data_type':'basestring',
'meta_type':'factory_types'}},
{'other_contributors':{'gsystem_names_list':['Quiz','Topic','File','Page','Pandora_video', 'E-Book'],
{'other_contributors':{'gsystem_names_list':['Quiz','Topic','File','Page','Pandora_video', 'E-Book','Jsmol'],
'data_type':'list',
'meta_type':'factory_types'}},
{'timerequired':{'gsystem_names_list':['Quiz','Topic','File','Page','Pandora_video', 'E-Book'],
{'timerequired':{'gsystem_names_list':['Quiz','Topic','File','Page','Pandora_video', 'E-Book','Jsmol'],
'data_type':'basestring',
'meta_type':'factory_types'}},
{'interactivitytype':{'gsystem_names_list':['Quiz','Topic','File','Page','Pandora_video'],
{'interactivitytype':{'gsystem_names_list':['Quiz','Topic','File','Page','Pandora_video','Jsmol'],
'data_type':'basestring',
'meta_type':'factory_types'}},
{'basedonurl':{'gsystem_names_list':['Quiz','Topic','File','Page','Pandora_video', 'E-Book'],
{'basedonurl':{'gsystem_names_list':['Quiz','Topic','File','Page','Pandora_video', 'E-Book','Jsmol'],
'data_type':'basestring',
'meta_type':'factory_types'}},
{'educationaluse':{'gsystem_names_list':['Quiz','Topic','File','Page','Pandora_video', 'E-Book'],
{'educationaluse':{'gsystem_names_list':['Quiz','Topic','File','Page','Pandora_video', 'E-Book','Jsmol'],
'data_type':'basestring',
'meta_type':'factory_types'}},
{'textcomplexity':{'gsystem_names_list':['Quiz','Topic','File','Page','Pandora_video', 'E-Book'],
{'textcomplexity':{'gsystem_names_list':['Quiz','Topic','File','Page','Pandora_video', 'E-Book','Jsmol'],
'data_type':'basestring',
'meta_type':'factory_types'}},
{'readinglevel':{'gsystem_names_list':['Quiz','Topic','File','Page','Pandora_video', 'E-Book'],
{'readinglevel':{'gsystem_names_list':['Quiz','Topic','File','Page','Pandora_video', 'E-Book','Jsmol'],
'data_type':'basestring',
'meta_type':'factory_types'}},
{'educationalsubject':{'gsystem_names_list':['Quiz','Topic','File','Page','Pandora_video', 'E-Book'],
{'educationalsubject':{'gsystem_names_list':['Quiz','Topic','File','Page','Pandora_video', 'E-Book','Jsmol'],
'data_type':'basestring',
'meta_type':'factory_types'}},
{'educationallevel':{'gsystem_names_list':['Quiz','Topic','File','Page','Pandora_video', 'E-Book'],
{'educationallevel':{'gsystem_names_list':['Quiz','Topic','File','Page','Pandora_video', 'E-Book','Jsmol'],
'data_type':'list',
'meta_type':'factory_types'}},
{'educationalalignment':{'gsystem_names_list':['Quiz','QuizItem','Topic','File','Page','NUSSD Course', 'Pandora_video', 'Theme', 'E-Book'],
{'educationalalignment':{'gsystem_names_list':['Quiz','QuizItem','Topic','File','Page','NUSSD Course', 'Pandora_video', 'Theme', 'E-Book','Jsmol'],
'data_type':'basestring',
'meta_type':'factory_types'}},
{'curricular':{'gsystem_names_list':['File','Page', 'Pandora_video', 'Theme', 'E-Book'],
{'curricular':{'gsystem_names_list':['File','Page', 'Pandora_video', 'Theme', 'E-Book','Jsmol'],
'data_type':'bool',
'meta_type':'factory_types'}},
{'source':{'gsystem_names_list':['File', 'Page', 'Pandora_video', 'E-Book'],
{'source':{'gsystem_names_list':['File', 'Page', 'Pandora_video', 'E-Book','Jsmol'],
'data_type':'basestring',
'meta_type':'factory_types'}},
{'adaptation_of':{'gsystem_names_list':['File','Page', 'Pandora_video', 'E-Book'],
{'adaptation_of':{'gsystem_names_list':['File','Page', 'Pandora_video', 'E-Book','Jsmol'],
'data_type':'basestring',
'meta_type':'factory_types'}},
{'name_eng':{'gsystem_names_list':['File', 'Page', 'Pandora_video', 'E-Book'],
......@@ -148,7 +149,7 @@ factory_attribute_types = [{'start_time':{'gsystem_names_list':['QuizItem','Foru
{'thread_interaction_type':{'gsystem_names_list':['Twist'],
'data_type':'basestring',
'meta_type':'factory_types'}},
{'co_contributors': {'gsystem_names_list':['Page', 'File', 'E-Book'],
{'co_contributors': {'gsystem_names_list':['Page', 'File', 'E-Book','Jsmol'],
'data_type':'basestring',
'meta_type':'factory_types'}},
{'entry_list':{'gsystem_names_list':['conference','inbook','inproceedings','manual','masterthesis','misc','phdthesis','proceedings','techreport','unpublished_entry','incollection','article','book','booklet'],
......@@ -204,7 +205,7 @@ factory_relation_types = [
},
{'has_profile_pic': {
'subject_type':['Author','Group','ModeratingGroup','CourseEventGroup','ProgramEventGroup','PartnerGroup'],
'subject_type':['Author','Group','ModeratingGroup','CourseEventGroup','ProgramEventGroup','PartnerGroup', 'BaseCourseGroup'],
'object_type':['Image','File'],
'inverse_name':'profile_pic_of',
'meta_type':'factory_types'
......@@ -212,7 +213,7 @@ factory_relation_types = [
},
{'has_banner_pic': {
'subject_type':['Author','Group','ModeratingGroup','CourseEventGroup','ProgramEventGroup','PartnerGroup'],
'subject_type':['Author','Group','ModeratingGroup','CourseEventGroup','ProgramEventGroup','PartnerGroup', 'BaseCourseGroup'],
'object_type':['Image','File'],
'inverse_name':'banner_pic_of',
'meta_type':'factory_types'
......@@ -263,7 +264,7 @@ factory_relation_types = [
},
{'has_thumbnail': {
'subject_type': ['Page', 'File'],
'subject_type': ['Page', 'File','Jsmol'],
'object_type': ['File'],
'inverse_name': 'thumbnail_of',
'meta_type': 'factory_types',
......
......@@ -55,16 +55,16 @@ def main():
app_items = node_collection.find({'name':k})
for each in list(app_items):
get_node = node_collection.one({'_id': ObjectId(each._id), 'member_of': gapp._id})
if get_node:
if get_node:
name=v.decode('utf-8')
print get_node.name
node_rt = triple_collection.find({'_type': "GRelation", 'subject': get_node._id, 'relation_type.$id': get_translation_rt._id})
node_rt = triple_collection.find({'_type': "GRelation", 'subject': get_node._id, 'relation_type': get_translation_rt._id})
if node_rt.count() > 0:
node = node_collection.one({'_id': ObjectId(node_rt[0].right_subject) })
node = node_collection.one({'_id': ObjectId(node_rt[0].right_subject) })
else:
node = None
node_rt = None
if node is None:
node = node_collection.collection.GSystem()
node.name = unicode(name)
......@@ -78,7 +78,7 @@ def main():
node.status = u"DRAFT"
node.save()
print "\nTranslated Node ",node.name," created successfully\n"
else:
else:
print "\nTranslated node ",node.name," already exists\n"
if node_rt is None:
......@@ -91,7 +91,7 @@ def main():
# grelation.name=u""
# grelation.save()
print "\nGRelation for node ",node.name," created sucessfully!!"
else:
else:
print "\nGRelation for node ",node.name," already exists\n"
......@@ -24,7 +24,8 @@ from gnowsys_ndf.ndf.models import GSystem, File, Group, Author
from gnowsys_ndf.ndf.models import Triple, GAttribute, GRelation
from gnowsys_ndf.ndf.models import ReducedDocs, ToReduceDocs, IndexedWordList
from gnowsys_ndf.ndf.models import node_holder
from gnowsys_ndf.ndf.models import db, node_collection, triple_collection
from gnowsys_ndf.ndf.models import db, node_collection, triple_collection, filehive_collection, counter_collection, benchmark_collection, filehive_collection, buddy_collection
from gnowsys_ndf.ndf.models import Filehive, Buddy, Counter
from gnowsys_ndf.ndf.models import INDEX_ASCENDING
......@@ -87,7 +88,11 @@ class Command(BaseCommand):
print "\nFollowing are the model(s) defined: \n{0}".format(', '.join(map(lambda name_tuple: name_tuple[0], model_names)))
collection_object_wrapper = {
'Nodes': node_collection.collection,
'Triples': triple_collection.collection
'Triples': triple_collection.collection,
'Benchmark': benchmark_collection,
'Filehive': filehive_collection,
'Buddy': buddy_collection,
'Counter': counter_collection
}
collection_index_dict = {}
......@@ -146,7 +151,7 @@ class Command(BaseCommand):
index_val = "" # Value returned after index is created/updated
index_val, index_fields_list = get_index_name(index_fields_list)
info_message = " {0}".format(index_val)
print info_message
log_list_append("\n" + info_message)
......@@ -163,7 +168,7 @@ class Command(BaseCommand):
continue
# Iterate through various index field-name(s) defined or
# field-tuple(s) [i.e. (field-name, indexing-order)] defined as
# field-tuple(s) [i.e. (field-name, indexing-order)] defined as
# part of index-field-list in a given collection
"""
for i, index_dict in enumerate(iter(indexes_defined_for_collection)):
......
......@@ -11,7 +11,7 @@ from django.core.management.base import BaseCommand, CommandError
# from django_mongokit import get_database
from django.template.defaultfilters import slugify
from gnowsys_ndf.ndf.org2any import org2html
# from gnowsys_ndf.ndf.org2any import org2html
from gnowsys_ndf.ndf.views.methods import create_gattribute
# from mongokit import IS
......@@ -51,13 +51,13 @@ def create_user_nroer_team():
if User.objects.filter(username="nroer_team"):
nroer_team_id = get_user_id("nroer_team")
else:
info_message = "\n- Creating super user: 'nroer_team': "
user = User.objects.create_superuser(username='nroer_team', password='nroer_team', email='nroer_team@example.com')