Changes between Initial Version and Version 1 of BluePrint/WebSetup


Ignore:
Timestamp:
04/26/11 17:35:31 (10 years ago)
Author:
anubhav
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • BluePrint/WebSetup

    v1 v1  
     1[[TOC]]                         
     2= WEB SETUP IMPLEMENTATION (Detail)=
     3
     4== '''MODULES'''''''
     5   
     6=== Layout.py ===
     7==== Dict of settings ====
     8
     9We will copy this file from Eden ( s3cfg can be changed to generated this file during its run )into the modules of Web Setup and make it run. These would be locally imported in the Models so they will be executed first:
     10             “categary”.”field_id”
     11                   
     12Like:-
     13{{{
     14#!python
     15 Settings = {"databse.db_type" : {"nice_name" :T("Database"),
     16                                  "description":T("Database Type: "),
     17                                  "input_type":"select",
     18                                  "options":['sqlite', 'sql', 'mysql'],
     19                                  "jquery_validation_requirements”: "required lettersonly"
     20                                 },
     21             #and similarly other options for language can be set
     22            }
     23       
     24}}}
     25
     26These are really useful for views as this provide the information regarding input type, the value to select from, the field name and the validation requirement. These layouts are mostly for the views. Some of these like port will also contain a validation field for the range of accepted values.
     27
     28==== Change in s3nfig to generate the dict shown above ====
     29
     30{{{
     31
     32changing s3cfg to generate this dict
     33
     341. Write
     35    a."settings = {" in the starting of the dict
     36    b.settings_type + "." + settings_name in each get function
     37    c.also specify the details like input type over there.
     38   
     39
     40}}}
     41
     42Thus only s3cfg will contain all the dict .
     43
     44After gsoc we can also change s3cfg in the starting to generate 000_config if it is the first time of run
     45
     46==== Dict of Modules ====
     47
     48
     49These needs to store the names of the modules:-
     50
     51{{{
     52#!python
     53modules = {
     54      "default":True,
     55      "admin":True,
     56      "gis":True,
     57}
     58#true meaning "on"
     59}}}
     60
     61Here the “on” indicate that the default value of the module status is on.
     62
     63In the modules the layout is not required, as they are stored when we run the modified form of 000_config in the models. The input types of these (name, Description, Access level) are quite fixed so they need not to be stored separately. Therefore not much help is required for the views to.
     64== '''MODELS''' ==
     65===     1st_run.py                                            (This will run before the modified version of 000_config) ===
     66
     67
     68==== Session variable : session.path_to_config ====
     69This will initialize a session variable that will help us get the status of the selector. If the session variable is “none” we can initialize it to “”,    and later in the controller it can be set to the path of 000_config of that particular eden they want the to the web-setup to run on.
     70This session variable will help us to get the path of the 000_config from the controllers.
     71
     72==== Parsing 000_config.py ====
     73
     74Once we get the path of 000_config we need to copy that file in the websetup models by the the name of modified_config.py so that it shall run after this file closes. Now open modified_config using os.path.join in the “w” mode and 000_config in the “r” mode. We need to read 000_config and
     75This would result in the creation of 2 dicts one is deployment_settings and the other one is for the modules  deployment_settings.modules .Now 6th and 7th steps will help us to maintain the dicts for modules that were turned off by commenting them.
     76{{{
     77#!html
     78<p class=MsoListParagraphCxSpMiddle style='margin-left:0cm'>---------------------------------------------------------------------------------------------------------------------------------------------------------</p>
     79<p style='color:#595959'>1.Remove the line containing <b>“s3base.s3config(” </b>from
     80the starting of the file</p>
     81
     82<p class=MsoListParagraphCxSpMiddle style='margin-left:0cm'><span
     83style='color:#595959'>&nbsp;</span></p>
     84
     85<p class=MsoListParagraphCxSpMiddle style='margin-left:0cm'><span
     86style='color:#595959'>2. Insert </span></p>
     87
     88<p class=MsoListParagraphCxSpMiddle style='margin-left:0cm'><b><span
     89style='color:#595959'>“ from gluon.storage import Storage</span></b></p>
     90
     91<p class=MsoListParagraphCxSpMiddle style='margin-left:0cm'><b><span
     92style='color:#595959'>from gluon.contrib.simplejson.ordered_dict import
     93OrderedDict</span></b></p>
     94
     95<p class=MsoListParagraphCxSpMiddle style='margin-left:0cm'><b><span
     96style='color:#595959'>deployment_settings = Storage( “</span></b><span
     97style='color:#595959'>   </span></p>
     98
     99<p class=MsoListParagraphCxSpLast style='margin-left:0cm'><span
     100style='color:#595959'>before the first line where they find  “deployment_settings.”
     101Without a “<b>#</b>”  in the 000_config.py           </span></p>
     102
     103<p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span
     104style='color:#595959'>3. And add <b>“ ) ”</b> Immediately before the import of
     105storage and remove the import of storage from there </span></p>
     106
     107<p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span
     108style='color:#595959'>&nbsp;</span></p>
     109
     110<p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span
     111style='color:#595959'>4. Add 4 spaces to each line between “<b>Storage(</b>“
     112and “<b>)</b>” even the commented ones </span></p>
     113
     114<p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span
     115style='color:#595959'>&nbsp;</span></p>
     116
     117<p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span
     118style='color:#595959'>5<b>.</b> Make the following to the lines except the ones
     119containing “#” before the use of “<b>deployment_settings.</b>”  </span></p>
     120
     121<p class=MsoListParagraphCxSpFirst style='margin-bottom:0cm;margin-bottom:.0001pt;
     122text-indent:-18.0pt'><span style='font-family:Wingdings;color:#595959'>v<span
     123style='font:7.0pt "Times New Roman"'>&nbsp; </span></span><span
     124style='color:#595959'>Wrap each word containing “<b>deployment_settings.</b>”
     125with “” </span></p>
     126
     127<p class=MsoListParagraphCxSpLast style='margin-bottom:0cm;margin-bottom:.0001pt;
     128text-indent:-18.0pt'><span style='font-family:Wingdings;color:#595959'>v<span
     129style='font:7.0pt "Times New Roman"'>&nbsp; </span></span><span
     130style='color:#595959'>Add a  <b>“,”(coma)</b> after the line </span></p>
     131
     132<p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span
     133style='color:#595959'> </span></p>
     134
     135<p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span
     136style='color:#595959'>6. Check if the    </span></p>
     137
     138<p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><b><span
     139style='color:#595959'>“&lt;?module_name?&gt; = Storage( \n” </span></b><span
     140style='color:#595959'>has a “#” in the same line then turn </span></p>
     141
     142<p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span
     143style='color:#595959'>module[module_name] ( variable in layout.py in modules
     144)   off .</span></p>
     145
     146<p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span
     147style='color:#595959'> </span></p>
     148
     149<p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span
     150style='color:#595959'>7<b>.</b>Remove “#” from there till the line you get <b>“#),”
     151</b></span></p>
     152
     153<p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'>----------------------------------------------------------------------------------------------------------------------------------------------------------</p>
     154
     155}}}
     156==== Handling database conflicts ====
     157There should be a list that will keep a list of databse_name and database_types of 2 eden application cannot be same at same time therefore a list of database types and databse names  needs to be made
     158
     159*       For this we will first have to generate a list paths .We can search for “Copyright: 2010 (c) Sahana Software Foundation” in all the LICENSE files of applications.
     160 
     161Then we will have to search in the list of paths for specific keywords like “deployment_setting.database.database” This can be done using regex command in grep
     162
     163{{{
     164
     165If  path(variable) is in the list of paths containing:
     166    Command_line = “grep ” +  “deployment_setting.database.database” + “path”
     167    Line = subprocess.Popen(command_line);
     168
     169}}}
     170
     171Now search the file for deployment_settings.database.db_type .These list will help in validating for the database values.
     172 
     173=== modified_config.py                                                       (Parsed Version OF  000_config.py ) ===
     174
     175It will initialize and define the dict for all the settings and the modules of whose we have mentioned before. 
     176This part of the code has not been done before. I expect to take a week at max. to complete this code.
     177
     178
     179== '''CONTROLLERS''' ==
     180=== default.py ===
     181     
     182==== Def selector(): ====
     183If the session variable of the path is not set then I redirect the user from the index function to this function of the controller.
     184*       I will access the list of paths generated in the models while solving the database conflicts
     185*       And then there is a drop down menu to select the path ( the user will select the name, I will retrieve the path using the request.post_vars in the form.accepts and then set the path accordingly).We can create forms using  SELECT() function for the dropdown and FIELDSET() for creating a filed in the form
     186
     187*       This function will also contain a field for creating a new eden
     188Selector will also contain an option for creating new eden . This should be need no network excess, I will execute statement by “exec” for copying the files from the existing eden to a new eden with a new name.
     189I will copy all the files except a few files like database logs, session and some other which are developed after you run the first time. After the script has run successfully
     190
     191This part of the code should not take more than 4 days to code.
     192
     193
     194==== Def index(): ====
     195If the session variable is set then this part is executed. The main purpose of this is to create forms according to the needs. We will have a submit ,back and next button on the every form .
     196
     197There should be a login form that would verify that admin is making changes in the settings. For this we will have to contact the database of the selected Eden.
     198
     199The TABLE() function will be extremely useful for setting the user interface and SELECT() function for defining dropboxes. INPUT() will help us define check boxes and other input types. All the fields stored in modules for every setting will be sent to the user using INPUT() (jquery validation requirement, input type and default value ) and FIELDSET(for field id  and the keys of the,  setting variable are extremely important here)
     200* Module Forms:
     201[[BR]]
     202
     203{{{
     204#!html
     205
     206<table class=MsoTableGrid border=1 cellspacing=0 cellpadding=0
     207 style='border-collapse:collapse;border:none'>
     208 <tr>
     209  <td width=297 valign=top style='width:178.0pt;border:solid windowtext 1.0pt;
     210  padding:0cm 5.4pt 0cm 5.4pt'>
     211  <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
     212  normal'><span style='color:#0D0D0D'>Module name</span></p>
     213  </td>
     214  <td width=297 valign=top style='width:178.05pt;border:solid windowtext 1.0pt;
     215  border-left:none;padding:0cm 5.4pt 0cm 5.4pt'>
     216  <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
     217  normal'><span style='color:#0D0D0D'>&nbsp;</span></p>
     218  <table class=MsoTableGrid border=1 cellspacing=0 cellpadding=0
     219   style='border-collapse:collapse;border:none'>
     220   <tr>
     221    <td width=278 valign=top style='width:166.5pt;border:solid windowtext 1.0pt;
     222    padding:0cm 5.4pt 0cm 5.4pt'>
     223    <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;
     224    line-height:normal'><span style='color:#0D0D0D'>Checkboxes for access level
     225    </span></p>
     226    </td>
     227   </tr>
     228   <tr>
     229    <td width=278 valign=top style='width:166.5pt;border:solid windowtext 1.0pt;
     230    border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
     231    <p class=MsoListParagraph style='margin-top:0cm;margin-right:0cm;
     232    margin-bottom:0cm;margin-left:18.0pt;margin-bottom:.0001pt;text-indent:
     233    -18.0pt;line-height:normal'><span style='font-family:"Courier New";
     234    color:#0D0D0D'>o<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp; </span></span><span
     235    style='color:#0D0D0D'>Admin</span></p>
     236    </td>
     237   </tr>
     238   <tr>
     239    <td width=278 valign=top style='width:166.5pt;border:solid windowtext 1.0pt;
     240    border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
     241    <p class=MsoListParagraph style='margin-top:0cm;margin-right:0cm;
     242    margin-bottom:0cm;margin-left:18.0pt;margin-bottom:.0001pt;text-indent:
     243    -18.0pt;line-height:normal'><span style='font-family:"Courier New";
     244    color:#0D0D0D'>o<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp; </span></span><span
     245    style='color:#0D0D0D'>Anonymous </span></p>
     246    </td>
     247   </tr>
     248   <tr>
     249    <td width=278 valign=top style='width:166.5pt;border:solid windowtext 1.0pt;
     250    border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
     251    <p class=MsoListParagraph style='margin-top:0cm;margin-right:0cm;
     252    margin-bottom:0cm;margin-left:18.0pt;margin-bottom:.0001pt;text-indent:
     253    -18.0pt;line-height:normal'><span style='font-family:"Courier New";
     254    color:#0D0D0D'>o<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp; </span></span><span
     255    style='color:#0D0D0D'>Only Division users</span></p>
     256    </td>
     257   </tr>
     258   <tr>
     259    <td width=278 valign=top style='width:166.5pt;border:solid windowtext 1.0pt;
     260    border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
     261    <p class=MsoListParagraph style='margin-top:0cm;margin-right:0cm;
     262    margin-bottom:0cm;margin-left:18.0pt;margin-bottom:.0001pt;text-indent:
     263    -18.0pt;line-height:normal'><span style='font-family:"Courier New";
     264    color:#0D0D0D'>o<span style='font:7.0pt "Times New Roman"'>&nbsp;&nbsp; </span></span><span
     265    style='color:#0D0D0D'>None </span></p>
     266    </td>
     267   </tr>
     268  </table>
     269  <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
     270  normal'><span style='color:#0D0D0D'> </span></p>
     271  </td>
     272  <td width=297 valign=top style='width:178.05pt;border:solid windowtext 1.0pt;
     273  border-left:none;padding:0cm 5.4pt 0cm 5.4pt'>
     274  <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
     275  normal'><span style='color:#0D0D0D'>                        ?help</span></p>
     276  </td>
     277 </tr>
     278 <tr>
     279  <td width=297 valign=top style='width:178.0pt;border:solid windowtext 1.0pt;
     280  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
     281  <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
     282  normal'><span style='color:#0D0D0D'>Module nice name</span></p>
     283  </td>
     284  <td width=297 valign=top style='width:178.05pt;border-top:none;border-left:
     285  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
     286  padding:0cm 5.4pt 0cm 5.4pt'>
     287  <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
     288  normal'><span style='color:#0D0D0D'>Textbox </span></p>
     289  <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
     290  normal'><span style='color:#0D0D0D'>(with correct width)</span></p>
     291  </td>
     292  <td width=297 valign=top style='width:178.05pt;border-top:none;border-left:
     293  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
     294  padding:0cm 5.4pt 0cm 5.4pt'>
     295  <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
     296  normal'><span style='color:#0D0D0D'>&nbsp;</span></p>
     297  </td>
     298 </tr>
     299 <tr>
     300  <td width=297 valign=top style='width:178.0pt;border:solid windowtext 1.0pt;
     301  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
     302  <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
     303  normal'><span style='color:#0D0D0D'>Module Description </span></p>
     304  </td>
     305  <td width=297 valign=top style='width:178.05pt;border-top:none;border-left:
     306  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
     307  padding:0cm 5.4pt 0cm 5.4pt'>
     308  <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
     309  normal'><span style='color:#0D0D0D'>Textbox</span></p>
     310  <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
     311  normal'><span style='color:#0D0D0D'>(with correct width)</span></p>
     312  </td>
     313  <td width=297 valign=top style='width:178.05pt;border-top:none;border-left:
     314  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
     315  padding:0cm 5.4pt 0cm 5.4pt'>
     316  <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
     317  normal'><span style='color:#0D0D0D'>&nbsp;</span></p>
     318  <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
     319  normal'><span style='color:#0D0D0D'>&nbsp;</span></p>
     320  </td>
     321 </tr>
     322 <tr>
     323  <td width=297 valign=top style='width:178.0pt;border:solid windowtext 1.0pt;
     324  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
     325  <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
     326  normal'><span style='color:#0D0D0D'>&nbsp;</span></p>
     327  <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
     328  normal'><span style='color:#0D0D0D'>BACK(after the last module)</span></p>
     329  <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
     330  normal'><span style='color:#0D0D0D'>&nbsp;</span></p>
     331  </td>
     332  <td width=297 valign=top style='width:178.05pt;border-top:none;border-left:
     333  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
     334  padding:0cm 5.4pt 0cm 5.4pt'>
     335  <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
     336  normal'><span style='color:#0D0D0D'>&nbsp;</span></p>
     337  <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
     338  normal'><span style='color:#0D0D0D'>NEXT(after the last  module)</span></p>
     339  </td>
     340  <td width=297 valign=top style='width:178.05pt;border-top:none;border-left:
     341  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
     342  padding:0cm 5.4pt 0cm 5.4pt'>
     343  <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
     344  normal'><span style='color:#0D0D0D'>&nbsp;</span></p>
     345  <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
     346  normal'><span style='color:#0D0D0D'>SAVE AND QUIT(after the last module )</span></p>
     347  </td>
     348 </tr>
     349</table>
     350
     351}}}
     352
     353* There will be similar forms for the settings; however I would like to have separate forms for different categories of settings. Like thsese:-
     354[[BR]]
     355
     356{{{
     357#!html
     358
     359<table class=MsoTableGrid border=1 cellspacing=0 cellpadding=0
     360 style='border-collapse:collapse;border:none'>
     361 <tr>
     362  <td width=328 valign=top style='width:196.8pt;border:solid windowtext 1.0pt;
     363  padding:0cm 5.4pt 0cm 5.4pt'>
     364  <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
     365  normal'><span style='color:#0D0D0D'>SETTINGS CATEGORY</span></p>
     366  </td>
     367  <td width=260 valign=top style='width:155.9pt;border:solid windowtext 1.0pt;
     368  border-left:none;padding:0cm 5.4pt 0cm 5.4pt'>
     369  <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
     370  normal'><span style='color:#0D0D0D'>(before the first setting only)</span></p>
     371  </td>
     372  <td width=302 valign=top style='width:181.4pt;border:solid windowtext 1.0pt;
     373  border-left:none;padding:0cm 5.4pt 0cm 5.4pt'>
     374  <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
     375  normal'><span style='color:#0D0D0D'>&nbsp;</span></p>
     376  </td>
     377 </tr>
     378 <tr>
     379  <td width=328 valign=top style='width:196.8pt;border:solid windowtext 1.0pt;
     380  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
     381  <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
     382  normal'><span style='color:#0D0D0D'>Setting name</span></p>
     383  </td>
     384  <td width=260 valign=top style='width:155.9pt;border-top:none;border-left:
     385  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
     386  padding:0cm 5.4pt 0cm 5.4pt'>
     387  <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
     388  normal'><span style='color:#0D0D0D'>FIELD according to the Input type
     389  required</span></p>
     390  </td>
     391  <td width=302 valign=top style='width:181.4pt;border-top:none;border-left:
     392  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
     393  padding:0cm 5.4pt 0cm 5.4pt'>
     394  <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
     395  normal'><span style='color:#0D0D0D'>                             ?help</span></p>
     396  </td>
     397 </tr>
     398 <tr>
     399  <td width=328 valign=top style='width:196.8pt;border:solid windowtext 1.0pt;
     400  border-top:none;padding:0cm 5.4pt 0cm 5.4pt'>
     401  <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
     402  normal'><span style='color:#0D0D0D'>&nbsp;</span></p>
     403  <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
     404  normal'><span style='color:#0D0D0D'>BACK(after the last one only)</span></p>
     405  <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
     406  normal'><span style='color:#0D0D0D'>&nbsp;</span></p>
     407  </td>
     408  <td width=260 valign=top style='width:155.9pt;border-top:none;border-left:
     409  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
     410  padding:0cm 5.4pt 0cm 5.4pt'>
     411  <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
     412  normal'><span style='color:#0D0D0D'>&nbsp;</span></p>
     413  <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
     414  normal'><span style='color:#0D0D0D'>NEXT(after the last one only)</span></p>
     415  </td>
     416  <td width=302 valign=top style='width:181.4pt;border-top:none;border-left:
     417  none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;
     418  padding:0cm 5.4pt 0cm 5.4pt'>
     419  <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
     420  normal'><span style='color:#0D0D0D'>&nbsp;</span></p>
     421  <p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:
     422  normal'><span style='color:#0D0D0D'>SAVE AND QUIT(after the last on only)</span></p>
     423  </td>
     424 </tr>
     425</table>
     426}}}
     427
     428* ''For adding some text on the  main page''
     429
     430We will just set a text field in the form.  Where he can type anything which he wants to be displayed at the main landing page of eden. I will set a global variable, that later I will write to the file 000_config.Then a division would be created in the index page of eden for displaying simple text.
     431
     432In the form.accepts you will need to set the module values according to the request.post_vars.
     433
     434==== Def write_out(): ====
     435{{{
     436#!html
     437<p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'>This writes
     438data to 000_config</p>
     439
     440<p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'>For this
     441they would need to open the config using os.path.join and write data to the
     442config  in the correct format. </p>
     443
     444<p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'>Like modules
     445needs to be done in this format:-</p>
     446}}}
     447{{{
     448“deployment_settings.modules = Storge(\n” +
     449 
     450#For for all keys
     451“    “ + <?module.key?> "= Storage(\n” +
     452   
     453#For all keys in module.keys
     454“    “  + “    ” + <?keys of module.keys?> + “=” + <?values of their respective fields?> + “,\n” +
     455 
     456"    " + “),\n”              #after module.key
     457 
     458+ “)”                   #for the main
     459}}}
     460{{{
     461#!html
     462
     463<p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'>Writing
     464settings will be much more easier, as they are not stored in dict, somewhat
     465like:-</p>
     466
     467}}}
     468{{{
     469For all keys of settings
     470<?Keys of the settings ?> + “=” + <?values of the respective keys?> “\n”
     471}}}
     472{{{
     473#!html
     474<p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'>I would
     475write default values if any request.post_var returns an invalid value according
     476to the validation.</p>
     477
     478<p class=MsoNormal style='margin-bottom:0cm;margin-bottom:.0001pt'><span
     479style='color:#0D0D0D'>&nbsp;</span></p>
     480}}}
     481
     482== '''VIEWS''' ==
     483
     484Though 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.
     485
     486===     Creating a license page : ===
     487This will be created only if  “FINISHED_EDITING_CONFIG_FILE” is false in the modified_config.py
     488
     489=== Sending Post Method To Get The Arguments To Controllers : ===
     490
     491=== These Will Contain A Static Folder Containing The Css And The  ExtJS: ===
     492
     493This part of the code is almost reusable.
     494
     495== '''WORKFLOW AND SUMMARY''' ==
     496please vist (http://eden.sahanafoundation.org/wiki/GSOCWebSetupArchitectue#WorkflowAndSummary) for this