Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Table of Contents

GeodiQueryJS

GeudiQueryJS.js kütüphanesini projenize dahil edip şablon belirleyerek sorgu sonuçlarını uygulamanızda gösterebilirsiniz. Template tanımlama şekli You can display the query results in your application by including the GeodiQueryJS.js library into your project and specifying a template. Template definition is the same with tools like Angular, Vue.js gibi araçlar ile aynıdır.  Şablon  içerisinde kullanabileceğiniz nesne özelliklerini örnekleri çalıştırdığınız tarayıcının debug konsolundan veya .  You can learn the object properties that you can use in the template from the debug console of the browser you are running or from the Geodi Query API - Document Search servis dokümanından öğrenebilirsiniz service document.

  •  {{data.DisplayName değerini göstermek için HTML şablon içeriğinde {{ }} must be used in the HTML template content to display the value of data.DisplayName }} ifadesi kullanılmalıdır. Döngü ve koşullar için
  • For loop and conditions, the d:r tag ve and data/visible attribute değerleri kullanılabilir. values can be used.
    • data : döngüde dolaşılacak veriyi belirlemekte kullanılır. Şablonun başlangıcında data değeri gelen sonuçların listesidir. data belirtilen her d:r tag içeriğinde data gezilen değere dönüşür. ihtiyaç halinde döngü dışındaki içeriğe data.parentdata ile erişilebilir.Örneklerused to determine the data to be circulated in the loop. The data value at the beginning of the template is the list of results. In each d:r tag, data is converted to the value of the data. if necessary, content outside the loop can be accessed with data.parentdata.
      • Examples
        • <d:r data="[0,1,2,3]">-{{data}}- </d:r> 
        • <d:r data="data"><d:r data=data.AditionalValues>{{data}} </d:r> </d:r>
    • visible: koşul geçerli ise If the condition is valid, the d: r alanı gösterilir. geçerli değilse içerik yok sayılır. data ile birlikte kullanılmasa dahi içinde blunduğu blok içeriksenki veri ile bir defa kontrol edilir. döngüdeki her item için kontrol yapılacaksa içeri bir d:r elementi daha oluşturulmalıdır.Örneklerfield is displayed or else content is ignored. Even if it is not used with data, the block in which it is contained is checked once with the data. If there is a check for each item in the loop, another element d: r must be created.
    • Examples
      • <d:r data="[0,1,2,3]"> <d:r visible="data>2"> -{{data}}- </d:r> </d:r> 
  • Encode/decode işlemleri için HttpUtility yardımcı sınıfı kullanılabilir.

...

  • The HttpUtility helper class can be used for encode / decode operations.

(warning)  To access the properties of the object used in the template,  you can use the {{debugger; }} expression to examine data and context objects through the console.

Sample Templates

GeodiQuery.js hazır şablon tanımı içermektedir. Herhangi bir şablon tanımlamadan sonuç elde edebilirsinizcontains a preset template definition. You can get results without defining any templates.

Code Block
languagexml
titleExample HTML
<script src="https://servis2.dece.com.tr/GUI/js/GeodiQueryJS.js"></script>
<div id=MyQueryResultArea></div>
<script>
 	var q = new GeodiQuery();
    q.wsName = "...";//wsName
    q.EndIndex = 8;
    q.ServerUrl = "...";// Server Url
    q.Token = "...";//Token
    q.SearchString = "";//Search Text
    q.UseRank = true;
	RenderDLV({ Query: q, TargetDiv: "#MyQueryResultArea" } )
</script>

...

Code Block
languagexml
titleExample HTML
<script src="https://servis2.dece.com.tr/GUI/js/GeodiQueryJS.js"></script>
<div id=MyQueryResultArea></div>
<script>
 	var q = new GeodiQuery();
    q.wsName = "...";//wsName
    q.EndIndex = 8;
    q.ServerUrl = "...";// Server Url
    q.Token = "...";//Token
    q.SearchString = "";//Search Text
    q.UseRank = true;
	RenderDLV(
				{ 
					Query: q, 
					TargetDiv: "#MyQueryResultArea", 
					Template: $("#MyTemplate"),
					OnStarting: function(args) { //before rest api call
						//...
					},
					OnStartRender: function() { //after rest api call, before render
						$.each(args.Data,function(i,d) { d.MyMethod=function() {return "SAMPLE";} });
					},
					OnEndRender: function(args) { // after render
						//...
					}
				} 
		)
	//$("#MyTemplate") yerine.html() or string could be sent istead of $("#MyTemplate").html() veya
string ifade iletilebilir.
</script>

Daha fazla örnek için aşağıdaki canlı demo projelerimiz üzerinden çalışan aşağıdaki örneği incelyebilirsiniz. Misafir kullanıcı için alınmış token kullanılmaktadır.


Örnek koda  For more examples, see the example below, which runs through our live demo projects below. The token taken for the guest user is used.

You can get the sample code from:  https://github.com/decesw/html/blob/master/DocumentQuery/Query_GeodiQueryJS.html adresinden erişebilirsiniz.Template düzenlemeyi deneyebileceğiniz örnek arayüz için tıklayınız


 Click here for the interface that you can try template editing

Using tools like Angular.js and Vue.js

Rest api sonuçları template render destekleyen herhangi bir kütüphaneye verilebilir. Sorgu servislerinden elde edilecek JSON kütüphanenin istediği şekilde kullanılarak sonuçlar gösterilebilir. Bu konudaki tüm çalışabilir durumdaki örneklere results can be exported to any library that supports template rendering. The results from Geodi Query API ( Query )  can be shown by using the JSON as desired by library. You can reach all the examples from: https://github.com/decesw/html/tree/master/DocumentQuery adresinden ulaşabilirsiniz. Örnekler canlı demo projelerimiz üzerinden çalıştırılmaktadır. Misafir kullanıcı için alınmış token kullanılmaktadır.   Samples are running using our live demo projects. The token taken for the guest user is used.