Mango Import doesn't work

Luis, I am not sure if this is finalised code or not. But when trying to import from mango blog, the entries / posts seem to not be associated with any categories. Yet the categories have been created, the entry is created but the entry categories map seems to be empty.

When I looked at the code I found this line

entry.setCategories( aCategories );

But for the life of me. I can’t see how this would work against the entityService. There is no method I can see, and yet it doesn’t seemd to fail either. I am assuming that this is somehow being passed through to the actually entity itself, so that it setups the M2M relationship, yet I don’t see how it is.

Is this something that is still being worked on, as the tickets say the Mango Importer is finalised.

Luis, I am not sure if this is finalised code or not. But when trying to import from mango blog, the entries / posts seem to not be associated with any categories. Yet the categories have been created, the entry is created but the entry categories map seems to be empty.

When I looked at the code I found this line

entry.setCategories( aCategories );

But for the life of me. I can’t see how this would work against the entityService. There is no method I can see, and yet it doesn’t seemd to fail either. I am assuming that this is somehow being passed through to the actually entity itself, so that it setups the M2M relationship, yet I don’t see how it is.

Is this something that is still being worked on, as the tickets say the Mango Importer is finalised.

Yeah I have had issues with it, but eventually it worked.

btw how good is your regexp? I am not getting far with this.

<cfset temp = reMatchNoCase(’(?i)src="[^>]*^>(gif|jpg|png)"’, i) />

The idea is to just get the string for the src

so

would get

this is an image.jpg

This regex should work for you

\ssrc=("|’)[^’"]*("|’)

That get’s any src in between any tag with " or ’ as enclosures.

Luis F. Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Social: twitter.com/lmajano facebook.com/lmajano

Hmm returns nothing back.

Here is one that will account for optional spaces on each side of the equals and also matches the trailing single/double quote based on which was found for the leading.

\ssrc\s*=\s*([""’])([^\1]*)\1

This is code used to test:

var img = ‘’;

var results = REFindNoCase("\ssrc\s*=\s*([""’])([^\1]*)\1",img,1,true);

if(ArrayLen(results.pos) GT 2) imageName = mid(img,results.pos[3],results.len[3]);

$dump(imageName, true);

The image name will be in position 3 of the results if found.

Here is one that will account for optional spaces on each side of the equals and also matches the trailing single/double quote based on which was found for the leading.

\ssrc\s*=\s*([""’])([^\1]*)\1

This is code used to test:

var img = ‘’;

var results = REFindNoCase("\ssrc\s*=\s*([""’])([^\1]*)\1",img,1,true);

if(ArrayLen(results.pos) GT 2) imageName = mid(img,results.pos[3],results.len[3]);

$dump(imageName, true);

The image name will be in position 3 of the results if found.