[ic] A la Carte IC tag functionality

Peter peter at pajamian.dhs.org
Tue Nov 16 03:36:42 UTC 2010

On 16/11/10 11:43, Hicks, Sam wrote:
> Hi all.
> I am looking for help with an interchange instance that is being used as
> the base for a custom web app.
> What I want to do right now is have a standalone perl script pass some
> html/text through the interchange tag-parsing modules/methods *without*
> all the fixins of our custom web app (the running interchange daemon,
> the web-server, db configuration etc.)
> I actually have successfully parsed some core ITL tags just by doing:
> 	use Vend::Interpolate;
>     	Vend::Interpolate::interpolate_html( $text );
> But we have some custom UserTags in our instance that I would like to be
> able to handle in the same way. I have tried to get the custom tag
> 'functionality' into memory with such ideas as:
> 	use Vend::Config; 
> 	Vend::Config::global_directives();
> 	Vend::Config->global_config();
> 	...
> 	use Vend::Dispatch;
> 	Vend::Dispatch::update_global_actions();
> 	...
> 	use Vend::Parse;
> 	Vend::Parse->global_init;
> ...in various combinations, to no avail. I have been weaving through the
> code in the above modules, and in particular I think that the
> interchange variable
> 	$Vend::Cfg->{UserTag}

This is only for local (catalog level) usertags.  You probably want to
look at $Global::UserTag.  Check out the parse_tag sub in Config.pm to
see how it is loaded up.

> One of my hopes, however, is to NOT need to load every module in the
> codebase, or to need/query a running interchange server. For performance
> reasons.
> Any tips or ideas welcome.

Most of the system tags are defined just the same as any other usertag
but refer to code in Interpolate.pm rather than having the routine
embedded in the tag itself.  Check some of the tags that are working and
try to make your usertags load up in the same way.

I like what you're trying to do, but keep in mind that Interchange
simply wasn't designed to work this way (from what I know), so you are
pretty much on your own here, and nothing is guaranteed to work in
future versions of IC.  Let us know how it works out, though.


More information about the interchange-users mailing list