How to interact with elements not in the DOM in VBA - excel

I have a problem with accessing 3 buttons on a webpage since they don't belong to the DOM and I cannot fetch them using ID or any other "anchor". These are ActiveX buttons from what I can see in the DOM tree, but I have no idea how to reach to them.
As for now, the only (stupid) workaround is to loop through all the items using on the page by SendKeys {TAB} and pressing space on each of them. Only those buttons react to the space key, but it's not a reliable solution, so I want find something proper.
I'm attaching the DOM screen from the area where they are placed on the page and the code where I think there are sitting.
<DIV id=divDragDrop style="HEIGHT: 200px; WIDTH: 700px; TEXT-ALIGN: left">
<!-- -------- DRAG/DROP ACTIVEX CONTROL AREA -------- -->
<OBJECT id=DragDropActiveX style="HEIGHT: 200px; WIDTH: 700px; LEFT: 0px; TOP: 0px; VISIBILITY: visible" name=DragDropActiveX codeBase="DragDropControl.dll" classid=clsid:b7e10a13-86c9-43af-9d8a-aa153b0470c8 enableviewstate="true">
<PARAM NAME="ClaimNumber" VALUE="0004887564">
<PARAM NAME="FileNoteNumber" VALUE="D3EFC3275F4ACA9D">
<PARAM NAME="FileNoteCategory" VALUE="COV">
<PARAM NAME="FileNoteSubcategory" VALUE="FNOL1">
<PARAM NAME="FileUploadServiceURL" VALUE="https://xlgc.r02.xlgs.local:443/Desktop/FileNotes/FileAcceptorForDragAndDrop.aspx?UserId=A135604">
<PARAM NAME="AllowedFileTypes" VALUE="doc.gif.htm.html.jpeg.jpg.pdf.rtf.tif.tiff.txt.xls.zip.fdf.xfdf.asp.asf.asx.aiff.au.dwg.dxf.dwf.atd.bmp.cvs.cfm.cfml.cgi.emz.cgm.csv.dec.dib.dcm.dtd.daf.eps.msg.fpx.xml.fos.mif.hdml.pcl.idl.xsf.xsn.one.ppt.mps.mpt.mpw.rmh.vsd.vss.vst.vsw.dot.dgn.mod.mp3.mpg.mpg2.mp4.mxf.pgm.ppm.soc.oft.pcx.pff.php.php3.phtml.pct.png.ps.pro.ptd.mov.ra.rm.ram.rmm.rnx.rv.svg.sct.scm.shtml.spml.stm.spl.swf.sgi.mht.smil.ras.sun.tga.avi.vrf.voc.wrl.wsdl.emf.jnt.wma.wax.wmv.wvx.wmf.wbmp.wpd.xfm.att.rls.rlx.ctm.hhf.mcr.tbr.ent.pen.xsd.elm.xsl.afp.cr2.crw.dita.dng.docm.docx.dotm.dv.eap.emcmf.f4v.flv.gxf.lxf.mdi.mmap.mmas.mmat.mss.odt.opml.pnm.pptx.pub.rle.ump.xlsb.xlsm.xlsx.xmi.pcd.eml">
<PARAM NAME="IsDirty" VALUE="False">
<PARAM NAME="MaxFileSizeInBytes" VALUE="">
<PARAM NAME="DraftVisible" VALUE="True">
<PARAM NAME="AutoSize" VALUE="False">
<PARAM NAME="AutoSizeMode" VALUE="GrowOnly">
<PARAM NAME="AutoValidate" VALUE="EnablePreventFocusChange">
<PARAM NAME="BorderStyle" VALUE="None">
<PARAM NAME="CurrentAutoScaleDimensions" VALUE="6, 13">
<PARAM NAME="AutoScroll" VALUE="False">
<PARAM NAME="AutoScrollMargin" VALUE="0, 0">
<PARAM NAME="AutoScrollMinSize" VALUE="0, 0">
<PARAM NAME="AccessibleDescription" VALUE="">
<PARAM NAME="AccessibleName" VALUE="">
<PARAM NAME="AccessibleRole" VALUE="Default">
<PARAM NAME="AllowDrop" VALUE="False">
<PARAM NAME="Anchor" VALUE="Top, Left">
<PARAM NAME="AutoScrollOffset" VALUE="0, 0">
<PARAM NAME="BackColor" VALUE="233, 238, 255">
<PARAM NAME="BackgroundImage" VALUE="">
<PARAM NAME="BackgroundImageLayout" VALUE="Tile">
<PARAM NAME="CausesValidation" VALUE="True">
<PARAM NAME="Cursor" VALUE="Default">
<PARAM NAME="Dock" VALUE="None">
<PARAM NAME="Enabled" VALUE="True">
<PARAM NAME="Font" VALUE="Arial, 11world">
<PARAM NAME="ForeColor" VALUE="Black">
<PARAM NAME="Location" VALUE="280, 652">
<PARAM NAME="Margin" VALUE="3, 3, 3, 3">
<PARAM NAME="MaximumSize" VALUE="0, 0">
<PARAM NAME="MinimumSize" VALUE="0, 0">
<PARAM NAME="Name" VALUE="DragDropControl">
<PARAM NAME="RightToLeft" VALUE="No">
<PARAM NAME="Size" VALUE="875, 250">
<PARAM NAME="TabIndex" VALUE="0">
<PARAM NAME="TabStop" VALUE="True">
<PARAM NAME="Tag" VALUE="">
<PARAM NAME="UseWaitCursor" VALUE="False">
<PARAM NAME="Visible" VALUE="True">
<PARAM NAME="PreferredSize" VALUE="685, 196">
<PARAM NAME="Padding" VALUE="0, 0, 0, 0">
<PARAM NAME="ImeMode" VALUE="NoControl">
</OBJECT>
<!-- ATTENTION: hDragDropState below is required for DragDropActiveX -->
<INPUT id=ctl00_MainContent_hDragDropState type=hidden name=ctl00$MainContent$hDragDropState>
<!-- ----- END DRAG/DROP ACTIVEX CONTROL AREA ------- -->
</DIV>
Thanks!

