Updated document with Code Workflow and documentation for User Pages.
diff --git a/SocialFeaturesMelangeGSoC2010.wiki b/SocialFeaturesMelangeGSoC2010.wiki index 3b07837..17123bc 100644 --- a/SocialFeaturesMelangeGSoC2010.wiki +++ b/SocialFeaturesMelangeGSoC2010.wiki
@@ -318,6 +318,71 @@ # If the user posting the even does not have 'owner' access to the calendar, the even entity will still be created on Melange with status "Unconfirmed" and will not posted to the Google Calendar. Instead, a notification with the event details will be sent to the 'owner' of the Calendar. # Upon recieving the notification, the owner may choose to accept the event, whereby the event will be posted to the Google Calendar, and the status of the correpoding event entity set to "Confirmed". + += Code Work Flow & Documentation = + +== User Pages == + +*Main Files*: + +*Code*: + * User Page View - soc/modules/social/views/models/user_page.py + * User Page Model - soc/modules/social/models/user_page.py + * User Page Logic - soc/modules/social/logic/models/user_page.py + +*Other Files* + * edit.html - soc/templates/modules/social/edit.html + * view_page.html - soc/templates/modules/social/view_page.html + * userpage.css - soc/content/modules/social/css/userpage.css + +*User Page View*: + * *__init__* function: + # Access params are set for 'create','edit' and 'list' access for User Pages. + # new_params[] is used to set: *(i)* module and url names, *(ii)* templates for create, edit, view_page and list, *(iii)* create,edit and exclude dynaproperties, *(iv)* set public fields to be shown in User Page lists. + # Setting url patterns for 'create','edit','list' and 'viewpage'. + * *viewpage* function: + # sets the template to be used for View Page + # calls Logic method to get context, containing User Page entity details. + * *_editPost_* function: + # used to set User Page properties before User Page entity is created + # properties such as *(i)* User reference, *(ii)* link_id, *(iii)* last_modified, *(iv)* role_entity of user, *(v)* calls Logic functions to get Student Projects associated with the role of the User, *(vi)* sets tags associated with user, *(vii)* image property(yet to be fixed) *(viii)* call Logic functions to get additional Work and Education entities added from the POST dictionary. + * *_editGet_* function: + # sets 'link_id' and 'tags' as a string before going to edit page. + * *_edit_* function: + # if request method is 'GET', call logic function to get all Work and Education entities associated with User Page to load to edit form. + # if request method is 'POST', call logic function to create the additional Work and Education entities added to edit form. + * *getExtraMenus* function: + # creates Extra menu item called 'User (Community)' + # if user if not logged in, shows a 'Sign In' link + # if user if logged in, call redirect functions to get links for 'create', 'edit', 'view', and 'list' user pages based on respective access checks. + * *list* function: + # Filter and list user pages whose status is set to 'Visible'. + +*User Page Logic* + * *getRoleEntity* function: gets the role entity associated with current user. + * *getProjects* function: get student projects associated with current user. + # student projects in which current user is participating as student. + # student projects in which current user is particiapting as mentor. + # if current user is org_admin, all student projects associated with the org. + * *getEducation* function: + # gets all additional education-related field values from POST dict and updateOrCreates the Education entities. + * *getWork* function: + # gets all additional work-related field values from POST dict and updateOrCreates the Job entities. + * *getUserPageContext* function: + # gets the User Page entity, and the addtional education and job entities associated with the user. + +*User Page Model* + * Contains all the properties of the user page data model. + +*edit.html* + * *Javascript* functions: + # *afterLoad()* function: This function is called upon the loading of the page. It gets the additional education and job entities in the context and calls *getWork()* and *getEducation()* functions to create the additional fields in the form for these entities. + # *getWork()* function: for each work entity in the context dictionary, this creates the additional form fields and fills it in with the already existing work entities, if any. + # *getEducation()* function: for each education entity in the context dictionary, creates the additional education form feilds and fills it with respective values. + # *$('#moreEducation').click* function: Creates a new set of empty education form fields for user to fill. + # *$('#moreWork').click* function: Creates a new set of empty Work form fields for the user to fill. + + = Timeline = The tentative project timeline will be added here.