<transform>tmarc.xsl</transform>
<urlRecipe>http://sever.com?title=${md-title[\s+/+/g]}</urlRecipe>
<zurl>localhost:9999/db01</zurl>
+ <contentConnector>connectorfile</contentConnector>
</record>
<record>
<piggyback>1</piggyback>
<attr type="1" value="12"/>
</qual>
</cclmap>
+ <contentProxy server="proxy.indexdata.com"/>
</filter>
</filters>
<routes>
std::string record_encoding;
std::string transform_xsl_fname;
std::string urlRecipe;
+ std::string contentConnector;
bool use_turbomarc;
bool piggyback;
CCL_bibset ccl_bibset;
std::map<std::string,std::string> fieldmap;
std::string xsldir;
std::string file_path;
+ std::string content_proxy_server;
CCL_bibset bibset;
std::string element_transform;
std::string element_raw;
{
s->cfSubDb = mp::xml::get_text(ptr);
}
+ else if (!strcmp((const char *) ptr->name,
+ "contentConnector"))
+ {
+ s->contentConnector = mp::xml::get_text(ptr);
+ }
else if (!strcmp((const char *) ptr->name, "udb"))
{
s->udb = mp::xml::get_text(ptr);
if (cql_field.length())
fieldmap[cql_field] = ccl_field;
}
+ else if (!strcmp((const char *) ptr->name, "contentProxy"))
+ {
+ const struct _xmlAttr *attr;
+ for (attr = ptr->properties; attr; attr = attr->next)
+ {
+ if (!strcmp((const char *) attr->name, "server"))
+ content_proxy_server = mp::xml::get_text(attr->children);
+ else
+ throw mp::filter::FilterException(
+ "Bad attribute " + std::string((const char *)
+ attr->name));
+ }
+ }
else
{
throw mp::filter::FilterException
xmlDoc *doc = xmlParseMemory(rec_buf, rec_len);
std::string res =
mp::xml::url_recipe_handle(doc, b->sptr->urlRecipe);
+ if (res.length() && b->sptr->contentConnector.length())
+ {
+ yaz_log(YLOG_LOG, "contentConnector: %s",
+ b->sptr->contentConnector.c_str());
+ size_t off = res.find_first_of("://");
+ if (off != std::string::npos)
+ {
+ char tmp[1024];
+ long id = 12345;
+ sprintf(tmp, "%ld.%s/",
+ id, m_p->content_proxy_server.c_str());
+ res.insert(off + 3, tmp);
+ }
+ }
if (res.length())
{
xmlNode *ptr = xmlDocGetRootElement(doc);
element mp:zurl { xsd:string },
element mp:cfAuth { xsd:string }?,
element mp:cfProxy { xsd:string }?,
- element mp:cfSubDb { xsd:string }?
+ element mp:cfSubDb { xsd:string }?,
+ element mp:contentConnector { xsd:string }?
}*
}?
}?,
attribute value { xsd:string }
}+
}*
+ }?,
+ element mp:contentProxy {
+ attribute server { xsd:string }
}?
+
<data type="string"/>
</element>
</optional>
+ <optional>
+ <element name="mp:contentConnector">
+ <data type="string"/>
+ </element>
+ </optional>
</element>
</zeroOrMore>
</element>
</zeroOrMore>
</element>
</optional>
+ <optional>
+ <element name="mp:contentProxy">
+ <attribute name="server">
+ <data type="string"/>
+ </attribute>
+ </element>
+ </optional>
</define>
</grammar>
<xs:element minOccurs="0" ref="mp:torus"/>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="mp:fieldmap"/>
<xs:element minOccurs="0" ref="mp:cclmap"/>
+ <xs:element minOccurs="0" ref="mp:contentProxy"/>
</xs:sequence>
</xs:group>
<xs:element name="torus">
<xs:element minOccurs="0" ref="mp:cfAuth"/>
<xs:element minOccurs="0" ref="mp:cfProxy"/>
<xs:element minOccurs="0" ref="mp:cfSubDb"/>
+ <xs:element minOccurs="0" ref="mp:contentConnector"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="cfAuth" type="xs:string"/>
<xs:element name="cfProxy" type="xs:string"/>
<xs:element name="cfSubDb" type="xs:string"/>
+ <xs:element name="contentConnector" type="xs:string"/>
<xs:element name="fieldmap">
<xs:complexType>
<xs:attribute name="cql" use="required" type="xs:string"/>
<xs:attribute name="value" use="required" type="xs:string"/>
</xs:complexType>
</xs:element>
+ <xs:element name="contentProxy">
+ <xs:complexType>
+ <xs:attribute name="server" use="required" type="xs:string"/>
+ </xs:complexType>
+ </xs:element>
<xs:attributeGroup name="filter_zoom">
<xs:attribute name="type" use="required">
<xs:simpleType>