Related

play swf file with parts online

i have some old flash games.
They contains:
a .swf file
a folder with files with type 'File'
when i use following code it runs locally but when i upload it on my server online then it doesn't work.
<object type="application/x-shockwave-flash" data="race.swf" id="histo2" style="width:100%; height:100%;float: none; vertical-align:middle">
<param name="movie" value="race.swf" />
<param name="allowfullscreen" value="true" />
<param name="allowScriptAccess" value="always" /><!-- sameDomain -->
<param name="wmode" value="opaque" />
<param name="quality" value="high" />
<param name="menu" value="false" />
<div class="outer">
<div class="middle">
<div class="inner">
<h3>Click below button to enable flash player or to install it.</h3>
<a href="http://www.adobe.com/go/getflash">
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
</a>
</div>
</div>
</div>
</object>

Sitecore - patch node with the same attributes as the others

how can I patch specified node if there are several other nodes with the same attributes?
I need to patch analyzer for czech language in ContentSearch section, but all nodes start with
<mapEntry type="Sitecore.ContentSearch.LuceneProvider.Analyzers.PerExecutionContextAnalyzerMapEntry, Sitecore.ContentSearch.LuceneProvider">
Part of that configuration looks like this
...</maEntry>
<mapEntry type="Sitecore.ContentSearch.LuceneProvider.Analyzers.PerExecutionContextAnalyzerMapEntry, Sitecore.ContentSearch.LuceneProvider">
<param hint="executionContext" type="Sitecore.ContentSearch.CultureExecutionContext, Sitecore.ContentSearch">
<param hint="cultureInfo" type="System.Globalization.CultureInfo, mscorlib">
<param hint="name">ar-AE</param>
</param>
</param>
<param desc="analyzer" type="Sitecore.ContentSearch.LuceneProvider.Analyzers.DefaultPerFieldAnalyzer, Sitecore.ContentSearch.LuceneProvider">
<param desc="defaultAnalyzer" type="Lucene.Net.Analysis.AR.ArabicAnalyzer, Lucene.Net.Contrib.Analyzers">
<param hint="version">Lucene_30</param>
</param>
</param>
</mapEntry>
<mapEntry type="Sitecore.ContentSearch.LuceneProvider.Analyzers.PerExecutionContextAnalyzerMapEntry, Sitecore.ContentSearch.LuceneProvider">
<param hint="executionContext" type="Sitecore.ContentSearch.CultureExecutionContext, Sitecore.ContentSearch">
<param hint="cultureInfo" type="System.Globalization.CultureInfo, mscorlib">
<param hint="name">pt-BR</param>
</param>
</param>
<param desc="analyzer" type="Sitecore.ContentSearch.LuceneProvider.Analyzers.DefaultPerFieldAnalyzer, Sitecore.ContentSearch.LuceneProvider">
<param desc="defaultAnalyzer" type="Sitecore.ContentSearch.LuceneProvider.Analyzers.Contrib.BrazilianAnalyzer, Sitecore.ContentSearch.LuceneProvider">
<param hint="version">Lucene_30</param>
</param>
</param>
</mapEntry>
<mapEntry type="Sitecore.ContentSearch.LuceneProvider.Analyzers.PerExecutionContextAnalyzerMapEntry, Sitecore.ContentSearch.LuceneProvider">
<param hint="executionContext" type="Sitecore.ContentSearch.CultureExecutionContext, Sitecore.ContentSearch">
<param hint="cultureInfo" type="System.Globalization.CultureInfo, mscorlib">
<param hint="name">cs-CZ</param>
</param>
</param>
<param desc="analyzer" type="Sitecore.ContentSearch.LuceneProvider.Analyzers.DefaultPerFieldAnalyzer, Sitecore.ContentSearch.LuceneProvider">
<param desc="defaultAnalyzer" type="Lucene.Net.Analysis.Cz.CzechAnalyzer, Lucene.Net.Contrib.Analyzers">
<param hint="version">Lucene_30</param>
</param>
</param>
</mapEntry>
<mapEntry>...
And I need to patch (in our example) defaultAnalyzer in second node. BUT second node is not in real life SECOND, but it could be third, seventh etc... I guess I need to find "mapEntry" node by specified inner node.
If I use this
<map hint="list:Add">
<!-- Patch analyzer for Czech language -->
<mapEntry type="Sitecore.ContentSearch.LuceneProvider.Analyzers.PerExecutionContextAnalyzerMapEntry, Sitecore.ContentSearch.LuceneProvider">
<param desc="analyzer" type="Sitecore.ContentSearch.LuceneProvider.Analyzers.DefaultPerFieldAnalyzer, Sitecore.ContentSearch.LuceneProvider">
<param desc="defaultAnalyzer" type="Lucene.Net.Analysis.Cz.CzechAnalyzer, Lucene.Net.Contrib.Analyzers">
<patch:attribute name="type">MySolution.MetroAsciiFoldingAnalyzer, MySolution</patch:attribute>
</param>
</param>
</mapEntry>
</map>
It will patch first node.
I found something similar in this issue Select node based on child node value in Web.config Transform, but as I understand I would replace whole one node with my custom one, but .... it is necessary?
The answer you linked to uses SlowCheetah to do it's transforms, and I presume you are trying to do this using Sitecore config patch...
Because you are selecting a node based on a child value, you can use the contains function to check for a value. But you can only patch that specific node, you can't select it for a query. So you would essentially have to replace the whole node.
I suggest you first delete the existing cs-CZ entry and then add in your own. Note that I had to make the mapEntry node more unique so I added a desc attribute, otherwise it overwrites the first match (in this case ja-JP)
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" >
<sitecore>
<contentSearch>
<indexConfigurations>
<defaultLuceneIndexConfiguration>
<analyzer>
<param desc="map">
<map>
<mapEntry patch:instead="*[contains(.,'cs-CZ')]">
<patch:delete />
</mapEntry>
<mapEntry desc="cs-CZ Analyzer" type="Sitecore.ContentSearch.LuceneProvider.Analyzers.PerExecutionContextAnalyzerMapEntry, Sitecore.ContentSearch.LuceneProvider">
<param hint="executionContext" type="Sitecore.ContentSearch.CultureExecutionContext, Sitecore.ContentSearch">
<param hint="cultureInfo" type="System.Globalization.CultureInfo, mscorlib">
<param hint="name">cs-CZ</param>
</param>
</param>
<param desc="analyzer" type="Sitecore.ContentSearch.LuceneProvider.Analyzers.DefaultPerFieldAnalyzer, Sitecore.ContentSearch.LuceneProvider">
<param desc="defaultAnalyzer" type="MySolution.MetroAsciiFoldingAnalyzer, MySolution">
<param hint="version">Lucene_30</param>
</param>
</param>
</mapEntry>
</map>
</param>
</analyzer>
</defaultLuceneIndexConfiguration>
</indexConfigurations>
</contentSearch>
</sitecore>
</configuration>

