Need a custom categorical search |
LiveContent S1000D has a set of built-in search categories. From this set, there is a finite number of search categories that can be used, or in essence “taken over” in order to create custom or user-defined searches. These custom searches are defined by one name in cvSearch.js and by another handle in query.conf (LiveContentData\collections\collection). The categories best suited for customizing are in the group that searches for IPD data: * part_pnr and part_dfp searches are typically used by most customers ** part_mfc search may not be used; if a customer desires ManufacturerCode (CAGE code), it should only entail adding “mfcSearch” to the “search” configitem string in wietmsd.xml *** part_* searches that are typically not used, and available for customization In this document we will set up a search to find Service Maintenance Recoverability codes, or “SMR” codes as they are known by. For a custom SMR search we will use the part_partno search:
Find all Parts containing given PARTNO element (ARMY) query.part_partno=//TITLE[@PARTNO "%s"]
a. Note the element (TITLE) and attribute (PARTNO) that this search will expect.
<xsl:for-each select".//isn | .//itemSequenceNumber | .//itemSeqNumber"> <TITLE> . . . <xsl:attribute name="PNR"> <xsl:value-of select="pnr"/> <xsl:value-of select="partNumber"/> </xsl:attribute>
<xsl:attribute name="PARTNO"> <xsl:value-of select="locationRcmdSegment/locationRcmd/ sourceMaintRecoverability"/> <xsl:value-of select="ces/smr"/> </xsl:attribute>
<configitem name="SearchIndexBuilder.WordwheelList"><value>pnr;nsn;dfp;partno;wirenum;wiredes;faultcode;faulttitle</value> </configitem>
<configitem name="partno.FileName"> <value>wwpartno</value> </configitem> <configitem name="partno.WordWheelTag"> <value>TITLE</value> </configitem> <configitem name="partno.WordWheelAttr"> <value>PARTNO</value> </configitem> <configitem name="partno.WordWheelLowerCase"> <value>0</value> </configitem> <configitem name="partno.WordWheelSeparator"> <value>2</value> </configitem> <configitem name="partno.IndexName"> <value>ipc</value> </configitem>
<component id="cvSearch"> <item extension="XXX_Search"/> (‘XXX” just indicates some customer-specific prefix)
function XXX_Search() { //set name this.componentName = "XXX Search Handler Component"; } XXX_Search.prototype = { extensionInit: function() { }, initSearchTypes: function() { // XXX: call core function first cvSearch.prototype.initSearchTypes.call(this); // XXX: use partNoSearch for SMR search var type = new Object(); type.id = "partNoSearch"; type.label = "SMR Code"; type.scope = "part_partno"; type.wwTitle = "part_partno"; type.handler = "smrHandler"; this.searchTypes[type.id] = type; }, smrHandler: function(elem) { var refStruct = new Object(); refStruct.partEID = elem.getAttribute("PART_REFID"); CVPortal.debug(" {cvSearch} Selecting search result, SMR " + elem.getAttribute("PART_REFID") + " in doc ceid " + elem.getAttribute("REFDOCID")); CVPortal.components.cvDocHandler.loadDocumentByCeId(elem.ge tAttribute("REFDOCID"), refStruct); } };
<configitem name="search"> <value>systtlSearch;tpcttlSearch;fgrttlSearch;pnrSearch;dfpSearch;faultcodeSearch;partNoSearch</value> </configitem>
|