JS: ImportXML localized by URI

Hello at all,
I have created an JS that imports an XML-File from my local file-system and processes this file with XML-Rules. Everything works fine!
But now i want to do same with an XML-File which is localized on a web-server, so that i have to reference on an URI with the http-protocol.
I know that there is the Socket-object to get acces to Files in the web, but with the socket object i only get the XML-File as String, but i want to import it in InDesign so that the XML-Rules can process it.
Does anyone knows how to import an XML-File, which is adressed by an URI? does there exists an function, analog to the importXML()-function for Files on a local file-system?
Thanks fpr the help
regards
G.Blow

Hi G.Blow
I know that there is the Socket-object to get acces to Files in the web,
but with the socket object i only get the XML-File as String, but i
want to import it in InDesign so that the XML-Rules can process it.
Can't you just first download the file with ExtendScript, then import as you would normally do?
I have a working example of downloading files via ExtendScript using on another computer, will see if I can find it later.

Similar Messages

  • AIR 1.5 - Can't Access Local Network URIs?

    private static const ROOT_PATH_TO_SERVER_TEMP:String =
    "\\\\server\\share\\queue\\temp_images\\"
    Up until the 1.5 update, this worked great. Now it gives me :
    Unhandled IOErrorEvent:. text=Error #2038: File I/O Error.
    Which implies that I do not have permission to access the
    resource. I do, but AIR isn't allowing it to happen. This has
    COMPLETELY hosed my application for our company's CMS.
    Any thoughts?

    I have implemented a work around for this issue. If the user
    is running 1.5, I create the folder in their local storage
    directory and then move it to the destination UNC path. That works.
    I pasted the static method I'm using to do this below:
    FileUtil.createFolder = function(path,overwrite) {
    var runtimeVersion =
    air.NativeApplication.nativeApplication.runtimeVersion;
    var runtimeArray = runtimeVersion.split(".");
    var useWorkaround = false;
    //1.5.0.7220 - bad version
    //do workaround for 1.5 if UNC path
    if ((runtimeArray[0] == "1") && (runtimeArray[1] ==
    "5") && (path.substr(0,2) == "\\\\")) {
    useWorkaround = true;
    var folder = new air.File(path);
    if ((!folder.exists) || (overwrite)) {
    if (folder.exists) {
    folder.deleteDirectory(true);
    if (useWorkaround) {
    var storeFolder = air.File.applicationStorageDirectory;
    var folderName = FileUtil.getLastFolder(path);
    var tempFolder = storeFolder.resolvePath(folderName);
    var parentFolder = folder.parent;
    if (!parentFolder.exists) {
    FileUtil.createFolder(parentFolder.nativePath,false);
    if (tempFolder.exists) {
    tempFolder.deleteDirectory(true);
    tempFolder.createDirectory();
    tempFolder.moveTo(folder,true);
    else {
    folder.createDirectory();
    FileUtil.getLastFolder = function(path) {
    path += "";
    for (var i=path.length-1;i>-1;i--) {
    var tmpChr = path.substr(i,1);
    if ((tmpChr == "/") || (tmpChr == "\\")) {
    return path.substr(i+1);
    return "";
    You can use this method instead of createDirectory(). So for
    example, newFolder.createDirectory() would be
    FileUtil.createFolder(newFolder.nativePath,true).
    Hope this helps.
    Ken

  • Local build error in OSB

    hi ,
    I am getting the below error
    main:
    validate:
    [mkdir] Created dir: C:\dev\apps\eclipse\workspace\GetLoyaltyMemberProfileOS
    B\target\schematron
    [schematron] 1 file(s) have been successfully validated.
    [schematron] Source file: GetLoyaltyMemberProfile-validator.proxy
    [schematron] [assert] /xml-fragment/*[local-name()='endpointConfig' and namespac
    e-uri()='http://www.bea.com/wli/sb/services']/*[local-name()='URI' and namespace
    -uri()='http://www.bea.com/wli/sb/transports'] -
    [schematron] Do not use default endpoint generated by
    OSB : /GetLoyaltyMemberProfileOSB/proxy/v10/GetLoyaltyMemberProfile-validator.
    Use the endpoint specified in the SDS.
    [schematron]
    [schematron] Source file: GetLoyaltyMemberProfile.proxy
    [schematron] [assert] /xml-fragment/*[local-name()='endpointConfig' and namespac
    e-uri()='http://www.bea.com/wli/sb/services']/*[local-name()='URI' and namespace
    -uri()='http://www.bea.com/wli/sb/transports'] -
    [schematron] Do not use default endpoint generated by
    OSB : /GetLoyaltyMemberProfileOSB/proxy/v10/GetLoyaltyMemberProfile. Use the en
    dpoint specified in the SDS.
    [schematron]
    [schematron] 2 file(s) have been successfully validated.
    [schematron] 3 file(s) have been successfully validated.
    [INFO] ------------------------------------------------------------------------
    [ERROR] BUILD ERROR
    [INFO] ------------------------------------------------------------------------
    [INFO] An Ant BuildException has occured: The following error occurred while exe
    cuting this line:
    C:\dev\apps\eclipse\workspace\GetLoyaltyMemberProfileOSB\target\osbBuildResource
    s\schematron\build.xml:64: Schematron Rules Failed...failing
    Can anybody can share any URLS of how to hadle this.
    Expecting a reply from ASAP
    regards
    srinu

    well the error message pretty much explains what is wrong
    i assume you or your fellow programmer added some schematron validations to validate the osb proxy file
    "/GetLoyaltyMemberProfileOSB/proxy/v10/GetLoyaltyMemberProfile-validator.
    Use the endpoint specified in the SDS"
    so i guess you need to change the "/GetLoyaltyMemberProfileOSB/proxy/v10/GetLoyaltyMemberProfile-validator" value to something from SDS?
    these messages aren't any osb specific messages..it's custom validation which got added by your team
    so best is to open op the proxy file in eclipse or notepad, and change the value of the URI element to something which is a valid value for your schematron validation rule

  • Flash builder external launching URL

    Hi. Flash Builder launch configuration has the option to specify an external URL, but it hardcodes local file URIs, making launch configurations not portable across developers. This is easy to fix (please, forgive me for bending the rules of the terms of license -- it's in good faith).
    1. FlexLaunchConfiguration#getCustomLaunchURL needs to be modified to make use of Eclipse's built-in substitution variables.
                    url = VariablesPlugin.getDefault().getStringVariableManager().performStringSubstitution(
                            fConfiguration.getAttribute(attributeKey, ""));
    2. Add imports:
    import org.eclipse.core.variables.IStringVariableManager;
    import org.eclipse.core.variables.VariablesPlugin;
    3. Make "Adobe Flash Builder Launching" bundle depend on org.eclipse.core.variables.
    Voila. You can now have any launch URL you wish, including project-relative (but not hardcoded) resources, as in:
    ${resource_loc:/my-project/bin/my-resource.html}
    It would be great if this could be integrated with the codebase, of course.

    The delay is in launching the adobe community help (ACH) or the browser. That takes 15-20 seconds. Once the ACH or browser is launched it loads the content pretty fast. There's no network activity during the delay.
    It looks like it launches the help with the following command (shown in the status bar).
    command://com.adobe.flexide.communityhelp.launchHelp(productHelpConfig=Flex_4.0,pageID=mx. collections_ArrayList
    It works fine on OS X, but it's super slow on XP.

  • Perl permissions

    For quite a time, I have a problem with perl on my system. I don't have the permissions to install or even execute perl scripts as a normal user. IMHO this shouldn't be the default behaviour, but I can't say when and where this changed on my computer.
    Examples:
    .-(~) - (strix@tirion)-
    `--> id
    uid=1000(strix) gid=100(users) groups=100(users),7(lp),10(wheel),50(games),90(network),91(video),108(vboxusers),150(wireshark)
    .-(~) - (strix@tirion)-
    `--> cpan
    Can't locate App/Cpan.pm: Permission denied at /usr/bin/core_perl/cpan line 9.
    BEGIN failed--compilation aborted at /usr/bin/core_perl/cpan line 9.
    .-(~) - (strix@tirion)-
    `--> perl-rename
    Can't locate Text/Abbrev.pm: Permission denied at /usr/bin/perl-rename line 22.
    BEGIN failed--compilation aborted at /usr/bin/perl-rename line 22.
    .-(~) - (strix@tirion)-
    `--> pacman -Qs perl
    local/cairo-perl 1.104-2
    Perl wrappers for cairo
    local/glade-perl 1.007-8
    Gtk2-GladeXML perl bindings for glade 2.x
    local/glib-perl 1.305-1
    Perl wrappers for glib 2.x, including GObject
    local/gtk2-perl 1.2492-1
    Perl bindings for GTK+ 2.x
    local/irssi 0.8.17-1
    Modular text mode IRC client with Perl scripting
    local/lib32-pcre 8.36-1
    A library that implements Perl 5-style regular expressions (32-bit)
    local/pango-perl 1.226-1
    Perl bindings for Pango
    local/pcre 8.36-2
    A library that implements Perl 5-style regular expressions
    local/perl 5.20.1-1 (base)
    A highly capable, feature-rich programming language
    local/perl-anyevent 4:7.08-1
    The DBI of event loop programming
    local/perl-anyevent-i3 0.16-1
    Communicate with the i3 window manager
    local/perl-async-interrupt 1.20-2
    allow C/XS libraries to interrupt perl asynchronously
    local/perl-common-sense 3.73-1
    Implements some sane defaults for Perl programs
    local/perl-data-dump 1.22-1
    Pretty printing of data structures
    local/perl-digest-hmac 1.03-3
    Perl Module: Keyed-Hashing for Message Authentication.
    local/perl-digest-sha1 2.13-5
    Perl interface to the SHA-1 Algorithm
    local/perl-encode-locale 1.03-2
    Determine the locale encoding
    local/perl-error 0.17022-1
    Perl/CPAN Error module - Error/exception handling in an OO-ish way
    local/perl-ev 4.18-1
    perl interface to libev, a high performance full-featured event loop
    local/perl-file-listing 6.04-2
    parse directory listing
    local/perl-file-which 1.09-4
    Portable implementation of which
    local/perl-guard 1.023-1
    safe cleanup blocks
    local/perl-html-parser 3.71-3
    Perl HTML parser class
    local/perl-html-tagset 3.20-4
    Data tables useful in parsing HTML
    local/perl-http-cookies 6.01-2
    HTTP cookie jars
    local/perl-http-daemon 6.01-2
    A simple http server class
    local/perl-http-date 6.02-2
    Date conversion routines
    local/perl-http-message 6.06-2
    HTTP style messages
    local/perl-http-negotiate 6.01-2
    Choose a variant to serve
    local/perl-image-exiftool 9.76-1
    Reader and rewriter of EXIF informations that supports raw files
    local/perl-json-xs 3.01-3
    JSON::XS - JSON serialising/deserialising, done correctly and fast
    local/perl-libwww 6.08-1
    The World-Wide Web library for Perl
    local/perl-locale-gettext 1.05-11
    Permits access from Perl to the gettext() family of functions
    local/perl-lwp-mediatypes 6.02-2
    Guess the media type of a file or a URL
    local/perl-net-dns 0.81-1
    Perl Module: Interface to the DNS resolver
    local/perl-net-http 6.07-1
    Low-level HTTP connection (client)
    local/perl-net-ip 1.26-2
    Perl Module: Easy manipulation of IPv4 and IPv6 addresses
    local/perl-rename 1.9-1
    Renames multiple files using Perl regular expressions.
    local/perl-text-unidecode 0.04-2
    US-ASCII transliterations of Unicode text
    local/perl-types-serialiser 1.0-1
    simple data types for common serialisation formats
    local/perl-uri 1.65-1
    Uniform Resource Identifiers (absolute and relative)
    local/perl-www-robotrules 6.02-2
    Database of robots.txt-derived permissions
    local/perl-xml-fast 0.11-5
    Simple and very fast XML to hash conversion.
    local/perl-xml-parser 2.43-1
    Expat-based XML parser module for perl
    Any ideas, how to fix this and where this problem comes from?

    Okay, first of all: I'm an absolute Noob when it comes to Perl. I only use perl in scripts I downloaded or which are part of a package.
    So to answer you first question, yes:
    lrwxrwxrwx 1 root root 18 Jul 4 14:53 /usr/bin/perl-rename -> vendor_perl/rename*
    -r-xr-xr-x 1 root root 13K Jul 4 14:53 /usr/bin/vendor_perl/rename*
    -r-xr-xr-x 1 root root 241K Nov 16 14:26 /usr/bin/vendor_perl/exiftool*
    The scripts complain, as soon as they use perl modules, e.g. almost always:
    A simple Hello World works:
    `--> cat hello.pl
    #!/usr/bin/perl
    print "Hello World\n";
    `--> ./hello.pl
    Hello World
    But most perl packages do not:
    exiftool:
    `--> exiftool
    Can't locate File/RandomAccess.pm: Permission denied at /usr/share/perl5/vendor_perl/Image/ExifTool.pm line 21.
    BEGIN failed--compilation aborted at /usr/share/perl5/vendor_perl/Image/ExifTool.pm line 21.
    Compilation failed in require at /usr/bin/vendor_perl/exiftool line 33.
    BEGIN failed--compilation aborted at /usr/bin/vendor_perl/exiftool line 33.
    iptab:
    `--> iptab
    Can't locate Net/IP.pm: Permission denied at /usr/bin/vendor_perl/iptab line 6.
    BEGIN failed--compilation aborted at /usr/bin/vendor_perl/iptab line 6.
    Edit:
    the perl modules do exist:
    `--> ll /usr/share/perl5/vendor_perl/Net/IP.pm
    -r--r--r-- 1 root root 73K Nov 28 2012 /usr/share/perl5/vendor_perl/Net/IP.pm
    Are these the correct permissions? And why can't I install any perl modules as user?
    Last edited by strix (2014-12-28 13:05:39)

  • Edit Proxies

    Hi,
    I enabled edit proxies when I installed final cut server, and from what I was reading, These would be created when I upload files to FCS, I can't see them in client, Do I need to set up a scan to create these edit proxies?
    Also, When I put the URI in the devices pane on the windows client computer it changes after I put it in, I put in: file:////192.168.8.127/Volumes/RAID0/primary representation/EditProxies.bundle
    and it changed to file://localhost//192.168.8.127/Volumes/RAID0/primary representation/EditProxies.bundle
    The Drive I am using for all FCS Devices is a 900GB RAID0 in the mac pro server computer.
    Hope someone can help ?

    Some points:
    (a) in order to use edit-in-place the storage must be visible to the server and the clients. This implies Xsan or some other sharing mechanism
    (b) the edit-in-place URI is always a local file URI. it is the path to the root of the "device"
    (c) "file:///" is equivalent to "file://localhost/" - it's defined that way in the standards
    (d) as people have stated elsewhere edit proxies are only created when FCP projects are uploaded
    (e) at present you can not do edit-in-place with contentbase devices (see http://support.apple.com/kb/TS1432 )

  • URI format for shared local files

    Firefox uses this format to access shared files on a local network... file://///host/path eg file://///computername/sharename/MyDocs/filename.txt.
    This format is different from the standard form file://host/path that is used on other browsers eg Windows, Chrome.
    This means that Firefox does not give me access to shared files when I have coded the standard format URI into my local HTML documents. Why is Firefox different or non-standard.

    hello seebee, apparently file://///host/path is the standard form for a unc path:
    "That's five slashes - two for the protocol, one to indicate the root of the file system, then two more to indicate the start of the server name."
    <sub>https://stackoverflow.com/questions/5317834/workaround-for-href-file-in-firefox</sub>
    it is also explained in this bug from 2001: https://bugzilla.mozilla.org/show_bug.cgi?id=66194#c8

  • Get Data from API which is hosted on local Machine

    I am using VS2013 to develop a databound app in win phone 8. I hosted a api on IIS Express on local machine with IP. When i browse the API on browser is comes easily,But a error is coming when trying to access from VS Solution.I am attaching my code and
    the error. the code is following
                         const string apiUrl = @"http://169.254.80.80/api/guest";
            public MainViewModel()
                this.Items = new ObservableCollection<ItemViewModel>();
            /// <summary>
            /// A collection for ItemViewModel objects.
            /// </summary>
            public ObservableCollection<ItemViewModel> Items { get; private set; }
            private string _sampleProperty = "Sample Runtime Property Value";
            /// <summary>
            /// Sample ViewModel property; this property is used in the view to display its value using a Binding
            /// </summary>
            /// <returns></returns>
            public string SampleProperty
                get
                    return _sampleProperty;
                set
                    if (value != _sampleProperty)
                        _sampleProperty = value;
                        NotifyPropertyChanged("SampleProperty");
            /// <summary>
            /// Sample property that returns a localized string
            /// </summary>
            public string LocalizedSampleProperty
                get
                    return AppResources.SampleProperty;
            public bool IsDataLoaded
                get;
                private set;
            /// <summary>
            /// Creates and adds a few ItemViewModel objects into the Items collection.
            /// </summary>
            public void LoadData()
                if (this.IsDataLoaded == false)
                    this.Items.Clear();
                    this.Items.Add(new ItemViewModel() { ID = "0", LineOne = "Please Wait...", LineTwo = "Please wait while the catalog is downloaded from the server.", LineThree = null });
                    WebClient webClient = new WebClient();
                    webClient.Headers["Accept"] = "application/json";
                    webClient.DownloadStringCompleted += new DownloadStringCompletedEventHandler(webClient_DownloadCatalogCompleted);
                    webClient.DownloadStringAsync(new Uri(apiUrl));
            private void webClient_DownloadCatalogCompleted(object sender, DownloadStringCompletedEventArgs e)
                try
                    this.Items.Clear();
                    if (e.Result != null)
                        var books = JsonConvert.DeserializeObject<GuestDetail[]>(e.Result);
                        int id = 0;
                        foreach (GuestDetail book in books)
                            this.Items.Add(new ItemViewModel()
                                ID = (id++).ToString(),
                                LineOne = book.GuestName,
                                LineTwo = book.Nationality,
                                LineThree = book.Profession.Replace("\n", " ")
                        this.IsDataLoaded = true;
                catch (Exception ex)
                    this.Items.Add(new ItemViewModel()
                        ID = "0",
                        LineOne = "An Error Occurred",
                        LineTwo = String.Format("The following exception occured: {0}", ex.Message),
                        LineThree = String.Format("Additional inner exception information: {0}", ex.InnerException.Message)
            public event PropertyChangedEventHandler PropertyChanged;
            private void NotifyPropertyChanged(String propertyName)
                PropertyChangedEventHandler handler = PropertyChanged;
                if (null != handler)
                    handler(this, new PropertyChangedEventArgs(propertyName));
    the error is ...
    {System.Net.WebException: The remote server returned an error: NotFound. ---> System.Net.WebException: The remote server returned an error: NotFound.
       at System.Net.Browser.ClientHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult)
       at System.Net.Browser.ClientHttpWebRequest.<>c__DisplayClasse.<EndGetResponse>b__d(Object sendState)
       at System.Net.Browser.AsyncHelper.<>c__DisplayClass1.<BeginOnUI>b__0(Object sendState)
       --- End of inner exception stack trace ---
       at System.Net.Browser.AsyncHelper.BeginOnUI(SendOrPostCallback beginMethod, Object state)
       at System.Net.Browser.ClientHttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
       at System.Net.WebClient.GetWebResponse(WebRequest request, IAsyncResult result)
       at System.Net.WebClient.DownloadBitsResponseCallback(IAsyncResult result)}
    Can anyone help me please, I am stuck with it.
     

    Did you set up your router to forward the request to your computer?  the ip you posted looks an ip your internet service provider gave you.
    Fyi you can get 10 free azure websites

  • Getting  file from local network computer

    Hi! I have a problem to get the file form local network. I have tried following ways to do it:
    new File ("file://10.150.11.214/pics/bilde.JPG");
    new File ("smb://10.150.11.214/pics/bilde.JPG");
    new File ("http://10.150.11.214/pics/bilde.JPG");There is always error:
    java.io.FileNotFoundException: file://10.150.11.214/pics/bilde.JPG
    (The filename, directory name, or volume label syntax is incorrect)On the local computer IP is 10.150.11.214 and shared folder "pics"
    Can U give me some solution!
    tnx! ;)

    Manivel wrote:
    +@kajbj+
    Why? The problem is already solved.
    <BR>
    Yes correct, but see OPs previous post.
    +PeterisR wrote
    I had tried as U sad, Manivel! but there were problems .. tnx, anyway!+Ok. I can understand that you want to know why / how it failed, but using URI/URL is in this case not the best way. Using the normal File class and UNC name is far more common.
    Kaj

  • Copy file from local system to Azure VM using powershell

    Hi
    Is there a simple powershell command to copy a small file from local computer to Azure VM. Point to Site is not an option for me.
    I am hoping for something simple like
    Copy-Item C:\Wabash\Logfiles\trasfer.txt -Destination C:\Presentation -ConnectionUri $uri -Credential $credential
    similar to Invoke-Command
    The only other option i have seen is 
    http://www.mattwrock.com/blog/copy-files-from-local-computer-to-an-azure-vm
    which i fell for my purpose is over kill.

    Hi,
    I will mark Ed's post as answer, if you fount that doesn't give you help, please feel free unmark it and follow up with more information.
    Best Regards,
    Jambor
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to use the same services-config for the local and remote servers.

    My flex project works fine using the below but when I upload my flash file to the server I doesn't work, all the relative paths and files are the same execpt the remote one is a linux server.
    <?xml version="1.0" encoding="UTF-8"?>
    <services-config>
        <services>
            <service id="amfphp-flashremoting-service"
                class="flex.messaging.services.RemotingService"
                messageTypes="flex.messaging.messages.RemotingMessage">
                <destination id="amfphp">
                    <channels>
                        <channel ref="my-amfphp"/>
                    </channels>
                    <properties>
                        <source>*</source>
                    </properties>
                </destination>
            </service>
        </services>
        <channels>
        <channel-definition id="my-amfphp" class="mx.messaging.channels.AMFChannel">
            <endpoint uri="http://localhost/domainn.org/amfphp/gateway.php" class="flex.messaging.endpoints.AMFEndpoint"/>
        </channel-definition>
        </channels>
    </services-config>
    I think the problem  is the line
            <endpoint uri="http://localhost/domainn.org/amfphp/gateway.php" class="flex.messaging.endpoints.AMFEndpoint"/>
    but I'm not sure how to use the same services-config for the local and remote servers.

    paul.williams wrote:
    You are confusing "served from a web-server" with "compiled on a web-server". Served from a web-server means you are downloading a file from the web-server, it does not necessarily mean that the files has been generated / compiled on the server.
    The server.name and server.port tokens are replaced at runtime (ie. on the client when the swf has been downloaded and is running) not compile time (ie. while mxmlc / ant / wet-tier compiler is running). You do not need to compile on the server to take advantage of this.
    Hi Paul,
    In Flex, there is feature that lets developer to put all service-config.xml file configuration information into swf file. with
    -services=path/to/services-config.xml
    IF
    services-config.xml
    have tokens in it and user have not specified additional
    -context-root
    and this swf file is not served from web-app-server (like tomcat for example) than it will not work,
    Flash player have no possible way to replace token values of service-config.xml file durring runtime if that service-config.xml file have been baked into swf file during compilation,
    for example during development you can launch your swf file from your browser with file// protocol and still be able to access blazeDS services if
    -services=path/to/services-config.xml
    have been specified durring compilation.
    I dont know any better way to exmplain this, but in summary there is two places that you can tell swf  about service confogiration,
    1) pass -services=path/to/services-config.xml  parameter to compiler this way you tell swf file up front about all that good stuff,
    or 2) you put that file on the webserver( in this case, yes you should have replacement tokens in that file) and they will be repaced at runtime .

  • How to find out the locale setting in a browser?

    In my Java web project, the multi-lingual issue on the JSP pages is handled by JSTL. It works fine so far for any input messages. However, some messages come from the container. It is needed to find out the browser's country and language settings inside of the container. My question is how to find out the settings?
    Thanks in advance.
    v.

    Hi, this I found on James' website--see http://www.rf.net/~james/perli18n.html#Q28
    Q28. Can web servers automatically detect the language of the browser and display the correct localized page?
    A28. Yes. HTTP/1.1 defines the details of how content negotiation works, including language content.
    WWW browsers send an Accept-Language request header specifying which languages are preferred for responses. This technique works fairly well, although some versions of Netscape Navigator send an improperly formatted request parameter. Also, switching language preferences in either Navigator or IE 4 doesn't always "take" without first deleting a language hint.
    Few sites do content-negotiation on language, and interestingly enough I do not know of any major portals doing this. One site that does is Sun's documentation library at SunDocs. Debian.org does a very nice job of using Apache content negotiation wih languages and also has some nice help info too on Setting the Default Language.
    Apache's Content Negotiation features will select the right page to return, whether HTML or image file. Annoyingly, the match logic is very literal, so a browser request for en-us will not match a server entry of en except as a last resort. Any other exact match will win over en, even if en-us was first preference.
    There are 2 ways of doing content negotiation with Apache: type or variant maps and multiviews.
    Variant Maps
    In httpd.conf, disable Options Multiviews if configured and add
    AddType type-var var
    DirectoryIndex index.var
    Then create an index.var file like this:
    URI: start; vary="type,language"
    URI: index.html.en
    Content-type: text/html
    Content-language: en-GB
    URI: index.html.en
    Content-type: text/html
    Content-language: en-US
    URI: index.html.en
    Content-type: text/html
    Content-language: en
    URI: index.html.fr
    Content-type: text/html
    Content-language: fr-CA
    URI: index.html.fr
    Content-type: text/html
    Content-language: fr
    URI: index.html.es
    Content-type: text/html
    Content-language: es
    Multiviews
    The multiviews technique works like this. This does add extra server load, as each content directory must be scanned for the variant document names.
    index.html is localized into variant documents such as:
    index.html.en (or index.en.html)
    index.html.fr
    index.html.es
    index.html (or index.html.html as a reader has recommended) symlinked to one of the above as the last resort.
    Here's an example of http.conf directives for this:
    # in httpd.conf
    AddLanguage en .en
    AddLanguage fr .fr
    AddLanguage es .es
    # LanguagePriority allows you to give precedence to some languages
    # in case of a tie during content negotiation.
    # Just list the languages in decreasing order of preference.
    LanguagePriority en es fr de pt
    Options Multiviews
    # end of httpd.conf fragment
    Starting in Apache 1.2, you may also create documents with multiple language extensions.
    O'Reilly's Apache - The Definitive Guide, Chapter 6
    ApacheWeek article on Language Negotiation
    Another ApacheWeek article on Language Negotiation

  • How to upload local files to Offices365 SharePoint Online Site by C# Code?

    Hi all,
    I've some requirement needs to upload files from local to Office365 Sharepoint Online Site Document Library using C# code?
                   public static void upload()
    Uri uri = new Uri("siteurl");
                    ClientContext context = new ClientContext(uri);
                    var passWord = new SecureString();
                    foreach (var c in "password") passWord.AppendChar(c);
                    context.Credentials = new SharePointOnlineCredentials("email", passWord);
    Web web = context.Web;
                   FileCreationInformation newFile = new FileCreationInformation();
                    newFile.Content = System.IO.File.ReadAllBytes(@"C:\myfile.txt");
                    newFile.Url = "file uploaded via client OM.txt";
                    List docs = web.Lists.GetByTitle("Documents");
                    Microsoft.SharePoint.Client.File uploadFile = docs.RootFolder.Files.Add(newFile);
                    context.ExecuteQuery();
    I don't know whether this method works and I'm always get issue for getting the ClientContext.
    Thanks for your reply.

    Please try below.
    public void SaveFileToSharePoint(string fileName)
    using (var context = new ClientContext("https://mydomain.com/"))
    var passWord = new SecureString();
    foreach (var c in "MyPassword") passWord.AppendChar(c);
    context.Credentials = new SharePointOnlineCredentials("[email protected]", passWord);
    var web = context.Web;
    var newFile = new FileCreationInformation {Content = File.ReadAllBytes(fileName), Url = Path.GetFileName(fileName)};
    var docs = web.Lists.GetByTitle("Documents");
    docs.RootFolder.Folders.GetByUrl("Test").Files.Add(newFile);
    context.ExecuteQuery();
    Bala

  • OSB : Endpoint URI problem in business service

    I have to invoke a http service from OSB where endpoint uri is http://<ip>:<port>/Resource.
    At invocation time OSB is adding "?" to the end of URI, in that case http message is becoming like following:
    POST /Resource? HTTP/1.1
    External service is considering it as a bad request and giving 500 response code with following comments:
    Error occured: 500, Cannot find local resource: /Resource?
    But I am getting proper response when I am calling from java program with http message POST /Resource HTTP/1.1
    It is not possible to change the external system, now how can I solve the problem??
    Please help.
    Thanks
    Afzal
    Edited by: uttam on May 2, 2012 9:49 PM

    Open your business service and navigate to HTTP Transport configuration page and check what is the http type is enabled.
    Look to me its with GET method, change it to POST and re-try.
    If the above solution is not helping, try to check the Follow HTTP redirects check box below the Advanced Setting in same page.
    Thanks,
    Vijay

  • How to access local connection factory created within Foreign Server in OSB

    Hi All
    I am facing an issue in my config plan. We have a RIB Foreign server with the following local connection factory:
    jms/RibAqJmsXATopicConnectionFactory
    I am using the below in my configuration plan:
    <cus:envValueAssignments>
    <xt:envValueType>Service URI</xt:envValueType>
    <xt:location xsi:nil="true"/>
    <xt:owner>
    <xt:type>ProxyService</xt:type>
    <xt:path>RLTPReturnToWarehouse/ProxyServices/ConsumeRIBRTWMessages</xt:path>
    </xt:owner>
    <xt:value xsi:type="xs:string" xmlns:xs="http://www.w3.org/2001/XMLSchema">jms://localhost:7001/jms.RibAqJmsXATopicConnectionFactory/jms.etASNInFromRIBToWH1</xt:value>
    </cus:envValueAssignments>
    and i am getting the below error:
    [java]
    [java] Loading customization File ./dev/OSBCustomizationFile.xml
    [java] Customization applied to the created resources only []
    [java] com.bea.wli.config.customization.EnvValueCustomization@553c13
    [java] Unexpected error: com.bea.wli.sb.transports.TransportException
    [java] Problem invoking WLST - Traceback (innermost last):
    [java] File "D:\VFUKScripts\DeploymentScripts\osb\import.py", line 200, in ?
    [java] File "D:\VFUKScripts\DeploymentScripts\osb\import.py", line 122, in importToALSBDomain
    [java] com.bea.wli.sb.transports.TransportException: Failed to lookup connection factory jms.RibAqJmsXATopicConnectionFactory
    what am i missing here?

    [java] com.bea.wli.sb.transports.TransportException: Failed to lookup connection factory jms.RibAqJmsXATopicConnectionFactory
    Looks like the JNDI that you created for the ConnectionFactory is not reflected in the server.
    Login to WLS Console> Summary of Servers > server_name > View JNDI Tree
    Browse to the JNDI tree and see if your JNDI is visible there. If it is not then, please restart the server and recheck.
    Once you are able to find it in the JNDI tree, then execute the customization file.
    If you have modified the existing JNDI properties (that have a small exclamatory symbol) then any changes to those are not reflected till all the servers in the cluster are restarted.
    If it still does not work, then recreate a new Connection with a different name and then retry. It should work then.
    Thanks,
    Patrick

Maybe you are looking for