+ // database repackaging
+ z_scanRequest->num_databaseNames = 1;
+ z_scanRequest->databaseNames = (char**)
+ odr_malloc(odr_en, sizeof(char *));
+ if (sr_req->database)
+ z_scanRequest->databaseNames[0]
+ = odr_strdup(odr_en, const_cast<char *>(sr_req->database));
+ else
+ z_scanRequest->databaseNames[0]
+ = odr_strdup(odr_en, "Default");
+
+
+ // query repackaging
+ // CQL or XCQL scan is not possible in Z3950, flagging a diagnostic
+ if (sr_req->query_type != Z_SRW_query_type_pqf)
+ {
+ //send_to_srw_client_error(7, "query");
+ return false;
+ }
+
+ // PQF query repackaging
+ // need to use Z_AttributesPlusTerm structure, not Z_Query
+ // this can be digget out of a
+ // Z_query->type1(Z_RPNQuery)->RPNStructure(Z_RPNStructure)
+ // ->u.simple(Z_Operand)->u.attributesPlusTerm(Z_AttributesPlusTerm )
+
+ //Z_Query *z_query = (Z_Query *) odr_malloc(odr_en, sizeof(Z_Query));
+ //z_searchRequest->query = z_query;
+
+ //if (!z3950_build_query(odr_en, z_query,
+ // (const SRW_query&)sr_req->query,
+ // sr_req->query_type))
+ //{
+ //send_to_srw_client_error(7, "query");
+ // return false;
+ //}
+
+ // TODO:
+
+ z3950_package.request() = apdu;