Hot to apply a loading text before the video-streaming begins

I am working in a project for the front-side.
We have a flash player showing a live video game from external. We have the access by api provided from a third part.
Everything works fine but the big issue now is how to display a simple text "loading" before the stream video starts, this is very necessary because the video delays a bit at the beginning.
I am newbie on it and have made a big search to find something helpful.
I have found a good documentation here and in this page explaining well to how to get external content into my SWF file. But my question is how can i edit my The FlashVars parameter of the HTML when the data is provided by an api?
<div id="flashContent">
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="550" height="400" id="FlashVars_AS2" align="middle">
<param name="movie" value="FlashVars_AS3.swf">
<param name="quality" value="high">
<param name="bgcolor" value="#ffff66">
<param name="play" value="true">
<param name="loop" value="true">
<param name="wmode" value="window">
<param name="scale" value="showall">
<param name="menu" value="true">
<param name="devicefont" value="false">
<param name="salign" value="">
<param name="allowScriptAccess" value="sameDomain">
<param name="FlashVars" value="myVariable=Hello%20World&mySecondVariable=Goodbye">
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="FlashVars_AS3.swf" width="550" height="400">
<param name="movie" value="FlashVars_AS2.swf">
<param name="quality" value="high">
<param name="bgcolor" value="#ffff66">
<param name="play" value="true">
<param name="loop" value="true">
<param name="wmode" value="window">
<param name="scale" value="showall">
<param name="menu" value="true">
<param name="devicefont" value="false">
<param name="salign" value="">
<param name="allowScriptAccess" value="sameDomain">
<param name="FlashVars" value="myVariable=Hello%20World&mySecondVariable=Goodbye">
<!--<![endif]-->
<a href="http://www.adobe.com/go/getflash">
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player">
</a>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
</div>
Thus is the code used by example in the Adobe documentation but i can work on it if my data is provided from a third part and it's not a swf?
Hope my explanation is clear and sorry if it's not because i am not expert on it.
Good examples and different solutions are very welcome too
thanks
you should handle NetStatusEvent of your NetStream in video-player
someFunctionShowingLoadingMessage();
stream.addEventListener(NetStatusEvent.NET_STATUS, streamStatusHandler);
private function streamStatusHandler(event:NetStatusEvent):void {
switch (event.info.code) {
case "NetConnection.Connect.Success":
break;
case "NetStream.Play.Start":
break;
case "NetStream.Buffer.Full":
// buffer is full and we may show video
// and hide our simple text "loading..."
break;
case "NetStream.Play.Stop":
break;
case "NetStream.Play.StreamNotFound":
break;
}
}

