Commit 5919d6dd authored by Rachana's avatar Rachana

Conflicts resolved with master

parents ce550ee5 23fb8b14
......@@ -12,9 +12,9 @@
[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
......@@ -25,47 +25,14 @@
(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:
......@@ -86,7 +53,7 @@
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:
> source bin/activate
......@@ -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
......@@ -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
......
# 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)
# 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
......@@ -5,7 +5,8 @@ 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.
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
===============================================================
......@@ -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',
......
......@@ -58,7 +58,7 @@ def main():
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) })
else:
......
......@@ -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 = {}
......
......@@ -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
......@@ -316,7 +316,8 @@ def create_object(name, member_of_id, prior_node_id=None, content_org=None, grou
if content_org:
node.content_org = unicode(content_org)
node.content = org2html(content_org, file_prefix=ObjectId().__str__())
# node.content = org2html(content_org, file_prefix=ObjectId().__str__())
node.content = unicode(content_org)
node.save()
......
......@@ -59,7 +59,7 @@ class Command(BaseCommand):
if each_attr_name:
at_node = node_collection.one({"_type":"AttributeType","name":unicode(each_attr_name)})
if at_node:
gattr_node = triple_collection.find({"_type": "GAttribute", "subject": each_node._id, "attribute_type.$id": at_node._id})
gattr_node = triple_collection.find({"_type": "GAttribute", "subject": each_node._id, "attribute_type": at_node._id})
if gattr_node:
for each_gattr_node in gattr_node:
triple_collection_ids.add(each_gattr_node._id)
......@@ -77,7 +77,7 @@ class Command(BaseCommand):
rt_node = node_collection.one({"$or":
[ {"name":unicode(each_rel_name)}, {"inverse_name":unicode(each_rel_name)}],"_type":"RelationType"})
if rt_node:
grel_node = triple_collection.find({"_type": "GRelation", "subject": each_node._id, "relation_type.$id": rt_node._id})
grel_node = triple_collection.find({"_type": "GRelation", "subject": each_node._id, "relation_type": rt_node._id})
if grel_node:
for each_grel_node in grel_node:
triple_collection_ids.add(each_grel_node._id)
......
......@@ -25,7 +25,7 @@ class Command(BaseCommand):
if pandora_video_st and source_id_at:
member_set=node_collection.find({'$and':[{'member_of': {'$all': [ObjectId(pandora_video_st._id)]}}, {'_type':'File'}]})
gattribute=triple_collection.find({'_type':'GAttribute', 'attribute_type.$id':source_id_at._id })
gattribute=triple_collection.find({'_type':'GAttribute', 'attribute_type':source_id_at._id })
for each in member_set:
each.delete()
print "Video ",each.name," removed from member_of successfully !!\n"
......
......@@ -82,11 +82,10 @@ def create_or_update_counter(user_obj, group_id):
## FILES ##
counter_obj['file']['rating_count_received'] = analytics_instance.get_ratings_counts_received_on_files()
counter_obj['page']['blog']['rating_count_received'] = analytics_instance.get_ratings_counts_received_on_notes()
# Get all files uploaded by user
counter_obj['file']['created'] = analytics_instance.get_user_files_count()
# Get all comments posted on files uploaded by user
counter_obj['page']['blog']['comments_gained'] = analytics_instance.get_comments_counts_on_users_files()
counter_obj['file']['comments_gained'] = analytics_instance.get_comments_counts_on_users_files()
# Get all files on which the user has posted a comment
counter_obj['file']['commented_on_others_res'] = analytics_instance.get_other_files_commented_by_user_count()
# Get all unique users who visited files uploaded by user
......@@ -102,6 +101,7 @@ def create_or_update_counter(user_obj, group_id):
## NOTES ##
# Get all notes/blog pages created by user
counter_obj['page']['blog']['rating_count_received'] = analytics_instance.get_ratings_counts_received_on_notes()
counter_obj['page']['blog']['created'] = analytics_instance.get_user_notes_count()
# Get all comments posted on notes created by user
# counter_obj['no_comments_received_on_notes'] = analytics_instance.get_comments_counts_on_users_notes()
......
......@@ -958,7 +958,7 @@ def clean_structure():
print info_message
log_list.append(info_message)
invalid_dates_cur = triple_collection.find({'attribute_type.$id': {'$in': [start_time._id, end_time._id]}, 'object_value': {'$not': {'$type': 9}}})
invalid_dates_cur = triple_collection.find({'attribute_type': {'$in': [start_time._id, end_time._id]}, 'object_value': {'$not': {'$type': 9}}})
for each in invalid_dates_cur:
date_format_string = ""
old_value = ""
......
......@@ -240,7 +240,7 @@ def update_registration_year():
# With value as datetime.datetime(2014, 1, 1, 0, 0)
# If found, replace it with datetime.datetime(2014, 1, 1, 0, 0)
ry_cur = triple_collection.find({'_type': "GAttribute", 'attribute_type.$id': ryat._id})
ry_cur = triple_collection.find({'_type': "GAttribute", 'attribute_type': ryat._id})
c = ry_cur.count()
if c:
......@@ -344,7 +344,7 @@ def setup_default_gapps():
info_message = "\n "+str(i+1)+") Setting GAPPS for this college group ("+g.name+" -- "+str(g._id)+")\n"
log_list.append(info_message)
is_apps_list = triple_collection.one({'_type': "GAttribute", 'subject': g._id, 'attribute_type.$id': at_apps_list._id})
is_apps_list = triple_collection.one({'_type': "GAttribute", 'subject': g._id, 'attribute_type': at_apps_list._id})
if is_apps_list:
info_message = " Default GAPPs list already exists for Group ("+g.name+" -- "+str(g._id)+"), so overriding it..."
log_list.append(info_message)
......
......@@ -400,7 +400,7 @@ def parse_data_create_gsystem(json_file_path):
json_documents_list = json.loads(json_file_content)
# Initiating empty node obj and other related data variables
node = node_collection.collection.File()
node = node_collection.collection.GSystem()
node_keys = node.keys()
node_structure = node.structure
# print "\n\n---------------", node_keys
......@@ -524,7 +524,6 @@ def parse_data_create_gsystem(json_file_path):
# ----- END of updating language -----
collection_name = parsed_json_document.get('collection', '')
if collection_name and nodeid:
......@@ -662,7 +661,6 @@ def parse_data_create_gsystem(json_file_path):
gst_possible_relations_dict = node.get_possible_relations(file_gst._id)
# processing each entry in relation_list
# print "=== relation_list : ", relation_list
......@@ -746,7 +744,7 @@ def parse_data_create_gsystem(json_file_path):
nodes = triple_collection.find({'_type': "GRelation",
'subject': subject_id,