简体   繁体   English

在 Spotfire dxp 的 URL 中插入 Document 属性

[英]Inserting Document property in an URL for a spotfire dxp

I have an URL where certain attributes can be changed and the corresponding data will be pull when the URL is executed in a browser.我有一个 URL,其中某些属性可以更改,并且在浏览器中执行 URL 时将拉取相应的数据。 The general content of the URL is like so: URL的大致内容是这样的:

https://server/App/Detect.do?dm=Rel&daysBack=60&toolId= ETX500 &chamberId= PM5 &senSorName= Lower_Middle_Temperature_Mean &stepId= POLY &module=&fdcApplication=&contextGroup=&sampleSize=25&recentLots=&dateLotWafer=true&_dateLotWafer=on&chartIndex=0&groupBy=UserTag&priorGroupBys=UserTag&priorGroupByKeys=_NA_&trendStyle=Mean&xAxis=DateLotWafer&title=Fdc%20Trend%20Analysis https://server/App/Detect.do?dm=Rel&daysBack=60&toolId= ETX500 &chamberId= PM5 &senSorName= Lower_Middle_Temperature_Mean &stepId= POLY &module=&fdcApplication=&contextGroup=&sampleSize=25&recentLots=&dateLot_dateWafergroup'PriorGroup=Users&Keys&Key=Users _NA_&trendStyle=Mean&xAxis=DateLotWafer&title=Fdc%20Trend%20Analysis

The parts in bold are the ones that can dynamically change.粗体部分是可以动态变化的部分。 I have a table in spotfire (dcube) that has a list of the toolId , chamberId , senSorName and stepId .我在 spotfire (dcube) 中有一个表,其中toolIdchamberIdsenSorNamestepId I have set it up such that when the user clicks on a row, it captures those attributes to 4 document properties.我已将其设置为当用户单击一行时,它将这些属性捕获到 4 个文档属性。 I use the text area to provide a link, but is there a way to control the URL of the link so that I can insert the document properties in those 4 places in the URL?我使用文本区域提供链接,但是有没有办法控制链接的 URL,以便我可以在 URL 的这 4 个位置插入文档属性?

Any insight would help.任何见解都会有所帮助。 Thank You谢谢你

You can use an Python script to update the HTML in a text area.您可以使用 Python 脚本更新文本区域中的 HTML。 Using your document properties in the script you can build the link you need.在脚本中使用您的文档属性,您可以构建所需的链接。 Since the document properties are updated on a marking you can add this to your document properties so when they change the url is updated.由于文档属性在标记上更新,因此您可以将其添加到文档属性中,以便在它们更改时更新 url。

from Spotfire.Dxp.Application.Visuals import HtmlTextArea
#Set vis as script parameter to a text area visual
vis = vis.As[HtmlTextArea]()

def UpdateUrl():    
    attr1 = Document.Properties['DocProp1']
    attr2 = Document.Properties['DocProp2']
    url = "http://www.google.com?ID={}&SaleID={}".format(attr1,attr2)   
    htmlText = '''<a href="{}" target="_blank">Click Here</a>'''.format(url)    
    vis.HtmlContent = htmlText  # can use vis.HtmlContent += to append instead of replace
 
UpdateUrl()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM