Changes between Version 4 and Version 5 of DeveloperGuidelines/WebSetup


Ignore:
Timestamp:
01/05/15 12:48:39 (7 years ago)
Author:
Fran Boon
Comment:

Deprecate old info

Legend:

Unmodified
Added
Removed
Modified
  • DeveloperGuidelines/WebSetup

    v4 v5  
    1 = WEB SETUP IMPLEMENTATION (Detail)=
     1= Web Setup =
    22[[TOC]]
    3 == '''MODELS''' ==
    4 === default.py ===
    53
    6 * '''session.SelectorCheck'''
    7   :It is a boolean value that checks if an eden instance is selected or not .It helps the controllers to decide whether to show the selector screen or not.
    8 
    9 * '''dict of libraries'''
    10   :These contain the information about lxml,reportlabs,xlwt,shapely and geos libraries . It helps to test the presence of these libraries and also give links to where they could be downloaded .
    11 {{{
    12 libraries = {
    13     'lxml':
    14         {
    15             'name': 'lxml',
    16             'description': 'To import and export XML, you need to install lxml',
    17             'link': 'http://codespeak.net/lxml/installation.html'
    18         },
    19 }
    20 }}}
    21 
    22 
    23 
    24 === parsed_config.py===
    25 It actually consists of s3cfg.py and 000_config.py written one after the other . When this code is allowed to run we get the dict of all the deployment settings can easily be obtained .[[BR]]
    26 The s3cfg.py contains docstring in each get function . These doctstring contain the information like:-
    27 * '''type''' : which type of the input field is required in the forms
    28 * '''category''' : which category to the setting belong.
    29 * '''name''' : The name of the setting
    30 * '''options''' :The list of values shown in the dropdown
    31 The 000_config also has disabled module dictionary . This is really important for the cases when an module was initially deactivated and later activated.
    32 
    33 As the values are taken from the current 000_config and s3cfg.py and then used thus there is no problem even if an old instance is used in websetup to change the settings. These values in the forms reflect the current values  of 000_config.py
    34 
    35 == '''CONTROLLERS''' ==
    36 === default.py ===
    37      
    38 ==== Def selector(): ====
    39 If the session variable of the path is not set then I redirect the user from the index function to this function of the controller.
    40 *       I create a the list of paths of all the eden applications( Identified by license file in the folder )
    41 *       And then there is a drop down menu to select the path ( the user will select the name, I retrieve the path using the request.post_vars in the form.accepts and then set the path accordingly).We create forms using  SELECT() function for the dropdown and FIELDSET() for creating a filed in the form
    42 
    43 
    44 ==== Def index(): ====
    45 If the session variable is set then this part is executed. The main purpose of this is to create forms according to the needs and the docstrings written in the s3cfg.py . This part parses those data to retrieve the input fields ,name and category of settings .[[BR]]
    46 
    47 As for modules all the module mentioned in the docstring of the get_module() function is used.[[BR]]
    48 
    49 This part also checks for the:-[[BR]]
    50 * '''Module dependecies'''[[BR]]
    51   :I have mentioned all the dependencies in the docstring of the get_module()function. These are parsed and checked in this part.If any module is activated that needs other modules those other modules will be activated by themselves .
    52 
    53 * '''Core modules'''[[BR]]
    54   :I have removed the status option for the 4 core modules. Thus these modules cannot be deactivatted.
    55 The Form is generated by followinf the following scheme :-[[BR]]
    56 [[BR]]   
    57 Form (Entire collection)[[BR]]
    58 |[[BR]]
    59 Fieldset (Categorizes Settings, modules or create new eden block)[[BR]]
    60 |[[BR]]
    61 Fieldset (Groups of settings)[[BR]]
    62 |[[BR]]
    63 Table (Optional) (Not everything uses a table this is just for organization)[[BR]]
    64 |[[BR]]
    65 Input/Element (Individual setting)[[BR]]
    66 
    67 * Module Forms:
    68 [[BR]]
    69 
    70 * There will be similar forms for the settings. However I would like to have separate forms for different categories of settings. Like thsese:-
    71 [[BR]]
    72 
    73 
    74 '''Other Functions made to help index()'''
    75 
    76 * def create_new_eden():[[BR]]
    77 This function is used to create new eden . It copies the content from the current instance into a new folder with the given name. It also uses bzr if present to update the code bu downloading the revisions .
    78 [[BR]]
    79 
    80 * def get_input_type():[[BR]]
    81 This function is used to create a dropdown menu or checkboxes for the given field. It also access the options to be made
    82 
    83 ==== Def write_out(): ====
    84 '''This writes data to 000_config'''[[BR]]
    85 For this they would need to open the config using os.path.join and write data to the config  in the correct format.[[BR]]
    86 This function extensively uses the modify() function to convert the dict of the deployment settings and and modules to convert into a python sytax which can be written to the 000_config.
    87 
    88 == '''VIEWS''' ==
    89 
    90 Though we have not talked about this part directly, however in the last section of index(): function we have talked about the forms that I would like to create. Most part of this code can be reused from the previous application.
    91 
    92 This part extensively uses jquery to create tabs and and also the css to create a good color scheme. Thus the form is generated only once and all the other
    93 navigaion is done through jquery thus making it much  faster and convenient to use. 
    94 
    95 
    96 == '''Workflow And Summary''' ==
    97 === Acivate the WebSetup : ===
    98  
    99 * Going to the web setup co-application and select an Eden Instance .
    100 
    101 === s3cfg and 000_config copied ===
    102  * These are stored in the models of the co-application thus they will run as the selector screen is submitted.
    103 
    104 === The forms for each setting is displayed ===
    105   * these forms are generated using index
    106   * there results are postulated using request.post_vars
    107 
    108 === The dict extracted from 000_config is writen to 000_config with the correct values ===
    109   * This process is done in write_out ()
    110 
    111 === In the process I am also generating a method for creating new Eden without Network Access ===
    112  
     4''tbc''