Friday, January 13, 2012

Custom Output from IDOL using Templates

One can get a customized output from IDOL as the response using Template parameter which is available with the following queries:

  • Action=Query
  • Action=GetContent
  • Action=List
  • Action=Suggest
  • Action=SuggestOnText
  • Action=GetQueryTagValues
  • Action=GetTagNames
  • Action=GetTagValues

To use Template parameter enable XSLTemplates=true needs to be set under [Server] Section of Autonomy IDOL Server configuration file, restart the IDOL Server for the change to reflect.

Then place custom .tmpl file inside the templates directory.

Use &Template=<template.tmpl>&ForceTemplateRefresh=true parameter along with any of the queries mentioned above to see a customized output.

Please find the below template file which outputs a customized response for GetQueryTagValues query i.e., autn:total_values value is removed in the XML Response.

The template content is 
---------------------------------

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:autn="http://schemas.autonomy.com/aci/"
> 
    <xsl:output method="xml" indent="yes"/>
    <xsl:include href="RetrievalAppConfig.tmpl" />
    <xsl:template match="/">
                   <autnresponse>
                   <action><xsl:value-of select="autnresponse/action"/></action>
                   <response><xsl:value-of select="autnresponse/response"/></response>
                   <responsedata>
                             <autn:number_of_fields><xsl:value-of select="autnresponse/responsedata/autn:number_of_fields"/></autn:number_of_fields>
                             <autn:field>
                                      <autn:name><xsl:value-of select="autnresponse/responsedata/autn:field/autn:name"/></autn:name>
                                      <autn:number_of_values><xsl:value-of select="autnresponse/responsedata/autn:field/autn:number_of_values"/></autn:number_of_values>                                   
                                      <xsl:copy-of select="autnresponse/responsedata/autn:field/autn:value">
                                      </xsl:copy-of>
                             </autn:field>
                   </responsedata>
                   </autnresponse>     
    </xsl:template>
</xsl:stylesheet>
  

Use ForceTemplateRefresh=true along with &Template=<template> parameter if one requires the change in the .tmpl file to reflect immediately in the response.


Wednesday, January 4, 2012

Autonomy Configuration Highlighter using Notepad++

Autonomy Configuration files (.cfg) are the used to control the behavior of the component which is being configured be it IDOL Server, DIH, DAH and any connector say FileSystemFetch, HttpFetch, Documentum Fetch and soon.

Editing the configuration can be done using a simple notepad editor easily.
An important aspect is while configuring is highlighting the Reserved Words or Keywords. Highlighting helps the developers avoid any typos while configuring.

I have tried to use Notepad++ (v5.8.7), a free source code editor running under the MS Windows environment to define a custom language i.e., Autonomy's Configuration Syntax to enable Highlight of the Reserved Words or Keywords.

