Page 1 of 1

Import Plugin: custom columns don't work

Posted: Wed Dec 29, 2010 9:40 pm
by mfelix
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

Re: Import Plugin: custom columns don't work

Posted: Thu Dec 30, 2010 2:09 pm
by Petko
Felix, I have to make some tests and will let you know if the problem is in MyInfo or in the plugin.

Re: Import Plugin: custom columns don't work

Posted: Fri Jan 28, 2011 2:59 pm
by Petko
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:

Code: Select all

StrCopy(document->ColumnValues, "2001-01-12T12:45:00\n\0");

Re: Import Plugin: custom columns don't work

Posted: Sun Jan 30, 2011 9:22 pm
by mfelix
I'm using the LCC C-Compiler for the plugin. Here is the code snippet:

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);
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:

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
'
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 ?

Re: Import Plugin: custom columns don't work

Posted: Thu Feb 24, 2011 10:12 pm
by mfelix
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

Re: Import Plugin: custom columns don't work

Posted: Thu Feb 24, 2011 11:16 pm
by Petko
Felix, yes, this will be the best scenario, because I will be able to debug it and see where the import fails.

Re: Import Plugin: custom columns don't work

Posted: Mon Feb 28, 2011 9:27 pm
by mfelix
Just sent you a mail for the test !

Re: Import Plugin: custom columns don't work

Posted: Tue Mar 01, 2011 12:34 pm
by Petko
Thanks, Felix, I will test it and let you know what causes the custom column import problems.

Re: Import Plugin: custom columns don't work

Posted: Mon Mar 28, 2011 7:52 am
by ozstar
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

Re: Import Plugin: custom columns don't work

Posted: Mon Mar 28, 2011 8:26 pm
by mfelix
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 :)

Re: Import Plugin: custom columns don't work

Posted: Mon Mar 28, 2011 10:18 pm
by ozstar
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