<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Free Code Collection</title>
	<atom:link href="http://www.freecodecollection.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.freecodecollection.com</link>
	<description>Your own code collection</description>
	<lastBuildDate>Mon, 19 Jul 2010 12:46:58 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Livelink Object from Work Flow Form</title>
		<link>http://www.freecodecollection.com/livelink-object-from-wf-form/</link>
		<comments>http://www.freecodecollection.com/livelink-object-from-wf-form/#comments</comments>
		<pubDate>Mon, 19 Jul 2010 12:42:43 +0000</pubDate>
		<dc:creator>Hussain</dc:creator>
				<category><![CDATA[Livelink]]></category>
		<category><![CDATA[work flow]]></category>

		<guid isPermaLink="false">http://www.freecodecollection.com/?p=85</guid>
		<description><![CDATA[On many occasions there are times when you want to snapshot the status of a Livelink workflow Form data at a given point in the work, either for auditing or for archiving. The following Event Script creates a Livelink Form Object using a specified Form Template and View and creates it in a specified folder [...]]]></description>
			<content:encoded><![CDATA[<p>On many occasions there are times when you want to snapshot the status of a Livelink workflow Form data at a given point in the work, either for auditing or for archiving. The following Event Script creates a Livelink Form Object using a specified Form Template and View and creates it in a specified folder in Livelink.<br />
This snippet comes in two sections, the first is the main Event Script (CreateLLObjFromForm) which acts as the wrapper, and a second OScript Script (CreateFormNode) which creates the Livelink Object. This second method does not have to sit within the same Script as the main event script, so could be placed elsewhere in your module.</p>
<p>In the first script, the output folder specfied by its Livelink Node ID (DTree.DataId), although in a production environment you may want to have this loaded from the Workflow Form, database table or ini file rather than being hardcoded. Next we load the Workflow itself and get the Forms package and grab the Form Template, the code assumes that we will always use the first template in the workflow, then we gather the values needed to create the Livelink Object and call the second method. A commented version of this Event Script is shown below :</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="Text"><div class="devcodeoverflow"><ol><li>Function Dynamic CreateLLObjFromForm( \</li><li>&nbsp;&nbsp;&nbsp;&nbsp;Object	 prgCtx, \</li><li>&nbsp;&nbsp;&nbsp;&nbsp;WAPIWORK	work, \</li><li>&nbsp;&nbsp;&nbsp;&nbsp;Integer	 workID, \</li><li>&nbsp;&nbsp;&nbsp;&nbsp;Integer	 subWorkID, \</li><li>&nbsp;&nbsp;&nbsp;&nbsp;Integer	 taskID, \</li><li>&nbsp;&nbsp;&nbsp;&nbsp;Integer	 returnSubWorkID, \</li><li>&nbsp;&nbsp;&nbsp;&nbsp;Integer	 returnTaskID, \</li><li>&nbsp;&nbsp;&nbsp;&nbsp;Dynamic	 extraData = Undefined )</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;// stick the current user context into a variable</li><li>&nbsp;&nbsp;&nbsp;&nbsp;Object tempPrgCtx = prgCtx</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;// create a new context as Admin to avoid Permissions/Rights issues</li><li>&nbsp;&nbsp;&nbsp;&nbsp;String cnctName = $Kernel.SystemPreferences.GetPrefGeneral( 'DftConnection' )</li><li>&nbsp;&nbsp;&nbsp;&nbsp;Assoc prgAssoc = $LLIApi.PrgSession.CreateNewNamed(cnctName,{&quot;Admin&quot;,undefined})</li><li>&nbsp;&nbsp;&nbsp;&nbsp;prgCtx = prgAssoc.pSession // dump the prog context into a Feature so it can be read elsewhere</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;// other variables</li><li>&nbsp;&nbsp;&nbsp;&nbsp;DAPINode templateNode, outputNode</li><li>&nbsp;&nbsp;&nbsp;&nbsp;Assoc	retval = Assoc.CreateAssoc()</li><li>&nbsp;&nbsp;&nbsp;&nbsp;retval.OK = true</li><li>&nbsp;&nbsp;&nbsp;&nbsp;record r</li><li>&nbsp;&nbsp;&nbsp;&nbsp;boolean found = false</li><li>&nbsp;&nbsp;&nbsp;&nbsp;Integer outputFolder=2000 // Create in the Container with DataID 2000</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;// Get the Form data from the workflow</li><li>&nbsp;&nbsp;&nbsp;&nbsp;Object obj = $WFMain.WFPackageSubsystem.GetItemByName( 'Form' )</li><li>&nbsp;&nbsp;&nbsp;&nbsp;// Load the work package</li><li>&nbsp;&nbsp;&nbsp;&nbsp;RecArray array = $WFMain.WAPIPkg.LoadWorkData( prgCtx, work )</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;// if we have loaded the Forms Package</li><li>&nbsp;&nbsp;&nbsp;&nbsp;if ( IsDefined( obj ) )</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// find the Form Template Node</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for r in array</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if ( { r.TYPE, r.SUBTYPE } == { obj.fType, obj.fSubType } )</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;found = True</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;templateNode=DAPI.GetNodeByID(prgCtx.DSession().fSession,DAPI.BY_DATAID,r.USERDATA.AvailableForms[ 1 ].TemplateID)</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// We have found the form containing the data </li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if ( found )</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// grab the node to put the data in </li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;outputNode = DAPI.GetNodeByID(prgCtx.DSession().fSession,DAPI.BY_DATAID,outputFolder)</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// if we have the Output Folder</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if ((isDefined(outputNode)) &amp;&amp; (!IsError(outputNode)))</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;String formName=r.USERDATA.Forms[1].Name // get the name of the Form</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Integer templateID=r.USERDATA.Forms[1].TemplateID // get the DTREE.DATAID of the Template</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Integer templateVersion=templateNode.pVersionNum // get the version number of the Template</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// create the Form Node</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;retval = CreateFormNode(prgCtx,formName,outputNode,r.USERDATA.Forms[1],templateID,templateVersion)</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end</li><li>&nbsp;&nbsp;&nbsp;&nbsp;end</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;//reset orginal prgctx before we leave</li><li>&nbsp;&nbsp;&nbsp;&nbsp;prgCtx = tempPrgCtx</li><li>&nbsp;&nbsp;&nbsp;&nbsp;Echo( 'LEAVE SAVEFORM' )</li><li>&nbsp;&nbsp;&nbsp;&nbsp;Echo( Str.ValueToString( retval ) )</li><li>&nbsp;&nbsp;&nbsp;&nbsp;return retval</li><li>end</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p>This helper function creates the actual HTML Form Node in Livelink. This script generates a unique name for the new object using the provided Form Name and the current date and time stamp. Once the node is created, we specify which Form View we wish to use for the new Node, this allows us to specify a custom or read only Form View for example. Then we create the Node and populate it with the information from the workflow to complete the activity. The commented code is shown below :</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="Text"><div class="devcodeoverflow"><ol><li>Function Assoc CreateFormNode( Object prgCtx, String formname, DAPINode parentNode, Assoc formData, Integer templateId, Integer templateVersion = undefined )</li><li>&nbsp;&nbsp;&nbsp;&nbsp;Assoc CreateInfo, retVal</li><li>&nbsp;&nbsp;&nbsp;&nbsp;retVal.ok = true</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;// firstly, grab the correct LLNode for a webform</li><li>&nbsp;&nbsp;&nbsp;&nbsp;Object llNode = $LLIAPI.LLNodeSubsystem.GetItem($TypeForm)</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;// if we have an LL Node Object</li><li>&nbsp;&nbsp;&nbsp;&nbsp;if( IsDefined( llNode ) )</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// create a unique object name using the Form Name and the Date</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;String newFormName=Str.Format(&quot;%1 - Form - %2&quot;,formname, \</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Date.DateToString(CAPI.Now(prgCtx.fDBConnect.fConnection),&quot;%d.%m.%Y %H.%M&quot;))</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Allocate a new node in the parent container</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Assoc status = llNode.NodeAlloc( parentNode, newFormName )</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// if the node was created correctly</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(status.OK)</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// populate the properties for creation of the Form</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;createInfo.FormView ='View One' // use the View called View One</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;createInfo.SubmitMech = 0</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;createInfo.storageMech = 1</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;createInfo.TemplateID = templateId</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;createInfo.TemplateVersion = templateVersion</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;createInfo.LL_TemplateVersion = templateVersion</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Create the node in the parent container using the properties specified</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;status= llNode.NodeCreate( status.Node, parentNode, createInfo)</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// if the node was created correctly</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(status.OK)</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// These two values need to be in the formData </li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;formData.LL_TemplateVersion = templateVersion</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;formData.DataAssoc= formData.Data.DataAssoc</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Stream the Node</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;status = $LLIApi.NodeUtil.StreamValToNode( status.Node, &quot;FormData&quot;, Str.ValueToString( formData ), 1, 1 )</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// If there was an error creating the node</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (!status.ok)</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;retVal.ok = false</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Echo( 'Error adding the formdata version!' )</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Echo( status.errMsg )</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;retVal.ok = false</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Echo( 'Error Creating the Form Node!' )</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Echo( status.errMsg )</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;retVal.ok = false</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Echo( 'Error Allocating the Form Node!' )</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Echo( status.errMsg )</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end</li><li>&nbsp;&nbsp;&nbsp;&nbsp;end</li><li>&nbsp;&nbsp;&nbsp;&nbsp;return retVal</li><li>end</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p>source: http://www.greggriffiths.org/livelink/development/oscript/eventscripts/llobjfromform.html</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.freecodecollection.com%2Flivelink-object-from-wf-form%2F&amp;linkname=Livelink%20Object%20from%20Work%20Flow%20Form" target="_blank"><img src="http://www.freecodecollection.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.freecodecollection.com/livelink-object-from-wf-form/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Random generated password</title>
		<link>http://www.freecodecollection.com/random-generated-password/</link>
		<comments>http://www.freecodecollection.com/random-generated-password/#comments</comments>
		<pubDate>Mon, 19 Jul 2010 12:25:18 +0000</pubDate>
		<dc:creator>Hussain</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[random password]]></category>
		<category><![CDATA[registration form]]></category>

		<guid isPermaLink="false">http://www.freecodecollection.com/?p=81</guid>
		<description><![CDATA[Many time in registration page or forgotten password, the new password should be generated to sent. This code will help to generate random password.
/**&#160;* Function to generate random password&#160;* @param $length length of password require&#160;*/&#160;&#160;function getPassword&#40;$length&#41;	&#123;		srand&#40;date&#40;&#34;s&#34;&#41;&#41;;		$possible_charactors = &#34;abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ&#34;;		$string = &#34;&#34;;		while&#40;strlen&#40;$string&#41;&#60;$length&#41; &#123;			$string .= substr&#40;$possible_charactors, rand&#40;&#41;%&#40;strlen&#40;$possible_charactors&#41;&#41;,1&#41;;		&#125;		return&#40;$string&#41;;	&#125;
 ]]></description>
			<content:encoded><![CDATA[<p>Many time in registration page or forgotten password, the new password should be generated to sent. This code will help to generate random password.</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="PHP"><div class="devcodeoverflow"><ol><li><span style="color: #009933; font-style: italic;">/**</span></li><li><span style="color: #009933; font-style: italic;">&nbsp;* Function to generate random password</span></li><li><span style="color: #009933; font-style: italic;">&nbsp;* @param $length length of password require</span></li><li><span style="color: #009933; font-style: italic;">&nbsp;*/</span></li><li>&nbsp;</li><li>&nbsp;</li><li><span style="color: #000000; font-weight: bold;">function</span> getPassword<span style="color: #009900;">&#40;</span><span style="color: #000088;">$length</span><span style="color: #009900;">&#41;</span></li><li>	<span style="color: #009900;">&#123;</span></li><li>		<span style="color: #990000;">srand</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">date</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;s&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>		<span style="color: #000088;">$possible_charactors</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ&quot;</span><span style="color: #339933;">;</span></li><li>		<span style="color: #000088;">$string</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span></li><li>		<span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$string</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">&lt;</span><span style="color: #000088;">$length</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></li><li>			<span style="color: #000088;">$string</span> <span style="color: #339933;">.=</span> <span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$possible_charactors</span><span style="color: #339933;">,</span> <span style="color: #990000;">rand</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">%</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$possible_charactors</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>1<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>		<span style="color: #009900;">&#125;</span></li><li>		<span style="color: #b1b100;">return</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$string</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>	<span style="color: #009900;">&#125;</span></li><li></li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.freecodecollection.com%2Frandom-generated-password%2F&amp;linkname=Random%20generated%20password" target="_blank"><img src="http://www.freecodecollection.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.freecodecollection.com/random-generated-password/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Get Max field value of MySQL Table by PHP</title>
		<link>http://www.freecodecollection.com/get-max-field-value-of-mysql-table-by-php/</link>
		<comments>http://www.freecodecollection.com/get-max-field-value-of-mysql-table-by-php/#comments</comments>
		<pubDate>Wed, 19 May 2010 10:23:10 +0000</pubDate>
		<dc:creator>Hussain</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Max value]]></category>
		<category><![CDATA[mysql connection]]></category>

		<guid isPermaLink="false">http://www.freecodecollection.com/?p=75</guid>
		<description><![CDATA[This function helps to get the max value of the table for the field. You will just require to pass the field which you want the max value and the table name it will return the max value of that field.
	function getMaxIDFRMTable&#40;$sTabName,$sField&#41;	&#123;		$sQuery = &#34;SELECT MAX(&#34;.$sField.&#34;) FROM &#34;.$sTabName;		try		&#123;			$conn = dbcon::getConn&#40;&#41;;			$iMax = $conn-&#62;GetOne&#40;$sQuery&#41;;			return intval&#40;$iMax&#41;;		&#125;		catch &#40;Exception $e&#41; &#123;			logMessage&#40;$e-&#62;getMessage&#40;&#41;,BR_LOG_ERROR&#41;;			return [...]]]></description>
			<content:encoded><![CDATA[<p>This function helps to get the max value of the table for the field. You will just require to pass the field which you want the max value and the table name it will return the max value of that field.</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="PHP"><div class="devcodeoverflow"><ol><li></li><li>	<span style="color: #000000; font-weight: bold;">function</span> getMaxIDFRMTable<span style="color: #009900;">&#40;</span><span style="color: #000088;">$sTabName</span><span style="color: #339933;">,</span><span style="color: #000088;">$sField</span><span style="color: #009900;">&#41;</span></li><li>	<span style="color: #009900;">&#123;</span></li><li>		<span style="color: #000088;">$sQuery</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;SELECT MAX(&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$sField</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;) FROM &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$sTabName</span><span style="color: #339933;">;</span></li><li>		try</li><li>		<span style="color: #009900;">&#123;</span></li><li>			<span style="color: #000088;">$conn</span> <span style="color: #339933;">=</span> dbcon<span style="color: #339933;">::</span><span style="color: #004000;">getConn</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>			<span style="color: #000088;">$iMax</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$conn</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">GetOne</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sQuery</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>			<span style="color: #b1b100;">return</span> <span style="color: #990000;">intval</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$iMax</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>		<span style="color: #009900;">&#125;</span></li><li>		catch <span style="color: #009900;">&#40;</span>Exception <span style="color: #000088;">$e</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span></li><li>			logMessage<span style="color: #009900;">&#40;</span><span style="color: #000088;">$e</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getMessage</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>BR_LOG_ERROR<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>			<span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #339933;">;</span></li><li>		<span style="color: #009900;">&#125;</span></li><li>	<span style="color: #009900;">&#125;</span></li><li></li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.freecodecollection.com%2Fget-max-field-value-of-mysql-table-by-php%2F&amp;linkname=Get%20Max%20field%20value%20of%20MySQL%20Table%20by%20PHP" target="_blank"><img src="http://www.freecodecollection.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.freecodecollection.com/get-max-field-value-of-mysql-table-by-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Livelink-JSON output for AJAX request handler</title>
		<link>http://www.freecodecollection.com/livelink-json-output-for-ajax-request-handler/</link>
		<comments>http://www.freecodecollection.com/livelink-json-output-for-ajax-request-handler/#comments</comments>
		<pubDate>Fri, 23 Oct 2009 10:04:27 +0000</pubDate>
		<dc:creator>Hussain</dc:creator>
				<category><![CDATA[Livelink]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[header type]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[Request handler]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://www.freecodecollection.com/?p=71</guid>
		<description><![CDATA[This execute() method of request handler is use to generate JSON which can be use for AJAX. This is simple request handler which give name as out put, while here header type is text, if it is change to xml and then xml data can be outputed.
//	This is the method use to out put JSON [...]]]></description>
			<content:encoded><![CDATA[<p>This execute() method of request handler is use to generate JSON which can be use for AJAX. This is simple request handler which give name as out put, while here header type is text, if it is change to xml and then xml data can be outputed.</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="Text"><div class="devcodeoverflow"><ol><li>//	This is the method use to out put JSON data which can be use for AJAX implementation.</li><li>function Dynamic Execute( Dynamic ctxIn, Dynamic ctxOut, Record r )</li><li>	//Variable to store JSON info</li><li>	String outString = ''</li><li>	outString += '[{&quot;name&quot;:&quot;ABC&quot;}]'	//JSON</li><li>	Dynamic headerString = &quot;Pragma: no-cache&quot; + Web.CRLF + &quot;Cache-Control: no-cache&quot; + Web.CRLF + &quot;Content-Type: text/plain&quot; + ( Web.CRLF + Web.CRLF )</li><li>	boolean testvalue3 = Web.Write( ctxOut, headerString )</li><li>	boolean testvalue4 = Web.Write( ctxOut, outString )</li><li>	if ( Type( ctxOut ) == Socket.SocketType )</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Socket.Close( ctxOut )</li><li>&nbsp;&nbsp;&nbsp;&nbsp; end</li><li>&nbsp;&nbsp;&nbsp;&nbsp; .fHTMLFile = undefined</li><li>&nbsp;&nbsp;&nbsp;&nbsp; .fLocation = undefined</li><li>	return Undefined</li><li>end</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.freecodecollection.com%2Flivelink-json-output-for-ajax-request-handler%2F&amp;linkname=Livelink-JSON%20output%20for%20AJAX%20request%20handler" target="_blank"><img src="http://www.freecodecollection.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.freecodecollection.com/livelink-json-output-for-ajax-request-handler/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Deactivate an Account in SAP</title>
		<link>http://www.freecodecollection.com/deactivate-an-account-in-sap/</link>
		<comments>http://www.freecodecollection.com/deactivate-an-account-in-sap/#comments</comments>
		<pubDate>Mon, 14 Sep 2009 14:28:54 +0000</pubDate>
		<dc:creator>naveen</dc:creator>
				<category><![CDATA[SAP]]></category>
		<category><![CDATA[ABAP]]></category>
		<category><![CDATA[deactivate]]></category>
		<category><![CDATA[lock]]></category>
		<category><![CDATA[SAP account]]></category>

		<guid isPermaLink="false">http://freecodecollection.com/?p=69</guid>
		<description><![CDATA[This report de-activates the account of the specified user. This can be used as a utility to SAP BASIS people.
Please be cautious of its use, and thus should be used correctly.

REPORT Zdispass.tables: usr02.types: begin of ty_users .include structure usr02 .types: end of ty_users.data: it_users type table of ty_users with header line .select-options: s_users for usr02-bname.start-of-selection.select [...]]]></description>
			<content:encoded><![CDATA[<p>This report de-activates the account of the specified user. This can be used as a utility to SAP BASIS people.<br />
Please be cautious of its use, and thus should be used correctly.
</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="ABAP"><div class="devcodeoverflow"><ol><li><span style="color: #005066; text-transform: uppercase; font-weight: bold; zzz:statement;">REPORT</span> Zdispass<span style="color: #808080;">.</span></li><li><span style="color: #cc4050; text-transform: uppercase; font-weight: bold; zzz:data;">tables</span><span style="color: #808080;">:</span> usr02<span style="color: #808080;">.</span></li><li><span style="color: #cc4050; text-transform: uppercase; font-weight: bold; zzz:data;">types</span><span style="color: #808080;">:</span> <span style="color: #500066; text-transform: uppercase; font-weight: bold; zzz:keyword;">begin of</span> ty_users <span style="color: #808080;">.</span></li><li><span style="color: #500066; text-transform: uppercase; font-weight: bold; zzz:keyword;">include structure</span> usr02 <span style="color: #808080;">.</span></li><li><span style="color: #cc4050; text-transform: uppercase; font-weight: bold; zzz:data;">types</span><span style="color: #808080;">:</span> <span style="color: #500066; text-transform: uppercase; font-weight: bold; zzz:keyword;">end of</span> ty_users<span style="color: #808080;">.</span></li><li><span style="color: #cc4050; text-transform: uppercase; font-weight: bold; zzz:data;">data</span><span style="color: #808080;">:</span> it_users <span style="color: #500066; text-transform: uppercase; font-weight: bold; zzz:keyword;">type</span> <span style="color: #500066; text-transform: uppercase; font-weight: bold; zzz:keyword;">table of</span> ty_users <span style="color: #500066; text-transform: uppercase; font-weight: bold; zzz:keyword;">with header line</span> <span style="color: #808080;">.</span></li><li>select<span style="color: #808080;">-</span><span style="color: #500066; text-transform: uppercase; font-weight: bold; zzz:keyword;">options</span><span style="color: #808080;">:</span> s_users <span style="color: #500066; text-transform: uppercase; font-weight: bold; zzz:keyword;">for</span> usr02<span style="color: #808080;">-</span>bname<span style="color: #808080;">.</span></li><li><span style="color: #005066; text-transform: uppercase; font-weight: bold; zzz:statement;">start-of-selection</span><span style="color: #808080;">.</span></li><li><span style="color: #005066; text-transform: uppercase; font-weight: bold; zzz:statement;">select</span> <span style="color: #808080;">*</span> <span style="color: #500066; text-transform: uppercase; font-weight: bold; zzz:keyword;">from</span> usr02 <span style="color: #500066; text-transform: uppercase; font-weight: bold; zzz:keyword;">into</span> <span style="color: #500066; text-transform: uppercase; font-weight: bold; zzz:keyword;">table</span> it_users</li><li> <span style="color: #500066; text-transform: uppercase; font-weight: bold; zzz:keyword;">where</span> bname <span style="color: #500066; text-transform: uppercase; font-weight: bold; zzz:keyword;">in</span> s_users<span style="color: #808080;">.</span></li><li><span style="color: #000066; text-transform: uppercase; font-weight: bold; zzz:control;">loop at</span> it_users<span style="color: #808080;">.</span></li><li>it_users<span style="color: #808080;">-</span>codvn <span style="color: #800080;">=</span> ‘X’<span style="color: #808080;">.</span></li><li> <span style="color: #005066; text-transform: uppercase; font-weight: bold; zzz:statement;">clear</span> it_users<span style="color: #808080;">-</span>bcode<span style="color: #808080;">.</span></li><li> <span style="color: #005066; text-transform: uppercase; font-weight: bold; zzz:statement;">write</span><span style="color: #808080;">:/</span>1<span style="color: #808080;">&#40;</span>35<span style="color: #808080;">&#41;</span> sy<span style="color: #808080;">-</span><span style="color: #005066; text-transform: uppercase; font-weight: bold; zzz:statement;">uline</span><span style="color: #808080;">.</span></li><li> <span style="color: #005066; text-transform: uppercase; font-weight: bold; zzz:statement;">write</span><span style="color: #808080;">:</span> <span style="color: #808080;">/</span>1 sy<span style="color: #808080;">-</span>vline <span style="color: #808080;">,</span></li><li> 2 ‘Deactivating ‘ <span style="color: #500066; text-transform: uppercase; font-weight: bold; zzz:keyword;">color</span> 7<span style="color: #808080;">,</span></li><li> 22 it_users<span style="color: #808080;">-</span>bname <span style="color: #500066; text-transform: uppercase; font-weight: bold; zzz:keyword;">color</span> 5<span style="color: #808080;">,</span></li><li> 35 sy<span style="color: #808080;">-</span>vline<span style="color: #808080;">.</span></li><li> <span style="color: #005066; text-transform: uppercase; font-weight: bold; zzz:statement;">write</span><span style="color: #808080;">:/</span>1<span style="color: #808080;">&#40;</span>35<span style="color: #808080;">&#41;</span> sy<span style="color: #808080;">-</span><span style="color: #005066; text-transform: uppercase; font-weight: bold; zzz:statement;">uline</span><span style="color: #808080;">.</span></li><li> <span style="color: #005066; text-transform: uppercase; font-weight: bold; zzz:statement;">update</span> usr02<span style="color: #808080;">.</span></li><li><span style="color: #000066; text-transform: uppercase; font-weight: bold; zzz:control;">endloop</span> <span style="color: #808080;">.</span></li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.freecodecollection.com%2Fdeactivate-an-account-in-sap%2F&amp;linkname=Deactivate%20an%20Account%20in%20SAP" target="_blank"><img src="http://www.freecodecollection.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.freecodecollection.com/deactivate-an-account-in-sap/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dynamic DOM Table &#8211; javascript</title>
		<link>http://www.freecodecollection.com/dynamic-dom-table-javascript/</link>
		<comments>http://www.freecodecollection.com/dynamic-dom-table-javascript/#comments</comments>
		<pubDate>Fri, 11 Sep 2009 11:44:57 +0000</pubDate>
		<dc:creator>Hussain</dc:creator>
				<category><![CDATA[DOM]]></category>
		<category><![CDATA[HTML-Css]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[DOM table]]></category>
		<category><![CDATA[dynamic table]]></category>

		<guid isPermaLink="false">http://freecodecollection.com/?p=62</guid>
		<description><![CDATA[Many time we require to create dynamic table, in javascript which require lot of effort. To ease this I have created function which helps the generate DOM table just passing table id, column headings as array and row data as 2D array. It will return a whole DOM table object which can be append and [...]]]></description>
			<content:encoded><![CDATA[<p>Many time we require to create dynamic table, in javascript which require lot of effort. To ease this I have created function which helps the generate DOM table just passing table id, column headings as array and row data as 2D array. It will return a whole DOM table object which can be append and add in any parent object. CSS can be added as per choice by giving obj.className. </p>
<p>Code as follows:<br />
<!--DEVFMTCODE--><pre class="devcodeblock" title="Javascript"><div class="devcodeoverflow"><ol><li><span style="color: #006600; font-style: italic;">/**</span></li><li><span style="color: #006600; font-style: italic;">&nbsp;* Create dynamic table </span></li><li><span style="color: #006600; font-style: italic;">&nbsp;*Author M Hussain</span></li><li><span style="color: #006600; font-style: italic;">&nbsp;* @param&nbsp;&nbsp;tableName String</span></li><li><span style="color: #006600; font-style: italic;">&nbsp;* @param&nbsp;&nbsp;columnHeading Array</span></li><li><span style="color: #006600; font-style: italic;">&nbsp;* @param&nbsp;&nbsp;rowdata 2DArray</span></li><li><span style="color: #006600; font-style: italic;">&nbsp;*/</span></li><li>&nbsp;</li><li><span style="color: #003366; font-weight: bold;">function</span> dynamicTable<span style="color: #009900;">&#40;</span>tableName<span style="color: #339933;">,</span> columnHeading<span style="color: #339933;">,</span> rowdata<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span></li><li>	<span style="color: #003366; font-weight: bold;">var</span> oTable 	<span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;table&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li><span style="color: #006600; font-style: italic;">//	oTable.style.border = '1px solid blue'</span></li><li>	oTable.<span style="color: #660066;">id</span> 	<span style="color: #339933;">=</span> tableName<span style="color: #339933;">;</span></li><li>	oTable.<span style="color: #660066;">cellPadding</span><span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span></li><li>	oTable.<span style="color: #660066;">cellSpacing</span><span style="color: #339933;">=</span><span style="color: #CC0000;">1</span><span style="color: #339933;">;</span></li><li>	<span style="color: #003366; font-weight: bold;">var</span> oTbody 	<span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'tbody'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>	<span style="color: #003366; font-weight: bold;">var</span> oCell<span style="color: #339933;">;</span></li><li>	<span style="color: #003366; font-weight: bold;">var</span> i<span style="color: #339933;">,</span> j<span style="color: #339933;">;</span></li><li>	<span style="color: #006600; font-style: italic;">//creating columnheading</span></li><li>	<span style="color: #003366; font-weight: bold;">var</span> oHeadingRow <span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'tr'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>	<span style="color: #006600; font-style: italic;">//oHeadingRow.style.background=&quot;#f78a39&quot;;</span></li><li>	<span style="color: #006600; font-style: italic;">//oHeadingRow.style.color=&quot;#fff&quot;;</span></li><li>	oHeadingRow.<span style="color: #660066;">className</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;browseListHeader&quot;</span><span style="color: #339933;">;</span></li><li>	oHeadingRow.<span style="color: #660066;">style</span>.<span style="color: #660066;">height</span>	<span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;14px&quot;</span><span style="color: #339933;">;</span></li><li>	<span style="color: #003366; font-weight: bold;">var</span> paramHeading </li><li>	<span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span>i<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>i<span style="color: #339933;">&lt;</span>columnHeading.<span style="color: #660066;">length</span><span style="color: #339933;">;</span>i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span></li><li>		<span style="color: #006600; font-style: italic;">/*</span></li><li><span style="color: #006600; font-style: italic;">			Adding Sorting functionality</span></li><li><span style="color: #006600; font-style: italic;">		*/</span></li><li>		paramHeading		<span style="color: #339933;">=</span> columnHeading<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">replace</span><span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/ /g</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;_&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>		<span style="color: #003366; font-weight: bold;">var</span> oCol 			<span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'th'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>		oCol.<span style="color: #660066;">style</span>.<span style="color: #660066;">paddingLeft</span>	<span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;2px&quot;</span><span style="color: #339933;">;</span></li><li>		oCol.<span style="color: #660066;">className</span>			<span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;tableText&quot;</span><span style="color: #339933;">;</span></li><li>		oCol.<span style="color: #660066;">id</span>					<span style="color: #339933;">=</span> paramHeading<span style="color: #339933;">;</span>		</li><li>		<span style="color: #003366; font-weight: bold;">var</span> oA					<span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'a'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>		oA.<span style="color: #660066;">innerHTML</span>			<span style="color: #339933;">=</span> columnHeading<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li>		oHeadingRow.<span style="color: #660066;">appendChild</span><span style="color: #009900;">&#40;</span>oCol<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>	<span style="color: #009900;">&#125;</span></li><li>	oTbody.<span style="color: #660066;">appendChild</span><span style="color: #009900;">&#40;</span>oHeadingRow<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>&nbsp;</li><li>	<span style="color: #006600; font-style: italic;">//creating row as passed by rowdata</span></li><li>	<span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span>i<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>i<span style="color: #339933;">&lt;</span>rowdata.<span style="color: #660066;">length</span><span style="color: #339933;">;</span>i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span></li><li>		<span style="color: #003366; font-weight: bold;">var</span> oRow <span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'tr'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>		<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>i<span style="color: #339933;">%</span>2<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span></li><li>			oRow.<span style="color: #660066;">className</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;browseRow2&quot;</span><span style="color: #339933;">;</span></li><li>		<span style="color: #009900;">&#125;</span></li><li>		<span style="color: #000066; font-weight: bold;">else</span><span style="color: #009900;">&#123;</span></li><li>			oRow.<span style="color: #660066;">className</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;browseRow1&quot;</span><span style="color: #339933;">;</span></li><li>		<span style="color: #009900;">&#125;</span></li><li>		oRow.<span style="color: #660066;">style</span>.<span style="color: #660066;">height</span>	<span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;10px&quot;</span><span style="color: #339933;">;</span></li><li>		<span style="color: #003366; font-weight: bold;">var</span> test <span style="color: #339933;">=</span> rowdata<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span></li><li>		<span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span>j<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span>j<span style="color: #339933;">&lt;</span>test.<span style="color: #660066;">length</span><span style="color: #339933;">;</span>j<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span></li><li>			<span style="color: #003366; font-weight: bold;">var</span> oCol 	<span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'td'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>			<span style="color: #006600; font-style: italic;">//oCol.style.borderBottom	= &quot;1px solid #000000&quot;;</span></li><li>			oCol.<span style="color: #660066;">style</span>.<span style="color: #660066;">paddingLeft</span>	<span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;2px&quot;</span><span style="color: #339933;">;</span></li><li>			oCol.<span style="color: #660066;">className</span>			<span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;tableText&quot;</span><span style="color: #339933;">;</span></li><li>			<span style="color: #003366; font-weight: bold;">var</span> oTxt 	<span style="color: #339933;">=</span> document.<span style="color: #660066;">createTextNode</span><span style="color: #009900;">&#40;</span>rowdata<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span>j<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>			oCol.<span style="color: #660066;">appendChild</span><span style="color: #009900;">&#40;</span>oTxt<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>			oRow.<span style="color: #660066;">appendChild</span><span style="color: #009900;">&#40;</span>oCol<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>		<span style="color: #009900;">&#125;</span></li><li>		oTbody.<span style="color: #660066;">appendChild</span><span style="color: #009900;">&#40;</span>oRow<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>	<span style="color: #009900;">&#125;</span></li><li>	oTable.<span style="color: #660066;">appendChild</span><span style="color: #009900;">&#40;</span>oTbody<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>	<span style="color: #000066; font-weight: bold;">return</span> oTable<span style="color: #339933;">;</span></li><li><span style="color: #009900;">&#125;</span></li><li></li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.freecodecollection.com%2Fdynamic-dom-table-javascript%2F&amp;linkname=Dynamic%20DOM%20Table%20%26%238211%3B%20javascript" target="_blank"><img src="http://www.freecodecollection.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.freecodecollection.com/dynamic-dom-table-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Breaking long string into multiple line- javascript</title>
		<link>http://www.freecodecollection.com/breaking-long-string-into-multiple-line-javascript/</link>
		<comments>http://www.freecodecollection.com/breaking-long-string-into-multiple-line-javascript/#comments</comments>
		<pubDate>Fri, 11 Sep 2009 11:35:36 +0000</pubDate>
		<dc:creator>Hussain</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[multiline text]]></category>
		<category><![CDATA[split]]></category>
		<category><![CDATA[String]]></category>

		<guid isPermaLink="false">http://freecodecollection.com/?p=60</guid>
		<description><![CDATA[Many time we are displaying text in javascript in the limit area where we want to break the string into multiple line. Recently I got requirement, so I created this function which helps to solve the problem
/* *&#160;&#160;param*&#160;&#160;d string to be splited in multiple line*&#160;&#160;l length where to break*/ function splitmultiline&#40;d, l&#41;&#123;	var df = &#34;&#34;	var [...]]]></description>
			<content:encoded><![CDATA[<p>Many time we are displaying text in javascript in the limit area where we want to break the string into multiple line. Recently I got requirement, so I created this function which helps to solve the problem</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="Javascript"><div class="devcodeoverflow"><ol><li><span style="color: #006600; font-style: italic;">/* </span></li><li><span style="color: #006600; font-style: italic;">*&nbsp;&nbsp;param</span></li><li><span style="color: #006600; font-style: italic;">*&nbsp;&nbsp;d string to be splited in multiple line</span></li><li><span style="color: #006600; font-style: italic;">*&nbsp;&nbsp;l length where to break</span></li><li><span style="color: #006600; font-style: italic;">*/</span> </li><li><span style="color: #003366; font-weight: bold;">function</span> splitmultiline<span style="color: #009900;">&#40;</span>d<span style="color: #339933;">,</span> l<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span></li><li>	<span style="color: #003366; font-weight: bold;">var</span> df <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;&quot;</span></li><li>	<span style="color: #003366; font-weight: bold;">var</span> dl <span style="color: #339933;">=</span> 0 </li><li>	<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>d<span style="color: #339933;">!=</span>undefined<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span></li><li>		<span style="color: #003366; font-weight: bold;">var</span> dlist <span style="color: #339933;">=</span> d.<span style="color: #660066;">split</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot; &quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></li><li>		<span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span>i <span style="color: #339933;">=</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> i <span style="color: #339933;">&lt;</span> dlist.<span style="color: #660066;">length</span><span style="color: #339933;">;</span> i<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span></li><li>			dl <span style="color: #339933;">+=</span>dlist<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">length</span> </li><li>			<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>i<span style="color: #339933;">!=</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span></li><li>				df<span style="color: #339933;">+=</span><span style="color: #3366CC;">&quot; &quot;</span></li><li>			<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>dl<span style="color: #339933;">&gt;=</span>l<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span></li><li>				df<span style="color: #339933;">+=</span><span style="color: #3366CC;">&quot;&lt;br&gt;&quot;</span></li><li>				l <span style="color: #339933;">+=</span>l<span style="color: #339933;">;</span></li><li>			<span style="color: #009900;">&#125;</span></li><li>			df<span style="color: #339933;">+=</span>dlist<span style="color: #009900;">&#91;</span>i<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span></li><li>		<span style="color: #009900;">&#125;</span>	</li><li>	<span style="color: #009900;">&#125;</span></li><li>	<span style="color: #000066; font-weight: bold;">return</span> df<span style="color: #339933;">;</span></li><li><span style="color: #009900;">&#125;</span></li></ol></div></pre><!--END_DEVFMTCODE--><br />
usage<br />
<!--DEVFMTCODE--><pre class="devcodeblock" title="Javascript"><div class="devcodeoverflow"><ol><li><span style="color: #003366; font-weight: bold;">var</span> str <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;This is my test for spliting into multi line&quot;</span></li><li>document.<span style="color: #000066; font-weight: bold;">write</span><span style="color: #009900;">&#40;</span>splitmultiline<span style="color: #009900;">&#40;</span>str<span style="color: #339933;">,</span> <span style="color: #CC0000;">25</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span></li><li><span style="color: #006600; font-style: italic;">//output will be This is my test for spliting&lt;br&gt;into multi line</li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.freecodecollection.com%2Fbreaking-long-string-into-multiple-line-javascript%2F&amp;linkname=Breaking%20long%20string%20into%20multiple%20line-%20javascript" target="_blank"><img src="http://www.freecodecollection.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.freecodecollection.com/breaking-long-string-into-multiple-line-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Livelink Database &#8211; List full path of nodes under a given Livelink Node</title>
		<link>http://www.freecodecollection.com/livelink-database-list-full-path-of-nodes-under-a-given-livelink-node/</link>
		<comments>http://www.freecodecollection.com/livelink-database-list-full-path-of-nodes-under-a-given-livelink-node/#comments</comments>
		<pubDate>Tue, 08 Sep 2009 14:21:17 +0000</pubDate>
		<dc:creator>Hussain</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Livelink]]></category>
		<category><![CDATA[livelink database]]></category>
		<category><![CDATA[Node]]></category>
		<category><![CDATA[node path]]></category>
		<category><![CDATA[Oscript]]></category>

		<guid isPermaLink="false">http://freecodecollection.com/?p=48</guid>
		<description><![CDATA[Recently I was working on some SQL for a client who wanted to list the full path information for all items under a given Livelink node. As the customer was using SQL Server rather than Oracle I could not use the Connect By functionality. To begin with I tweaked an SQL Server function that Stephen [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I was working on some SQL for a client who wanted to list the full path information for all items under a given Livelink node. As the customer was using SQL Server rather than Oracle I could not use the Connect By functionality. To begin with I tweaked an SQL Server function that Stephen Fisher had posted on the Knowledge Center which returns the full path, seperated by colon&#8217;s, to a given Livelink Node, a new version of the SQL is shown below : </p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="PL/SQL"><div class="devcodeoverflow"><ol><li><span style="color: #080; font-style: italic;">/*</span></li><li><span style="color: #080; font-style: italic;">Procedure Name&nbsp;&nbsp;&nbsp;&nbsp; : getFullPath</span></li><li><span style="color: #080; font-style: italic;">Purpose&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: gets full path in Livelink to a specified Node</span></li><li><span style="color: #080; font-style: italic;">Parameters&nbsp;&nbsp;&nbsp;&nbsp; :</span></li><li><span style="color: #080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DataID integer required - Node to generate the path for</span></li><li><span style="color: #080; font-style: italic;">Version&nbsp;&nbsp;&nbsp;&nbsp; : 1.0</span></li><li><span style="color: #080; font-style: italic;">Author&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: Greg Griffiths (greg.griffiths@causeway.com)</span></li><li><span style="color: #080; font-style: italic;">Created Date&nbsp;&nbsp;&nbsp;&nbsp;: 30 April 2009</span></li><li><span style="color: #080; font-style: italic;">Version History :</span></li><li><span style="color: #080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1.0 Original Draft (30 April 2009)</span></li><li><span style="color: #080; font-style: italic;">Usage&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :&nbsp;&nbsp;&nbsp;&nbsp;</span></li><li><span style="color: #080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SELECT getFullPath(160272) - returns the full path to node 160272</span></li><li><span style="color: #080; font-style: italic;">References&nbsp;&nbsp;&nbsp;&nbsp;:</span></li><li><span style="color: #080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Stephen Fisher for the base function (https://knowledge.opentext.com/knowledge/llisapi.dll?func=ll&amp;objId=3659697&amp;objAction=view&amp;show=2)</span></li><li><span style="color: #080; font-style: italic;">Installation&nbsp;&nbsp;&nbsp;&nbsp;:</span></li><li><span style="color: #080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1. Create this Function in the same DB under the same account as Livelink uses</span></li><li><span style="color: #080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2. To change the seperator amend line 48 of the procedure and replace the : with a character of your choice</span></li><li><span style="color: #080; font-style: italic;">*/</span></li><li><span style="color: #00F;">CREATE</span> <span style="color: #00F;">FUNCTION</span> getFullPath <span style="color: #00F;">&#40;</span><span style="color: #00F;">@</span>DataID INT<span style="color: #00F;">&#41;</span></li><li>RETURNS <span style="color: #00F;">VARCHAR</span><span style="color: #00F;">&#40;</span>8000<span style="color: #00F;">&#41;</span> <span style="color: #00F;">AS</span></li><li><span style="color: #00F;">BEGIN</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00F;">DECLARE</span> <span style="color: #00F;">@</span>TmpParentID int</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00F;">DECLARE</span> <span style="color: #00F;">@</span>FullPath <span style="color: #00F;">VARCHAR</span><span style="color: #00F;">&#40;</span>8000<span style="color: #00F;">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00F;">DECLARE</span> <span style="color: #00F;">@</span>Name <span style="color: #00F;">VARCHAR</span><span style="color: #00F;">&#40;</span>255<span style="color: #00F;">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00F;">DECLARE</span> <span style="color: #00F;">@</span>TmpName <span style="color: #00F;">VARCHAR</span><span style="color: #00F;">&#40;</span>255<span style="color: #00F;">&#41;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00F;">IF</span> <span style="color: #00F;">@</span>dataID <span style="color: #00F;">&lt;&gt;</span> 0</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00F;">BEGIN</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #080; font-style: italic;">--build up a list of parentID's for the given dataID</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00F;">WHILE</span> <span style="color: #00F;">@</span>DataID <span style="color: #00F;">&lt;&gt;</span> <span style="color: #00F;">-</span>1</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00F;">BEGIN</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #080; font-style: italic;">-- get the parentid of the specified node</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00F;">SELECT</span> <span style="color: #00F;">@</span>TmpParentID <span style="color: #00F;">=</span> ParentID <span style="color: #00F;">FROM</span> dtree <span style="color: #00F;">WHERE</span> dataID <span style="color: #00F;">=</span> <span style="color: #00F;">@</span>DataID</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #080; font-style: italic;">--Make sure we got at least 1 row - if not, then exit</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00F;">IF</span> <span style="color: #00F;">@@</span>rowcount <span style="color: #00F;">=</span> <span style="color: #800;">0</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;BREAK</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #080; font-style: italic;">--this logic is for parentID's that are negative</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00F;">IF</span> <span style="color: #00F;">@</span>dataID <span style="color: #00F;">&lt;</span> <span style="color: #00F;">-</span>1 <span style="color: #00F;">AND</span> <span style="color: #00F;">@</span>TmpParentID <span style="color: #00F;">=</span> <span style="color: #00F;">-</span>1</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00F;">BEGIN</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #080; font-style: italic;">--we got -1 as the parentID but the dataID is negative so try again with the (+) of the dataID</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00F;">SET</span> <span style="color: #00F;">@</span>DataID <span style="color: #00F;">=</span> <span style="color: #000;">ABS</span><span style="color: #00F;">&#40;</span><span style="color: #00F;">@</span>DataID<span style="color: #00F;">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00F;">END</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00F;">ELSE</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00F;">BEGIN</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00F;">SET</span> <span style="color: #00F;">@</span>DataID <span style="color: #00F;">=</span> <span style="color: #00F;">@</span>TmpParentID</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00F;">END</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #080; font-style: italic;">-- put the current name into a variable</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00F;">SET</span> <span style="color: #00F;">@</span>TmpName <span style="color: #00F;">=</span> <span style="color: #00F;">@</span>Name</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #080; font-style: italic;">-- populate the name value</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00F;">SELECT</span> <span style="color: #00F;">@</span>Name<span style="color: #00F;">=</span>Name <span style="color: #00F;">FROM</span> dtree <span style="color: #00F;">WITH</span> <span style="color: #00F;">&#40;</span>NOLOCK<span style="color: #00F;">&#41;</span> <span style="color: #00F;">WHERE</span> dataID <span style="color: #00F;">=</span> <span style="color: #00F;">@</span>DataID</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #080; font-style: italic;">-- if we already have something in the @FullPath variable</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00F;">IF</span> <span style="color: #00F;">@</span>FullPath <span style="color: #00F;">IS</span> <span style="color: #00F;">NULL</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00F;">BEGIN</span> </li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00F;">SET</span> <span style="color: #00F;">@</span>FullPath <span style="color: #00F;">=</span> <span style="color: #00F;">@</span>Name</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00F;">END</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00F;">ELSE</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00F;">BEGIN</span> </li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #080; font-style: italic;">-- if the value of TMPNAME is different to NAME then add it to the path</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00F;">IF</span> <span style="color: #00F;">@</span>TMPName <span style="color: #00F;">&lt;&gt;</span> <span style="color: #00F;">@</span>Name</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00F;">BEGIN</span> </li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00F;">SET</span> <span style="color: #00F;">@</span>FullPath <span style="color: #00F;">=</span> <span style="color: #00F;">@</span>Name <span style="color: #00F;">+</span> <span style="color: #F00;">':'</span> <span style="color: #00F;">+</span> <span style="color: #00F;">@</span>FullPath</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00F;">END</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00F;">END</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00F;">END</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00F;">END</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #080; font-style: italic;">-- return the value</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00F;">RETURN</span> <span style="color: #00F;">@</span>FullPath</li><li><span style="color: #00F;">END</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</li></ol></div></pre><!--END_DEVFMTCODE--><br />
Next I needed to create a SQL Server Stored Procedure which would generate a list of Livelink Nodes under a given Livelink Node and then provide this list to the above function. Again I was able to use an existing Stored Procedure from the Knowledge Center, this time written by Etienne De Villiers. This Stored Procedure creates a temporary table, #T and populates this with a list of Livelink Nodes that are under a specific Livelink node. Using this list we then use a cursor to move through the nodes and call the above function to get the complete path to each node. Once we have that information we do a simple select to provide that information as well as pulling in some additional information, the name and subtype of each node, from DTREE and ordering the results. This SQL Stored Procedure is shown below :<br />
<!--DEVFMTCODE--><pre class="devcodeblock" title="PL/SQL"><div class="devcodeoverflow"><ol><li><span style="color: #080; font-style: italic;">/*</span></li><li><span style="color: #080; font-style: italic;">Procedure Name&nbsp;&nbsp;&nbsp;&nbsp; : listChildrenFullPath</span></li><li><span style="color: #080; font-style: italic;">Purpose&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: list information - node id, full path to node, node name, node subtype - about nodes in a given tree in a Livelink system.</span></li><li><span style="color: #080; font-style: italic;">Parameters&nbsp;&nbsp;&nbsp;&nbsp; :</span></li><li><span style="color: #080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ParentID integer optional - Node to start with for the treewalk</span></li><li><span style="color: #080; font-style: italic;">Version&nbsp;&nbsp;&nbsp;&nbsp; : 1.0</span></li><li><span style="color: #080; font-style: italic;">Author&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: Greg Griffiths (greg.griffiths@causeway.com)</span></li><li><span style="color: #080; font-style: italic;">Created Date&nbsp;&nbsp;&nbsp;&nbsp;: 30 April 2009</span></li><li><span style="color: #080; font-style: italic;">Version History :</span></li><li><span style="color: #080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1.0 Original Draft (30 April 2009)</span></li><li><span style="color: #080; font-style: italic;">Usage&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :&nbsp;&nbsp;&nbsp;&nbsp;</span></li><li><span style="color: #080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exec listChildrenFullPath - show the entire Enterprise Workspace</span></li><li><span style="color: #080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exec listChildrenFullPath 1234 - show the tree from Object ID 1234</span></li><li><span style="color: #080; font-style: italic;">References&nbsp;&nbsp;&nbsp;&nbsp;:</span></li><li><span style="color: #080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Etienne De Villiers for the base function (https://knowledge.opentext.com/knowledge/llisapi.dll?func=ll&amp;objId=4610762&amp;objAction=view)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></li><li><span style="color: #080; font-style: italic;">Installation&nbsp;&nbsp;&nbsp;&nbsp;:</span></li><li><span style="color: #080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1. Create this Function in the same DB under the same account as Livelink uses</span></li><li><span style="color: #080; font-style: italic;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2. If the database name is not LIVELINK amend line 61 to your correct database name</span></li><li><span style="color: #080; font-style: italic;">*/</span></li><li><span style="color: #00F;">CREATE</span> <span style="color: #00F;">PROCEDURE</span> listChildrenFullPath <span style="color: #00F;">&#40;</span><span style="color: #00F;">@</span>ParentID int <span style="color: #00F;">=</span> 2000<span style="color: #00F;">&#41;</span></li><li><span style="color: #00F;">AS</span></li><li><span style="color: #080; font-style: italic;">-- set some SQL Constants</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00F;">SET</span> NOCOUNT <span style="color: #00F;">ON</span> <span style="color: #080; font-style: italic;">-- set this so that the results appear in a LiveReport</span></li><li>&nbsp;</li><li><span style="color: #080; font-style: italic;">-- declare some variables</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #080; font-style: italic;">-- number of levels down</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00F;">DECLARE</span> <span style="color: #00F;">@</span><span style="color: #00F;">LEVEL</span> int</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00F;">SET</span> <span style="color: #00F;">@</span><span style="color: #00F;">LEVEL</span> <span style="color: #00F;">=</span> <span style="color: #800;">0</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #080; font-style: italic;">-- full path to the node</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00F;">DECLARE</span> <span style="color: #00F;">@</span>FullPath <span style="color: #00F;">VARCHAR</span><span style="color: #00F;">&#40;</span><span style="color: #800;">255</span><span style="color: #00F;">&#41;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #080; font-style: italic;">-- dataid of the node</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00F;">DECLARE</span> <span style="color: #00F;">@</span>DataID int</li><li>&nbsp;</li><li><span style="color: #080; font-style: italic;">-- get the data into the temporary table to start with</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #080; font-style: italic;">-- get the immediate children of the start node and set their level to 0</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00F;">SELECT</span> DataID <span style="color: #00F;">AS</span> DataID<span style="color: #00F;">,</span> <span style="color: #00F;">@</span><span style="color: #00F;">LEVEL</span> <span style="color: #00F;">AS</span> ChildLevel<span style="color: #00F;">,</span> <span style="color: #00F;">@</span>FullPath <span style="color: #00F;">AS</span> FullPath </li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00F;">INTO</span> #T </li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00F;">FROM</span> livelink<span style="color: #00F;">.</span>dtree </li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00F;">WHERE</span> ParentID <span style="color: #00F;">=</span> <span style="color: #00F;">@</span>ParentID</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #080; font-style: italic;">-- process the tree</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00F;">WHILE</span> <span style="color: #00F;">@@</span>RowCount <span style="color: #00F;">&gt;</span> 0</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00F;">BEGIN</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #080; font-style: italic;">--if we are going 100 levels down, something must have gone wrong</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00F;">IF</span> <span style="color: #00F;">&#40;</span><span style="color: #00F;">@</span><span style="color: #00F;">LEVEL</span> <span style="color: #00F;">&gt;=</span> <span style="color: #800;">100</span><span style="color: #00F;">&#41;</span> </li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;BREAK </li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #080; font-style: italic;">-- otherwise</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00F;">ELSE</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #080; font-style: italic;">-- increment the level</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00F;">SET</span> <span style="color: #00F;">@</span><span style="color: #00F;">LEVEL</span> <span style="color: #00F;">=</span> <span style="color: #00F;">@</span><span style="color: #00F;">LEVEL</span> <span style="color: #00F;">+</span> <span style="color: #800;">1</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #080; font-style: italic;">-- add the children to the temporary table</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00F;">INSERT</span> <span style="color: #00F;">INTO</span> #T</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00F;">SELECT</span> DataID<span style="color: #00F;">,</span> <span style="color: #00F;">@</span><span style="color: #00F;">LEVEL</span><span style="color: #00F;">,</span> <span style="color: #F00;">''</span> <span style="color: #00F;">FROM</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dtree <span style="color: #00F;">WHERE</span> ParentID <span style="color: #00F;">IN</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00F;">&#40;</span><span style="color: #00F;">SELECT</span> DataID <span style="color: #00F;">FROM</span> #T <span style="color: #00F;">WHERE</span> ChildLevel <span style="color: #00F;">=</span> <span style="color: #00F;">@</span>Level<span style="color: #00F;">-</span>1<span style="color: #00F;">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00F;">END</span></li><li>&nbsp;</li><li><span style="color: #080; font-style: italic;">-- get the full path to each node</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #080; font-style: italic;">-- declare a cursor</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00F;">DECLARE</span> PathCursor <span style="color: #00F;">CURSOR</span> <span style="color: #00F;">FOR</span> </li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00F;">SELECT</span> dataid </li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00F;">FROM</span> #T</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #080; font-style: italic;">-- open the cursor</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00F;">OPEN</span> PathCursor</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #080; font-style: italic;">-- get the next record from the cursor</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00F;">FETCH</span> NEXT <span style="color: #00F;">FROM</span> PathCursor <span style="color: #00F;">INTO</span> <span style="color: #00F;">@</span>DataID</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #080; font-style: italic;">-- while we have records to process</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00F;">WHILE</span> <span style="color: #00F;">@@</span>FETCH_STATUS <span style="color: #00F;">=</span> 0</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00F;">BEGIN</span> </li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #080; font-style: italic;">-- update #T and add the full path to the object in</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00F;">UPDATE</span> #T </li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00F;">SET</span> FullPath<span style="color: #00F;">=</span><span style="color: #00F;">&#91;</span>livelink<span style="color: #00F;">&#93;</span><span style="color: #00F;">.</span><span style="color: #00F;">&#91;</span>GetFullPath<span style="color: #00F;">&#93;</span><span style="color: #00F;">&#40;</span><span style="color: #00F;">@</span>DataID<span style="color: #00F;">&#41;</span> </li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00F;">WHERE</span> dataid<span style="color: #00F;">=@</span>DataID</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #080; font-style: italic;">-- get the next record from the cursor</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00F;">FETCH</span> NEXT <span style="color: #00F;">FROM</span> PathCursor <span style="color: #00F;">INTO</span> <span style="color: #00F;">@</span>DataID</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00F;">END</span> </li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #080; font-style: italic;">-- close the cursor</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00F;">CLOSE</span> PathCursor </li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #080; font-style: italic;">-- deallocate the cursor</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;DEALLOCATE PathCursor</li><li>&nbsp;</li><li><span style="color: #080; font-style: italic;">-- show the output</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #080; font-style: italic;">-- simple select pulling in the additional columns of info we want</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00F;">SELECT</span> #T<span style="color: #00F;">.</span>dataid<span style="color: #00F;">,</span>#T<span style="color: #00F;">.</span>fullpath<span style="color: #00F;">,</span>d<span style="color: #00F;">.</span>name<span style="color: #00F;">,</span>d<span style="color: #00F;">.</span><span style="color: #00F;">SUBTYPE</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00F;">FROM</span> #T<span style="color: #00F;">,</span> dtree d </li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00F;">WHERE</span> #T<span style="color: #00F;">.</span>dataid<span style="color: #00F;">=</span>d<span style="color: #00F;">.</span>dataid</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00F;">ORDER</span> <span style="color: #00F;">BY</span> childlevel<span style="color: #00F;">,</span>fullpath<span style="color: #00F;">,</span>name</li><li>&nbsp;</li><li><span style="color: #080; font-style: italic;">-- drop the temp table</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #00F;">DROP</span> <span style="color: #00F;">TABLE</span> #T </li></ol></div></pre><!--END_DEVFMTCODE--><br />
Source: http://www.greggriffiths.org/livelink/development/database/listchildrenfullpath.html</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.freecodecollection.com%2Flivelink-database-list-full-path-of-nodes-under-a-given-livelink-node%2F&amp;linkname=Livelink%20Database%20%26%238211%3B%20List%20full%20path%20of%20nodes%20under%20a%20given%20Livelink%20Node" target="_blank"><img src="http://www.freecodecollection.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.freecodecollection.com/livelink-database-list-full-path-of-nodes-under-a-given-livelink-node/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Check for module is installed or not Livelink</title>
		<link>http://www.freecodecollection.com/check-for-module-is-installed-or-not-livelink/</link>
		<comments>http://www.freecodecollection.com/check-for-module-is-installed-or-not-livelink/#comments</comments>
		<pubDate>Tue, 08 Sep 2009 14:11:45 +0000</pubDate>
		<dc:creator>Hussain</dc:creator>
				<category><![CDATA[Livelink]]></category>
		<category><![CDATA[core module]]></category>
		<category><![CDATA[install module]]></category>
		<category><![CDATA[Module]]></category>

		<guid isPermaLink="false">http://freecodecollection.com/?p=45</guid>
		<description><![CDATA[In some cases, you may want to access functionality provided in another module, and in manu cases this is an optional, rather than core, module. If you call an function in another module that does not exist, you will get an error for the user and a Trace file. This code snippet provides a method [...]]]></description>
			<content:encoded><![CDATA[<p>In some cases, you may want to access functionality provided in another module, and in manu cases this is an optional, rather than core, module. If you call an function in another module that does not exist, you will get an error for the user and a Trace file. This code snippet provides a method so you can test if a module is installed on a server prior to calling it withing your code. The code for this function is as follows : </p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="Text"><div class="devcodeoverflow"><ol><li>// This function returns TRUE if the specified module is loaded, and FALSE otherwise</li><li>function Boolean isAModule (string moduleName)</li><li>&nbsp;&nbsp;&nbsp;&nbsp;dynamic module=$Kernel.ModuleSubsystem.GetItem(moduleName)</li><li>&nbsp;&nbsp;&nbsp;&nbsp;// if the module is loaded</li><li>&nbsp;&nbsp;&nbsp;&nbsp;if (IsDefined(module)) </li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return true</li><li>&nbsp;&nbsp;&nbsp;&nbsp;else</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return false</li><li>&nbsp;&nbsp;&nbsp;&nbsp;end</li><li>end </li></ol></div></pre><!--END_DEVFMTCODE--><br />
The following code snippet shows how you could use this function to test if the Directory Services module (module name directory) is installed on the server, assuming that the function is in the same Object or Request Handler as the calling function :<br />
<!--DEVFMTCODE--><pre class="devcodeblock" title="ABAP"><div class="devcodeoverflow"><ol><li><span style="color: #000066; text-transform: uppercase; font-weight: bold; zzz:control;">if</span> <span style="color: #808080;">&#40;</span><span style="color: #808080;">.</span>isAModule<span style="color: #808080;">&#40;</span><span style="color: #808080; font-style: italic;">&quot;directory&quot;))</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;echo<span style="color: #808080;">&#40;</span><span style="color: #808080; font-style: italic;">&quot;Directory module installed&quot;)</span></li><li><span style="color: #000066; text-transform: uppercase; font-weight: bold; zzz:control;">else</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;echo<span style="color: #808080;">&#40;</span><span style="color: #808080; font-style: italic;">&quot;Directory module NOT installed&quot;)</span></li><li>end </li></ol></div></pre><!--END_DEVFMTCODE--><br />
Source: http://www.greggriffiths.org/livelink/development/oscript/snippets/isamodule.html</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.freecodecollection.com%2Fcheck-for-module-is-installed-or-not-livelink%2F&amp;linkname=Check%20for%20module%20is%20installed%20or%20not%20Livelink" target="_blank"><img src="http://www.freecodecollection.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.freecodecollection.com/check-for-module-is-installed-or-not-livelink/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Get Default link for a Node</title>
		<link>http://www.freecodecollection.com/get-default-link-for-a-node/</link>
		<comments>http://www.freecodecollection.com/get-default-link-for-a-node/#comments</comments>
		<pubDate>Tue, 08 Sep 2009 14:02:54 +0000</pubDate>
		<dc:creator>Hussain</dc:creator>
				<category><![CDATA[Livelink]]></category>
		<category><![CDATA[Node]]></category>
		<category><![CDATA[Node URL]]></category>
		<category><![CDATA[Oscript]]></category>
		<category><![CDATA[URL]]></category>

		<guid isPermaLink="false">http://freecodecollection.com/?p=43</guid>
		<description><![CDATA[Sometimes you may have a Livelink Object ID (the value of dataid from dtree) and you need to create a link to that object. Generally you can find most of the components that you need in the request object, such as the complete URL, but the actual Request Handler for that type of Livelink Object [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes you may have a Livelink Object ID (the value of dataid from dtree) and you need to create a link to that object. Generally you can find most of the components that you need in the request object, such as the complete URL, but the actual Request Handler for that type of Livelink Object is a little more complex. You can follow the function calls used in the Browse pages, but sometimes you do not have enough information, for example when within a function where these objects are not available.<br />
This article looks at an alternative method to get a link to that Livelink Object. For this we will use the Livelink URL that is used by the Notifications system (<Livelink URL>?func=notify.config). </p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="Text"><div class="devcodeoverflow"><ol><li>function String getDefaultURL (DAPINode inNode)</li><li>&nbsp;&nbsp;&nbsp;&nbsp;// Load the Notification Configuration information</li><li>&nbsp;&nbsp;&nbsp;&nbsp;Dynamic config=$LLAgent.Utils.ConfigLoad( prgCtx.USession().fDbConnect.fConnection, 100 )</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;// Convert the Node into a WebNode</li><li>&nbsp;&nbsp;&nbsp;&nbsp;Object webNode=$WebNode.WebNodes.GetItem(inNode.pSubType)</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;// Get the Open action of the WebNode</li><li>&nbsp;&nbsp;&nbsp;&nbsp;Object open=webNode.Cmd(&quot;open&quot;)</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;// String to store the return value</li><li>&nbsp;&nbsp;&nbsp;&nbsp;String nodeURL</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;// if the Object in question is not a Document then use this link format</li><li>&nbsp;&nbsp;&nbsp;&nbsp;if (inNode.pSubType &lt;&gt; $TypeDocument)</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;nodeURL=Str.Format(&quot;%1?%2&quot;,config.URL,Str.Format(open.fQueryString,inNode.pID))</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;// For Documents point at the General Properties page</li><li>&nbsp;&nbsp;&nbsp;&nbsp;else</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;nodeURL=Str.Format(&quot;%1?func=ll&amp;objid=%2&amp;objaction=properties&quot;,config.URL,inNode.pID)</li><li>&nbsp;&nbsp;&nbsp;&nbsp;end</li><li>end </li></ol></div></pre><!--END_DEVFMTCODE--><br />
In response to a question on the Knowledge Center, another approach for creating the nodeURL was provided by Kyle Swidrovich. This approach would replace the if .. then clause in the function with the following : <!--DEVFMTCODE--><pre class="devcodeblock" title="Text"><div class="devcodeoverflow"><ol><li>nodeURL = Str.Format( &quot;%1/open/%2&quot;, config.URL, inNode.pID) </li></ol></div></pre><!--END_DEVFMTCODE--><br />
Having tested this approach, the only difference I&#8217;ve found is that the original code takes you to the browse page for Folders, Projects, Compound Documents etc and the Properties page for Documents, whereas the new one just calls the open action for that Object. Thus if a Document is a Word document it would be viewed &#8211; or you would see the Document Overview page depending on your configuration &#8211; and a ZIP file would be downloaded rather than showing the Properties dialog for the Object, in some cases this may be what you want.<br />
Source: http://www.greggriffiths.org/livelink/development/oscript/snippets/defaultopenlink.html</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.freecodecollection.com%2Fget-default-link-for-a-node%2F&amp;linkname=Get%20Default%20link%20for%20a%20Node" target="_blank"><img src="http://www.freecodecollection.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.freecodecollection.com/get-default-link-for-a-node/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
