Import Plugin: custom columns don't work
Import Plugin: custom columns don't work
Petko, I need a little bit of help from your side, because I'm not successful with importing custom columns.
Some details:
The custom columns are created in the topic, but they are not filled with the corresponding values for each document.
The values for the built-in attributes like Title, DateCreated, Priority etc. are all filled.
I supply the values for the custom columns to document->ColumnValues as a string, e.g. "Felix\nFelix2\Felix3\n" and in exactly the same order as they were defined in ImportCustomColumn.
I made a lot of tests, but can't get it working, even with only one column.
What makes me suspicious is that the csv import you provide works well with custom columns.
Am I doing something wrong, or is it a problem with the SDK ?
If you need the plugin and test data please let me know.
For the moment I'm stuck...
Felix
Some details:
The custom columns are created in the topic, but they are not filled with the corresponding values for each document.
The values for the built-in attributes like Title, DateCreated, Priority etc. are all filled.
I supply the values for the custom columns to document->ColumnValues as a string, e.g. "Felix\nFelix2\Felix3\n" and in exactly the same order as they were defined in ImportCustomColumn.
I made a lot of tests, but can't get it working, even with only one column.
What makes me suspicious is that the csv import you provide works well with custom columns.
Am I doing something wrong, or is it a problem with the SDK ?
If you need the plugin and test data please let me know.
For the moment I'm stuck...
Felix
Felix, I have to make some tests and will let you know if the problem is in MyInfo or in the plugin.
I am sorry that this took so long!
I am trying to reproduce this problem, but it works ok with my file. What development tool do you use for your plugin? If it is C++Builder or Delphi, do you supply the custom values as this:
I am trying to reproduce this problem, but it works ok with my file. What development tool do you use for your plugin? If it is C++Builder or Delphi, do you supply the custom values as this:
Code: Select all
StrCopy(document->ColumnValues, "2001-01-12T12:45:00\n\0");
I'm using the LCC C-Compiler for the plugin. Here is the code snippet:
I just tested again with one simple custom attribute. The attribute is created, but it is empty.
The value of the custom attribute was "Felix". As you can see from the snippet I log the value. Here is what I got in the log file:
As you can see in the last line, "Felix" is terminated by a carriage return / line feed (x0D0A).
Seems correct to me. What do you think ?
Code: Select all
//-- Fill in all MyInfo custom attributes in the correct sequence:
document->ColumnValues[0] = '\0';
for (int i = 0; i < gCustomAttribMax; i++)
{
//-- check that maximum capacity of ColumnValues is not exceeded
if (10001 > strlen(document->ColumnValues) + strlen(gCustomAttribs[i].value) + 1)
{
strcat(document->ColumnValues, gCustomAttribs[i].value);
strcat(document->ColumnValues, "\n");
}
else
{
sprintf(logMsg, "ERROR: Custom attributes exceed size limit in MyInfo. Import aborted.");
writeLog(logMsg, LOG_LEVEL_LOW);
ERROR_MESSAGEBOX(logMsg);
return RE_ERROR;
}
}
sprintf(logMsg, "document->ColumnValues='%s'",document->ColumnValues);
writeLog(logMsg, LOG_LEVEL_HIGH);
The value of the custom attribute was "Felix". As you can see from the snippet I log the value. Here is what I got in the log file:
Code: Select all
[668@asksam_import] Import started: 01/30/11 - 22:10:59
[766@asksam_import] ImportDocument()
[790@asksam_import] Inserting empty top level document: 'Imported 01/30/11 - 22:10:59'
[792@asksam_import] ---------------------------------------------------------------------------------------------------
[766@asksam_import] ImportDocument()
[798@asksam_import] Document #1
[285@asksam_import] MyInfo.First line=' Title[ Fischsuppe für Nichtschwimmer'
[285@asksam_import] MyInfo.Title='Fischsuppe für Nichtschwimmer'
[879@asksam_import] Allocated memory size in MyInfo: 2441
[936@asksam_import] document->ColumnValues='Felix
'
Seems correct to me. What do you think ?
Petko,
the import plugin for askSam is basically finished (the plain text version).
I planned to continue working on it to enable RTF as import format as well, because I think that most people would like to keep their formatting as far as possible.
Before I do that I have to get the custom columns working, because testing is now severely hampered by the lack of it: every askSam database I have would make use of it.
I would suggest the following: I send you the plugin and a test case. I assume you could then debug my return values in MyInfo and tell me whether I did something wrong, or if there is a glitch within MyInfo.
Would that be ok for you ?
Felix
the import plugin for askSam is basically finished (the plain text version).
I planned to continue working on it to enable RTF as import format as well, because I think that most people would like to keep their formatting as far as possible.
Before I do that I have to get the custom columns working, because testing is now severely hampered by the lack of it: every askSam database I have would make use of it.
I would suggest the following: I send you the plugin and a test case. I assume you could then debug my return values in MyInfo and tell me whether I did something wrong, or if there is a glitch within MyInfo.
Would that be ok for you ?
Felix
Felix, yes, this will be the best scenario, because I will be able to debug it and see where the import fails.
Just sent you a mail for the test !
Thanks, Felix, I will test it and let you know what causes the custom column import problems.
Is this asksam export - import to myinfo okay. If so where would one find it pl
I just have regular text pages in AS 6.1 with no columns, no pix etc.
Thanks
oz
I just have regular text pages in AS 6.1 with no columns, no pix etc.
Thanks
oz
Yes, we've figured out what the problem was. I still have to do final testing on the text import version of the plugin before I can release it. I will post it on the forum as soon as it is available. And for sure you're welcome to tell me whether the thing works with your files 

Thank you.
Yes my AskS is only a collection of about 2500 blank pages with regular text in them. There may be some bold, colour etc, but it is not important at this stage. Really just want to get the pages over.
I'll give you a runnung commentary..
Have a good day/night..
oz
in Sydney Oz
Yes my AskS is only a collection of about 2500 blank pages with regular text in them. There may be some bold, colour etc, but it is not important at this stage. Really just want to get the pages over.
I'll give you a runnung commentary..

Have a good day/night..
oz
in Sydney Oz