I hope you get this email.
I started working on this and I have the basics working.
This attached jar is beta15.3 and it should accept your arguments.
I think you might need to call the invoke method with the necessary uri
like:
filename="file":fileformat="file format":dateformat="date
format":importaccount="my account"
or I made it so you can leave off the enclosing " " like:
filename=filepath:fileformat=file format:dateformat=date
format:importaccount=my account
@Override
public void invoke( String uri )
{
StringTokenizer tokenizer = new StringTokenizer( uri, ":" );
HashMap argsHM = new HashMap();
I am not sure how you actually call other extensions.
If you do not want to get the importer jar file this way, let me know
and I can
put it here: http://code.google.com/p/mdcsvimporter/issues/detail?id=10
Thanks,
Stan Towianski
I uploaded a new beta 15.3 jar file that you should be able to work with
and pass the arguments below to.
This is a new build that includes a custom configurable reader manager
so you can define your own readers. It also has other enhancements like
the ability to be called by the "Import List" extension to auto-process
a selected file.
http://code.google.com/p/mdcsvimporter/downloads/list
Stan Towianski
On 10/19/2011 08:35 AM, Hello World wrote:
//filename="file"&fileformat="file format"&dateformat="date
format"&importaccount="my account"
//deletecsvfileflag&importtype="online|regular"
I don't know if anyone else is calling mdcsvimporter like you are so I
changed the
delimiter to &. Will that work for you? I should have thought about :
in the windows filename :-)
> 2: If no importaccount specified in the options, mdcsvimporter would
> use the previous imported account.
> : It should display the mdcsvimporter dialog instead.
DONE.
This is a matter of preference though. For me I am always importing
into the same temporary account so it was ok for me, but I changed
it for now to the way you wanted it.
OK. There is a default for this for developers for mdcsvimporter,
but if you already got around it, good for you! I would have thought
that was a pain to figure out!
> Thanks again Stan
>
I will upload this version as beta15.4
Stan Towianski
thank you for your message. As far as the Import List extension is concerned, it invokes the txtimport extension using the URI scheme moneydance:fmodule:txtimport:?file=/path/to/file/to/import, which is similar to the standard schemes given at http://moneydance.com/dev/urischeme. I parameterized the txtimport extension in build number 8 (see http://code.google.com/p/moneydance/source/list).
In my opinion, the Import List extension itself must *not* make any assumptions about which extension handles the import of CSV files. Rather, the user should decide on that by installing the CSV import extension of his/her choice. The Moneydance "framework" would then dispatch the "moneydance:fmodule:txtimport" call to the installed extension at runtime (i.e. either to the txtimport extension or to the mdcsvimporter extension).
Thus, I would suggest the mdcsvimporter extension complies with the existing "moneydance:fmodule:txtimport" URI scheme of the txtimport extension (and vice versa) with additional parameters. A universal URI scheme could look like this:
moneydance:fmodule:txtimport:?file=/path/to/file/to/import&fileformat=fileformat&dateformat=dateformat&importaccount=myaccount&deletecsvfile=1&importtype=online
The Import List extension (or any other caller) could fill in and pass the required parameters (such as the filename for now). Whatever CSV extension responds to the call is then responsible for handling (or ignoring) the parameters. The main advantage of this approach would be loose coupling of the extensions.
What do you think? More ideas?
Flow
Hello Stan, hello World, thank you for your message. As far as the Import List extension is concerned, it invokes the txtimport extension using the URI scheme moneydance:fmodule:txtimport:?file=/path/to/file/to/import, which is similar to the standard schemes given at http://moneydance.com/dev/urischeme. I parameterized the txtimport extension in build number 8 (see http://code.google.com/p/moneydance/source/list). In my opinion, the Import List extension itself must *not* make any assumptions about which extension handles the import of CSV files. Rather, the user should decide on that by installing the CSV import extension of his/her choice. The Moneydance "framework" would then dispatch the "moneydance:fmodule:txtimport" call to the installed extension at runtime (i.e. either to the txtimport extension or to the mdcsvimporter extension).
Thus, I would suggest the mdcsvimporter extension complies with the existing "moneydance:fmodule:txtimport" URI scheme of the txtimport extension (and vice versa) with additional parameters. A universal URI scheme could look like this: moneydance:fmodule:txtimport:?file=/path/to/file/to/import&fileformat=fileformat&dateformat=dateformat&importaccount=myaccount&deletecsvfile=1&importtype=online
The Import List extension (or any other caller) could fill in and pass the required parameters (such as the filename for now). Whatever CSV extension responds to the call is then responsible for handling (or ignoring) the parameters. The main advantage of this approach would be loose coupling of the extensions. What do you think? More ideas? Flow
I do not know how to get your code or mxt files. Did you commit the code?
I downloaded a zip file and made the 2 code file changes you
mentioned, but it did not work for me.
I built your code with: ant importlist and that worked.
The importlist.mxt file has your properties file with my
change in it, but when I load the *.mxt file in MD, and
I click on a *.csv file, it opens up 'text file importer' and
not mdcsvimporter.
By the way, I did not find:
File: src\com\moneydance\modules\features\quickimport\io
\FileAdmin.java
but found FileAdmin.java at:
..../my-flow-importlist-b907a4a/src/com/moneydance/modules/features/importlist/io/
Thanks,
Stan Towianski
Hi,
I will try this later in the morning.
1.) I was thinking you might have a drop down that would let the user choose like
Use: text file importer
Import csv file
2.) I said before that I made the arguments to be not case sensitive, so you can use either 'fileformat' or 'FileFormat'. Is that what you wanted also?
Thanks,
Stan
--
You received this message because you are subscribed to the Google Groups "mdcsvimporter" group.
To post to this group, send email to mdcsvi...@googlegroups.com.
To unsubscribe from this group, send email to mdcsvimporte...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mdcsvimporter?hl=en.
Right, I am confused by who you guys are. Thanks for saying something :-)
Ok, I will check, but I think I am only ignoring case for the argument name, not the value, so I should be good.
Thanks,
Stan Towianski
Although "Hello World" seems to be completing his integration quest, let me clarify some general points I made earlier on how importlist and mdcsvimporter could possibly interact. I suspect you misunderstood my previous suggestion on the common interface of mdcsvimporter and txtimport. The main idea is that mdcsvimporter should use the interface
moneydance:fmodule:txtimport:?file=/path/to/file/to/import&...
Please note the "txtimport" part (*not* "mdcsvimporter" as it is currently implemented) which is the same as in the txtimport extension. This means that importlist could call both extensions (mdcsvimporter and txtimport) using the *exact same* call with the *exact same* arguments. There's no need for importlist to choose which of the two extensions should be called (no drop down, no radio button, no settings) because the user would install only one of the two extensions that can handle CSV files. By complying with the exact same interface, the moneydance:fmodule:txtimport call would be forwarded to the one extension that is installed (either mdcsvimporter or txtimport).
So importlist creates only *one* URI call (which uses *one* URI scheme with the *same* arguments for both extensions) and the Moneydance "framework" forwards this URI call to the one extension that is installed.
Cheers,
Flow
Hmmm. I thought "disguise9" sent me the link to the new code*.zip,
but I thought you are not much on Java, and I am still confused on
which of you is doing what. My thunderbird email working with gmail
seems to suck too as I am not always able to find my emails and
a couple of inbox emails showed up in 'sent' mail. very strange.
Anyways, I made a quick change on my part to take arg: 'file' instead
of 'filename' if that matters. I see someone was passing me 'filename'
successfully though.
Now there is a problem with the args I am getting. They are not correct:
Java: 1.6.0_25 (Sun Microsystems Inc.)
uri string
=filename=/home/stowians/Downloads/aa-test.csv&fileformat=aa-test&importaccount=aa-test&importtype=online=
arg token [0] =filename= token[1] =/home/stowians/Downloads/aa-test.csv=
arg key =filename= value =/home/stowians/Downloads/aa-test.csv=
arg token [0] =fileformat= token[1] =aa-test=
arg key =fileformat= value =aa-test=
arg token [0] =importaccount= token[1] =aa-test=
arg key =importaccount= value =aa-test=
arg token [0] =importtype= token[1] =online=
arg key =importtype= value =online=
What happened here?
Thanks,
Stan Towianski
>>>>> delimiter to&. Will that work for you? I should have thought about : in the windows filename :-)
Who is actually modifying the importlist java code, you or Florian??
The problem below is only the 'file' and the hardcoded
'importtype=online' args
are correct. The other ones are wrong.
fileformat=aa-test<-- these are both passing the filename which is incorrect
&importaccount=aa-test
This is probably where it is happening?
if (this.textFileFilter.accept(file)) {
callUri = this.prefs.getTextFileImportUriPrefix()
+ file.getAbsolutePath() + "&fileformat=" +
file.getName().replaceFirst("[.][^.]+$", "") + "&importaccount=" +
file.getName().replaceFirst("[.][^.]+$", "") + "&importtype=online";
}
Do you both work on this code or what parts do you each handle?
Thanks,
Stan
In looking at your importlist window again, you are not asking
the user for the 'fileformat' or the 'importaccount' or the optional
'deletecsvfileflag' (if this argument exists, it is true), so how can
you pass any of them to me! :-)
Thanks,
Stan
I see disguise9 changed a property:
# The prefix of the application event that imports a given CSV file using
# the text file importer plugin.
text_file_import_uri_prefix = moneydance:fmodule:mdcsvimporter:file=
to make it call mdcsvimporter and that works now.
I have not looked into much about how MD extensions work
up to this point. Would I have to change something in mdcsvimporter
to say "I implement " moneydance:fmodule:txtimport: interface
...?file=/path/to/file/to/import&...
and would that conflict in a source code tree somewhere with "text file
importer"?
Would I have to change java package paths or something in our code?
How does this work?
Thanks,
Stan Towianski
Stan Towianski
BETA 15.5
added &processflag arg if you want to have it autoprocess as in from
"input list" extension.
played with arguments processing code. Tried to have it bring up less
error dialog boxes
when not needed.
Made a pretty significant change to duplicate catching. Added another 2
hashSets for
matching on FITxnId for protocolId = 1 and 999 (mine). This should get
rid of duplicates
that were coming when you imported twice; especially once with type
online and then with regular
or vice versa.
I would think that in importlist, you could do what I mentioned before
and put a drop-down list if you want, listing text file importer and
mdcsvimporter
and let people pick if you install both.
disguise9, if you leave off arguments that you know will be wrong and
just pass:
&file=xxx&processflag&importType=online
it won't give you unnecessary error dialog messages.
Thanks,
Stan Towianski
1.) A couple of flags (processFlag and deleteCsvFileFlag) only have to exist
to be used. That's why I put the name 'flag' on the end of them to try to
help with understanding. So, they do not need a value like the other args:
no: &processFlag=xxx (but it would work also) just &processFlag
and this is like pressing the "Process" button.
If you do not use it, it just brings up the importDialog.
2.)
if (this.textFileFilter.accept(file)) {
callUri = this.prefs.getTextFileImportUriPrefix()
+ file.getAbsolutePath() + "&processFlag&fileformat=Savings
Account&importAccount=Savings Account&importType=online";
}
works for me. You have to have a fileformat and an importaccount both
call "Savings Account"
and if you do, it will work. I know you used a regex before. If I could
find that code, I would try it,
but I think it would work. I was going to look at these some more, but I
wanted to fix
the duplicates matching too.
If you tell it to use something invalid, I want to pop up a window to
let you know. That is my thought.
If the importaccount and fileformat exist, it will work without giving
you a pop up window.
Do they exist for you?
3.) by saying "leave off arguments", i mean you can do just:
callUri = this.prefs.getTextFileImportUriPrefix()
+ file.getAbsolutePath()
and it will fill in your filename and the bring up the importDialog window
4.) I like some of your suggestions. I do need to use the same terms,
like either "custom reader" or "file format", but not both :-)
I will look at the rest of your suggestions later.
Thanks for your work too. You are very helpful!
Stan Towianski
>> added&processflag arg if you want to have it autoprocess as in from
I was thinking of doing that for you, but as I mentioned, I moved
to working on the duplicates. So, I just now added this new flag
for you and you can use it this way:
+ file.getAbsolutePath() + "&fileformat="
+ file.getName().replaceFirst("[.][^.]+$", "") + "&importaccount="
+ file.getName().replaceFirst("[.][^.]+$", "") +
"&importtype=online&NoPopErrorsFlag&ProcessFlag";
I have not put out a build yet, because I might do a couple of other
things first.
I will let you know when it is out there.
Thanks,
Stan Towianski
I just did some of these changes, plus you should be able
to use the new arg: &NoPopErrorsFlag
Another big change has to do with managing the 'Date' format settings.
Check yours before using.
Thanks,
Stan Towianski
On 10/30/2011 06:15 AM, Hello World wrote:
Hi,
Does my file work if you rename it to simply mscsvimporter.mxt before you install it?
Dumbness in the install I think.
That it what your rebuild names it.
Let new know.
Stan Towianski
--
You received this message because you are subscribed to the Google Groups "mdcsvimporter" group.
To post to this group, send email to mdcsvi...@googlegroups.com.
To unsubscribe from this group, send email to mdcsvimporte...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mdcsvimporter?hl=en.