12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122 |
- // Licensed Materials - Property of IBM
- //
- // IBM Cognos Products: ps
- //
- // (C) Copyright IBM Corp. 2005, 2021
- //
- // US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- // Copyright (C) 2008 Cognos ULC, an IBM Company. All rights reserved.
- // Cognos (R) is a trademark of Cognos ULC, (formerly Cognos Incorporated).
- var DUAL_CNX_STR_SEPARATOR = 'IBM_JD_CNX_STR:';
- function isDualStackConnectString(connectionString) {
- return (connectionString.indexOf(DUAL_CNX_STR_SEPARATOR) != -1) ? true : false ;
- }
- function buildConnectString(connectType, connectVariant) {
- // reset the connect string
- var f = document.pform;
- f.m_p_connectionString.value = '';
- var connectTypes = connectType.split(",");
- for (var i = 0; i < connectTypes.length; i++) {
- if (i != 0) {
- // append special separator
- f.m_p_connectionString.value += DUAL_CNX_STR_SEPARATOR;
- }
- // trim off the whitespace
- var type = connectTypes[i].replace(/^\s\s*/, '').replace(/\s\s*$/, '');
- f.m_p_connectionString.value += _buildConnectString(type, connectVariant);
- }
- }
- function parseConnectString(connectType, credentialNamespaces, connectVariant) {
- var connectTypes = connectType.split(",");
- var connectStrings = document.pform.m_p_connectionString.value.split(DUAL_CNX_STR_SEPARATOR);
-
- for (var i = 0; i < connectTypes.length; i++) {
- if (i < connectStrings.length) {
- // trim off the whitespace
- var type = connectTypes[i].replace(/^\s\s*/, '').replace(/\s\s*$/, '');
- _parseConnectString(type, connectStrings[i], credentialNamespaces, connectVariant);
- }
- }
- }
- function _buildConnectString(connectType, connectVariant)
- {
- var connectString = '';
- var f = document.pform;
- if (connectType == 'redbrick' || connectType == 'sybaseIQ' || connectType == 'openEdge')
- {
- connectString = ';LOCAL';
- var type = '';
- if (connectType == 'redbrick')
- {
- type = 'RB'
- }
- else if (connectType == 'sybaseIQ')
- {
- type = 'IQ';
- }
- else if (connectType == 'openEdge')
- {
- type = 'PG';
- }
-
- connectString += ';' + type;
- connectString += ';DSN=' + f.m_connection_database.value;
- if (f.m_connection_use_userid.checked)
- {
- var prefix = '^User ID:';
- connectString += ';UID=%s';
- if (f.m_connection_use_pword.checked)
- {
- prefix += '\^\?Password:';
- connectString += ';PWD=%s';
- }
- connectString = prefix + connectString;
- }
- connectString += ';' + f.m_connection_string.value;
- connectString += '@ASYNC=' + ((isCheckboxChecked(f.m_connection_use_async)) ? '1' : '0');
- connectString += '@' + f.m_connection_connect_time.value;
- connectString += '/' + f.m_connection_reply_time.value;
- if (connectType == 'openEdge' || connectType == 'sybaseIQ')
- {
- if (f.m_connection_odbc_access_mode.checked)
- connectString += '@UNICODE';
- }
- connectString += '@COLSEQ=' + f.m_connection_colseq.value;
- }
-
- else if (connectType == 'odbc' || connectType == 'composite' || connectType == 'virtualviewmanager' || connectType == 'sqlodbc' || connectType == 'teradata' || connectType == 'db2' || connectType == 'netezza')
- {
- connectString = ';LOCAL';
- var type = '';
- if (connectType == 'odbc')
- {
- type = 'OD';
- }
- else if (connectType == 'sqlodbc')
- {
- type = 'SS';
- }
- else if (connectType == 'db2')
- {
- type = 'D2';
- }
- else if (connectType == 'teradata')
- {
- type = 'TD';
- }
- else if (connectType == 'composite')
- {
- type = 'CS'; //Composite connection.
- }
- else if (connectType == 'netezza')
- {
- type = 'NZ';
- }
- else
- {
- type = 'VM'; //Virtual View Manager
- }
- connectString += ';' + type;
- connectString += ';DSN=' + f.m_connection_database.value;
- if (isRadioButtonSelected(f.authentication, 'namespace') || isRadioButtonSelected(f.authentication, 'signon'))
- {
- var prefix = '^User ID:';
- connectString += ';UID=%s';
- if (f.m_connection_use_pword.checked || isRadioButtonSelected(f.authentication, 'namespace'))
- {
- prefix += '\^\?Password:';
- connectString += ';PWD=%s';
- }
- // for third party namespace authentication we need to put Trusted_Connection=yes in the connection string
- if (isRadioButtonSelected(f.authentication, 'namespace') && connectType != 'teradata' && connectType != 'db2' && connectType != 'odbc' && connectType != 'netezza')
- {
- connectString += ';Trusted_Connection=yes';
- }
- connectString = prefix + connectString;
- }
- else if ((connectType == 'sqlodbc') && isRadioButtonSelected(f.authentication, 'windows'))
- {
- connectString += ';Trusted_Connection=yes';
- }
- connectString += ';' + f.m_connection_string.value;
- connectString += '@ASYNC=' + (isCheckboxChecked(f.m_connection_use_async) ? '1' : '0');
- connectString += '@' + f.m_connection_connect_time.value;
- connectString += '/' + f.m_connection_reply_time.value;
- if (connectType == 'odbc' || connectType == 'composite' || connectType == 'virtualviewmanager')
- {
- if (f.m_connection_odbc_access_mode.checked)
- connectString += '@UNICODE';
- }
- if (connectType == 'db2')
- {
- if (isCheckboxChecked(f.m_connection_trusted_context))
- { connectString += '@TRUSTED_CONTEXT';
- if (f.m_connection_identity_propagation && f.m_connection_identity_propagation.value!='')
- {
- connectString += '@REGISTRY_NAME=' + f.m_connection_identity_propagation.value;
- }
- }
- }
- if (isCheckboxChecked(f.m_transformUserIdentification)){
- connectString += '@TRANSFORMUID';
- }
-
- connectString += '@COLSEQ=' + f.m_connection_colseq.value;
- }
-
- else if (connectType == 'consolidation' || connectType == 'contributor' || connectType == 'contributorSeries7')
- {
-
- connectString = ';LOCAL';
- var type = '';
- var padid = '';
-
- if (connectType == 'consolidation')
- {
- type = 'CL';
- }
- else if (connectType == 'contributor')
- {
- type = 'CR';
- }
- else if (connectType == 'contributorSeries7')
- {
- type = 'CR';
- if (f.m_connection_padid && f.m_connection_padid.value != null)
- {
- padid = f.m_connection_padid.value;
- }
- }
-
- connectString += ';' + type;
- if (connectType == 'consolidation')
- {
- connectString += ';SERVER=' + f.m_connection_servername.value;
- connectString += ';PORT=' + f.m_connection_port.value;
- } else if (connectType == 'contributorSeries7') {
- connectString += ';SERVER=' + f.m_connection_servername.value;
- connectString += ';PORT=' + f.m_connection_port.value;
- if ( padid != '' )
- {
- connectString += ';PADID=' + padid + ';UID=%s;PWD=%s';
- }
- } else if (connectType == 'contributor')
- {
- if (f.m_p_credentialNamespaces && f.m_p_credentialNamespaces.options[f.m_p_credentialNamespaces.selectedIndex].value != '')
- {
- connectString += ';UID=%s;PWD=%s';
- }
- }
- if (connectType == 'consolidation')
- {
- connectString += ';UID=%s;PWD=%s';
- }
- }
- else if (connectType == 'dbtwoolap')
- {
-
- connectString = ';LOCAL';
-
- connectString += ';DO';
- connectString += ';SERVER=' + f.m_connection_servername.value;
- if (f.authentication[1].checked || f.authentication[2].checked)
- {
- var prefix = '^User ID:';
- connectString += ';UID=%s';
- if (f.m_connection_use_pword.checked || f.authentication[1].checked)
- {
- prefix += '\^\?Password:';
- connectString += ';PWD=%s';
- }
- connectString = prefix + connectString;
- }
- }
-
- else if (connectType == 'tm1')
- {
-
- connectString = ';LOCAL';
-
- connectString += ';TM';
- connectString += ';TM1AdminHost=' + f.m_connection_hostname.value;
- connectString += ';TM1ServerName=' + f.m_connection_servername.value;
- if (f.authentication[1].checked || f.authentication[2].checked)
- {
- var prefix = '^User ID:';
- connectString += ';UID=%s';
- if (f.m_connection_use_pword.checked || f.authentication[1].checked)
- {
- prefix += '\^\?Password:';
- connectString += ';PWD=%s';
- }
- connectString = prefix + connectString;
- }
- }
-
- else if (connectType == 'tm1R')
- {
-
- connectString = ';LOCAL';
-
- connectString += ';TMR;LCID=en-us';
- connectString += ';TM1AdminHost=' + f.m_connection_hostname.value;
- if (f.m_connection_use_ssl.checked){
- connectString += ';TM1Protocol=https';
- } else {
- connectString += ';TM1Protocol=http';
- }
- connectString += ';TM1ServerPort=' + f.m_connection_tm1port.value;
- connectString += ';TM1ServerName=TM1ServerName;CATALOG=CATALOG';
- if (f.authentication[1].checked || f.authentication[2].checked)
- {
- var prefix = '^User ID:';
- connectString += ';UID=%s';
- if (f.m_connection_use_pword.checked || f.authentication[1].checked)
- {
- prefix += '\^\?Password:';
- connectString += ';PWD=%s';
- }
- connectString += ";";
- connectString = prefix + connectString;
- }
- }
-
- else if (connectType == 'odata')
- {
- connectString = ';LOCAL';
- connectString += ';ODATA';
- connectString += ';URL=' + f.m_connection_service_root_URI.value;
- if (f.authentication[1].checked)
- {
- var prefix = '^User ID:';
- connectString += ';UID=%s';
- if (f.m_connection_use_pword.checked || f.authentication[1].checked)
- {
- prefix += '\^\?Password:';
- connectString += ';PWD=%s';
- }
- connectString = prefix + connectString;
- }
- }
-
- else if (connectType == 'json')
- {
- connectString = ';LOCAL';
- connectString += ';JSON';
- connectString += ';URL=' + f.m_connection_url.value;
- if(f.m_connection_subType) {
- connectString += ';SUBTYPE=' + f.m_connection_subType;
- }
- if(f.m_connection_assembly.checked) {
- connectString += ';ASSEMBLY=true';
- }
- if(!f.m_connection_schema.disabled && f.m_connection_schema.value) {
- connectString += ';SCHEMA=' + f.m_connection_schema.value;
- }
- if(!f.m_connection_http_method.disabled) {
- connectString += ';METHOD=' + f.m_connection_http_method.value;
- }
- if(f.m_connection_http_mime_type && !f.m_connection_http_mime_type.disabled && f.m_connection_http_mime_type.value) {
- connectString += ';MIME_TYPE=' + f.m_connection_http_mime_type.value;
- }
- if(f.m_connection_http_message_body && !f.m_connection_http_message_body.disabled && f.m_connection_http_message_body.value) {
- connectString += ';DATA=' + f.m_connection_http_message_body.value;
- }
- if(!f.m_connection_json_path.disabled && f.m_connection_json_path.value) {
- connectString += ';PATH=' + f.m_connection_json_path.value;
- }
- if(f.m_connection_authentication_type.value == 'OAuth1.0'){
- connectString += ';TEMPORARY_TOKEN_ENDPOINT=' + f.m_connection_temporary_token_endpoint.value;
- connectString += ';AUTHORIZATION_ENDPOINT=' + f.m_connection_authorization_endpoint.value;
- connectString += ';TOKEN_ENDPOINT=' + f.m_connection_token_endpoint.value;
- }
- if(f.m_connection_authentication_type.value == 'OAuth2.0'){
- connectString += ';AUTHORIZATION_ENDPOINT=' + f.m_connection_authorization_endpoint.value;
- connectString += ';TOKEN_ENDPOINT=' + f.m_connection_token_endpoint.value;
- if (f.m_connection_scope.value)
- {
- connectString += ';SCOPE=' + f.m_connection_scope.value;
- }
- }
- connectString += ';AUTHENTICATION_TYPE=' + f.m_connection_authentication_type.value;
- if (f.m_connection_authentication_type.value != 'None')
- {
- connectString += ';UID=%s';
- connectString += ';PWD=%s';
- }
-
- }
- else if (connectType == 'cognosnow')
- {
-
- connectString = ';LOCAL';
-
- connectString += ';LA';
- connectString += ';SERVER=' + f.m_connection_servername.value;
- if (f.m_connection_port.value != '')
- {
- connectString += ':' + f.m_connection_port.value;
- }
- connectString += f.m_connection_file.value;
- }
- else if (connectType == 'msas_xmla')
- {
- connectString = ';LOCAL';
- connectString += ';X8';
- connectString += ';SERVER=' + f.m_connection_servername.value;
-
- if (f.m_connection_locale)
- {
- connectString += ';LCID=' + f.m_connection_locale.value;
- }
-
- if (f.m_connection_use_userid.checked)
- {
- var prefix = '^User ID:';
- connectString += ';UID=%s';
- if (f.m_connection_use_pword.checked)
- {
- prefix += '\^\?Password:';
- connectString += ';PWD=%s';
- }
- connectString = prefix + connectString;
- }
- }
- else if (connectType == 'msanalysis2005' || connectType == 'msanalysis2008' || connectType == 'msanalysis2012' || connectType == 'msanalysis2014' || connectType == 'msanalysis2016' || connectType == 'msanalysis2017')
- {
- connectString = ';LOCAL';
- var type = '';
-
- if (connectType == 'msanalysis2005')
- {
- type = 'YK';
- }
- else if (connectType == 'msanalysis2008')
- {
- type = 'M8';
- }
- else if (connectType == 'msanalysis2012')
- {
- type = 'M12';
- }
- else if (connectType == 'msanalysis2014')
- {
- type = 'M14';
- }
- else if (connectType == 'msanalysis2016')
- {
- type = 'M16';
- }
- else if (connectType == 'msanalysis2017')
- {
- type = 'M17';
- }
-
- connectString += ';' + type;
- connectString += ';SERVER=' + f.m_connection_servername.value;
- if ( trim(f.m_connection_namedinstance.value) != '')
- {
- connectString += '\\' + f.m_connection_namedinstance.value;
- }
-
- if (f.authentication[1].checked || f.authentication[2].checked)
- {
- var prefix = '^User ID:';
- connectString += ';UID=%s';
- if (f.m_connection_use_pword.checked || f.authentication[1].checked)
- {
- prefix += '\^\?Password:';
- connectString += ';PWD=%s';
- }
- connectString = prefix + connectString;
- }
- if (f.authentication[0].checked)
- {
- connectString += ';Trusted_Connection=yes';
- }
- if (f.m_connection_locale)
- {
- connectString += ';LCID=' + f.m_connection_locale.value;
- }
- }
-
- else if (connectType == 'powercube')
- {
-
- connectString = ';LOCAL';
- connectString += ';PC';
- connectString += ';WIN_PATH=' + f.m_connection_windows_cube.value;
- connectString += ';UNIX_PATH=' + f.m_connection_unix_cube.value;
-
- if (f.m_connection_cache_size && f.m_connection_cache_size.value != '')
- {
- connectString += ';readCacheSize=' + f.m_connection_cache_size.value;
- }
- if (f.cube_password_checkbox && f.cube_password_checkbox.checked)
- {
- connectString = '^?Password:' + connectString;
- connectString += ';cubePassword=%s';
- }
- }
-
- else if (connectType == 'sql' || connectType == 'sql2005' || connectType == 'sql2008' || connectType == 'sql2012-2014')
- {
- if (connectType == 'sql')
- {
- connectString = ';LOCAL;OL;DBInfo_Type=MS;Provider=SQLOLEDB';
- }
-
- else if (connectType == 'sql2005')
- {
- connectString = ';LOCAL;OL;DBInfo_Type=MS;Provider=SQLNCLI';
- }
-
- else if (connectType == 'sql2008')
- {
- connectString = ';LOCAL;OL;DBInfo_Type=MS;Provider=SQLNCLI10';
- }
- else if (connectType == 'sql2012-2014')
- {
- connectString = ';LOCAL;OL;DBInfo_Type=MS;Provider=SQLNCLI11';
- }
- if (f.authentication[2].checked || f.authentication[3].checked)
- {
- var prefix = '^User ID:';
- connectString += ';User ID=%s';
- if (f.m_connection_use_pword.checked || f.authentication[2].checked)
- {
- prefix += '\^\?Password:';
- connectString += ';Password=%s';
- }
- connectString = prefix + connectString;
- }
- connectString += ';Data Source=' + f.m_connection_database.value;
-
- if (f.authentication[1].checked || f.authentication[2].checked)
- {
- connectString += ';Integrated Security=SSPI';
- }
-
- var cat = isRadioButtonSelected(f.m_connection_sql_database_choice, 'master') ? 'master' : f.m_connection_sql_database_name.value;
- connectString += ';Provider_String=Initial Catalog=' + cat;
-
- if (f.m_connection_sql_application.value != '')
- {
- connectString += ';Application=';
- connectString += f.m_connection_sql_application.value;
- }
- if (connectType == 'sql2005' || connectType == 'sql2008' || connectType == 'sql2012-2014')
- {
- if (isListItemSelected(f.m_connection_sql_marsconnection, 'YES'))
- {
- connectString += ';MarsConn=YES';
- }
- }
- if (f.m_connection_optional_parameters.value && f.m_connection_optional_parameters.value != '')
- {
- connectString += ';' + f.m_connection_optional_parameters.value;
- }
- connectString += ';';
- if (isCheckboxChecked(f.m_transformUserIdentification))
- {
- connectString += '@TRANSFORMUID';
- }
- connectString += '@COLSEQ=' + f.m_connection_colseq.value;
- }
- else if (connectType == 'oracle')
- {
- connectString = ';LOCAL;OR;ORACLE@';
- var prefix = '';
-
- if (f.m_connection_use_userid.checked || isRadioButtonSelected(f.authentication, 'namespace'))
- {
- prefix = '^User ID:';
- connectString += '%s';
- }
- connectString += '@' + f.m_connection_database.value + '/';
- if ((f.m_connection_use_userid.checked && f.m_connection_use_pword.checked) || isRadioButtonSelected(f.authentication, 'namespace'))
- {
- prefix += '^?Password:';
- connectString += '%s';
- }
- connectString = prefix + connectString;
- if (isCheckboxChecked(f.m_transformUserIdentification))
- {
- connectString += '@TRANSFORMUID';
- }
- connectString += '@COLSEQ=' + f.m_connection_colseq.value;
- }
- else if (connectType == 'sybase' || connectType == 'sybase_ct15')
- {
- connectString = ';LOCAL;';
- if (connectType == 'sybase')
- {
- connectString += 'CT;';
- } else
- {
- connectString += 'CT15;';
- }
- connectString += f.m_connection_database.value;
- connectString += '|';
- var cat;
- if (f.m_connection_sybase_database_choice[0].checked)
- {
- cat = 'master';
- }
- else
- {
- cat = f.m_connection_sybase_database_name.value;
- }
- connectString += cat;
- connectString += '@';
- if (f.m_connection_use_userid.checked)
- {
- var prefix = '^User ID:';
- connectString += '%s/';
- if (f.m_connection_use_pword.checked)
- {
- prefix += '^?Password:';
- connectString += '%s';
- }
- connectString = prefix + connectString;
- }
- connectString += '@';
- connectString += f.m_connection_connect_time.value;
- connectString += '/';
- connectString += f.m_connection_reply_time.value;
- connectString += '@';
- connectString += f.m_connection_packet.value;
- connectString += '@ASYNC=';
- connectString += f.m_connection_sybase_async.options[f.m_connection_sybase_async.selectedIndex].value;
- connectString += '@POLL=';
- connectString += f.m_connection_polling.value;
- connectString += '@APPNAME=';
- connectString += f.m_connection_sybase_application.value;
- connectString += '@COLSEQ=';
- connectString += f.m_connection_colseq.value;
- }
- else if (connectType == 'informix')
- {
- connectString = ';LOCAL;IF;';
- connectString += f.m_connection_database.value;
- connectString += '@';
- connectString += f.m_connection_hostname.value;
- connectString += ':';
- connectString += f.m_connection_servername.value;
- connectString += '|';
- if (f.m_connection_service[0].checked)
- {
- connectString += f.m_connection_service[0].value;
- }
- else if (f.m_connection_service[1].checked)
- {
- connectString += f.m_connection_service[1].value;
- }
- else
- {
- if (f.m_connection_service_name.value != '')
- {
- connectString += f.m_connection_service_name.value;
- }
- }
- if (f.m_connection_use_userid.checked)
- {
- var prefix = '^User ID:';
- connectString += '@%s';
- if (f.m_connection_use_pword.checked)
- {
- prefix += '^?Password:';
- connectString += '/%s';
- }
- connectString = prefix + connectString;
- }
- connectString += '@COLSEQ=';
- connectString += f.m_connection_colseq.value;
- }
- else if (connectType == 'sr3')
- {
- connectString = ';LOCAL;ERP-SAP;URL=sap:';
-
- var prefix = '^User ID:';
- if (f.m_connection_use_pword.checked || f.authentication[0].checked)
- {
- prefix += '\^\?Password:';
- }
- connectString = prefix + connectString;
-
- if (f.m_connection_use_loadbalancing_hidden.value == "true")
- {
- connectString += 'LB:' + f.m_connection_message_server.value + ':' + f.m_connection_system_id.value + ':' + f.m_connection_logon_group.value + ':';
-
- }
- else
- {
- connectString += f.m_connection_application_server.value + ':' + f.m_connection_system_number.value + ':';
-
- }
-
- connectString += 'ROUTER_STRING=' + f.m_connection_router_string.value;
-
- connectString += ':' + f.m_connection_client.value + ':' + f.m_connection_language.value + ';';
-
- connectString += 'MAX_CONN=' + f.m_connection_max_conn_in_pool.value + ';';
-
- connectString += 'ABAP_QUERY_DB_ACCESSES=' + f.m_connection_abap_query_db_access_limit.value + ';';
-
- connectString += 'TABLE_READ_COUNT=' + f.m_connection_table_row_count.value + ';';
-
- connectString += 'READ_TABLE_FUNCTION_NAME=' + f.m_connection_table_read_function.value + ';';
-
- connectString += 'DRIVER_NAME=com.cognos.jdbc.driver.sap.SAPJdbcDriver';
-
- }
- else if (connectType == 'sfdc')
- {
- connectString = ';LOCAL;ERP-SFDC;URL=sfdc:' + f.m_connection_url.value;
- var prefix = '^User ID:';
- if (f.m_connection_use_pword.checked || f.authentication[0].checked)
- {
- prefix += '\^\?Password:';
- }
- connectString = prefix + connectString;
-
- connectString += ';CONCURRENT_CALLS_LIMIT=' + f.m_connection_conc_calls_limit.value + ';USER_CONCURRENT_CALLS_LIMIT=';
-
- connectString += f.m_connection_user_conc_calls_limit.value + ';CONNECTION_TIMEOUT=';
-
- connectString += f.m_connection_timeout.value + ';QUERY_BATCH_SIZE=';
-
- connectString += f.m_connection_query_batch_size.value + ';MAX_RETRIES=';
-
- connectString += f.m_connection_max_retries.value + ';WAIT_BETWEEN_RETRIES=';
-
- connectString += f.m_connection_wait_between_retries.value + ';PROXY_ENABLED=';
-
- if (f.m_connection_proxy_enabled.value == "true")
- {
- connectString += f.m_connection_proxy_enabled.value + ';PROXY_HOST=';
- connectString += f.m_connection_proxy_host.value + ';PROXY_PORT=';
- connectString += f.m_connection_proxy_port.value;
- }
- else
- {
- connectString += 'false';
- }
- connectString += ';USE_REST_API=';
-
- connectString += 'FALSE;CLIENT_ID=';
-
- connectString += ';CLIENT_SECRET=';
-
- connectString += ';';
-
- connectString += 'DRIVER_NAME=com.cognos.jdbc.driver.sfdc.SFDCJdbcDriver';
-
- }
- else if (connectType == 'siebel')
- {
- connectString = ';LOCAL;ERP-SIEBEL;URL=Siebel.';
- var prefix = '^User ID:';
- if (f.m_connection_use_pword.checked || f.authentication[0].checked)
- {
- prefix += '\^\?Password:';
- }
- connectString = prefix + connectString;
- connectString += f.m_connection_transport.value + '.';
-
- connectString += f.m_connection_encryption.value + '.';
-
- connectString += f.m_connection_compression.value + ':';
-
- connectString += '//' + f.m_connection_gatewayserver.value + ':';
-
- connectString += f.m_connection_gatewayport.value + '/' + f.m_connection_enterprise_name.value + '/';
-
- connectString += f.m_connection_aom.value + '_' + f.m_connection_language.value + ';';
-
- if (f.m_connection_siebel_repo.value != "")
- {
- connectString += 'REPOSITORY_NAME=' + f.m_connection_siebel_repo.value + ';';
- }
-
- if (f.m_connection_login_retries.value != "")
- {
- connectString += 'LOGIN_RETRY_COUNT=' + f.m_connection_login_retries.value + ';';
- }
-
- if (f.m_connection_login_retry_delay.value != "")
- {
- connectString += 'LOGIN_RETRY_DELAY=' + f.m_connection_login_retry_delay.value + ';';
- }
-
- if (f.m_connection_local_sort.value != "")
- {
- connectString += 'LOCALSORT=' + f.m_connection_local_sort.value + ';';
- }
-
- if (f.m_connection_level.value != "")
- {
- connectString += 'LEVEL=' + f.m_connection_level.value + ';';
- }
-
- if (f.m_connection_charset.value != "")
- {
- connectString += 'CHARSET=' + f.m_connection_charset.value + ';';
- }
-
- if (f.m_connection_adv_parameters.value != "")
- {
- connectString += 'ADVANCED_PARAMETERS=' + f.m_connection_adv_parameters.value + ';';
- }
-
- connectString += 'DRIVER_NAME=com.cognos.jdbc.driver.siebel.SiebelJdbcDriver';
-
- }
- else if (connectType == 'sap')
- {
- var sapType = f.m_connection_sap_type.options[f.m_connection_sap_type.selectedIndex].value;
- connectString = '^User ID:^?Password:;LOCAL;BW;serverType=';
- connectString += sapType + ';';
- connectString += 'server=';
- connectString += f.m_connection_database.value + ';';
- if (sapType == 'applicationServer')
- {
- connectString += 'sysnr=';
- connectString += f.m_connection_sys_no.value + ';';
- }
- if (sapType == 'messageServer')
- {
- connectString += 'sysid=';
- connectString += f.m_connection_sys_id.value + ';';
- }
- connectString += 'client=';
- connectString += f.m_connection_client_no.value + ';';
- if (sapType == 'messageServer')
- {
- connectString += 'logonGroup=';
- connectString += f.m_connection_logon.value + ';';
- }
- if (f.m_connection_sap_codepage.value != '')
- {
- connectString += 'codePage=';
- connectString += f.m_connection_sap_codepage.value + ';';
- }
-
- connectString += 'UID=%s;PWD=%s;';
- if (f.m_connection_router_string && f.m_connection_router_string.value != '')
- {
- connectString += 'routerString=';
- connectString += f.m_connection_router_string.value + ';';
- }
-
- if (isCheckboxChecked(f.m_transformUserIdentification))
- {
- connectString += '@TRANSFORMUID=TRUE';
- }
- }
- else if (connectType == 'sapR3' || connectType == 'sapECC')
- {
- if (connectType == 'sapR3')
- {
- connectString = '^User ID:^?Password:;LOCAL;R3;hostname=';
- }
- else if (connectType == 'sapECC')
- {
- connectString = '^User ID:^?Password:;LOCAL;EC;hostname=';
- }
- connectString += f.m_connection_hostname.value + ';';
- connectString += 'sysnr=';
- connectString += f.m_connection_sys_no.value + ';';
- connectString += 'gateway_host=';
- connectString += f.m_connection_gateway_host.value + ';';
- connectString += 'gateway_service=';
- connectString += f.m_connection_gateway_service.value + ';';
- connectString += 'destination=';
- connectString += f.m_connection_destination.value + ';';
- connectString += 'client=';
- connectString += f.m_connection_client.value + ';';
- connectString += 'UID=%s;PWD=%s;';
- connectString += 'language=';
- connectString += f.m_connection_sap_language.value + ';';
- if (f.m_connection_dictionary && f.m_connection_dictionary.value != '')
- {
- connectString += 'dictionary=';
- connectString += f.m_connection_dictionary.value + ';';
- }
- connectString += 'background=';
- if (f.m_connection_background.checked)
- {
- connectString += 'ON;';
- }
- else
- {
- connectString += 'OFF;';
- }
- if (connectType == 'sapR3')
- {
- if (f.m_connection_cogudaouterjoin.options[f.m_connection_cogudaouterjoin.selectedIndex].value == 'ON')
- {
- //No need to add it when the value is off.
- connectString += 'cogudaouterjoin=ON;';
- }
- }
- connectString += '@COLSEQ=';
- connectString += f.m_connection_colseq.value;
- }
- else if (connectType == 'xml')
- {
- connectString = ';LOCAL;XML;';
- connectString += f.m_connection_database.value;
- }
- else if (connectType == 'jdbc-db2')
- {
- // [^User ID:][^?Password:];LOCAL;JD-D2;URL=<URLSPEC>;DRIVER_NAME=com.ibm.db2.jcc.DB2Driver[;CognosProperty1=value1[;...]]
- // where
- // URLSPEC = jdbc:db2://<SERVERNAME>:<PORT>/<DBNAME>[:[jdbcproperty1=jdbcvalue1][;jdbcproperty2=jdbcvalue2]...]
-
- // Authentication: [0] None, [1] Namespace, [2] Signon (User ID/[Password])
-
- if (f.authentication[1].checked || f.authentication[2].checked) {
- var prefix = '^User ID:';
- if (f.m_connection_use_pword.checked || f.authentication[1].checked){
- prefix += '\^\?Password:';
- }
- connectString = prefix + connectString;
- }
- connectString += ';LOCAL;JD-D2';
- connectString += ';URL=jdbc:db2://' + f.m_connection_servername.value + ':' + f.m_connection_port.value + '/' + f.m_connection_jdbc_database_name.value;
-
- if (f.m_connection_jdbc_parameters.value != '') {
- connectString += ':' + f.m_connection_jdbc_parameters.value;
- }
-
- connectString += ';DRIVER_NAME=com.ibm.db2.jcc.DB2Driver';
- if (isCheckboxChecked(f.m_transformUserIdentification)){
- connectString += '@TRANSFORMUID=TRUE';
- }
- if (f.m_connection_jdbc_sort_colseq.value != '') {
- connectString += ';LOCALSORT=' + f.m_connection_jdbc_sort_colseq.value + ';LEVEL=' + f.m_connection_jdbc_sort_level.value;
- }
- }
- else if (connectType == 'jdbc-oracle')
- {
- // [^User ID:][^?Password:];LOCAL;JD-OR;URL=<URLSPEC>;DRIVER_NAME=oracle.jdbc.OracleDriver [;CognosProperty1=value1[;...]]
- // where
- // URLSPEC = jdbc:oracle:thin:@//<SERVERNAME>:<PORT>/<SERVICE_D>
- // URLSPEC = jdbc:oracle:thin:@(DESCRIPTION=...)
- // URLSPEC = jdbc:oracle:thin:@(DESCRIPTION_LIST=...)
- // URLSPEC = jdbc:oracle:oci:@<TNS_NAME>
- // URLSPEC = jdbc:oracle:oci:@(DESCRIPTION=...)
- // or URLSPEC = jdbc:oracle:oci:@(DESCRIPTION_LIST=...)
-
- // Authentication: Signon (User ID/[Password])
-
- if (f.m_connection_use_userid.checked || isRadioButtonSelected(f.authentication, 'namespace')) {
- connectString += '^User ID:';
- }
- if ((f.m_connection_use_userid.checked && f.m_connection_use_pword.checked) || isRadioButtonSelected(f.authentication, 'namespace')) {
- connectString += '^?Password:';
- }
-
- connectString += ';LOCAL;JD-OR;URL=jdbc:oracle:';
- if (f.m_connection_jdbc_oracle_style[0].checked) {
- connectString += "thin:@//" + f.m_connection_servername.value + ":" + f.m_connection_port.value + "/" + f.m_connection_oracle_service_id.value;
- } else if (f.m_connection_jdbc_oracle_style[1].checked) {
- connectString += "oci:@" + f.m_connection_oracle_tns_name.value;
- } else {
- if (f.m_connection_jdbc_oracle_driver_type[0].checked) {
- connectString += "thin:@";
- } else {
- connectString += "oci:@";
- }
- connectString += stripSpecialCharsFromOracleNetDesc(f.m_connection_oracle_net_descriptor.value);
- }
-
- connectString += ';DRIVER_NAME=oracle.jdbc.OracleDriver';
-
- if (isCheckboxChecked(f.m_transformUserIdentification))
- {
- connectString += '@TRANSFORMUID=TRUE';
- }
-
- var properties = f.m_connection_jdbc_parameters.value;
- if (properties != '' )
- {
- connectString += ';'
- connectString += properties;
- }
-
- if (f.m_connection_jdbc_sort_colseq.value != '') {
- connectString += ';LOCALSORT=' + f.m_connection_jdbc_sort_colseq.value + ';LEVEL=' + f.m_connection_jdbc_sort_level.value;
- }
- }
- else if (connectType == 'jdbc-generic' || connectType == 'lob-jdbc')
- {
- // [^User ID:][^?Password:];LOCAL;JDBC-OR;URL=<URLSPEC>;DRIVER_NAME=<DRIVER_NAME>[;CognosProperty1=value1[;...]]
- // where
- // URLSPEC = specific to the driver
- var connectString = '';
- if (f.authentication[2].checked) {
- connectString += '^User ID:';
- if (f.m_connection_use_pword.checked) {
- connectString += '^?Password:';
- }
- }
- connectString += ';LOCAL;JDBC;URL=';
- var url = f.m_jdbc_connection_url.value;
- connectString += url;
- connectString += ';DRIVER_NAME=' + f.m_jdbc_driver_class.value + ';';
- if (isCheckboxChecked(f.m_transformUserIdentification)){
- connectString += '@TRANSFORMUID=TRUE';
- }
- var properties = f.m_jdbc_connection_properties.value;
- connectString += properties;
- if (properties != '' && properties.charAt(properties.length - 1) != ';')
- {
- connectString += ';';
- }
- if (f.m_connection_jdbc_sort_colseq.value != '') {
- connectString += 'LOCALSORT=' + f.m_connection_jdbc_sort_colseq.value + ';LEVEL=' + f.m_connection_jdbc_sort_level.value;
- }
- }
- else if (connectType == 'filenet')
- {
- // [^User ID:][^?Password:];LOCAL;RP-CMIS-FILENET;URL=<URLSPEC>;DRIVER_NAME=<DRIVER_NAME>[;CognosProperty1=value1[;...]]
- // where
- // URLSPEC = specific to the driver
-
- // Authentication: Signon (User ID/[Password])
-
- var repositoryPluginClass;
- var provider;
- if (f.m_connection_jdbc_driverclass.value.indexOf('CMIS_') == 0) {
- repositoryPluginClass = 'com.ibm.cognos.cm.CMISRepository.CMISRepositoryPlugin';
- provider = f.m_connection_jdbc_driverclass.value.substring(5);
- if (f.m_connection_use_userid.checked) {
- connectString += '^User ID:';
- }
- if (f.m_connection_use_userid.checked && f.m_connection_use_pword.checked) {
- connectString += '^?Password:';
- }
- }
- connectString += ';LOCAL;RP-CMIS-FILENET;URL=';
- if (f.m_connection_jdbc_driverclass.value == 'FileSystem') {
- repositoryPluginClass = 'com.ibm.cognos.cm.fileSystemPlugin.FileSystemArchivePlugin';
- connectString += "alias:"
- }
- connectString += f.m_connection_jdbc_url.value + ";DRIVER_NAME=" + repositoryPluginClass;
- if (f.m_connection_file.value != '') {
- connectString += ';ROOT=' + f.m_connection_file.value;
- }
- if (f.m_connection_jdbc_parameters.value != '') {
- providerIdx = f.m_connection_jdbc_parameters.value.indexOf('PROVIDER=');
- if (providerIdx < 0 && provider != null) {
- connectString += ';PROVIDER=' + provider;
- }
- connectString += ';' + f.m_connection_jdbc_parameters.value;
- } else {
- if (provider != null) {
- connectString += ';PROVIDER=' + provider;
- }
- }
- }
- else if (connectType == 'jdbc-sql')
- {
- // [^User ID:][^?Password:];LOCAL;JD-SS;URL=<URLSPEC>;DRIVER_NAME=com.microsoft.sqlserver.jdbc.SQLServerDriver[;CognosProperty1=value1[;...]]
- // where
- // URLSPEC = jdbc:sqlserver://<SERVERNAME>[:<PORT>][;INSTANCENAME=<INSTNAME>];DATABASE=<DB>[;LOGINTIMEOUT=<TIMEOUT>][;integratedSecurity=true][;[jdbcproperty1=jdbcvalue1][;jdbcproperty2=jdbcvalue2]...]
-
- // Authentication: [0] None, [1] C8 service creds, [2] Namespace, [3] Signon (User ID/[Password])
-
- if (f.authentication[2].checked || f.authentication[3].checked) {
- connectString = '^User ID:';
- if (f.m_connection_use_pword.checked || f.authentication[2].checked) {
- connectString += '\^\?Password:';
- }
- }
-
- connectString += ';LOCAL;JD-SS';
- connectString += ';URL=jdbc:sqlserver://' + f.m_connection_servername.value;
- if (f.m_connection_port.value != '') {
- connectString += ':' + f.m_connection_port.value;
- }
- connectString += ';DATABASE=' + f.m_connection_jdbc_database_name.value;
-
- if (f.m_connection_sql_instance_name.value != '') {
- connectString += ';INSTANCENAME=' + f.m_connection_sql_instance_name.value;
- }
- if (f.m_connection_jdbc_connect_time.value != '') {
- connectString += ';LOGINTIMEOUT=' + f.m_connection_jdbc_connect_time.value;
- }
-
- if (f.authentication[1].checked || f.authentication[2].checked) {
- connectString += ';integratedSecurity=true';
- }
-
- if (f.m_connection_jdbc_parameters.value != '') {
- connectString += ';' + f.m_connection_jdbc_parameters.value;
- }
-
- connectString += ';DRIVER_NAME=com.microsoft.sqlserver.jdbc.SQLServerDriver';
-
- if (isCheckboxChecked(f.m_transformUserIdentification)){
- connectString += '@TRANSFORMUID=TRUE';
- }
- if (f.m_connection_jdbc_sort_colseq.value != '') {
- connectString += ';LOCALSORT=' + f.m_connection_jdbc_sort_colseq.value + ';LEVEL=' + f.m_connection_jdbc_sort_level.value;
- }
-
- }
- else if (connectType == 'jdbc-teradata')
- {
- // [^User ID:][^?Password:];LOCAL;JD-TD;URL=<URLSPEC>;DRIVER_NAME=com.teradata.jdbc.TeraDriver[;CognosProperty1=value1[;...]]
- // where
- // URLSPEC = jdbc:teradata://<SERVERNAME>/DBS_PORT=<PORT>,DATABASE=<DBNAME>[,jdbcproperty1=jdbcvalue1][,jdbcproperty2=jdbcvalue2]...
-
- // Authentication: [0] None, [1] Namespace, [2] Signon (User ID/[Password])
- if (f.authentication[1].checked || f.authentication[2].checked) {
- var prefix = '^User ID:';
- if (f.m_connection_use_pword.checked || f.authentication[1].checked){
- prefix += '\^\?Password:';
- }
- connectString = prefix + connectString;
- }
- connectString += ';LOCAL;JD-TD';
- connectString += ';URL=jdbc:teradata://' + f.m_connection_servername.value;
- if (f.m_connection_port.value != '') {
- connectString += '/DBS_PORT=' + f.m_connection_port.value;
- }
- if (f.m_connection_jdbc_database_name.value != '') {
- connectString += ',DATABASE=' + f.m_connection_jdbc_database_name.value;
- }
- if (f.m_connection_jdbc_parameters.value != '') {
- connectString += ',' + f.m_connection_jdbc_parameters.value;
- }
- connectString += ';DRIVER_NAME=com.teradata.jdbc.TeraDriver';
-
- if (isCheckboxChecked(f.m_transformUserIdentification)){
- connectString += '@TRANSFORMUID=TRUE';
- }
- if (f.m_connection_jdbc_sort_colseq.value != '') {
- connectString += ';LOCALSORT=' + f.m_connection_jdbc_sort_colseq.value + ';LEVEL=' + f.m_connection_jdbc_sort_level.value;
- }
- }
- else if (connectType == 'jdbc-netezza')
- {
- // [^User ID:][^?Password:];LOCAL;JD-NZ;URL=<URLSPEC>;DRIVER_NAME=org.netezza.Driver[;CognosProperty1=value1[;...]]
- // where
- // URLSPEC = jdbc:netezza://<SERVERNAME>[:<PORT>]/<DBNAME>[[;jdbcproperty1=jdbcvalue1][;jdbcproperty2=jdbcvalue2]...]
-
- var isNamespaceAuthSelected = f.authentication[1].checked;
- var isSignonsAuthSelected = f.authentication[2].checked;
- if (isNamespaceAuthSelected || isSignonsAuthSelected) {
- var prefix = '^User ID:';
- if (f.m_connection_use_pword.checked || isNamespaceAuthSelected){
- prefix += '\^\?Password:';
- }
- connectString = prefix + connectString;
- }
- connectString += ';LOCAL;JD-NZ';
-
- portString = "";
- if (f.m_connection_port.value != ""){
- portString = ":" + f.m_connection_port.value;
- }
-
- connectString += ';URL=jdbc:netezza://' + f.m_connection_servername.value + portString + '/' + f.m_connection_jdbc_database_name.value;
-
- if (f.m_connection_jdbc_parameters.value != '') {
- connectString += ';' + f.m_connection_jdbc_parameters.value;
- }
-
- connectString += ';DRIVER_NAME=org.netezza.Driver';
-
- if (isCheckboxChecked(f.m_transformUserIdentification)){
- connectString += '@TRANSFORMUID=TRUE';
- }
- if (f.m_connection_jdbc_sort_colseq.value != '') {
- connectString += ';LOCALSORT=' + f.m_connection_jdbc_sort_colseq.value + ';LEVEL=' + f.m_connection_jdbc_sort_level.value;
- }
- }
- else if (connectType == 'other')
- {
- connectString = f.m_other_connectionString.value;
- }
- return connectString;
- }
- function _parseConnectString(connectType, cs, credentialNamespaces, connectVariant)
- {
- var f = document.pform;
-
- if (connectType == 'composite' || connectType == 'virtualviewmanager' || connectType == 'db2' || connectType == 'odbc' || connectType == 'openEdge' || connectType == 'redbrick' || connectType == 'teradata' || connectType == 'sqlodbc' || connectType == 'sybaseIQ' || connectType == 'netezza')
- {
- var TRUSTED_CONNECTION = "Trusted_Connection=yes";
- var indexOfTrustedConnection = cs.indexOf(TRUSTED_CONNECTION);
- // Determine if a userid and password are required.
- var start;
- var end;
- if (credentialNamespaces == 'true' && (connectType == 'composite' || connectType == 'virtualviewmanager' || connectType == 'sqlodbc' || connectType == 'teradata' || connectType == 'db2' || connectType == 'odbc' || connectType == 'netezza'))
- {
- selectRadioButton(f.authentication, 'namespace');
-
- if (indexOfTrustedConnection != -1) {
- cs = cs.substring(0, indexOfTrustedConnection - 1) + cs.substring(indexOfTrustedConnection + TRUSTED_CONNECTION.length);
- }
-
- if (cs.indexOf("^?Password:") != -1)
- {
- start = cs.indexOf("PWD=");
- end = cs.indexOf(";", start + 5);
- if (start != -1 && end != -1)
- {
- cs = cs.substring(0, start) + cs.substring(end + 1);
- }
- }
- start = cs.indexOf("UID=");
- end = cs.indexOf(";", start + 5);
- if (start != -1 && end != -1)
- {
- cs = cs.substring(0, start) + cs.substring(end + 1);
- }
- }
- else if (indexOfTrustedConnection != -1 && connectType == 'sqlodbc')
- {
- selectRadioButton(f.authentication, 'windows');
- cs = cs.substring(0, indexOfTrustedConnection - 1) + cs.substring(indexOfTrustedConnection + TRUSTED_CONNECTION.length);
- }
- else if (cs.indexOf("^User ID:") != -1)
- {
- if (connectType == 'sqlodbc' || connectType == 'composite' || connectType == 'virtualviewmanager' || connectType == 'teradata' || connectType == 'db2' || connectType == 'odbc' || connectType == 'netezza')
- {
- selectRadioButton(f.authentication, 'signon');
- }
- else if (connectType == 'oracle') {
- selectRadioButton(f.authentication, 'signon');
- f.m_connection_use_userid.checked = true;
- }
- else
- {
- f.m_connection_use_userid.checked = true;
- }
- f.m_connection_use_pword.disabled = false;
- if (cs.indexOf("^?Password:") != -1)
- {
- f.m_connection_use_pword.checked = true;
- start = cs.indexOf("PWD=");
- end = cs.indexOf(";", start + 5);
- if (start != -1 && end != -1)
- {
- cs = cs.substring(0, start) + cs.substring(end + 1);
- }
- }
- start = cs.indexOf("UID=");
- end = cs.indexOf(";", start + 5);
- if (start != -1 && end != -1)
- {
- cs = cs.substring(0, start) + cs.substring(end + 1);
- }
- }
- else if (connectType == 'sqlodbc' || connectType == 'composite' || connectType == 'virtualviewmanager' || connectType == 'teradata' || connectType == 'db2' || connectType == 'odbc' || connectType == 'netezza' || connectType == 'oracle')
- {
- selectRadioButton(f.authentication, 'none');
- }
- // Strip everything up to and including the database code.
- // The offset is 10 because 7 for ;LOCAL; and 3 for XX; which is the database code.
- cs = cs.substring(cs.indexOf(";LOCAL;") + 10);
- // Determine the datasource name.
- start = cs.indexOf("DSN=");
- if (start != -1)
- {
- var end = cs.indexOf(";", start + 4);
- f.m_connection_database.value = cs.substring(start + 4, end);
- // Strip off the datasource name.
- cs = cs.substring(end + 1);
- }
- // Determine the collation sequence.
- start = cs.indexOf("@COLSEQ=");
- if (start != -1)
- {
- f.m_connection_colseq.value = cs.substring(start + 8);
- }
- // Determine the Async option.
- start = cs.indexOf("@ASYNC=");
- if (start != -1)
- {
- var useAsync = cs.substring(start + 7, start + 8);
- f.m_connection_use_async.checked = (useAsync == "1" ? true : false);
- }
-
- // Determine the connect timeout and reply timeout.
- start = cs.indexOf("@", start + 1);
- mid = cs.indexOf("/", start + 1);
- end = cs.indexOf("@", mid + 1);
- if (start != -1 && mid != -1 && end != -1)
- {
- f.m_connection_connect_time.value = cs.substring(start + 1, mid);
- f.m_connection_reply_time.value = cs.substring(mid + 1, end);
- }
- else
- {
- f.m_connection_connect_time.value = "0";
- f.m_connection_reply_time.value = "0";
- }
- // Determine the datasource Unicode access.
- start = cs.indexOf("@UNICODE");
- if (start != -1 && f.m_connection_odbc_access_mode)
- {
- f.m_connection_odbc_access_mode.checked = true;
- }
-
- start = cs.indexOf("@ASYNC=");
- if (start != -1)
- {
- f.m_connection_string.value = cs.substring(0, start);
- }
- else
- {
- f.m_connection_string.value = cs;
- }
- // Determine the User Identification Transform value.
- start = cs.indexOf("@TRANSFORMUID");
- if (start != -1)
- {
- f.m_transformUserIdentification.checked = true;
- }
- start = cs.indexOf("@TRUSTED_CONTEXT");
- if (start != -1)
- {
- f.m_connection_trusted_context.checked = true;
- start = cs.indexOf("@REGISTRY_NAME");
- if (start != -1)
- {
- end = cs.indexOf("@", start+14)
- f.m_connection_identity_propagation.value=cs.substring(start+15,end);
- }
-
-
- }
- }
- else if (connectType == 'oracle')
- {
- var start;
- var end;
- var bHasUserID = false;
- var bHasPassword = false;
- if (credentialNamespaces == 'true')
- {
- selectRadioButton(f.authentication, 'namespace');
- var bHasUserID = true;
- var bHasPassword = true;
- } else {
- if (cs.indexOf("^User ID:") != -1)
- {
- bHasUserID = true;
- f.m_connection_use_userid.checked = true;
- f.m_connection_use_pword.disabled = false;
- if (cs.indexOf("^?Password:") != -1)
- {
- bHasPassword = true;
- f.m_connection_use_pword.checked = true;
- }
- }
- }
- // Strip everything up to and including the ORACLE@ token.
- cs = cs.substring(cs.indexOf(";ORACLE@") + 8);
- if (bHasUserID == true)
- {
- // Strip off the user id placeholder.
- cs = cs.substring(cs.indexOf("@") + 1);
- }
- // if we're left with an @ at the start then remove it. This should happen with Bering+ Oracle strings but not with Baltic strings
- else if (cs.indexOf("@") == 0)
- {
- cs = cs.substring(1);
- }
- // Determine the User Identification Transform value.
- start = cs.indexOf("@TRANSFORMUID");
- if (start != -1)
- {
- f.m_transformUserIdentification.checked = true;
- }
- // Determine the collation sequence.
- start = cs.indexOf("@COLSEQ=");
- if (start != -1)
- {
- f.m_connection_colseq.value = cs.substring(start + 8);
- // Strip off the collation sequence.
- cs = cs.substring(0, start);
- }
- // Strip off the password placeholder and everything after it.
- start = cs.indexOf("/");
- if (start != -1)
- {
- cs = cs.substring(0, start);
- }
-
- // What remains of cs should be the SQL*Net connection string.
- f.m_connection_database.value = cs;
- }
- else if (connectType == 'sql' || connectType == 'sql2005' || connectType == 'sql2008' || connectType == 'sql2012-2014')
- {
- // Determine if a userid and password are required.
- var start;
- var end;
- if (credentialNamespaces == 'true')
- {
- f.authentication[2].checked='true';
- }
- else if (cs.indexOf("^User ID:") != -1)
- {
- f.authentication[3].checked = true;
- f.m_connection_use_pword.disabled = false;
- if (cs.indexOf("^?Password:") != -1)
- {
- f.m_connection_use_pword.checked = true;
- }
- }
- else if (cs.indexOf(";Integrated Security=SSPI") != -1)
- {
- f.authentication[1].checked = true;
- }
- else
- {
- f.authentication[0].checked = true;
- }
- // Determine the database name.
- f.m_connection_database.value = getField(cs, "Data Source=");
- // Determine the collation sequence.
- f.m_connection_colseq.value = getField(cs, "COLSEQ=");
- start = cs.indexOf("Initial Catalog=");
- if (-1 != start)
- {
- end = cs.indexOf(";", start + 16);
- var cat = '';
- if (end == -1)
- {
- cat = cs.substring(start + 16);
- }
- else
- {
- cat = cs.substring(start + 16, end);
- }
- if (cat == 'master')
- {
- f.m_connection_sql_database_choice[0].checked = true;
- f.m_connection_sql_database_choice[1].checked = false;
- f.m_connection_sql_database_name.value = '';
- }
- else
- {
- f.m_connection_sql_database_choice[0].checked = false;
- f.m_connection_sql_database_choice[1].checked = true;
- f.m_connection_sql_database_name.value = cat;
- }
- }
- //Determine the MARS connection
- if (connectType == 'sql2005' || connectType == 'sql2008' || connectType == 'sql2012-2014')
- {
- var marsconn = getField(cs, "MarsConn=");
- if (marsconn == 'YES') {
- f.m_connection_sql_marsconnection.value = 'YES' ;
- }
- }
- // Determine the application string.
- // Still waiting for the actual format (within the connect string) for this entry.
- f.m_connection_sql_application.value = getField(cs, "Application=");
- // last valid param can be either "MarsConn=" "Application=" or "Catalog="
- startMarsConn = cs.indexOf("MarsConn=");
- startApplication = cs.indexOf("Application=");
- startCatalog = cs.indexOf("Catalog=");
- last_valid_param = Math.max(startMarsConn, startApplication, startCatalog);
-
- // Determine the User Identification Transform value.
- start = cs.indexOf("@TRANSFORMUID");
- if (start != -1)
- {
- f.m_transformUserIdentification.checked = true;
- end = start;
- }
- else
- {
- end = cs.indexOf("@COLSEQ=");
- }
-
- // Determine optional params (if they exist)
- var optional_params ='';
- if (last_valid_param != -1)
- {
- start = cs.indexOf(";", last_valid_param);
- if (start != -1)
- {
- optional_params = cs.substring (start+1,end);
- }
- }
- f.m_connection_optional_parameters.value = optional_params;
- }
- else if (connectType == 'sybase' || connectType == 'sybase_ct15')
- {
- // Treat the prefixes
- if (cs.indexOf("^User ID:") != -1)
- {
- f.m_connection_use_userid.checked = true;
- f.m_connection_use_pword.disabled = false;
- if (cs.indexOf("^?Password:") != -1)
- {
- f.m_connection_use_pword.checked = true;
- }
- }
- if (connectType == 'sybase')
- {
- cs = cs.substring(cs.indexOf(";LOCAL;CT;") + 10);
- } else
- {
- cs = cs.substring(cs.indexOf(";LOCAL;CT15;") + 12);
- }
- var tokens = cs.split("@");
- var first = tokens[0];
- var start = first.indexOf("|");
- if (-1 != start)
- {
- var cat = first.substring(start+1);
- f.m_connection_sybase_database_choice[0].checked = (cat == "master");
- f.m_connection_sybase_database_choice[1].checked = (cat != "master");
- if (cat != "master")
- {
- f.m_connection_sybase_database_name.value = cat;
- }
- first = first.substring(0, start);
- }
- f.m_connection_database.value = first;
- var third = tokens[2];
- start = third.indexOf("/");
- if (-1 != start)
- {
- var value = third.substring(0, start);
- value = (value == '') ? '0' : value;
- f.m_connection_connect_time.value = value;
- third = third.substring(start + 1);
- }
- f.m_connection_reply_time.value = (third == '') ? '0' : third;
- var fourth = tokens[3];
- f.m_connection_packet.value = (fourth == '') ? '512' : fourth;
- var fifth = tokens[4];
- start = fifth.indexOf("ASYNC=");
- if (-1 != start)
- {
- var value = fifth.substring(start + 6);
- value = (value == '') ? '0' : value;
- var number = parseInt(value);
- for (var i = 1; i < 4; i++)
- {
- f.m_connection_sybase_async.options[i].selected = (number == i) ? true : false;
- }
- }
- var sixth = tokens[5];
- start = sixth.indexOf("POLL=");
- if (-1 != start)
- {
- var value = sixth.substring(start + 5);
- value = (value == '') ? '100' : value;
- f.m_connection_polling.value = value;
- }
- var seventh = tokens[6];
- f.m_connection_sybase_application.value = getField(seventh , "APPNAME=");
- var eigth = tokens[7];
- f.m_connection_colseq.value = getField(eigth, "COLSEQ=");
- }
- else if (connectType == 'informix')
- {
- // Treat the prefixes
- if (cs.indexOf("^User ID:") != -1)
- {
- f.m_connection_use_userid.checked = true;
- f.m_connection_use_pword.disabled = false;
- if (cs.indexOf("^?Password:") != -1)
- {
- f.m_connection_use_pword.checked = true;
- }
- }
- cs = cs.substring(cs.indexOf(";LOCAL;IF;") + 10);
- var colStart = cs.indexOf("@COLSEQ=");
- if (-1 != colStart)
- {
- f.m_connection_colseq.value = cs.substring(colStart + 8);
- cs = cs.substring(0, colStart);
- }
- var tokens = cs.split("@");
- f.m_connection_database.value = tokens[0];
- if (tokens.length > 1)
- {
- var middle = tokens[1];
- var start = middle.indexOf("|");
- if (-1 != start)
- {
- var service = middle.substring(start + 1);
-
- f.m_connection_service[0].checked = (service == "sqlexec");
- f.m_connection_service[1].checked = (service == "sqlturbo");
- f.m_connection_service[2].checked = (service != "sqlexec" && service != "sqlturbo");
- if (f.m_connection_service[2].checked)
- {
- f.m_connection_service_name.value = service;
- }
- middle = middle.substring(0, start);
- }
-
- start = middle.indexOf(":");
- if (-1 != start)
- {
- f.m_connection_servername.value = middle.substring(start + 1);
- middle = middle.substring(0, start);
- }
- f.m_connection_hostname.value = middle;
- }
- }
-
-
-
- else if (connectType == 'consolidation' || connectType == 'contributorSeries7')
- {
- f.m_connection_servername.value = getField(cs, "SERVER=");
- f.m_connection_port.value = getField(cs, "PORT=");
- if (connectType == 'contributorSeries7')
- {
- if(f.m_connection_padid)
- {
- f.m_connection_padid.value = getField(cs, "PADID=");
- }
- }
- }
-
- else if (connectType == 'powercube')
- {
- // Determine if a userid and password are required.
- var start;
- var end;
- if (credentialNamespaces == 'true')
- {
- f.authentication[1].checked = true;
- }
- else
- {
- f.authentication[0].checked = true;
- }
- // Determine the cache size.
- if (getField(cs, "readCacheSize=") != '')
- {
- f.m_connection_cache_size.value = getField(cs, "readCacheSize=");
- }
-
- // Determine the Location string.
- if (getField(cs, "WIN_PATH=") != '')
- {
- f.m_connection_windows_cube.value = getField(cs, "WIN_PATH=");
- }
- else
- {
- // upgrade old powercube connections to the new UI (WO 1116)
- f.m_connection_windows_cube.value = getField(cs, "CUBE=");
- }
- f.m_connection_unix_cube.value = getField(cs, "UNIX_PATH=");
- if (cs.indexOf("^?Password:") != -1 && f.cube_password_checkbox)
- {
- f.cube_password_checkbox.checked = true;
- }
- }
-
- else if (connectType == 'msanalysis2005' || connectType == 'msanalysis2008' || connectType == 'msanalysis2012' || connectType == 'msanalysis2014' || connectType == 'msanalysis2016' || connectType == 'msanalysis2017')
- {
- // Determine if a userid and password are required.
- if (credentialNamespaces == 'true')
- {
- f.authentication[1].checked = true;
- }
- else if (cs.indexOf("^User ID:") != -1)
- {
- f.authentication[2].checked = true;
- f.m_connection_use_pword.disabled = false;
- if (cs.indexOf("^?Password:") != -1)
- {
- f.m_connection_use_pword.checked = true;
- }
- }
- else if (cs.indexOf("Trusted_Connection=yes") != -1)
- {
- f.authentication[0].checked = true;
- }
-
- // Determine the server name.
- var serverField = getField(cs, "SERVER=");
- var position = serverField.indexOf("\\");
- if ( position != -1)
- {
- f.m_connection_servername.value = serverField.slice(0, position);
- f.m_connection_namedinstance.value = serverField.slice(position+1);
- }
- else {
- f.m_connection_servername.value = serverField;
- f.m_connection_namedinstance.value = '';
- }
- }
-
- else if (connectType == 'dbtwoolap')
- {
- // Determine if a userid and password are required.
- if (credentialNamespaces == 'true')
- {
- f.authentication[1].checked='true';
- }
- else if (cs.indexOf("^User ID:") != -1)
- {
- f.authentication[2].checked = true;
- f.m_connection_use_pword.disabled = false;
- if (cs.indexOf("^?Password:") != -1)
- {
- f.m_connection_use_pword.checked = true;
- }
- }
- else
- {
- f.authentication[0].checked = true;
- }
- // Determine the server name.
- f.m_connection_servername.value = getField(cs, "SERVER=");
- }
-
- else if ((connectType == 'tm1'))
- {
- if (credentialNamespaces == 'true')
- {
- f.authentication[1].checked='true';
- }
- else if (cs.indexOf("^User ID:") != -1)
- {
- f.authentication[2].checked = true;
- f.m_connection_use_pword.disabled = false;
- if (cs.indexOf("^?Password:") != -1)
- {
- f.m_connection_use_pword.checked = true;
- }
- }
- else
- {
- f.authentication[0].checked = true;
- }
- //Determine the TM1 hostname
- f.m_connection_hostname.value = getField(cs, "TM1AdminHost=");
- // Determine the TM1 server name.
- f.m_connection_servername.value = getField(cs, "TM1ServerName=");
- }
- else if ((connectType == 'tm1R'))
- {
- if (credentialNamespaces == 'true')
- {
- f.authentication[1].checked='true';
- }
- else if (cs.indexOf("^User ID:") != -1)
- {
- f.authentication[2].checked = true;
- f.m_connection_use_pword.disabled = false;
- if (cs.indexOf("^?Password:") != -1)
- {
- f.m_connection_use_pword.checked = true;
- }
- }
- else
- {
- f.authentication[0].checked = true;
- }
- //Determine the TM1 hostname
- f.m_connection_hostname.value = getField(cs, "TM1AdminHost=");
- // Determine the TM1 server name.
- f.m_connection_tm1port.value = getField(cs, "TM1ServerPort=");
- //determine the tm1 protocol
- var protocol = getField(cs, "TM1Protocol=");
- if (protocol === 'https') {
- f.m_connection_use_ssl.checked = true;
- }
- }
- else if (connectType == 'odata')
- {
- if (cs.indexOf("^User ID:") != -1)
- {
- f.authentication[1].checked = true;
- f.m_connection_use_pword.disabled = false;
- if (cs.indexOf("^?Password:") != -1)
- {
- f.m_connection_use_pword.checked = true;
- }
- }
- else
- {
- f.authentication[0].checked = true;
- }
- //Determine the OData Service Root URI
- f.m_connection_service_root_URI.value = getField(cs, ";URL=");
- }
- else if (connectType == 'json')
- {
- f.m_connection_subType = getField(cs, ";SUBTYPE=");
- f.m_connection_url.value = getField(cs, ";URL=");
- f.m_connection_assembly.checked = (getField(cs, ";ASSEMBLY=") == 'true');
- if (f.m_connection_assembly.checked) {
- f.m_connection_schema.disabled = true;
- f.m_connection_http_method.disabled = true;
- if (f.m_connection_http_message_body) {
- f.m_connection_http_message_body.disabled = true;
- }
- f.m_connection_json_path.disabled = true;
- } else {
- f.m_connection_schema.value = getField(cs, ";SCHEMA=");
- f.m_connection_http_method.value = getField(cs, ";METHOD=");
- if(f.m_connection_http_method.value == 'POST'){
- f.m_connection_http_mime_type.value = getField(cs, ";MIME_TYPE=");
- f.m_connection_http_message_body.value = getField(cs, ";DATA=");
- }
- f.m_connection_json_path.value = getField(cs, ";PATH=");
- }
- f.m_connection_authentication_type.value = getField(cs,';AUTHENTICATION_TYPE=');
- if(f.m_connection_authentication_type.value == 'OAuth1.0'){
- f.m_connection_temporary_token_endpoint.value = getField(cs,';TEMPORARY_TOKEN_ENDPOINT=');
- f.m_connection_authorization_endpoint.value = getField(cs,';AUTHORIZATION_ENDPOINT=');
- f.m_connection_token_endpoint.value = getField(cs,';TOKEN_ENDPOINT=');
- }
- if(f.m_connection_authentication_type.value == 'OAuth2.0'){
- f.m_connection_authorization_endpoint.value = getField(cs,';AUTHORIZATION_ENDPOINT=');
- f.m_connection_token_endpoint.value = getField(cs,';TOKEN_ENDPOINT=');
- f.m_connection_scope.value = getField(cs,';SCOPE=');
- }
- }
- else if (connectType == 'cognosnow')
- {
- // Determine if a userid and password are required.
- var start;
- var end;
- // Determine the CognosNow port.
- start = cs.indexOf(":");
- end = cs.indexOf("/", start + 1);
- if (start != -1 && end != -1)
- {
- f.m_connection_port.value = cs.substring(start+1, end);
- }
- //Determine the CognosNow server
- var startServer = cs.indexOf("SERVER=");
- if (startServer != -1) {
- if (start!=-1)
- {
- f.m_connection_servername.value = cs.substring(startServer+7, start);
- }
- else if (end!=-1)
- {
- f.m_connection_servername.value = cs.substring(startServer+7, end-1);
- }
- }
- //Determine the file name and path.
- start = cs.indexOf("/");
- if (start != -1)
- {
- cs = cs.substring(start, cs.length-1);
- }
- }
- else if (connectType == 'sap')
- {
- // Determine the server name.
- f.m_connection_database.value = getField(cs, "server=");
- // Determine the system number.
- if (f.m_connection_sys_no)
- {
- f.m_connection_sys_no.value = getField(cs, "sysnr=");
- }
- // Determine the system id.
- if (f.m_connection_sys_id)
- {
- f.m_connection_sys_id.value = getField(cs, "sysid=");
- }
-
- // Determine the logon group.
- if (f.m_connection_logon)
- {
- f.m_connection_logon.value = getField(cs, "logonGroup=");
- }
-
- // Determine the client number.
- f.m_connection_client_no.value = getField(cs, "client=");
- // Determine the system number.
- if (f.m_connection_sap_codepage)
- {
- var value = getField(cs, "codePage=")
- if (value == '')
- {
- f.m_connection_sap_codepage.value = "4110";
- }
- else
- {
- f.m_connection_sap_codepage.value = value;
- }
- }
- // default the signon section
- if (f.authentication)
- {
- if (credentialNamespaces == 'true')
- {
- f.authentication[0].checked = true;
- }
- else
- {
- f.authentication[1].checked = true;
- }
- }
- // Determine the router string.
- if (f.m_connection_router_string)
- {
- f.m_connection_router_string.value = getField(cs, "routerString=");
- }
- // Determine the User Identification Transform value.
- if (cs.indexOf("@TRANSFORMUID") != -1)
- {
- f.m_transformUserIdentification.checked = true;
- }
- }
- else if (connectType == 'sapR3' || connectType == 'sapECC')
- {
- // Determine the server name.
- f.m_connection_hostname.value = getField(cs, "hostname=");
- f.m_connection_sys_no.value = getField(cs, "sysnr=");
- f.m_connection_gateway_host.value = getField(cs, "gateway_host=");
- f.m_connection_gateway_service.value = getField(cs, "gateway_service=");
- f.m_connection_client.value = getField(cs, "client=");
- f.m_connection_destination.value = getField(cs, "destination=");
-
- f.m_connection_sap_language.value = getField(cs, "language=");
- // Determine the background.
- var value = getField(cs, "background=")
- if (value == 'ON')
- {
- f.m_connection_background.checked=true;
- }
- else
- {
- f.m_connection_background.checked=false;
- }
- if (connectType == 'sapR3')
- {
- var cogudajoin = getField(cs, "cogudaouterjoin=");
- if (cogudajoin == 'ON')
- {
- f.m_connection_cogudaouterjoin.value = cogudajoin;
- }
- }
- // Determine the collation sequence.
- f.m_connection_colseq.value = getField(cs, "COLSEQ=");
- }
- else if (connectType == 'jdbc-db2')
- {
- // [^User ID:][^?Password:];LOCAL;JD-D2;URL=<URLSPEC>;DRIVER_NAME=com.ibm.db2.jcc.DB2Driver[;CognosProperty1=value1[;...]]
- // where
- // URLSPEC = jdbc:db2://<SERVERNAME>:<PORT>/<DBNAME>[:[jdbcproperty1=jdbcvalue1][;jdbcproperty2=jdbcvalue2]...]
-
- // Authentication: [0] None, [1] Namespace, [2] Signon (User ID/[Password])
-
- if (credentialNamespaces == 'true') {
- f.authentication[1].checked = true;
- } else if (cs.indexOf("^User ID:") != -1) {
- f.authentication[2].checked = 'true';
- f.m_connection_use_pword.disabled = false;
- if (cs.indexOf("^?Password:") != -1) {
- f.m_connection_use_pword.checked = true;
- }
- } else {
- f.authentication[0].checked = 'true';
- }
- var serverNameEnd;
- var urlProtocol = "jdbc:db2://";
- var urlStart = cs.indexOf(urlProtocol);
- if (urlStart != -1) {
- serverNameEnd = cs.indexOf(":", urlStart + urlProtocol.length);
- if (serverNameEnd != -1) {
- f.m_connection_servername.value = cs.substring(urlStart + urlProtocol.length, serverNameEnd);
- }
- }
-
- var portEnd = cs.indexOf("/", serverNameEnd + 1);
- if (portEnd != -1) {
- f.m_connection_port.value = cs.substring(serverNameEnd + 1, portEnd);
- }
-
- var urlEnd;
- var dbNameEnd = cs.indexOf(":", portEnd + 1);
- if (dbNameEnd != -1) {
- // has JDBC properties
- f.m_connection_jdbc_database_name.value = cs.substring(portEnd + 1, dbNameEnd);
- var urlEnd = cs.indexOf(";DRIVER_NAME", dbNameEnd + 1);
- if (urlEnd != -1) {
- f.m_connection_jdbc_parameters.value = cs.substring(dbNameEnd + 1, urlEnd);
- }
- } else {
- var urlEnd = cs.indexOf(";DRIVER_NAME", portEnd + 1);
- if (urlEnd != -1) {
- f.m_connection_jdbc_database_name.value = cs.substring(portEnd + 1, urlEnd);
- }
- }
- if (isCheckboxChecked(f.m_transformUserIdentification)){
- connectString += '@TRANSFORMUID=TRUE';
- }
- f.m_connection_jdbc_sort_colseq.value = getFieldStartingAt(cs, urlEnd + 1, "LOCALSORT=", ";");
- f.m_connection_jdbc_sort_level.value = getFieldStartingAt(cs, urlEnd + 1, "LEVEL=", ";");
- }
- else if (connectType == 'jdbc-oracle')
- {
- // [^User ID:][^?Password:];LOCAL;JD-OR;URL=<URLSPEC>;DRIVER_NAME=oracle.jdbc.OracleDriver [;CognosProperty1=value1[;...]]
- // where
- // URLSPEC = jdbc:oracle:thin:@//<SERVERNAME>:<PORT>/<SERVICE_D>
- // URLSPEC = jdbc:oracle:thin:@(DESCRIPTION=...)
- // URLSPEC = jdbc:oracle:thin:@(DESCRIPTION_LIST=...)
- // URLSPEC = jdbc:oracle:oci:@<TNS_NAME>
- // URLSPEC = jdbc:oracle:oci:@(DESCRIPTION=...)
- // or URLSPEC = jdbc:oracle:oci:@(DESCRIPTION_LIST=...)
-
- // Authentication: Signon (User ID/[Password])
-
- if (cs.indexOf("^User ID:") != -1) {
- f.m_connection_use_userid.checked = true;
- f.m_connection_use_pword.disabled = false;
- if (cs.indexOf("^?Password:") != -1) {
- f.m_connection_use_pword.checked = true;
- }
- }
- var urlEnd;
- if (cs.indexOf('DESCRIPTION') != -1 || cs.indexOf('DESCRIPTION_LIST') != -1) {
- // Oracle Net Descriptor
- f.m_connection_jdbc_oracle_style[2].checked = true;
-
- var thinURLProtocol = "jdbc:oracle:thin:@";
- var thinURLStart = cs.indexOf(thinURLProtocol);
- if (thinURLStart != -1) {
- // Thin
- f.m_connection_jdbc_oracle_driver_type[0].checked = true;
-
- urlEnd = cs.indexOf(";DRIVER_NAME", thinURLStart + thinURLProtocol.length);
- if (urlEnd != -1) {
- f.m_connection_oracle_net_descriptor.value = formatOracleNetDesc(cs.substring(thinURLStart + thinURLProtocol.length, urlEnd));
- }
-
- } else {
- // OCI
- f.m_connection_jdbc_oracle_driver_type[1].checked = true;
-
- var ociProtocol = "jdbc:oracle:oci:@";
- var ociURLStart = cs.indexOf(ociProtocol);
- if (ociURLStart != -1) {
- urlEnd = cs.indexOf(";DRIVER_NAME", ociURLStart + ociProtocol.length);
- if (urlEnd != -1) {
- f.m_connection_oracle_net_descriptor.value = formatOracleNetDesc(cs.substring(ociURLStart + ociProtocol.length, urlEnd));
- }
- }
- }
-
- } else {
- var thinServiceIDProtocol = "jdbc:oracle:thin:@//";
- var thinURLStart = cs.indexOf(thinServiceIDProtocol);
- if (thinURLStart != -1) {
- // Service ID
- f.m_connection_jdbc_oracle_style[0].checked = true;
-
- var serverNameEnd = cs.indexOf(":", thinURLStart + thinServiceIDProtocol.length);
- if (serverNameEnd != -1) {
- f.m_connection_servername.value = cs.substring(thinURLStart + thinServiceIDProtocol.length, serverNameEnd);
- }
-
- var portEnd = cs.indexOf("/", serverNameEnd + 1);
- if (portEnd != -1) {
- f.m_connection_port.value = cs.substring(serverNameEnd + 1, portEnd);
- }
-
- urlEnd = cs.indexOf(";DRIVER_NAME", portEnd + 1);
- if (urlEnd != -1) {
- f.m_connection_oracle_service_id.value = cs.substring(portEnd + 1, urlEnd);
- }
- } else {
- var ociProtocol = "jdbc:oracle:oci:@";
- var ociURLStart = cs.indexOf(ociProtocol);
- if (ociURLStart != -1) {
- // TNS Names Alias
- f.m_connection_jdbc_oracle_style[1].checked = true;
-
- urlEnd = cs.indexOf(";DRIVER_NAME", ociURLStart + ociProtocol.length);
- if (urlEnd != -1) {
- f.m_connection_oracle_tns_name.value = cs.substring(ociURLStart + ociProtocol.length, urlEnd);
- }
- }
- }
- }
-
- // find out if there are driver specific properties
- // urlEnd = cs.indexOf(";DRIVER_NAME");
- var driverEnd = cs.indexOf(";", urlEnd + ";DRIVER_NAME".length);
- if (driverEnd != -1) {
- var localsortstart = cs.indexOf(";LOCALSORT", driverEnd)
- if (localsortstart != -1) {
- if (localsortstart != driverEnd ) {
- f.m_connection_jdbc_parameters.value = cs.substring(driverEnd + 1, cs.indexOf(";LOCALSORT", driverEnd));
- }
- } else {
- f.m_connection_jdbc_parameters.value = cs.substring(driverEnd + 1);
- }
- f.m_connection_jdbc_sort_colseq.value = getFieldStartingAt(cs, urlEnd + 1, "LOCALSORT=", ";");
- f.m_connection_jdbc_sort_level.value = getFieldStartingAt(cs, urlEnd + 1, "LEVEL=", ";");
- }
- }
- else if (connectType == 'jdbc-generic' || connectType == 'lob-jdbc')
- {
- // [^User ID:][^?Password:];LOCAL;JDBC;URL=jdbc:<subprotocol>:<URL>;DRIVER_NAME=<DRIVER_NAME>[;CognosProperty1=value1[;...]]
- // where
- // subprotocol is defined in generateDatasourceMetadata.
- // URL is user specified.
- if (credentialNamespaces == 'true' ) {
- selectRadioButton(f.authentication, 'namespace');
- } else if (cs.indexOf("^User ID:") != -1) {
- selectRadioButton(f.authentication, 'signon');
- f.m_connection_use_pword.disabled = false;
- if (cs.indexOf("^?Password:") != -1) {
- f.m_connection_use_pword.checked = true;
- }
- } else {
- selectRadioButton(f.authentication, 'none');
- }
-
- var urlConstant = "URL=";
- var urlStart = cs.indexOf(urlConstant)
- if (urlStart != -1) {
- var urlEnd;
- var driverConstant = ";DRIVER_NAME=";
- urlEnd = cs.indexOf(driverConstant, urlStart + urlConstant.length);
- if (urlEnd != -1) {
- var jdbcUrl = cs.substring(urlStart + urlConstant.length, urlEnd);
- var protocolStart = "jdbc:".length;
- // Sybase and Greenplum have ':' in the protocol name so searching for the first index doesn't work
- // Have to put in a static check for now. If we get too many exceptions we should look at
- // reading the connections metadata file for a list subprotocols.
- var protocolEnd = jdbcUrl.indexOf(":", protocolStart);
- if (protocolEnd != -1) {
- var subprotocol = jdbcUrl.substring(protocolStart, protocolEnd);
- if (subprotocol.toLowerCase() == "sybase" || subprotocol.toLowerCase() == "pivotal") {
- protocolEnd = jdbcUrl.indexOf(":", protocolEnd + 1);
- subprotocol = jdbcUrl.substring(protocolStart, protocolEnd);
- }
- f.m_jdbc_connection_code = subprotocol;
- f.m_jdbc_connection_url.value = jdbcUrl;
- }
- var driverEnd = cs.indexOf(";", urlEnd + driverConstant.length);
- if (driverEnd != -1) {
- f.m_jdbc_driver_class.value = cs.substring(urlEnd + driverConstant.length, driverEnd);
- var localSort = "LOCALSORT=";
- var propEnd = cs.indexOf(localSort, driverEnd + 1);
- if (propEnd == -1) {
- f.m_jdbc_connection_properties.value = cs.substring(driverEnd + 1);
- } else if (propEnd == 0) {
- f.m_jdbc_connection_properties.value = '';
- } else {
- f.m_jdbc_connection_properties.value = cs.substring(driverEnd + 1, propEnd);
- }
- f.m_connection_jdbc_sort_colseq.value = getFieldStartingAt(cs, driverEnd, "LOCALSORT=", ";");
- f.m_connection_jdbc_sort_level.value = getFieldStartingAt(cs, driverEnd, "LEVEL=", ";");
- } else {
- f.m_jdbc_driver_class.value = cs.substring(urlEnd + driverConstant.length);
- }
-
- // Determine the User Identification Transform value.
- start = cs.indexOf("@TRANSFORMUID");
- if (start != -1)
- {
- f.m_transformUserIdentification.checked = true;
- }
- }
- }
- }
- else if (connectType == 'filenet')
- {
- // [^User ID:][^?Password:];LOCAL;RP-CMIS-FILENET;URL=<URLSPEC>;DRIVER_NAME=<DRIVER_NAME>;ROOT=GRAPHIC[;CognosProperty1=value1[;...]]
- // where
- // URLSPEC = specific to the driver
-
- // Authentication: Signon (User ID/[Password])
-
- if (cs.indexOf("^User ID:") != -1) {
- f.m_connection_use_userid.checked = true;
- f.m_connection_use_pword.disabled = false;
- if (cs.indexOf("^?Password:") != -1) {
- f.m_connection_use_pword.checked = true;
- }
- }
-
- connectionData = [
- {key: "URL=", field: "m_connection_jdbc_url", end: ";DRIVER_NAME="},
- {key: "DRIVER_NAME=", field: "m_connection_jdbc_driverclass", end: ";"},
- {key: "ROOT=", field: "m_connection_file", end: ";"},
- {key: "PROVIDER=", field: "", end: ";"}
- ];
- var startAt = cs.indexOf(connectionData[1].key);
- var repositoryPluginType = getFieldStartingAt(cs, startAt, connectionData[1].key, connectionData[1].end);
- var provider;
- var isFilesystem = false;
- if(repositoryPluginType == 'com.ibm.cognos.cm.fileSystemPlugin.FileSystemArchivePlugin') {
- f[connectionData[1].field].value = "FileSystem";
- isFilesystem = true;
- } else {
- startAt = cs.indexOf(connectionData[3].key);
- if (startAt>=0) {
- provider = getFieldStartingAt(cs, startAt, connectionData[3].key, connectionData[3].end);
- if (isSupportedCmisProvider(provider)) {
- f[connectionData[1].field].value = "CMIS_" + provider;
- } else {
- f[connectionData[1].field].value = "CMIS_FileNet";
- }
- } else {
- f[connectionData[1].field].value = "CMIS_FileNet";
- }
- }
- repoTypeSelectInd=f[connectionData[1].field].selectedIndex;
-
- startAt = cs.indexOf(connectionData[0].key);
- if(isFilesystem) {
- f[connectionData[0].field].value = getFieldStartingAt(cs, startAt, connectionData[0].key+'alias:', connectionData[0].end);
- } else {
- f[connectionData[0].field].value = getFieldStartingAt(cs, startAt, connectionData[0].key, connectionData[0].end);
- }
- var endAt = 0;
- startAt = cs.indexOf(connectionData[2].key);
- if (startAt >= 0) {
- f[connectionData[2].field].value = getFieldStartingAt(cs, startAt, connectionData[2].key, connectionData[2].end);
- if (isSupportedCmisProvider(provider)) {
- endAt = cs.indexOf(connectionData[3].key) + connectionData[3].key.length + provider.length;
- } else {
- endAt = cs.indexOf(connectionData[2].key) + connectionData[2].key.length + f[connectionData[2].field].value.length;
- }
- } else {
- if (isSupportedCmisProvider(provider)) {
- endAt = cs.indexOf(connectionData[3].key) + connectionData[3].key.length + provider.length;
- } else {
- endAt = cs.indexOf(connectionData[1].key) + connectionData[1].key.length + repositoryPluginType.length;
- }
- }
- f.m_connection_jdbc_parameters.value = cs.substring(endAt + 1);
- }
- else if (connectType == 'jdbc-sql')
- {
- // [^User ID:][^?Password:];LOCAL;JD-SS;URL=<URLSPEC>;DRIVER_NAME=com.microsoft.sqlserver.jdbc.SQLServerDriver[;CognosProperty1=value1[;...]]
- // where
- // URLSPEC = jdbc:sqlserver://<SERVERNAME>:<PORT>[;INSTANCENAME=<INSTNAME>];DATABASE=<DB>[;LOGINTIMEOUT=<TIMEOUT>][;integratedSecurity=true][;[jdbcproperty1=jdbcvalue1][;jdbcproperty2=jdbcvalue2]...]
-
- // Authentication: [0] None, [1] C8 service creds, [2] Namespace, [3] Signon (User ID/[Password])
- if (credentialNamespaces == 'true') {
- f.authentication[2].checked = 'true';
- } else if (cs.indexOf("^User ID:") != -1) {
- f.authentication[3].checked = true;
- f.m_connection_use_pword.disabled = false;
- if (cs.indexOf("^?Password:") != -1) {
- f.m_connection_use_pword.checked = true;
- }
- } else if (cs.indexOf(";integratedSecurity=true") != -1) {
- f.authentication[1].checked = true;
- } else {
- f.authentication[0].checked = true;
- }
-
- var serverNameEnd;
- var urlProtocol = "jdbc:sqlserver://";
- var urlStart = cs.indexOf(urlProtocol);
- var portEnd = -1;
- if (urlStart != -1) {
- serverNameEnd = cs.indexOf(":", urlStart + urlProtocol.length);
- portEnd = cs.indexOf(";", urlStart + urlProtocol.length);
- var hasPort = true;
- if (serverNameEnd == -1 || serverNameEnd > portEnd) {
- serverNameEnd = portEnd;
- hasPort = false;
- }
- if (serverNameEnd != -1) {
- f.m_connection_servername.value = cs.substring(urlStart + urlProtocol.length, serverNameEnd);
- }
- if (hasPort) {
- f.m_connection_port.value = cs.substring(serverNameEnd + 1, portEnd);
- }
- }
-
- var startingWith = "INSTANCENAME=";
- var start = cs.indexOf(startingWith, portEnd + 1);
- if (start != -1) {
- var end = cs.indexOf(";", start + startingWith.length);
- if (end != -1) {
- f.m_connection_sql_instance_name.value = cs.substring(start + startingWith.length, end);
- } else {
- f.m_connection_sql_instance_name.value = cs.substring(start + startingWith.length);
- }
- cs = cs.replace(eval("/;" + startingWith + f.m_connection_sql_instance_name.value + "/"), "");
- }
-
- var startingWith = "DATABASE=";
- var start = cs.indexOf(startingWith, portEnd + 1);
- if (start != -1) {
- var end = cs.indexOf(";", start + startingWith.length);
- if (end != -1) {
- f.m_connection_jdbc_database_name.value = cs.substring(start + startingWith.length, end);
- } else {
- f.m_connection_jdbc_database_name.value = cs.substring(start + startingWith.length);
- }
- cs = cs.replace(eval("/;" + startingWith + f.m_connection_jdbc_database_name.value + "/"), "");
- }
- var startingWith = "LOGINTIMEOUT=";
- var start = cs.indexOf(startingWith, portEnd + 1);
- if (start != -1) {
- var end = cs.indexOf(";", start + startingWith.length);
- if (end != -1) {
- f.m_connection_jdbc_connect_time.value = cs.substring(start + startingWith.length, end);
- } else {
- f.m_connection_jdbc_connect_time.value = cs.substring(start + startingWith.length);
- }
- cs = cs.replace(eval("/;" + startingWith + f.m_connection_jdbc_connect_time.value + "/"), "");
- }
-
- cs = cs.replace(/;integratedSecurity=true/, "");
-
- var startingWith = ";DRIVER_NAME=";
- var start = cs.indexOf(startingWith, portEnd);
- if (start != portEnd) {
- f.m_connection_jdbc_parameters.value = cs.substring(portEnd + 1, start);
- }
-
- f.m_connection_jdbc_sort_colseq.value = getFieldStartingAt(cs, portEnd + 1, "LOCALSORT=", ";");
- f.m_connection_jdbc_sort_level.value = getFieldStartingAt(cs, portEnd + 1, "LEVEL=", ";");
- }
- else if (connectType == 'jdbc-teradata')
- {
- // [^User ID:][^?Password:];LOCAL;JD-TD;URL=<URLSPEC>;DRIVER_NAME=com.teradata.jdbc.TeraDriver[;CognosProperty1=value1[;...]]
- // where
- // URLSPEC = jdbc:teradata://<SERVERNAME>/DBS_PORT=<PORT>,DATABASE=<DBNAME>[,jdbcproperty1=jdbcvalue1][,jdbcproperty2=jdbcvalue2]...
-
- // Authentication: [0] None, [1] Namespace, [2] Signon (User ID/[Password])
-
- if (credentialNamespaces == 'true') {
- f.authentication[1].checked = true;
- } else if (cs.indexOf("^User ID:") != -1) {
- f.authentication[2].checked = 'true';
- f.m_connection_use_pword.disabled = false;
- if (cs.indexOf("^?Password:") != -1) {
- f.m_connection_use_pword.checked = true;
- }
- } else {
- f.authentication[0].checked = 'true';
- }
- var serverNameEnd;
- var urlProtocol = "jdbc:teradata://";
- var urlStart = cs.indexOf(urlProtocol);
- var dbs_port = "DBS_PORT=";
- var dbs_port_start = cs.indexOf(dbs_port, serverNameEnd + 1);
-
- if (urlStart != -1) {
- if (dbs_port_start != -1) {
- serverNameEnd = cs.indexOf("/", urlStart + urlProtocol.length);
- } else {
- serverNameEnd = cs.indexOf(",", urlStart + urlProtocol.length);
- if (serverNameEnd == -1){
- serverNameEnd = cs.indexOf(";", urlStart + urlProtocol.length);
- }
- }
-
- if (serverNameEnd != -1) {
- f.m_connection_servername.value = cs.substring(urlStart + urlProtocol.length, serverNameEnd);
- }
- }
-
- var startingWith = "DBS_PORT=";
- var start = cs.indexOf(startingWith, serverNameEnd + 1);
- if (start != -1) {
- var end = cs.indexOf(",", start + startingWith.length);
- if (end != -1) {
- f.m_connection_port.value = cs.substring(start + startingWith.length, end);
- } else {
- var end = cs.indexOf(";", start + startingWith.length);
- if (end != -1) {
- f.m_connection_port.value = cs.substring(start + startingWith.length, end);
- }
- }
- var separator = "";
- if (cs.charAt(start-1) == ",") {
- separator = ",";
- }
- cs = cs.replace(eval("/" + separator + startingWith + f.m_connection_port.value + "/"), "");
- }
-
- var startingWith = "DATABASE=";
- var start = cs.indexOf(startingWith, serverNameEnd);
- if (start != -1) {
- var end = cs.indexOf(",", start + startingWith.length);
- if (end != -1) {
- f.m_connection_jdbc_database_name.value = cs.substring(start + startingWith.length, end);
- } else {
- var end = cs.indexOf(";", start + startingWith.length);
- if (end != -1) {
- f.m_connection_jdbc_database_name.value = cs.substring(start + startingWith.length, end);
- }
- }
- var separator = "";
- if (cs.charAt(start-1) == ",") {
- separator = ",";
- }
- cs = cs.replace(eval("/" + separator + startingWith + f.m_connection_jdbc_database_name.value + "/"), "");
- }
-
- var startingWith = ";DRIVER_NAME=";
- var start = cs.indexOf(startingWith, serverNameEnd);
- if (start != serverNameEnd + 1 && start != serverNameEnd) {
- if (cs.charAt(serverNameEnd + 1) == ",") {
- f.m_connection_jdbc_parameters.value = cs.substring(serverNameEnd + 2, start);
- } else {
- f.m_connection_jdbc_parameters.value = cs.substring(serverNameEnd + 1, start);
- }
- }
- f.m_connection_jdbc_sort_colseq.value = getFieldStartingAt(cs, serverNameEnd + 1, "LOCALSORT=", ";");
- f.m_connection_jdbc_sort_level.value = getFieldStartingAt(cs, serverNameEnd + 1, "LEVEL=", ";");
- }
- else if (connectType == 'jdbc-netezza')
- {
- // [^User ID:][^?Password:];LOCAL;JD-NZ;URL=<URLSPEC>;DRIVER_NAME=org.netezza.Driver[;CognosProperty1=value1[;...]]
- // where
- // URLSPEC = jdbc:netezza://<SERVERNAME>[:<PORT>]/<DBNAME>[[;jdbcproperty1=jdbcvalue1][;jdbcproperty2=jdbcvalue2]...]
-
- // Authentication: [0] None, [1] Namespace, [2] Signon (User ID/[Password])
-
- if (credentialNamespaces == 'true') {
- f.authentication[1].checked = true;
- } else if (cs.indexOf("^User ID:") != -1) {
- f.authentication[2].checked = 'true';
- f.m_connection_use_pword.disabled = false;
- if (cs.indexOf("^?Password:") != -1) {
- f.m_connection_use_pword.checked = true;
- }
- } else {
- f.authentication[0].checked = 'true';
- }
- var serverNameEnd;
- var urlProtocol = "jdbc:netezza://";
- var urlStart = cs.indexOf(urlProtocol);
-
- if (urlStart != -1) {
- var serverPortEnd = cs.indexOf("/", urlStart + urlProtocol.length);
- if (serverPortEnd != -1) {
- var serverAndPort = cs.substring(urlStart + urlProtocol.length, serverPortEnd);
- var indexOfPortStart = serverAndPort.indexOf(":");
- if (indexOfPortStart == -1){
- //in this case there was no port so just set the sername to the whole thing and forget about the port
- f.m_connection_servername.value = serverAndPort;
- } else {
- //in this case we have a server and a port so need to take care of that
- f.m_connection_servername.value = serverAndPort.substring(0, indexOfPortStart);
- f.m_connection_port.value = serverAndPort.substring(indexOfPortStart + 1);
- }
- }
- }
-
- var urlEnd;
- var dbNameEnd = cs.indexOf(";", serverPortEnd + 1);
- if (dbNameEnd != -1) {
- f.m_connection_jdbc_database_name.value = cs.substring(serverPortEnd + 1, dbNameEnd);
- urlEnd = cs.indexOf(";DRIVER_NAME", dbNameEnd + 1);
- if (urlEnd != -1) {
- f.m_connection_jdbc_parameters.value = cs.substring(dbNameEnd + 1, urlEnd);
- }
- }
-
- f.m_connection_jdbc_sort_colseq.value = getFieldStartingAt(cs, urlEnd + 1, "LOCALSORT=", ";");
- f.m_connection_jdbc_sort_level.value = getFieldStartingAt(cs, urlEnd + 1, "LEVEL=", ";");
- }
- else if (connectType == 'xml')
- {
- f.m_connection_database.value = cs.substring(11);
- }
- else if (connectType == "sr3")
- {
- var connectionData = cs.substring(43);
- var indexOfLB = connectionData.indexOf("LB:");
- var endIndex = 0;
- if (indexOfLB == -1)
- {
- endIndex = connectionData.indexOf(":");
- f.m_connection_application_server.value = connectionData.substring(0,endIndex);
- connectionData = connectionData.substring(endIndex + 1);
- endIndex = connectionData.indexOf(":");
- f.m_connection_system_number.value = connectionData.substring(0,endIndex);
- connectionData = connectionData.substring(endIndex + 1);
- }
- else
- {
- f.m_connection_use_loadbalancing.checked = true;
- f.m_connection_use_loadbalancing_hidden.value = "true";
- endIndex = connectionData.indexOf(":", indexOfLB + 3);
- f.m_connection_message_server.value = getFieldStartingAt(connectionData, 0, "LB:", ":");
- connectionData = connectionData.substring(endIndex + 1);
- endIndex = connectionData.indexOf(":");
- f.m_connection_system_id.value = connectionData.substring(0,endIndex);
- connectionData = connectionData.substring(endIndex + 1);
- endIndex = connectionData.indexOf(":");
- f.m_connection_logon_group.value = connectionData.substring(0,endIndex);
- connectionData = connectionData.substring(endIndex + 1);
- }
- f.m_connection_router_string.value = getFieldStartingAt(connectionData, 0, "ROUTER_STRING=", ":");
- endIndex = connectionData.indexOf(":");
- connectionData = connectionData.substring(endIndex + 1);
- endIndex = connectionData.indexOf(":");
- f.m_connection_client.value = connectionData.substring(0,endIndex);
- connectionData = connectionData.substring(endIndex + 1);
- endIndex = connectionData.indexOf(";");
- f.m_connection_language.value = connectionData.substring(0,endIndex);
- connectionData = connectionData.substring(endIndex + 1);
- f.m_connection_max_conn_in_pool.value = getFieldStartingAt(connectionData, 0, "MAX_CONN=", ";");
- f.m_connection_abap_query_db_access_limit.value = getFieldStartingAt(connectionData, 0, "ABAP_QUERY_DB_ACCESSES=", ";");
- f.m_connection_table_row_count.value = getFieldStartingAt(connectionData, 0, "TABLE_READ_COUNT=", ";");
- f.m_connection_table_read_function.value = getFieldStartingAt(connectionData, 0, "READ_TABLE_FUNCTION_NAME=", ";");
- }
- else if (connectType == "sfdc")
- {
- if (cs.indexOf("^?Password:") != -1)
- {
- f.m_connection_use_pword.checked = true;
- }
- var startIndex = cs.indexOf("sfdc:");
- var connectionData = cs.substring(startIndex+5);
- var endIndex = connectionData.indexOf(";");
- f.m_connection_url.value = connectionData.substring(0,endIndex);
- f.m_connection_conc_calls_limit.value = getFieldStartingAt(connectionData, 0, "CONCURRENT_CALLS_LIMIT=", ";");
- f.m_connection_user_conc_calls_limit.value = getFieldStartingAt(connectionData, 0, "USER_CONCURRENT_CALLS_LIMIT=", ";");
- f.m_connection_timeout.value = getFieldStartingAt(connectionData, 0, "CONNECTION_TIMEOUT=", ";");
- f.m_connection_query_batch_size.value = getFieldStartingAt(connectionData, 0, "QUERY_BATCH_SIZE=", ";");
- f.m_connection_max_retries.value = getFieldStartingAt(connectionData, 0, "MAX_RETRIES=", ";");
- f.m_connection_wait_between_retries.value = getFieldStartingAt(connectionData, 0, "WAIT_BETWEEN_RETRIES=", ";");
- if (getFieldStartingAt(connectionData, 0, "PROXY_ENABLED=", ";") == "true") {
- f.m_connection_proxy_enabled.checked = true;
- disableProxyControls(false);
- } else {
- f.m_connection_proxy_enabled.checked = false;
- disableProxyControls(true);
- }
-
- setProxyControls();
-
- f.m_connection_proxy_host.value = getFieldStartingAt(connectionData, 0, "PROXY_HOST=", ";");
- f.m_connection_proxy_port.value = getFieldStartingAt(connectionData, 0, "PROXY_PORT=", ";");
- }
- else if (connectType == "siebel")
- {
- var connectionData = cs.substring(49);
- var endIndex = connectionData.indexOf(".");
- f.m_connection_transport.value = connectionData.substring(0,endIndex);
- connectionData = connectionData.substring(endIndex + 1);
- endIndex = connectionData.indexOf(".");
- f.m_connection_encryption.value = connectionData.substring(0,endIndex);
- connectionData = connectionData.substring(endIndex + 1);
- endIndex = connectionData.indexOf(":");
- f.m_connection_compression.value = connectionData.substring(0,endIndex);
- connectionData = connectionData.substring(endIndex + 1);
- endIndex = connectionData.indexOf(":");
- f.m_connection_gatewayserver.value = connectionData.substring(2,endIndex);
- connectionData = connectionData.substring(endIndex + 1);
- endIndex = connectionData.indexOf("/");
- f.m_connection_gatewayport.value = connectionData.substring(0,endIndex);
- connectionData = connectionData.substring(endIndex + 1);
- endIndex = connectionData.indexOf("/");
- f.m_connection_enterprise_name.value = connectionData.substring(0,endIndex);
- connectionData = connectionData.substring(endIndex + 1);
- endIndex = connectionData.indexOf("_");
- f.m_connection_aom.value = connectionData.substring(0,endIndex);
- connectionData = connectionData.substring(endIndex + 1);
- endIndex = connectionData.indexOf(";");
- f.m_connection_language.value = connectionData.substring(0,endIndex);
- connectionData = connectionData.substring(endIndex + 1);
- f.m_connection_siebel_repo.value = getFieldStartingAt(connectionData, 0, "REPOSITORY_NAME=", ";");
- f.m_connection_login_retries.value = getFieldStartingAt(connectionData, 0, "LOGIN_RETRY_COUNT=", ";");
- f.m_connection_login_retry_delay.value = getFieldStartingAt(connectionData, 0, "LOGIN_RETRY_DELAY=", ";");
- f.m_connection_local_sort.value = getFieldStartingAt(connectionData, 0, "LOCALSORT=", ";");
- f.m_connection_level.value = getFieldStartingAt(connectionData, 0, "LEVEL=", ";");
- f.m_connection_charset.value = getFieldStartingAt(connectionData, 0, "CHARSET=", ";");
- f.m_connection_adv_parameters.value = getFieldStartingAt(connectionData, 0, "ADVANCED_PARAMETERS=", ";");
- }
- else if (connectType == 'other')
- {
- f.m_other_connectionString.value = cs;
- }
- }
- function getFieldStartingAt(string, startingAt, startingWith, endingWith)
- {
- var start = string.indexOf(startingWith, startingAt);
- if (start != -1) {
- var end = string.indexOf(endingWith, start + startingWith.length);
- if (end == -1) {
- return(string.substring(start + startingWith.length));
- }
- return(string.substring(start + startingWith.length, end));
- }
- return '';
- }
- // Searches the string for a given param and sets the frmField to the value found
- function getField(string, param)
- {
- start = string.indexOf(param);
- if (start != -1)
- {
- end = string.indexOf(";", start + param.length);
- if (end == -1)
- {
- return(string.substring(start + param.length));
- }
-
- return(string.substring(start + param.length, end));
- }
- return '';
- }
- function togglePasswordCheckbox()
- {
- var f = document.pform;
- if (f.m_connection_default_signon && f.m_connection_default_signon.checked)
- {
- disablePasswordFields(!f.m_connection_use_pword.checked);
- }
- }
- function toggleCreateSignon()
- {
- var f = document.pform;
- var defaultSignonChecked = f.m_connection_default_signon && f.m_connection_default_signon.checked;
-
- disableUserIDField(!defaultSignonChecked);
- if (f.m_connection_use_pword)
- {
- disablePasswordFields(!(defaultSignonChecked && f.m_connection_use_pword.checked));
- }
- else
- {
- disablePasswordFields(!defaultSignonChecked);
- }
- }
- function toggleAssemblyCheckbox()
- {
- var f = document.pform;
- disableAssemblyFields(f.m_connection_assembly.checked);
- }
- function updateRepositoryType() {
- var f = document.pform;
- if (f.m_connection_jdbc_driverclass.value == "FileSystem") {
- if (f.fsAliasRoot_select.length==0) {
- window.alert(repo_fs_none_msg);
- f.m_connection_jdbc_driverclass.selectedIndex=repoTypeSelectInd;
- return;
- }
- }
-
- var allowSwitch = true;
- if (f.m_connection_file.value!='' || f.m_connection_jdbc_parameters.value!='') {
- allowSwitch = confirm(repo_wmsg);
- } else {
- if (f.m_connection_jdbc_driverclass.options[repoTypeSelectInd].value == "FileSystem") {
- if (f.fsAliasRoot_select.selectedIndex!=0) {
- allowSwitch = confirm(repo_wmsg);
- }
- } else {
- if (f.cmisURL_input.value!='' || !f.m_connection_use_userid.checked || !f.m_connection_use_pword.checked || (f.m_connection_default_signon!=null && !f.m_connection_default_signon.checked)
- || (f.m_connection_userid!=null && f.m_connection_userid.value!='') || (f.m_connection_password!=null && f.m_connection_password.value!='') || (f.m_connection_confirm_password!=null && f.m_connection_confirm_password.value!='')) {
- allowSwitch = confirm(repo_wmsg);
- }
- }
- }
-
- if (allowSwitch) {
- f.m_connection_file.value='';
- f.m_connection_jdbc_parameters.value='';
- if (f.m_connection_jdbc_driverclass.options[repoTypeSelectInd].value == "FileSystem") {
- f.fsAliasRoot_select.selectedIndex=0;
- f.m_connection_jdbc_url.value='';
- } else {
- f.cmisURL_input.value='';
- f.m_connection_jdbc_url.value='';
- f.m_connection_use_userid.checked=false;
- f.m_connection_use_pword.checked=false;
- if (f.m_connection_default_signon) {
- f.m_connection_default_signon.checked=true;
- f.m_connection_userid.value='';
- f.m_connection_password.value='';
- f.m_connection_confirm_password.value='';
- updateSignonSection(false);
- }
- }
- repoTypeSelectInd=f.m_connection_jdbc_driverclass.selectedIndex;
- initRepositoryConnectionPage();
- } else {
- f.m_connection_jdbc_driverclass.selectedIndex=repoTypeSelectInd;
- }
- }
- function isSupportedCmisProvider(provider) {
- return provider == 'CM8' || provider == 'FileNet';
- }
- function cmisURL_input_changed() {
- var f = document.pform;
- f.m_connection_jdbc_url.value=f.cmisURL_input.value;
- }
- function fsAliasRoot_select_changed() {
- var f = document.pform;
- f.m_connection_jdbc_url.value=f.fsAliasRoot_select.value;
- }
- function updateTrustedContext()
- {
- var f = document.pform;
- f.m_connection_identity_propagation.disabled = !f.m_connection_trusted_context.checked;
- }
- function initRepositoryConnectionPage()
- {
- var f = document.pform;
- if (f.m_connection_jdbc_driverclass) {
- if (f.m_p_credentialNamespaces) {
- f.m_p_credentialNamespaces.value='';
- }
- var signonDiv = document.getElementById('gen-signon-section');
- f.fsAliasRoot_select.selectedIndex=0;
- if (f.m_connection_jdbc_driverclass.value == "FileSystem") {
- if (f.fsAliasRoot_select.length==0) {
- f.m_connection_jdbc_url.value='';
- } else {
- if (f.m_connection_jdbc_url.value == '') {
- f.m_connection_jdbc_url.value=f.fsAliasRoot_select.value;
- }
- }
- f.fsAliasRoot_select.value=f.m_connection_jdbc_url.value;
- showDynamicDiv('fileSystemDiv');
- hideDynamicDiv('cmisDiv');
- signonDiv.style.display = 'none';
- } else {
- f.cmisURL_input.value=f.m_connection_jdbc_url.value;
- f.m_connection_use_userid.checked=true;
- f.m_connection_use_pword.checked=true;
- if (f.m_connection_default_signon) {
- f.m_connection_default_signon.checked=true;
- }
- updateSignonSection(true);
- showDynamicDiv('cmisDiv');
- hideDynamicDiv('fileSystemDiv');
- signonDiv.style.display = 'inline';
- }
- }
- }
- function updateJdbcOracle()
- {
- var f = document.pform;
- if (f.m_connection_jdbc_oracle_style) {
- if (f.m_connection_jdbc_oracle_style[0] && f.m_connection_jdbc_oracle_style[0].checked == true) {
- showDynamicDiv('serviceID');
- f.m_connection_servername.disabled = false;
- f.m_connection_port.disabled = false;
- f.m_connection_oracle_service_id.disabled = false;
-
- hideDynamicDiv('tnsNamesAlias');
- f.m_connection_oracle_tns_name.disabled = true;
- hideDynamicDiv('oracleNetDescriptor');
- f.m_connection_oracle_net_descriptor.disabled = true;
- } else if (f.m_connection_jdbc_oracle_style[1] && f.m_connection_jdbc_oracle_style[1].checked == true) {
- hideDynamicDiv('serviceID');
- f.m_connection_servername.disabled = true;
- f.m_connection_port.disabled = true;
- f.m_connection_oracle_service_id.disabled = true;
-
- showDynamicDiv('tnsNamesAlias');
- f.m_connection_oracle_tns_name.disabled = false;
-
- hideDynamicDiv('oracleNetDescriptor');
- f.m_connection_oracle_net_descriptor.disabled = true;
-
- } else if (f.m_connection_jdbc_oracle_style[2] && f.m_connection_jdbc_oracle_style[2].checked == true) {
- hideDynamicDiv('serviceID');
- f.m_connection_servername.disabled = true;
- f.m_connection_port.disabled = true;
- f.m_connection_oracle_service_id.disabled = true;
-
- hideDynamicDiv('tnsNamesAlias');
- f.m_connection_oracle_tns_name.disabled = true;
-
- showDynamicDiv('oracleNetDescriptor');
- f.m_connection_oracle_net_descriptor.disabled = false;
- }
- }
- }
- function updateJdbcSortOptions()
- {
- var f = document.pform;
- if (f.m_connection_jdbc_sort_colseq && f.m_connection_jdbc_sort_level) {
- if (f.m_connection_jdbc_sort_colseq.value == '') {
- f.m_connection_jdbc_sort_level.disabled = true;
- } else {
- f.m_connection_jdbc_sort_level.disabled = false;
- }
- }
- }
- function updateSignonSection(rootChecked)
- {
- var f = document.pform;
- if (f.m_connection_default_signon)
- {
- f.m_connection_default_signon.disabled = !rootChecked;
- }
- if (f.m_connection_use_pword)
- {
- f.m_connection_use_pword.disabled = !rootChecked;
- }
- // if the signon radio button isn't checked, then then disabled the userid and password fields
- if (!rootChecked)
- {
- disableUserIDField(true);
- disablePasswordFields(true);
- }
- // if the generate default signon isn't checked, then disabled the userid and password fields
- else if (f.m_connection_default_signon && !f.m_connection_default_signon.checked)
- {
- disableUserIDField(true);
- disablePasswordFields(true);
- }
- else
- {
- disableUserIDField(false);
- disablePasswordFields(!((f.m_connection_use_pword && f.m_connection_use_pword.checked) || !f.m_connection_use_pword));
- }
- }
- // when the user switches between authentication types (no authentication, external namespace, signon, ...)
- function onChangeAuthentication()
- {
- var f = document.pform;
- for (var i=0; i < f.authentication.length; i++)
- {
- if (f.authentication[i].value == 'namespace')
- {
- if (f.m_p_credentialNamespaces)
- {
- f.m_p_credentialNamespaces.disabled = !f.authentication[i].checked;
- if (f.m_transformUserIdentification) {
- f.m_transformUserIdentification.disabled = !f.authentication[i].checked;
- }
- }
- }
- else if (f.authentication[i].value == 'signon')
- {
- updateSignonSection(f.authentication[i].checked);
- }
- }
- }
- function disableUserIDField(disabled)
- {
- if (document.pform.m_connection_userid) {
- document.pform.m_connection_userid.disabled = disabled;
- }
- }
- function disablePasswordFields(disabled)
- {
- if (document.pform.m_connection_password) {
- document.pform.m_connection_password.disabled = disabled;
- }
- if (document.pform.m_connection_confirm_password) {
- document.pform.m_connection_confirm_password.disabled = disabled;
- }
- }
- function disableAssemblyFields(disabled)
- {
- if (document.pform.m_connection_schema) {
- document.pform.m_connection_schema.disabled = disabled;
- }
- if (document.pform.m_connection_http_method) {
- document.pform.m_connection_http_method.disabled = disabled;
- }
- if (document.pform.m_connection_http_message_body) {
- document.pform.m_connection_http_message_body.disabled = disabled;
- }
- if (document.pform.m_connection_json_path) {
- document.pform.m_connection_json_path.disabled = disabled;
- }
- }
- function isValidNameValuePairList(field, separator) {
- if (field != null && field.value != '') {
- var pairs = field.value.split(separator);
- if (pairs != null && pairs.length != 0) {
- for (var i = 0; i < pairs.length; i++) {
- var regExp = new RegExp("^([^=]+)=([^=]*)$");
- if (regExp.test(pairs[i]) == false){
- return false;
- }
- }
- }
- }
- return true;
- }
- // In a dual-stack world a checkbox may be a checkbox or a hidden field by the time it
- // is used to build the connection string. This method takes care of the difference.
- function isCheckboxChecked(field){
- return (field && (field.checked || field.type != 'checkbox'))
- }
- function isListItemSelected(select, item) {
- if (select && select.value == item) {
- return true;
- }
- return false;
- }
- // When creating a dual stack connection, fieldOrArrayOfFields may be 1) an array of input fields or 2) one hidden input.
- // It is an array when the form is enabled and a hidden input when on the jdbc connection page.
- function isRadioButtonSelected(fieldOrArrayOfFields, name) {
- if (fieldOrArrayOfFields) {
- if (fieldOrArrayOfFields.length > 0) {
- for (var i = 0; i < fieldOrArrayOfFields.length; i++) {
- var input = fieldOrArrayOfFields[i];
- if (input.value == name) {
- return (input.checked || input.type == 'hidden');
- }
- }
- } else {
- if (fieldOrArrayOfFields.value == name) {
- return (fieldOrArrayOfFields.checked || fieldOrArrayOfFields.type == 'hidden');
- }
- }
- }
- return false;
- }
- function selectRadioButton(radioButtongGroup, name) {
- for (var i = 0; i < radioButtongGroup.length; i++) {
- var input = radioButtongGroup[i];
- if (input.value == name) {
- input.checked = 'true';
- }
- }
- }
- function stripSpecialCharsFromOracleNetDesc(value) {
- return value.replace(new RegExp( "[\\t\\r\\n\\b\\f]", "g" ), "");
- }
- function formatOracleNetDesc(value) {
- var formattedValue = '';
- var indentLevel = 0;
- var lastBracket = null;
- for (var i = 0 ; i < value.length; i++) {
- var currChar = value.charAt(i);
- if (currChar == '(') {
- if (lastBracket == ')') {
- // )(
- formattedValue += '\n' + generateIndent(indentLevel) + currChar;
- } else {
- // ((
- if (lastBracket == null) {
- // for the very first bracket, don't newline or increase indentLevel
- formattedValue += generateIndent(indentLevel) + currChar;
- } else {
- indentLevel++;
- formattedValue += '\n' + generateIndent(indentLevel) + currChar;
- }
- }
- lastBracket = currChar;
- } else if (currChar == ')') {
- if (lastBracket == ')') {
- // ))
- indentLevel--;
- formattedValue += '\n' + generateIndent(indentLevel) + currChar;
- } else {
- // ()
- formattedValue += currChar;
- }
- lastBracket = currChar;
- } else {
- // all other chars
- formattedValue += currChar;
- }
- }
- return formattedValue;
- }
- function setProxyControls()
- {
- frm = document.pform;
- if (frm.m_connection_proxy_enabled.checked == true)
- {
- frm.m_connection_proxy_enabled.value = "true";
- disableProxyControls(false)
- }
- else
- {
- frm.m_connection_proxy_enabled.value = "false";
- disableProxyControls(true)
- }
- }
- function disableProxyControls(disabled)
- {
- frm = document.pform;
- frm.m_connection_proxy_host.disabled=disabled;
- frm.m_connection_proxy_port.disabled=disabled;
- frm.m_connection_proxy_user.disabled=disabled;
- frm.m_connection_proxy_password.disabled=disabled;
- }
- function generateIndent(indentLevel) {
- var indent = '';
- var j = indentLevel;
- while (j != 0) {
- indent += '\t';
- j--;
- }
- return indent;
- }
|