Can't display .swf files on a page with httpHandler

Read the last EDIT, please.
I have a page in which I should display some media data.
For this I'm using html tag, like this:
<object type="video/x-ms-wmv" width="320" height="240">
<param name="src" value="some_media_url" />
<param name="AutoSize" value="true">
<param name="ShowDisplay" value="false">
<param name="AutoStart" value="false">
<param name="StretchToFit" value="true">
<param name="bgcolor" value="#ffffff" />
</object>
In my case, I should get media data from SQL server by some MediaHandler.ashx http handler.
When I get an audio(.mp3, .wma) or video(.flv, .mp4) stream this works fine.
But I'm getting some problems with .swf flash files.
For this type of files I change <object> type to be "application/x-shockwave-flash". In this case when I use some remote path, like http://www.tizag.com/pics/example.swf, it works fine:
<object type="application/x-shockwave-flash" width="320" height="240">
<param name="src" value='http://www.tizag.com/pics/example.swf' />
<param name="AutoSize" value="true">
<param name="ShowDisplay" value="false">
<param name="AutoStart" value="false">
<param name="StretchToFit" value="true">
</object>
But, it doesn't work with my handler. It neither works with local paths,like "c:\videos\example.swf"
Any idea?
EDIT: Actually src for media looks like this:
<object type="video/x-ms-wmv" width="320" height="240">
<param name="src" value="http://localhost:11111/MediaHandler.ashx?Id=1111" />
<param name="AutoSize" value="true">
<param name="ShowDisplay" value="false">
<param name="AutoStart" value="false">
<param name="StretchToFit" value="true">
<param name="bgcolor" value="#ffffff" />
</object>
EDIT:
This works fine, if I directly refer to an existing file:
<object type="application/x-shockwave-flash" width="320" height="240">
<param name="src" value="/videos/ETFflash1016.swf" />
<param name="AutoSize" value="true">
<param name="ShowDisplay" value="false">
<param name="AutoStart" value="true">
<param name="StretchToFit" value="true">
</object>
But when I use httpHandler to get file from DB:
<object type="application/x-shockwave-flash" width="320" height="240">
<param name="src" value="http://localhost:57031/MediaHandler.ashx?Id=512429" />
<param name="AutoSize" value="true">
<param name="ShowDisplay" value="false">
<param name="AutoStart" value="true">
<param name="StretchToFit" value="true">
</object>
flash is not displayed.
I've compared the output html for these cases, they're the same in both cases (except src param value). Fiddler shows the same result for both requests for .swf file and the browser shows(e.g. in IE dev tool's Netwok tab) that the file was downloaded to client in both cases.
BUT in the case with the handler, flash is not being displayed.
Fiddler shows the same result for both requests for .swf file
In Fiddler, Response Headers, do both the local file and ASHX handler return the same Content-Type: application/x-shockwave-flash ?
try this:
<object type="application/x-shockwave-flash" data="file.swf" style="width:640px;height:480px;margin:10px 36px;">
<param name="movie" value="file.swf" />
<param name="AutoSize" value="true">
<param name="ShowDisplay" value="false">
<param name="AutoStart" value="false">
<param name="StretchToFit" value="true">
<param name="bgcolor" value="#ffffff" />
</object>
it worked for me
I've solved it!
In the handler, I was setting Response Header's parameters the same values as they were in the case with directly referring to an existing file.
Now, I just removed all this values, and it works!
I still can't understand why, but it works :)

how to make audio autoplay

I'd like an audio file to play automatically when I open the page.
Here's the code:
<object width="290" height="24" data="http://localhost/placement/theme/anomaly/sound/player.swf" type="application/x-shockwave-flash" id="audioplayer1">
<param name="movie" value="/placement/theme/anomaly/sound/player.swf" />
<param name="FlashVars" value="playerID=1&bg=0xCDDFF3&leftbg=0x357DCE&lefticon=0xF2F2F2&rightbg=0xE66511&rightbghover=0xEF9C10&righticon=0xF2F2F2&righticonhover=0xFFFFFF&text=0x357DCE&slider=0x357DCE&track=0xFFFFFF&border=0xFFFFFF&loader=0xAF2910&soundFile=/placement/theme/anomaly/sound/2.mp3" />
<param name="quality" value="high" />
<param name="menu" value="false" />
<param name="wmode" value="transparent" />
I tried to add the following line:
<param value="true" name="autoplay" />
but it doesn't work. Please help me.
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="590" height="475" ID="Captivate1">
<param name="movie" value="untitled_skin.swf">
<param name="quality" value="high">
<param name="loop" value="0">
<param name="play" value="false">
<embed src="untitled_skin.swf" width="590" height="475" loop="0" quality="high" pluginspage="http://www.adobe.com/go/getflashplayer" type="application/x-shockwave-flash" play="false" flashvars="autoplay=false&play=false" menu="false"></embed>
</object>

Resources