Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Options GUI #6

Open
wants to merge 28 commits into
base: master
Choose a base branch
from
Open

Conversation

bchoquet-heliopsis
Copy link
Contributor

At last, a long time discussed pull request :)

I tried to make it as simple as possible :

  • each handler's options are defined in sqliimport.ini.append.php
  • on handler selection in admin interface, an AJAX request is made returning an HTML form for handler options
  • form is generated by loading a subtemplate for each option according to its type
  • each subtemplate is responsible for adding a form field named ImportOptions[<option name>] whose value will be stored in database

NB : there is no server side validation for options input but there wasn't either in the textarea version

For complex option input, one can define a YUI3 module to manage his needs and fill in a hidden input field with the computed value. A boilerplate for such a module can be seen in design/admin/javascript/sqliimportsampleoptionmodule.js.

Finally, I added a file option type enabling file upload, validation and storage.

I reckon the code is well commented enough, tell me if you need any more details

@lolautruche
Copy link
Owner

Wow O_O ! This is what I call a pull request :-).
I'll need some time to review it...

Thanks !

@lolautruche
Copy link
Owner

First remark : Please add the licence header to every new file :)

$csvOptions = new SQLICSVOptions( array() );

//extract headers in temp file to ensure fast csv parsing
$f = fopen( $filePath, 'r' );
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not cluster safe !

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method is used to validate file format before storing it on the server. Therefore it must not be cluster aware as it is used on temporary files.

However I'm updating the initialize() method to fetch file from cluster before calling this method.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

@lolautruche
Copy link
Owner

Could you please also add some documentation ? You can make a separate doc file if you wish (markdown format is preferred)

@bchoquet-heliopsis
Copy link
Contributor Author

Alright, I made the changes and redacted the doc. I'm a bit puzzled with markdown syntax though: HTML in code blocks do not appear when viewing file on Github...

class SQLIImportInvalidFileFormatException extends SQLIImportBaseException
{

}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing empty line at end of file

@lolautruche
Copy link
Owner

OK, I think we're good, apart the various notes I left.
Please note that for every file added, you miss an empty line at the end of it.

A rebase is also needed.

Good job ! 👍

@lolautruche
Copy link
Owner

Ping @bchoquet-heliopsis
Can you please fix the left overs and rebase ?
Also, one or two screenshots in the PR description would be nice 😃

Thanks !

@bchoquet-heliopsis
Copy link
Contributor Author

Well I missed your comments from 2 months ago. Longest PR ever, I thought it was dead.
I'll try to find some time but it may not be soon.

@lolautruche
Copy link
Owner

Ping @bchoquet-heliopsis

@bchoquet-heliopsis
Copy link
Contributor Author

Sorry but I definitely don't have time to get back to this right now and it's not a priority at all...
But feel free to make the changes yourself :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants