Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

  1. #1
    Sencha - Services Team
    Join Date
    Aug 2007
    Posts
    98
    Vote Rating
    0
    mdlincoln is on a distinguished road

      0  

    Default ScriptTagProxy and XML

    ScriptTagProxy and XML


    Anyone have an example of using ScriptTagProxy and XmlReader with the server returning an XML document? I would be very interested in the server implementation as well. The documentation only has an example using JSON. Thanks...

  2. #2
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,496
    Vote Rating
    44
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    You can't.

  3. #3
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,496
    Vote Rating
    44
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    You could write your own implementation of a DataProxy which would call up an XML document into a hidden iframe, and use its Reader to read the records from the iframe's document...

    but this runs into security problems. The script, being from another domain, can't access the XML document!

    Code:
    // Usage: new Ext.data.IframeProxy({url: "http://www.example.com/getXML"});
    Ext.data.IframeProxy = function(config) {
        Ext.data.IframeProxy.superclass.constructor.call(this);
    	Ext.apply(this, config);
    };
    
    Ext.extend(Ext.data.IframeProxy, Ext.data.DataProxy, {
        load: function(params, reader, callback, scope, arg){
            if(this.fireEvent("beforeload", this, params) !== false){
    
                var  o = {
                    frameId: Ext.id(),
                    params : params || {},
                    request: {
                        callback : callback,
                        scope : scope,
                        arg : arg
                    },
                    reader: reader,
                    callback : this.loadResponse,
                    scope: this
                };
                o.cb = this.loadResponse.createDelegate(this, [o], 0);
                o.frame = document.createElement('iframe');
                o.frame.id = o.frameId;
                o.frame.name = o.frameId;
                o.frame.className = 'x-hidden';
                o.frame.src = this.url;
    	        if(Ext.isIE){
    	           document.frames[o.frameId].name = o.frameId;
    	        }
                Ext.EventManager.on(o.frame, 'load', o.cb);
                document.body.appendChild(o.frame);
            }else{
                callback.call(scope||this, null, arg, false);
            }
        },
    
    
        // private
        loadResponse : function(o){
    //		Remove the load listener from the iframe
            Ext.EventManager.removeListener(o.frame, 'load', o.cb);
    
            var result;
            try {
                var doc = o.frame.contentWindow.document;
    
    //			No document, could be wront Content-Type, or invalid XML
    	        if(!doc){
    	            setTimeout(function(){document.body.removeChild(o.frame);}, 100);
    	            this.fireEvent("loadexception", this, o, {});
    	            o.request.callback.call(o.request.scope, null, o.request.arg, false);
    	            return;
    	        }
    
    //			Create a bogus response object from the XML document in the frame
                var r = {};
                r.responseXML = doc && doc.documentElement ? doc.documentElement : doc;
                result = o.reader.read(response);
            }catch(e){
                this.fireEvent("loadexception", this, o, {}, e);
                o.request.callback.call(o.request.scope, null, o.request.arg, false);
                return;
            }
            this.fireEvent("load", this, o, o.request.arg);
            o.request.callback.call(o.request.scope, result, o.request.arg, true);
            setTimeout(function(){document.body.removeChild(o.frame);}, 100);
        }
    });
    
    Ext.onReady(function(){
    
        // create the Data Store
        var ds = new Ext.data.Store({
            // load using HTTP
            proxy: new Ext.data.IframeProxy({url: 'http://extjs.com/deploy/ext/examples/grid/sheldon.xml'}),
    
            // the return will be XML, so lets set up a reader
            reader: new Ext.data.XmlReader({
                   // records will have an "Item" tag
                   record: 'Item',
                   id: 'ASIN',
                   totalRecords: '@total'
               }, [
                   // set up the fields mapping into the xml doc
                   // The first needs mapping, the others are very basic
                   {name: 'Author', mapping: 'ItemAttributes > Author'},
                   'Title', 'Manufacturer', 'ProductGroup'
               ])
        });
    
        var cm = new Ext.grid.ColumnModel([
    	    {header: "Author", width: 120, dataIndex: 'Author'},
    		{header: "Title", width: 180, dataIndex: 'Title'},
    		{header: "Manufacturer", width: 115, dataIndex: 'Manufacturer'},
    		{header: "Product Group", width: 100, dataIndex: 'ProductGroup'}
    	]);
        cm.defaultSortable = true;
    
        // create the grid
        var grid = new Ext.grid.Grid('example-grid', {
            ds: ds,
            cm: cm
        });
        grid.render();
    
        ds.load();
        ds.on("load", function(){alert(ds.getAt(0).asXml())});
    });
    
    Ext.override(Ext.data.Store, {
        getRowAsXml : function(rowIndex) {
        	return this.getAt(rowIndex).asXml();
        }
    });
    
    Ext.override(Ext.data.Record, {
        asXml : function(rowIndex) {
        	var r = this.store.reader.meta;
        	var elName = r.record || r.root; // Use XmlReader or JsonReader
        	var result = "<" + elName + " id=\"" + this.id + "\">";
       		this.fields.each(function(f) {
       			result += "<" + f.name;
       			if (f.type && f.type !== "auto") {
       				result += " type=\"" + f.type + "\"";
       			}
       			result += ">" + this.get(f.name) + "</" + f.name + ">";
       		}, this);
         	return result + "</" + elName + ">";
        }
    });

  4. #4
    Sencha - Services Team
    Join Date
    Aug 2007
    Posts
    98
    Vote Rating
    0
    mdlincoln is on a distinguished road

      0  

    Default


    Well, I solved it! I'll try to explain my solution in case someone else faces this issue.

    In the application I am currently developing, I am only responsible for the client application. Another developer with another organization is responsible for the server application. The server application has been designed to return the data requested as an XML document. This works great when requesting the application and the data from the same domain, however, it is expected that they may not always be in the same domain in a production environment. Therefore, I have been working with the other developer to insure that the application works as designed in both situations.

    After looking at the examples and documentation for the ScriptTagProxy class, we implemeted a solution for the server similar to the one presented in the ScriptTagProxy documentation. Although the ScriptTagProxy example uses JSON, we implemented our solution using XML. Basically the server checks the incoming HTTP request for an occurrence of the "callback" parameter and if it is found returns an HTTP response containing the content in a format similiar to "CallbackFunctionName( '<data>.....</data>' );". There are several interesting items to note here. First, the "CallbackFunctionName" is the value of the "callback" parameter recevied in the HTTP request and is specified by the client application, specifically the ScriptTagProxy class. Second, you will note the single quotes around the XML content, '<data>.....</data>'. This is necessary in order to get the client application to treat the XML content as a single string. If they are omitted, the browser will raise an error about a missing parenthesis or semicolon. Also, it is important that the XML content contain no carriage return or line feed characters for the same reason. Now this works very well and the client application receives the XML content correctly except for one little problem. Since the server sets the Content Type for the HTTP response as "text/javascript" instead of "text/xml", the XML content remains a string when the application receives it since the browser does not parse it into an XML document. This is where the fun begins.

    When the XML content is returned, the XmlReader attached to the data store attempts to read the data, however, it does not see it as an XML document since the string containing the XML content has not been parsed. Because of this, when it attempts to retrieve information, specifically the "totalrecords" attribute from the XML document, an exception is raised. Curiously, if you have not assigned a "loadexception" event handler to your data store, you will not receive any information about the problem. The exception is handled silently and you will see no data in the data store. After discovering this in the debugger, I added the "loadexception" event handler and discovered the parsing problem. This led me to the following solution:

    Code:
    // Create a class the can handle a string containing XML content.
    Ext.data.XmlStringReader = function( meta, recordType ) {
    
       // Execute the ancestor class contructor passing the specified parameters.
       Ext.data.XmlStringReader.superclass.constructor.call( this, meta, recordType );
       
    }; // End of Function - XmlStringReader()
    
    // Extend the XmlStringReader class with the methods of the XmlReader class.
    Ext.extend( Ext.data.XmlStringReader, Ext.data.XmlReader, {
    
       parseXmlString : function ( sXml ) {
    
          // If the specified XML document content is a string...
          if ( typeof sXml == "string" ) {
          
             var oXml; // Reference to the parsed XML document
       
             // If the current browser is Internet Explorer...
             if ( window.ActiveXObject ) {
       
                // Create a reference to the Microsoft XML Document Object Model.
                oXml = new ActiveXObject( "Microsoft.XMLDOM" );
                
                // Assign the flag to process the XML synchronously.
                oXml.async = "false";
                
                // Load the XML document with the content from the specified string.
                oXml.loadXML( sXml );
       
             }
             
             else { // Current browser is Mozilla, Firefox, Opera, etc.
       
                // Create a reference to the XML document parser.
                var oParser = new DOMParser();
                
                // Parse the XML string and return a reference to the XML document.
                oXml = oParser.parseFromString( sXml, "text/xml" );
                
             }
             
             // Return the reference to the XML document.
             return oXml;
             
          }
          
          else { // XML document content is NOT a string...
          
             // Return the specified XML document since it has already been parsed.
             return sXml;
          
          }
    		
       }, // End of Function - parseXmlString()
    
       readRecords : function( doc ){
    
          // If the specified XML document is actually a string containing the XML
          // content, parse it into an XML document reference so that the reader
          // can process it into records.  If the specified XML document is not a
          // string, this statement will simply return the XML document reference.
          doc = this.parseXmlString( doc );
    
          // Execute the ancestor class method to read the records passing the XML
          // document reference.  This returns an object containing the success
          // flag for reading the data, a reference to the record set, and the
          // total number of records read.
          return Ext.data.XmlStringReader.superclass.readRecords.call( this, doc );
          
       } // End of Function - readRecords()
       
    } );
    It is a class, XmlStringReader, that extends the XmlReader class and adds the ability to handle a string containing the XML content. It adds a new method, parseXmlString() that provides a browser independent solution for parsing the XML string and returning a reference to an XML document. It also extends the readRecords() method to add the behavior for parsing the XML string and then uses the ancestor class readRecords() method to handle the actual reading of the records from the XML document.

    Again, I hope this helps others facing this issue.

    Mark

  5. #5
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,496
    Vote Rating
    44
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    Good solution.

  6. #6
    Ext User
    Join Date
    Sep 2007
    Posts
    2
    Vote Rating
    0
    MrChaos is on a distinguished road

      0  

    Default


    [Sorry for my English]

    Hallo Animal,

    first of all: Thanks for this iFrameProxy.

    I have only one probleme. it doesnt add the values to the table (dom). Also i dont get an error in firebug. Maybe its a problem with the bridge into the iframe-dom
    (window.frames['name_of_iframe'].document.body) for the xmlreader. Can you give me a hit?

    Thanks

  7. #7
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,496
    Vote Rating
    44
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    No, you don't get an error. The security just doesn't allow you to read the document from the other domain.

  8. #8
    Ext User
    Join Date
    Sep 2007
    Posts
    11
    Vote Rating
    0
    datanomisch is on a distinguished road

      0  

    Default IframeProxy and GData

    IframeProxy and GData


    Hey, does anyone know how the Google Data API actually sifts data back and forth? I heard they are using and Iframe-based solution, too...

  9. #9
    Sencha User
    Join Date
    Nov 2008
    Posts
    50
    Vote Rating
    0
    dtondo is on a distinguished road

      0  

    Default Rss integration

    Rss integration


    Hi man. Have you ever tried using this code with RSS? I

  10. #10
    Ext User
    Join Date
    Aug 2008
    Posts
    10
    Vote Rating
    0
    abhishek611plus is on a distinguished road

      0  

    Default doubt????

    doubt????


    Hello Animal,

    My Requirement is like instead of having precompiled XML url, i ned to generate xml based on parameters for example


    sheldon.php
    this file id located on other domain

    i need to post some parameters by whcih it generates dnamic XM and then to load it in our local Store.