edit-task
Home
Up
Delete
Task Name:
Task Description:
] export LOCATION as .csv file,
TaskGroup ID:
Start Date:
Start Time:
Duration:
Priority:
Status:
To Do
Completed
In Process
Add Photo:
Owner ID:
Content:
use HTML
Edit Content
<h1 style="text-align: center;">PROJECT - NEW FEATURE</h1> <h1 style="text-align: center;">[ import location(s) as .csv]</h1> <h2>[what]</h2> <ol style="font-size: 10px; font-weight: normal; text-align: start;"> <li>] NEW feature to enable users to import .csv files</li> <ol> <li>] REVIEW existing code (similar) - have existing code in page - view/person, that exports record to file( person record as a .vcf file)</li> <li>] MOVE code to</li> </ol></ol> <h2>[why]</h2> <ol style="font-size: 10px; font-weight: normal; text-align: start;"> <li>] outlook addresses exported to .csv</li> <li>] excel</li> <li>] gmail</li> <li>] many</li> </ol> <h2>[where]</h2> <ol style="font-size: 10px; font-weight: normal; text-align: start;"> <li>]</li> </ol> <h2>[when]</h2> <ol style="font-size: 10px; font-weight: normal; text-align: start;"> <li>]</li> </ol> <h2>[example]</h2> <ol style="font-size: 10px; font-weight: normal; text-align: start;"> <li>]</li> </ol> <h2>[how-to]</h2> <ol style="font-size: 10px; font-weight: normal; text-align: start;"> <li>] user uploads .csv file, in a specified format, ex locations.csv</li> <li>] reads the file</li> <li>] creates location entries for each</li> </ol> <h2>[reference]</h2> <ol style="font-size: 10px; font-weight: normal; text-align: start;"> <li>]</li> </ol><hr /> <h1 style="text-align: center;">developer implementation</h1> <h2>[-process]</h2> <ol> <li> <div><strong>] export "format" required</strong></div> </li> <ol> <li> <div>] name</div> </li> <li> <div>] url</div> </li> <li> <div>] telephone</div> </li> <li> <div>] street1</div> </li> <li> <div>] street2</div> </li> <li> <div>] city</div> </li> <li> <div>] state/province</div> </li> <li> <div>] country</div> </li> <li> <div>] zip/postal</div> </li> <li> <div>]</div> </li> </ol> <li> <div><strong>] overall process outline</strong></div> </li> <ol> <li> <div>] get(file) - user uploads file to server -> use file upload on ?? option - save file on server</div> </li> <li> <div>] read(file)</div> </li> <li> <div>] map line in file</div> </li> <ol> <li> <div>ex {name, address1, address2, city,province,country,postal,telephone,url}</div> </li> <li> <div>convert city name to city code</div> </li> <li> <div>IF city doesnt exist {new city }</div> </li> <li> <div>convert province name to province code</div> </li> <li> <div>convert country name to country code</div> </li> <li> <div>for location (aka parent id ) use "dfault || user specified</div> </li> </ol> <li> <div>] handle empty fields </div> </li> <ol> <li> <div> </div> </li> </ol></ol></ol> <h2>[-notes]</h2> <ol> <li> <div><strong>*] mysql has an input file function </strong></div> </li> <ol> <li> <div>] (BM on android)</div> </li> </ol> <li> <div><strong>*] use 1 insert statement with many values </strong></div> </li> <ol> <li> <div>] VS looping insert statement</div> </li> </ol> <li> <div><strong>] review export person as .vcf</strong></div> <ol> <li> <div>] PAGE view/person - has block of server side code in POST section, code creates file .csv file to download,</div> </li> <li> <div>] have "input type = submit, value=export" - which fires the code post code</div> </li> </ol></li> <li> <div><strong>] new class - exportFile</strong></div> </li> <ol> <li> <div>] moving code from PAGE(view/person) inline into class</div> </li> </ol> <li> <div><strong>] review export-people</strong></div> </li> <ol> <li> <div>] code highlightiing is broken in wm ide, 100+errors,</div> </li> </ol></ol><hr /> <h1 style="text-align: center;">status</h1> <h2>[-previous-]</h2> <ol> <li> <strong> [2015-05-30] view/people -v-005</strong></li> <ol> <li>] -v-005 - new PAGE-version-005 - x] REMOVES code to write file as .vcf</li> </ol> <li><strong>[2015-05-30] fileExport</strong></li> <ol> <li>x] # 5213 - PAGE-CLASS-fileExport</li> </ol></ol> <h2>[-current-]</h2> <ol> <li> <div> ]</div> </li> </ol> <h2>[-next-]</h2> <ol> <li> <div>]</div> </li> </ol> <p> </p> <p> </p> <p> </p> <p> </p> <pre style="background: white; color: black; font-family: Consolas; font-size: 10pt;"> <span style="color: #46830d;">// @place.street1+" "+@place.street2+"</street><locality>"+@city.name_sector+"</locality><region>"+@state.name_map+"</region><code>"+@place.postalORzip+"</code><country>"+@country.name_atlas+"</span> <span style="color: #46830d;">// string text = "fkdfdsfdflkdkfk@dfsdfjk72388389@kdkfkdfkkl@jkdjkfjd@jjjk@"; text = text.Replace("@", "@" + System.Environment.NewLine); </span> <span style="color: #46830d;">// var dataFile = Server.MapPath("/users/vCard4.vcf"); </span> <span style="color: #46830d;">// successfully CREATES the file in the server directory, ] copy file to where i need it</span> <span style="color: #46830d;">// File.WriteAllText(@dataFile, vCard4);</span> <span style="color: #46830d;">// I want to write the file to the response object so the user is prompted to "SaveAs"</span> </pre> <pre style="background: white; color: black; font-family: Consolas; font-size: 10pt;"><span style="color: #46830d;">// TRY 1] response.redirect GET vCard4 file should prompt download of file</span> <span style="color: #46830d;">// WORKS to write the contents of the file to the browser, </span> <span style="color: #46830d;">// Response.Redirect(@Href("~/users/vCard4.vcf"));</span> </pre> <pre style="background: white; color: black; font-family: Consolas; font-size: 10pt;"><span style="color: #46830d;">// TRY 2] writeFile directly to response object </span> <span style="color: #46830d;">// WORK to write the contents of the file to the page, </span> <span style="color: #46830d;">// Response.TransmitFile(@dataFile); </span> <span style="color: #46830d;">// TRY 3] // WORKS to saveAS, PRB = ] filename & .ext cur=page filename and ext, need = custom and .vcf ext</span> <span style="color: #46830d;">/* current function VS this Response.Clear(); Response.ContentType = "text/vcard"; Response.TransmitFile("/users/vCard4.vcf"); // Response.WriteFile("/users/vCard4.vcf"); // ... */</span> </pre> <p> </p> <p> </p>