Procedure to configure custom language in Notepad++ is 
1.      Copy the below userDefineLang.xml file to  
C:\Documents and Settings\<username>\Application Data\Notepad++    C:\Users\[username]\AppData\Roaming\Notepad++ (for vista/win7 users)
If the file already exists then don't copy the <NotepadPlus> and </NotepadPlus> tags from the below text.
Paste this into the file userDefineLang.xml if it already exists. If it doesn't exists, just create a new file.
So if you have userDefineLang.xml already, remove the <NotepadPlus> and </NotepadPlus>, otherwise keep them.
-------------------------------- userDefineLang.xml-------------------------------
<NotepadPlus>
    <UserLang name="Autonomy" ext="cfg">
        <Settings>
            <Global caseIgnored="yes" />
            <TreatAsSymbol comment="no" commentLine="yes" />
            <Prefix words1="no" words2="no" words3="no" words4="yes" />
        </Settings>
        <KeywordLists>
            <Keywords name="Delimiters">000000</Keywords>
            <Keywords name="Folder+"></Keywords>
            <Keywords name="Folder-"></Keywords>
            <Keywords name="Operators">- ! ( ) , . : ; [ ] + &lt; = &gt;</Keywords>
            <Keywords name="Comment">1/* 2*/ 0//</Keywords>
            <Keywords name="Words1">AbsoluteLinkPrefix ACIFlushBatchSize ACLType AciPort AciPort AciPort AciPort Action ActionsPrintAllSections ActivateCaseSensitive AddFieldIfNotFound AdditionalDREQueryParameters AdditionalDRETermGetBestParameters AdditionalDRETermGetInfoParameters AdditionalNameSpaces AdminClients AdvancedCaseSearch AdvancedPlus AdvancedSearch AdvancedSuggest AgentBooleanCacheField AgentBooleanVQL AgentBooleanWeighting AgentField AgentIndexFieldCSVs AgentResultsCacheDuration AgentResultsCacheDuration Agents AgentSecurityCacheField AgentsFindAgents AgentsFindProfiles AlertRetrainedAgentsOnly AllowDeleteOriginal AllowDuplicates AllowDuplicateFields AllowedOutputDirectoryCSVs AllowOverlaps AllowSecurityOverride AlwaysMatchType AlphaNumericTermChunkSize AlwaysSendAttachment AppendTrainingText ArchivePath AttachFileFromReference AttachmentTemplate AttachmentUserField AugmentSeparators AuthorizeWithoutUser AutnRank AutnRankType AutoDetectLanguagesAtIndex AutomateHiFiPDF AutoSetDatabases Backup BackupBeforeUpgrade BackupCompression BackupCompressionLevel BackupDir BackupDir BackupInterval BackupMaintainDirStructure BackupRetryAttempts BackupRetryPause BackupTime BadTask BaseDN BaseDNPassword BatchSize BatchSize BatchTimeout BestTermMemoryMaxSize BindLevel BitFieldCompressed BitFieldMaxMemoryKB BitFieldPath BitFieldType BlockIfFull BooleanFields BusyTimeout CallBackURL CantHaveFieldCSVs CaseNormalization CaseSensitiveFieldNames CaseSensitiveGroupNames CaseSensitiveMatchValues CaseSensitiveParametricValues CaseSensitiveUserNames CategoryDirectory CategoryInheritance CheckDiskSpace CheckEntitlement ClassificationServerFields ClassificationServerHost ClassificationServerNumResults ClassificationServerParams ClassificationServerPort ClassificationServerRetries ClassificationServerThreshold ClassificationServerTimeout ClassificationServerValues ClassificationSSLConfig ClassifyShortDocs ClusterDirectory ClusterThreshold ClusterTitleLength CombineIgnoreMissingValue CommsAllowUnencrypted CommsEncryptionTEAKeys CommsEncryptionType Compact CompactDatabaseFile CompactInterval CompactTime CompoundRelevance ConceptThreshold Condition ConfigurationEncoding ConnectRetries ConnectTimeout ContentType (Alert Task) ContentType (Custom) ContextSummaryQueryTermWeight CookieForwarding CountMemoryMaxSize CountType Cycles DatabasePrivilege DatabaseReadOnly DatabaseType DateFormatCSVs DateType DecompositionFile DefaultAddSetToReadDocuments DefaultContentTransferEncoding DefaultDocumentFormat DefaultEndTag DefaultEmailFormat DefaultEmailResultsType DefaultEncoding DefaultExcludeReadDocuments DefaultLanguageType DefaultMimeVersion DefaultNamedArea DefaultQueryOperator DefaultRoleName DefaultScript DefaultSecurityType DefaultSendEmail DefaultStartTag DefaultSubject DefaultTemplate DefaultUrlPrefix DefaultXMLEncoding DefaultLanguageType DefaultLanguageType DeferLogin DeferLoginSyncDuration DelayIndexing DelayedSync DeleteAfterAdd DIHAciPort DIHHost DirectoryHashing DiSHACIPort DiSHHost DiSHRetries DiSHTimeout DiminishSeparators DisallowAgentWeights DisallowWildcards DiscardUnconfiguredLanguagesAtIndex DiscardUnknownLanguagesAtIndex DiskHash DistributionThreshold DocumentDelimiterCSVs DocumentField DocumentSecurity DocumentSecurityType DocumentTrackingActive DocumentTrackingType Domain DontCopyAgentFields DownloadDocAction DRE&amp;#60;QueryParameter&amp;#62; DRE&amp;#60;QueryParameter&amp;#62; DRETemplateNoResults DRETemplateReferenceEnd DRETemplateReferenceStart DRETermActionCompatibility DynTermPath EductType EmailActionXSLTemplate EmailXSLTemplate EnableLogging Encoding Encodings EncryptionAESKey EngineConnectionTimeout Entity EntityField EntityMatchRange EntityMinScore EntityZone Equivalence EscapedEntries EvictWhenFull ExpandQuery ExpandQueryLog ExpandQueryMaxResults ExpandQueryMaxScore ExpandQueryMaxTerms ExpandQueryMinScore ExpansionDepthLimit Expire ExpireDateType ExpireInterval ExpireIntoDatabase ExpireTime (Database sections) ExpireTime (Schedule) ExplicitHost ExtraFieldText ExtraText FailedPath FailedPath (Index tasks) FailedPath (IndexTasks Failover Options) Failover FieldBoolean FieldCSVs FieldCheckType FieldMappings FieldPositionGap Fields (ACI tasks) Fields (Alert tasks) Fields (HTTP tasks) FieldTextCacheField File FileCommandMatch FileCommandPath FileCommandPolling FlattenIndexType FlushLockFile From FromField FromHost FromName FromNameField GenericFullStemming GenericStemming GenericTransliteration GetDetailsSeparateFields GoodTask Group GroupDN GroupMemberAttribute GroupMembershipValueFormat GroupServerHost GroupServerParameters GroupServerParentRole GroupServerPort GroupServerPrefixDomain GroupServerRepository GroupServerTimeout GroupServerUserField HiddenType HighlightType HighlightChunkSize Host Host Host Host Host HyphenChars IdolHost IdolPort IDOLserver (ACI tasks) IDOLserver (Alert tasks) IDOLserver (Cat tasks) IDOLserver (Index tasks) IDOLServers (IndexTasks Failover Options) IdolTimeout IDXFieldPrefix IDXUseDRESection ImExDirectory InactiveSchedules InactiveUserDeleteCycleDuration InactiveUserDeleteDuration Incoming Index IndexAciPort IndexCacheMaxSize IndexClients IndexCompression IndexFieldCSVs IndexHost IndexNumbers IndexNumbers IndexNumbers1MaxLength IndexNumbers2MaxLength IndexNumbersType IndexNumbersMaxValue IndexPerDocument IndexPort IndexQueuePath IndexQueueTillSuccess IndexSSLConfig IndexThreadPriority InitialScore Internal Interval InvertedAgent InvertedAgentType KeepPasswordDuration KeyUsername KillDuplicates KillDuplicatesChecksumField LangDetectType LangDetectUTF8 Language LanguageDirectory LangaugeDirectory LanguageType LDAPAllAttributeValues LDAPAttributeValueSeparatorChar LDAPPort LDAPSecurityType LDAPServer Library (Security types) Library (User Security custom) Library (Email custom) LicenseServerACIPort LicenseServerHost LicenseServerRetries LicenseServerTimeout Limit LockRemovalDuration LogArchiveDirectory LogCompressionMode LogDirectory LogEcho LogExpireAction LogFile LogGSSDisplayName LogHistorySize LoginExpiryTime LoginFieldName LoginFieldValue LoginMaxAttempts LogLevel LogLevelMatch LogMaxLineLength LogMaxOldFiles LogMaxSizeKBs LogOldAction LogOutputLogLevel LogRequestTiming LogSysLog LogTime LogTypeCSVs MailServerTimeout Main MainPath MaintainSuggestStatistics Match MatchCase MatchType MatchWholeWord MaxAgents MaxBatchSize MaxConcepts MaxDocumentCount MaxDocumentCount MaxDocumentCountLower MaxDocumentCountUpper MaxEmailsPerUser MaxEmailsToSendBatchProcess MaxEntityLength MaxExpandLevel MaxFileUploadSize MaxIndexDelay MaxIndexOccurrencesPerDocument MaxIndexOccurrencesPerField MaxIndexQueueSize MaxIndexTermsPerDocument MaxInputString MaxLanguageDetectTerms MaxNumber MaxNumPasswordPerUser MaxQNum MaxQueryTerms MaxResults MaxRetries MaxScore MaxSectionLength MaxSize MaxSourceCharacters MaxSyncDelay MaxTermNumber MaxTermWeight MemCachedType MinChildren MinClusterDocs MinConceptOccs MinFieldLength MinFreeSpaceMB MinPasswordLength MinScore MinTermOccurrences MinTermOccurrencesProportion MinUsernameLength MinWordsPerSentence MinimumValidTerms Module Modules MultipleParentsAllowed MustHaveFieldCSVs Name Name ( section) NativeDirection NextTask NGram NgramMultibyteOnly NodeTableCacheFields NodetableMaxFieldLength NodeTablePaddingBytes NodeTablePrepopulateCache NodeTablePath NodeTableStoreACLsInRefTable NodeTableStoreContent NodetableMemoryMaxSize NonReversibleType NoDocAction NoProxyHostsCSVs NoResultsString Normalise NotesAuthURL NotesPasswordFormField NotesUsernameFormField NotesUseSessionAuth NotifyFieldCSVs NScripts NumClusters NumDBs Number Number NumberOfBackups NumberPerUser NumberPunctuation NumericDateType NumericIntegerOnly NumericNormalMaxMem NumericPath NumericTermChunkSize NumericType OcrFilterType OcrLanguageFile OnFailureTask OnFalseTask OnTrueTask OnlyMatchSubset Operation Outgoing OutgoingSSLConfig OutputDirectory OutputEncoding Parameter1 (Field op tasks) Parameter1 (Route tasks) Parameter2 (Field op tasks) Parameter2 (Route tasks) Parameter3 (Field op tasks) ParametricMaxPairsPerDocument ParametricMemoryMaxSize ParametricNumericMapping ParametricRangeType ParametricRefinement ParametricType Params (ACI tasks) Params (Cat tasks) PasswordChangeDuration PasswordParamCSV PasswordStrength PercentageAlphaNumerical PercentageLanguageTerms PercentageNonLanguageTerms PercentagePunctuation PersistentConnectionTimeout PictureFormat PictureQuality PincodeChangeDuration PincodeLength PingInterval Port PrecacheNumericFieldCSVs PreCompactionBackup PreCompactionBackupPath PrintType Profile ProfilesFindAgents ProfilesFindProfiles ProxyClients ProxyHost ProxyHost ProxyLogin ProxyLogin ProxyPassword ProxyPassword ProxyPort ProxyPort ProperNames Property PropertyFieldCSVs PropertyMatch PropertyNegativeFieldCSVs ProxyHost ProxyPassword ProxyPort ProxyUsername Punctuation QueryAction QueryClients QueryParameters QuerySummaryAdvanced QuerySummaryIDs QuerySummaryLength QuerySummaryMaxDocLength QuerySummaryTerms QueryTimeoutInMilliseconds QueueUntilSuccess RDNAttribute RandomSeed Ranges ReadDocumentMemorySize RecvTimeOut RedirectAbsoluteLinks RefDocs RefHashes RefIndexMemoryMaxSize RefIndexPath RefLog ReferenceField ReferenceMemoryMappedType ReferencePrefix ReferenceType RegenerateBitFieldIndex RegenerateCountIndex RegenerateMatchIndex RegenerateNumericDateIndex RegenerateNumericIndex RegenerateParametricIndex RegenerateSortFieldIndex RelevanceThreshold RemapToFields (ACI tasks) RemapToFields (HTTP tasks) RemoveDuplicates RequireCompleteIndexing ResourceFiles ResultExpiryDays ResultsCacheDuration ResultsCacheDuration RestrictToAllowedDirectories Retries Retries RoleListUseSecurity RootDir RunMailer RunMissedSchedules ScheduleAction ScheduleCycles ScheduleDependencies ScheduleInterval ScheduleStartTime ScheduleThreads ScoreBoost ScriptFile ScriptFilename SearchFields SecIndexPath SectionBreakType SecureCacheExpirySeconds SecurityCode SecurityDebugLogging SecurityFieldCSVs SecurityInfoKeys SecurityTokenLifetime SecurityType SecurityUsernameDefaultToLoginUsername SeedBindLevel SeedSize SendToList SentenceBreaking SentenceBreakingOptions SeparateDuplicateXMLFields Separators (Cat tasks) ServiceACIMode ServiceControlClients ServiceHost ServiceName ServicePort ServiceStatusClients SetBlocking SetXForwardedForHTTPHeader SGExpiryDays SiblingStrength SimpleCatPairFactor SleepBetweenRequests SleepBetweenSentEmails SMTPFromHost SMTPPort SMTPSendFrom SMTPServer SMTPSubject SnapshotExpiryDays SocketTimeout SoftSeparators SortByScore SortFieldMemoryMaxSize SortFieldPath SortFieldPrefixCSVs SortFieldStorageLength SortMissingValueAtEnd SortReturnAllDocuments SortType Soundex SourceType SpellCheckAlphaNumeric SpellCheckCacheMaxSize SpellCheckCorrectMinDocOccs SpellCheckIncorrectMaxDocOccs SpellCheckMaxCheckTerms SpellCheckShowOriginal SplitNumbers SSLCACertificate SSLCertificate SSLCheckCertificate SSLCheckCommonName SSLConfig SSLConfig SSLConfig SSLConfig SSLConfig SSLConfig SSLConfig SSLConfig SSLConfig SSLConfig SSLConfig SSLConfig SSLIDOLComponents SSLMethod SSLPrivateKey SSLPrivateKeyPassword StandaloneProxy Start StartMatch StartTask StartTime StartupTimeout StartupTimeout StartingSuggestOverrideFactor StatePath StateReferenceDirUsesHashStructure StateReferencePath StatusDirUsesHashStructure StatusPath StemAndUnstem Stemming StemmingFile Stoplist Stoplist ( section) StopFile StopWordIndex StoreDocCounts StoredType StripXMLWhiteSpace SuggestTerms SuggestUseThreshold SummaryField SuppressMatchLogging SyncRolesFromGroups SynonymType SysLogSuppress TagField TagPath TagXMLPath TangibleCharacters TargetPathFieldsCSVs TaxonomyDirectory Temp Template TemplateDirectory TemplateMappings TemplateNames TermCacheMaxSize TermCachePersistentKB TermCachePersistentMinOccs TermFile TermGetBestStoredOnly TermSize TermsPerDoc TermWeightBoostFactor TermWeightMax TestEmailAddress TestUser TextFields TextParse (ACI Tasks) TextParse (Alert Tasks) TextParse (Categorization Tasks) TextParseIndexType TextParseParam Threads Threads Threshold Timeout Timeout Timeout Timeout (ACI Tasks) Timeout (Categorization Tasks) Timeout (HTTP Tasks) TimeoutMS TitleFromSummary TitleType TotalResultsPredictionThreshold TotalResultsPrintDatabases Transliteration TrimSpaces Type UASParameterNames UAS&lt;ParameterName&gt; URL UnescapeGetRequestLog UnstemmedMemoryMaxSize UnstemmedMinDocOccs UnstemmedTermTree UnstemmedTrackFields UrlAnalysis UsePersistentConnection UsePostMethod UserCacheCycleTime UserCacheExpiryTime UserClients UserNameCaseInsensitive UserPath V4 Values Values VerboseLogging VQL VQLWeighting ViewAllowedSpecialUNCPathsCSVs ViewCacheDirectory ViewingFiltersPath ViewingTemplatesPath ViewLocalDirectoriesCSVs WaitForBackup WaitForImport WarpFields Weight WildcardFallback WildcardFullEval WildcardMaxTerms WorkingDir XMLBackupDirectory XMLDuration XMLEncoding XMLEncoding XMLFieldNames XMLFieldSeparator XMLFullStructure XMLPaths XMLTempDirectory XMLThreadSleepTime XSLTemplates FileBaseDirectory FilePollFilename ImportRefReplaceCSVs ImportRefReplaceWithCSVs ImportHTMLExtns PollingPostAction PollingAction PollingMaxNumber DreHost QueryPort DreIndexPort PollingMethod PollingPeriod RemoveLogFileOnStart INDEXMODE NSOCKETS SPIDERREPEATSECS SPIDERCYCLES DEPTH SPIDERSTARTTIME SITEDURATION MAXPAGES NTLMUsername NTLMPassword</Keywords>
            <Keywords name="Words2">ACIEncryption Agent AgentDRE AnalysisSchedules Category CatDRE Cluster Community DRE DataDRE DistributionSettings DocumentTracking FieldProcessing IndexCache IndexServer IndexTasks LanguageTypes License Logging MemoryCache MyProperty Paths Profile ProfileNamedAreas Role Schedule SectionBreaking Security Server Service SSLOptionN Summary Synonym Taxonomy TermCache User UserCustom UserSecurity UserSecurityFields Viewing Databases Default Configuration</Keywords>
            <Keywords name="Words3">true false TRUE FALSE on ON OFF off</Keywords>
            <Keywords name="Words4">Database HTMLFieldName HTMLFieldStart HTMLFieldStop ImportField ImportExtractDateFrom ImportExtractDateToField ImportExtractDateToFormat ImportExtractExtension ImportEmbedded FixedFieldName FixedFieldValue</Keywords>
        </KeywordLists>
        <Styles>
            <WordsStyle name="DEFAULT" styleID="11" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
            <WordsStyle name="FOLDEROPEN" styleID="12" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="1" />
            <WordsStyle name="FOLDERCLOSE" styleID="13" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="1" />
            <WordsStyle name="KEYWORD1" styleID="5" fgColor="0000FF" bgColor="FFFFFF" fontName="" fontStyle="1" />
            <WordsStyle name="KEYWORD2" styleID="6" fgColor="FF0000" bgColor="FFFFFF" fontName="" fontStyle="1" />
            <WordsStyle name="KEYWORD3" styleID="7" fgColor="FF0000" bgColor="FFFFFF" fontName="" fontStyle="1" />
            <WordsStyle name="KEYWORD4" styleID="8" fgColor="0392EB" bgColor="FFFFFF" fontName="" fontStyle="0" />
            <WordsStyle name="COMMENT" styleID="1" fgColor="808080" bgColor="FFFFFF" fontName="" fontStyle="2" />
            <WordsStyle name="COMMENT LINE" styleID="2" fgColor="808080" bgColor="FFFFFF" fontName="" fontStyle="2" />
            <WordsStyle name="NUMBER" styleID="4" fgColor="FF00FF" bgColor="FFFFFF" fontName="" fontStyle="0" />
            <WordsStyle name="OPERATOR" styleID="10" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="1" />
            <WordsStyle name="DELIMINER1" styleID="14" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
            <WordsStyle name="DELIMINER2" styleID="15" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
            <WordsStyle name="DELIMINER3" styleID="16" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" />
        </Styles>
    </UserLang>
</NotepadPlus>
2.      Open Notepad++ Editor (close and open if already opened) and there should a new option under Language’s User Defined menu called Autonomy

3.      And just open any Autonomy configuration and one can see the Highlighting working. If it is not working just go to Language Menu and select Autonomy. The configuration should look something like











I have tried to included the keywords of  IDOL Server, FileSystemFetch & Httpfetch.
And any new Keywords can be added in the userDefineLang.xml file.

Happy Highlighting...



Wednesday, November 9, 2011

Programmatic DreReplace in Autonomy IDOL Server

Whenever a field needs to be updated/replaced with a new one in the IDOL Server index the available options are
1. Re-index the data
2. Use DREREPLACE index command
3. Use DRECHANGEMETA index command if the fields to be changed are autnrank,database,date & expiredate
Re-indexing the data will override the existing data and the entire document will be updated. But re-indexing may not be always possible especially when the volume of data is huge. This is where DREREPLACE will be useful.

I have written DREREPLACE functionality using Autonomy Java ACI API which is available in the Autonomy's Customer Support Portal either as a separate JAR or bundled with Portal-In-A-Box & Retina WAR file.

The latest ACI API version is 4.9.5.
The following jar files needs to be in your classpath i.e., AutonomyACIAPI-4.9.5.jar, commons-codec-1.4.jar, commons-httpclient-3.1.jar, commons-logging-1.1.1.jar.

The DREREPLACE code is

import java.util.ArrayList;
import java.util.List;
import com.autonomy.aci.ActionParameter;
import com.autonomy.aci.exceptions.IndexingException;
import com.autonomy.aci.services.IndexingService;
public class DreReplace {
public static void main(String[] args) {
final String sIDOLServerHostIP = "127.0.0.1";
final int iIDOLServerIndexPort = 9001;
IndexingService indexingService = new IndexingService(
sIDOLServerHostIP, iIDOLServerIndexPort);
List lsActionParameters = new ArrayList();
StringBuilder sbDataFormation = new StringBuilder();
String sDocumentID = "1";
String sDREFieldName0 = "AUTHOR";
String sDREFieldValue0 = "mahesh";
sbDataFormation.append("#DREDOCID ").append(sDocumentID).append("\n");
sbDataFormation.append("#DREFIELDNAME ").append(sDREFieldName0)
.append("\n").append("#DREFIELDVALUE ").append(sDREFieldValue0)
.append("\n");
// this is the repeating part based on the no. of fields to be replaced
sbDataFormation.append("#DREENDDATA\n\n");
try {
indexingService.dreReplace(sbDataFormation.toString(),
lsActionParameters);
} catch (IndexingException indexe) {
indexe.printStackTrace();
}
}
}