Override web.xml With Server Specific Values

Not sure if here or the OC4J/J2EE forum is most appropriate place for this question:
We're currently working on migrating from the old jserv setup to 9.0.4 app server with OC4J. We have the infrastructure installed and are managing the application through Enterprise Manager. In my web.xml file I provide initialization parameters to one of my servlets using something similar to the following:
<servlet>
<servlet-name>util.GlobalPropertyManager</servlet-name>
<servlet-class>util.GlobalPropertyManager</servlet-class>
<init-param>
<param-name>mhris.batch.outputdir</param-name>
<param-value>d:/dev/java/mhris/defaultroot/batch/</param-value>
</init-param>
</servlet>
Now, this directory path I've provided is only good on my local workstation. When I deploy to my UNIX production servers, I need to override this with a valid path depending on the server being deployed to (no, they don't all have the same directory setup, yeah it's a pain). These servers include our production boxes, development server, test, training, etc.
Currently under JSERV, I provide server specific values in the Global Init Parameters section of my property file (don't remember why we didn't use the Servlet Init Parameters property instead). This works very well since this file is not touched when we land updates, so the values are set once for each server.
Under OC4J, I understand that I can override the values in web.xml by using an orion-web.xml file BUT it appears that this file resides in the WAR I deploy, so each server will get the same orion-web.xml rather than maintaining its own set of values.
Is there another .xml file I can use to provide these initalization parameters? global-web-applications.xml looked promising but I wasn't completely sure I could put values for my application in it or where exactly they should go (ie. inside the existing <web-app> section or if I should create a second one specifically for my app).
Any ideas or will I have to reploy a different orion-web.xml file to each of my servers?
Appreciate the assistance,
Michael

Michael,
First, I would just modify the web.xml during each deployment.
Second, I would recommend using the same relative path with the web-app context. Then, you can use the Servlet API to retrive the real path of the web-app context.
I don't think it is necessary to use orion-web.xml or other properties files.

Similar Messages

  • Overriding web.xml using Plan.xml

    Hi,
    I want to override certain values (MAX_ROW_FETCH_SIZE)  in web.xml using Plan.xml for a servlet deployed on weblogic server.
    My web.xml looks like this.
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
             version="2.5">
      <servlet>
        <servlet-name>trial</servlet-name>
        <servlet-class>oracle.apps.cmi.sv.fwk.webui.trial</servlet-class>
        <init-param>
          <param-name>MAX_ROW_FETCH_SIZE</param-name>
          <param-value>50</param-value>
        </init-param>
        <init-param>
          <param-name>JDBC_MAX_FETCH_SIZE</param-name>
          <param-value>20</param-value>
        </init-param>
      </servlet>
      <servlet-mapping>
        <servlet-name>trial</servlet-name>
        <url-pattern>/trial</url-pattern>
      </servlet-mapping>
    </web-app>
    My Plan.xml looks like this
    <?xml version='1.0' encoding='UTF-8'?>
    <deployment-plan xmlns="http://xmlns.oracle.com/weblogic/deployment-plan" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.oracle.com/weblogic/deployment-plan http://xmlns.oracle.com/weblogic/deployment-plan/1.0/deployment-plan.xsd">
      <application-name>SPUF</application-name>
      <variable-definition>
        <variable>
          <name>SessionDescriptor_timeoutSecs_13708393894780</name>
          <value>3602</value>
        </variable>
        <variable>
          <name>MAX_ROW_FETCH_SIZE</name>
          <value>3</value>
        </variable>
        <variable>
          <name>JDBC_MAX_FETCH_SIZE</name>
          <value>2</value>
        </variable>       
      </variable-definition>
      <module-override>
        <module-name>SPUF.war</module-name>
        <module-type>war</module-type>
        <module-descriptor external="false">
          <root-element>weblogic-web-app</root-element>
          <uri>WEB-INF/weblogic.xml</uri>
          <variable-assignment>
            <name>SessionDescriptor_timeoutSecs_13708393894780</name>
            <xpath>/weblogic-web-app/session-descriptor/timeout-secs</xpath>
          </variable-assignment>
        </module-descriptor>
        <module-descriptor external="false">
          <root-element>web-app</root-element>
          <uri>WEB-INF/web.xml</uri>
          <variable-assignment>
            <name>MAX_ROW_FETCH_SIZE</name>
            <xpath>/web-app/servlet/init-param/[param-name="MAX_ROW_FETCH_SIZE"]/param-value</xpath>
            <operation>replace</operation>
          </variable-assignment>
          <variable-assignment>
            <name>JDBC_MAX_FETCH_SIZE</name>
            <xpath>/web-app/servlet/init-param/[param-name="JDBC_MAX_FETCH_SIZE"]/param-value</xpath>
            <operation>replace</operation>
           </variable-assignment>                     
        </module-descriptor>
        <module-descriptor external="true">
          <root-element>wldf-resource</root-element>
          <uri>META-INF/weblogic-diagnostics.xml</uri>
        </module-descriptor>
      </module-override>
      <config-root>/home/oracle/ebssdk2</config-root>
    </deployment-plan>
    I can see new value reflected for "Session TimeOut" for service configuration.
    However when I use service to query certain data while considering "MAX_ROW_FETCH_SIZE" parameter, It is still querying 50 rows (Value in web.xml) at a time instead of 3 (As defined in Plan.xml)
    I am using servlet init method to get init parameters in my java file.
    Can someone help me to overcome from this issue or have any suggestion?

    You could use Apache Ant and create 2 separate WAR files , one for development and one for production.
    Normally I don't create a WAR file for the development environment. WAR file is made only for production.
    This is how my Ant task runs currently.
    1) For the development environment the ant task runs only to compile Java classes and nothing else, web.xml is that for development environment.
    2) When the app is ready for production , I run Ant to copy all files from my dev folder to a temporary build folder - during this copy I filter out the .java files (since there's no longer a need for them in production) only class files are moved.
    3) Then I treat the above temporary folder as the source folder, and run the Jasper pre-compiler which significantly alters the web.xml file .
    But the good part is that my original development web.xml stays unaltered since it is in it's own folder.
    4) Then finally I run a WAR task on the processed contents of the temporary build folder which contains the modified web.xml
    This way each environment has it's own web.xml .

  • WAR Deployment and overriding web.xml

    Hi there,
    I've been racking my brains out trying to determine if it is possible to override specific declarations of my WAR file's web.xml without actually mutating it.
    I have a web application contained in a WAR and want to simply copy it to the webapps folder of my container and then maintain another file that overrides the web.xml's servlet/init-param declarations. The web.xml that is part of the WAR is development specific and I want to declare production information without upsetting the WAR file.
    Am I barking up the wrong tree i.e. going about this all-wrong - is there a "J2EE way" of overriding WAR file declarations?
    Thanks for any help.
    Cheers,
    -C

    You could use Apache Ant and create 2 separate WAR files , one for development and one for production.
    Normally I don't create a WAR file for the development environment. WAR file is made only for production.
    This is how my Ant task runs currently.
    1) For the development environment the ant task runs only to compile Java classes and nothing else, web.xml is that for development environment.
    2) When the app is ready for production , I run Ant to copy all files from my dev folder to a temporary build folder - during this copy I filter out the .java files (since there's no longer a need for them in production) only class files are moved.
    3) Then I treat the above temporary folder as the source folder, and run the Jasper pre-compiler which significantly alters the web.xml file .
    But the good part is that my original development web.xml stays unaltered since it is in it's own folder.
    4) Then finally I run a WAR task on the processed contents of the temporary build folder which contains the modified web.xml
    This way each environment has it's own web.xml .

  • Error while deploying in web.xml with web-app_2_5.xsd

    Weblogic version 10.3.5 and java is 1.6.0_31
    context root is - "/" (slash)
    Web.xml - old
    has following declaration and works fine
    <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
    <web-app>
    i am trying to change web.xml's web-app definition as below
    Web.xml - new
    <web-app xmlns="http://java.sun.com/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
         version="2.5">
    and to accommodate above change i enclosed all "tag libs" inside <jsp-config> tag which is as per 2.5
    when i try to deploy with above changes, i am getting following error but with old definition i am not getting any error.
    <Error> <Deployer> <clbblr-4423> <StoreFront> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1358234763292> <BEA-149205> <Failed to initialize the application 'shopstr' due to error weblogic.application.ModuleException: Failed to load webapp: '/'.
    weblogic.application.ModuleException: Failed to load webapp: '/'
         at weblogic.servlet.internal.WebAppModule.prepare(WebAppModule.java:393)
         at weblogic.application.internal.flow.ScopedModuleDriver.prepare(ScopedModuleDriver.java:176)
         at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:199)
         at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:517)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:52)
         at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:159)
         at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:45)
         at weblogic.application.internal.BaseDeployment$1.next(BaseDeployment.java:613)
    Caused By: java.lang.ClassNotFoundException: atg.web.tagsupport.CollectionTagSupport
         at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:297)
         at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:270)
         at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:64)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
         at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:179)
         at weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAwareClassLoader.java:43)
         at java.lang.ClassLoader.defineClass1(Native Method)
    Would appreciate suggestions. Thanks

    added JAR file pwsTaglib2_0.jar and now problems are resolved. will open this thread if i see any other error

  • Java.lang.IllegalArgumentException for listener in web.xml with weblogic12.1.1

    Hi.
    Im trying to upgrade the weblogic version from 10 to 12 for my application.
    Im getting below mentioned error while deploying ear file in weblogic 12 which works fine with version10.
    " java.lang.IllegalArgumentException:[HTTP:101164] User defined class com.ab.util.session object is not a listener as it doesnt implement the correct interface."
    Deployment is getting failed because of this error.
    If i comment out listener, deployment is success.

    HI Timo,
    Old Weblogic version: 10.3.3
    New weblogic version:12.1.1
    Using Struts frame work.
    SessionObject class:
    public class SessionObject implements HttpSessionBindingListener{
    public void valueBound( HttpSessionBindingEvent  event)
    public voind valueUnbound (HttpSessionBindingEvent  event)
    web.xml:
    <listener>
    <listener-class>com.ab.util.SessionObject</listener-class>
    <listener>
    I want to know that why im getting  " java.lang.IllegalArgumentException:[HTTP:101164] User defined class com.ab.util.session object is not a listener as it doesnt implement the correct interface"  error while deploying the ear file under version 12.1.1 when it is working fine with version 10.3.3.
    Should i make any changes in web.xml or should i include any jars???

  • Opening a web page with a specific size window

    I have an interesting problem. I want to open a Safari window on my computer with a specific size and screen position. Is this possible to do? Maybe an HTML string? This would apply to a very specific web site.
    If it matters, I am using a Sling Box to watch TV on my iMac. I want a "small-ish" window that opens on the lower right of the screen. What happens now is the the window usually opens in the same place as last time (the lower right) but not always. Sometimes I have to go hunting for it. And it's almost never the right size or aspect ratio which has to adjusted manually each time.
    Another question: The new version of Safari insists on putting the web page name on the top of the window. Any way to turn this off?
    Thanks in advance.
    That's the little window in the lower right. See the page name?

    "Many" financial institutions and banks use special web software that all versions of Safari are incompatible with.  My bank is one of those.  The downloading, installing, and use of "Firefox" for an alternate browser is what they recommend, instead of Safari.

  • Servlet registration in web.xml with weblogic 5.1 sp10

    I've been developing this site using one "dispatch"
              servlet as my traffic cop for my framework. i now
              have to do this charting thing and i plan to
              stream in an image from a servlet. this means adding
              another servlet to the application. i've edited the
              web.xml according to the standerd and WL still pukes
              on startup saying
              "Error parsing descriptor in Web application
              'c:/workspace/com/somthing/'
              org.xml.sax.SAXParseException: Element "web-app" does
              not allow "servlet" here."
              below is my web.xml file...
              <?xml version="1.0" encoding="ISO-8859-1"?>
              <!DOCTYPE web-app
              PUBLIC "-//Sun Microsystems, Inc.//DTD Web
              Application 2.2//EN"
              "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
              <web-app>
              <description>
              blah blah
              </description>
              <servlet>
              <servlet-name>
              WebDispatcher
              </servlet-name>
              <servlet-class>
              com.somthing.somthin.WebDispatcher
              </servlet-class>
              </servlet>
              <servlet-mapping>
              <servlet-name>
              WebDispatcher
              </servlet-name>
              <url-pattern>
              /dispatch
              </url-pattern>
              </servlet-mapping>
              <servlet>
              <servlet-name>
              AssetChartServlet
              </servlet-name>
              <servlet-class>
              com.something.somthn.charts.ChartServlet
              </servlet-class>
              </servlet>
              <servlet-mapping>
              <servlet-name>
              ChartServlet
              </servlet-name>
              <url-pattern>
              /Chart
              </url-pattern>
              </servlet-mapping>
              some jsp tags
              </web-app>
              What am I doing wrong? Do I have to register the
              servlet in the weblogic.properties file? If so do I add the line
              weblogic.httpd.register.chart=com.somthing.somthin.charts.ChartServlet
              And the the (local)url would be http://localhost:7001/Chart ? And if
              this is the case where/how do I do the url mapping bit for this?
              Any help would be greatly appreciated.
              thanks,
              -Gabe
              

    To answer Mike's follow-up question, yes. From the DTD for the web.xml
              file:
              <!ELEMENT web-app (icon?, display-name?, description?, distributable?,
              context-param*, servlet*, servlet-mapping*, session-config?,
              mime-mapping*, welcome-file-list?, error-page*, taglib*,
              resource-ref*, security-constraint*, login-config?, security-role*,
              env-entry*, ejb-ref*)>
              The ordering of elements must be followed if they are specified in the DTD.
              Move your first <servlet-mapping> element to after the second <servlet>
              element and it should work just fine.
              -chris
              "Mike Reiche" <[email protected]> wrote in message
              news:[email protected]...
              >
              >
              >
              > Hmmm... do all the <servlet> </servlet> need to come before all the
              <servlet-mapping>
              > ?
              >
              > Mike
              >
              >
              > [email protected] (gabe) wrote:
              > >I've been developing this site using one "dispatch"
              > >servlet as my traffic cop for my framework. i now
              > >have to do this charting thing and i plan to
              > >stream in an image from a servlet. this means adding
              > >another servlet to the application. i've edited the
              > >web.xml according to the standerd and WL still pukes
              > >on startup saying
              > >
              > >"Error parsing descriptor in Web application
              > >'c:/workspace/com/somthing/'
              > >org.xml.sax.SAXParseException: Element "web-app" does
              > >not allow "servlet" here."
              > >
              > >below is my web.xml file...
              > >------------------------------
              > >
              > ><?xml version="1.0" encoding="ISO-8859-1"?>
              > >
              > ><!DOCTYPE web-app
              > > PUBLIC "-//Sun Microsystems, Inc.//DTD Web
              > >Application 2.2//EN"
              > > "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
              > >
              > ><web-app>
              > >
              > > <description>
              > > blah blah
              > > </description>
              > >
              > > <servlet>
              > > <servlet-name>
              > > WebDispatcher
              > > </servlet-name>
              > > <servlet-class>
              > > com.somthing.somthin.WebDispatcher
              > > </servlet-class>
              > > </servlet>
              > > <servlet-mapping>
              > > <servlet-name>
              > > WebDispatcher
              > > </servlet-name>
              > > <url-pattern>
              > > /dispatch
              > > </url-pattern>
              > > </servlet-mapping>
              > >
              > > <servlet>
              > > <servlet-name>
              > > AssetChartServlet
              > > </servlet-name>
              > > <servlet-class>
              > > com.something.somthn.charts.ChartServlet
              > > </servlet-class>
              > > </servlet>
              > > <servlet-mapping>
              > > <servlet-name>
              > > ChartServlet
              > > </servlet-name>
              > > <url-pattern>
              > > /Chart
              > > </url-pattern>
              > > </servlet-mapping>
              > >
              > > ...
              > > some jsp tags
              > > ...
              > >
              > ></web-app>
              > >---------------------------------
              > >What am I doing wrong? Do I have to register the
              > >servlet in the weblogic.properties file? If so do I add the line
              > >
              > >weblogic.httpd.register.chart=com.somthing.somthin.charts.ChartServlet
              > >
              > >And the the (local)url would be http://localhost:7001/Chart ? And if
              > >this is the case where/how do I do the url mapping bit for this?
              > >
              > >Any help would be greatly appreciated.
              > >
              > >thanks,
              > >
              > >-Gabe
              >
              

  • ORDER BY with a Specific value first

    I am creating an Employee Contact page in ASP that populates a table with a SQL query (command).  I want to sort the employees by last name (which is obviously an easy SORT BY property), but I need to show the Managers first.  How can I display
    employees that have 'Managers' in their 'Job Title' first, then the rest of the employees by last name.

    create table #t (id int, title char(1))
    insert into #t values (4,'A')
    insert into #t values (2,'M')
    insert into #t values (3,'D')
    insert into #t values (1,'M')
    insert into #t values (5,'M')
    insert into #t values (6,'e')
    insert into #t values (7,'X')
    select * from #t order by
    case when title ='m' then 1 end desc, title 
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • How to count ONLY fields with a specific value

    I modified the code below from the API reference to count combobox fields with a value of "MT" so I could total the number of a specific choice the form user input.
    var count = 0;
    for (var i=0; i<this.numFields; i++)
    var fname = this.getNthFieldName(i);
    if ( this.getField(fname).type == "combobox" && this.getField(fname).value == "MT" ) count++;
    this.getField("mTurb").value = count.value;
    Here's the problem: I tried to use a similar script, modified only slightly from this form, in another total field to tally a different choice made with comboboxes and the script continues to tally the first choice. An example of one of the modified versions of the script is below.
    var gcount = 0;
    for (var i=0; i<this.numFields; i++)
    var gname = this.getNthFieldName(i);
    if ( this.getField(gname).type == "combobox" && this.getField(gname).value == "MT" ) gcount++;
    this.getField("gPack").value = gcount.value;
    I suspect I'm just missing something painfully obvious to seasoned scripters, but I can't seem to figure it out and I need this script to be able to count the number of 9 different options in the comboboxes.

    OK, you can use a script like the following as the custom calculate script for the text fields that perform the counts:
    // Custom calculate script for text field
    (function () {
        // Declare and initialize variables
        var fn, s = "MT", count = 0;
        // Loop through the combo boxes
        for (var i = 1; i < 25; i++) {
            // Determine the current field name
            fn = "M" + util.printf("%02d", i));
            // See if the field value matches
            if (getField(fn).valueAsString === s) count++
        // Set this field value to the count
        event.value = count;
    Change the value of the "s" variable to match the item that you want to count. The first and last lines prevent the unnecessary creatio of global variables, which is good. It also makes it easy to transfer to a more general document-level routine, which would be event better, something like:
    // Custom calculate script for text field
    function getCBCount(s) {
        var fn, count = 0;
        // Loop through the combo boxes
        for (var i = 1; i < 25; i++) {
            // Determine the current field name
            fn = "M" + util.printf("%02d", i));
            // See if the field value matches
            if (getField(fn).valueAsString === s) count++
        // Set this field value to the count
        event.value = count;
    You would then call this function from the individual text boxes with the following custom calculate script:
    getCBCount("MT");
    and replace "MT" with the vlaue you want to count.

  • Set party number sequence with a specific value

    Hi all,
    I have a requirement to start the customer party number sequence from a specific number, so whenever a new customer is created the party number will be above a certain value. Any suggestions on how I can do that?
    Thanks, Mike.

    Thanks for the feedback. I got it with following SQL statements to start from 700000.
    alter sequence ar.HZ_PARTY_NUMBER_S increment by 700000 ;
    select HZ_PARTY_NUMBER_S.nextval from dual ;
    alter sequence ar.HZ_PARTY_NUMBER_S increment by 1 ;

  • Invoking a bpm process with web services with a return value

    Hello,
    Im invoking a bpm process in my application using web services. The problem is that I want to get a responde with the process id of the created process, but not wait for the finishing of the process. Is this possible?
    thank you

    Assuming this is for Oracle BPM 11g.
    I'm a novice at this and sure others will have infinitely better ideas (have I lowered your expectations enough?), but here are two thoughts. Both of these ideas assume that your child process was invoked by an Oracle BPM parent process.
    When you expose a process as a web service and invoke it asynchronously from a parent process, there is a call back service available. I've yet to figure out exactly how to get it to work, but if you look at the "Start" event's property in the composite (it's the service) you will see the callback information in the bottom dropdown. I believe what this means is that from your child process, you can use a Service activity to invoke a service that invokes the callback service back to the parent process's Service activity.
    My other idea (you're not going to like this one) would be to to invoke the subprocess using a Message Start Event activity instead of the Service activity you're currently using. If you go this route, then you could have your parent process kick off the child subprocess using a Message Start Event activity and then immediately after this have a Message Catch Event activity. The child process could have a Message Throw Event activity immediately after its Start Message Event activity that sends a notification to the parent process. The good part about this is that I've actually gotten this to work.
    You can send argument information back to the parent process, but (sorry) I don't yet know how to capture the process id.
    Wish I could be of more help and hope this helps a little.

  • Table: Only show XML with a certain value?

    I am building a table from an xml file and it is working great if I ask it to show every node.
    But I only want the row to be added if it matches a particular value in the xml.
    For example my xml has values for name, rating and enrollment.
    So something like...
    if ({@rating}=="acceptable"){
                   <tr spry:repeat="ds1" >
                           <td width="300">{@name}</td>
                           <td width="150">{@rating}</td>
                           <td width="150">{@enrollment}</td>
                   </tr>
    Any suggestions would be appreciated.
    Thanks.

    Set setXPath is probably the best way to go. See here http://labs.adobe.com/technologies/spry/samples/data_region/SetURL.html#

  • Compare column to another column with a specific value?

    What i need to do is compare a column that holds the SiteNames of holidays to another column with the DifficultyDescription of holidays.
    I want to show that sites that are not included in boldANY*bold* holiday with an “easy” or “moderate” rating.
    Some of my SiteNames have holidays with different difficulty ratings....
    e.g Yellowstone National Park(SiteName) - H2 - Moderate(DifficultyDescrip)
    Yellowstone National Park(SiteName - H3 - Strenuous(DifficultyDescrip)
    In this example i would want Yellowstone not to be in the results of my query as one of its results is 'moderate'.
    I want to show holidays that are not in boldANY*bold* holiday with 'easy' or 'moderate'
    Here is my attempt so far...
    select it220_holdet.holcode.holcode as holcode
             it220_holdet.diffdetails.diffdescrip as diffdescrip
             it220_sitedetails.sitename as sitename
    from it220_holidaydetails it220_holidaydetails,
    etc....
    where it220_sitedetails.sitename != it220_diffdetails.diffdescrip = 'Easy' <<<< where the sitename is not equal to a difficulty description of 'Easy'
    and     it220_sitedetails.sitename != it220_diffdetails.diffdescrip = 'Moderate' <<<< where the sitename is not equal to a difficulty description of 'Moderate'
    Is the logic of this correct? The error message i am getting is SQL command not properly ended.
    Is this more of a syntax problem than logic. Any help would be great.
    Thanks in advance!
    Edited by: Jay on 19-Nov-2010 02:47
    Edited by: Jay on 19-Nov-2010 02:47

    Hi,
    Ok,
    Problem is in this part of query
    where   "IT220_HOLIDAYDETAILS"."DIFFRATING"="IT220_DIFFDETAILS"."DIFFCODE"
    and      "IT220_HOLIDAYDETAILS"."HOLCODE"="IT220_LOOKUP_SITEHOLIDAY"."HOLCODE"
    and      "IT220_LOOKUP_SITEHOLIDAY"."SITECODE"="IT220_SITEDETAILS"."SITECODE"
    and "IT220_SITEDETAILS"."SITENAME" = "IT220_DIFFDETAILS"."DIFFDESCRIP"
    and "IT220_SITEDETAILS"."SITENAME" =  "IT220_DIFFDETAILS"."DIFFDESCRIP"
    Check are you joining correct columns.
    And remove possibility that tables values are in different cases
    SELECT "IT220_HOLIDAYDETAILS"."HOLCODE" AS "HOLCODE",
      "IT220_HOLIDAYDETAILS"."COUNTRYVIS"   AS "COUNTRYVIS",
      "IT220_DIFFDETAILS"."DIFFDESCRIP"     AS "DIFFDESCRIP",
      "IT220_SITEDETAILS"."SITENAME"        AS "SITENAME"
    FROM "IT220_SITEDETAILS" "IT220_SITEDETAILS",
      "IT220_LOOKUP_SITEHOLIDAY" "IT220_LOOKUP_SITEHOLIDAY",
      "IT220_DIFFDETAILS" "IT220_DIFFDETAILS",
      "IT220_HOLIDAYDETAILS" "IT220_HOLIDAYDETAILS"
    WHERE UPPER("IT220_HOLIDAYDETAILS"."DIFFRATING")  = UPPER("IT220_DIFFDETAILS"."DIFFCODE")
    AND UPPER("IT220_HOLIDAYDETAILS"."HOLCODE")       = UPPER("IT220_LOOKUP_SITEHOLIDAY"."HOLCODE")
    AND UPPER("IT220_LOOKUP_SITEHOLIDAY"."SITECODE")  = UPPER("IT220_SITEDETAILS"."SITECODE")
    AND UPPER("IT220_SITEDETAILS"."SITENAME")         = UPPER("IT220_DIFFDETAILS"."DIFFDESCRIP")
    AND UPPER("IT220_DIFFDETAILS"."DIFFDESCRIP") NOT IN('EASY','MODERATE')Regards,
    Jari

  • Distribute Layers with a Specific Value

    I found this old post where Paul Riggot created this wonderful and very useful script, something I was looking for, but just wondering if I can request for some few updates to it.
    1) Seems like this does not work properly with CC version, works with my cs4. Is it possible to support CC? The spacing distances are really off...
    2) The distances between layers are not exactly the same as specified in the dialog, is it possible to make it more accurate. So for example, if I specified 23px for the horizontal gaps, when i measure it gives me 25px.
    3) On first time, is it possible to make the horizontal and vertical input fields have zero? Right now it defaults to 10px for each.
    Here's the original binary code, which you have to copy and paste into a text file and change the file type to be "filename.jsx" to work.
    @JSXBIN@ES@[email protected]UjBj
    MhAiTjQjBjDjJjOjHhAiFjOjUjFjSjFjEACzChdhdBXzEjUjFjYjUCXzKjIjPjSjJjajPjOjUjBjMDX
    jMhAiTjQjBjDjJjOjHhAiFjOjUjFjSjFjEACBXCXzIjWjFjSjUjJjDjBjMHXEXFjGnneAnZhUnAFct0
    zGjQjBjOjFjMhREXzGjQjBjOjFjMhQFjzDjXjJjOGnneAnOyhTZhTnAFegbiOjPhAiWjFjSjUjJjDjB DzIjWjBjMjJiEjBjUjFIAhVJJBnASzDjEjMjHJAne2meDjEjJjBjMjPjHjbjUjFjYjUhahHiTjDjSjJ
    jYjUhahHhHhAhMjQjSjPjQjFjSjUjJjFjThajbjCjPjSjEjFjSiTjUjZjMjFhahHjFjUjDjIjFjEhHh
    jQjUhAiJjOjUjFjSjGjBjDjFhHhMjCj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JjHjIjFjSffZPnAnACzBhcMEXzGjTjVjCjTjUjSNjzHjWjF XzIjHjSjBjQjIjJjDjTRXzFjUjJjUjMjFSXFVGBEXzHjOjFjXiGjPjOjUTjzIiTjDjSjJjQjUiViJUR
    hEnASgcCnctffAUzCjcjchACBVgdDnndACBVgdDnndCnnOhFbhGn0ADJhGnASgcCnctffJhHnASzGjS
    DFeHiHjFjPjSjHjJjBFeKiCiPiMiEiJiUiBiMiJiDFdgaffnfACzBheVEXNjORCFdAEXPjORBFeBhOf fffnndJnJUnABXzKjPjOiDjIjBjOjHjJjOjHWXDXEXFVGBNyBnAMUbyBn0ABOVbyWn0ABJWnABXCezE jUjIjJjTXEXzHjSjFjQjMjBjDjFYXCeXRCYJibieichNichOicjEidBjHFeAffnfAEXzFjNjBjUjDjI ZXCeXRBYJibieichNichOicjEidAffn0DzAgaCYnfJZnABXWXHXEXFVGBNyBnAMZbyBn0ABOgabygbn 0ABJgbnABXCeXEXYXCeXRCYJibieichNichOicjEidBjHFeAffnfAEXZXCeXRBYJibieichNichOicj EidAffn0DgaCgdnfJgenAEXzGjDjFjOjUjFjSgbVGBnfJgfnASzEjEjPjOjFgcCncfftlhAbhBn0ACJ hBnASzBjYgdDEXzEjTjIjPjXgeVGBnfnftOhCbhDn0ACJhDnABXzIjDjBjOjDjFjMjFjEgfVGBnctfJ jFjTjVjMjUhBEEjInfnftOhIbhJn0ACJhJnAEjLRBVhBEffZhKnAnACzChBhdhCVhBEnnctbyhNn0AB
    VzBjJhVEffAVhVEAXzGjMjFjOjHjUjIhWVhOCByBMJiBnAEjzNjFjYjFjDjVjUjFiBjDjUjJjPjOhXR
    JhNnAEjzKjTjQjBjDjFiNjBjTjLjThDRCEjzIjQjBjSjTjFiJjOjUhERBXCXDXEXFVGBffEjhERBXCX HXEXFVGBffffACBVgdDnndBnAhzBhBhFVgcCAFgd4D0AiAJ40BiAgc4C0AiAhB4E0AiAG4B0AiAAFAz EjNjBjJjOhGAhWMhXbyBn0AhKJh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ftJyiGnASzFjSjPjXhRhViMVAnnftJiHnASzFjSjPjXhRhWiNWAnnftJyiHnASzFjSjPjXhR hXiOXAnnftJyiHnASzFjSjPjXhRhYiPYAnnftJyiHnASzFjSjPjXhRhZiQZAnnftJyiHnASzFjSjPjX hShQiRgaAnnftaiIbiJn0AJJiJnABXhQjhREXzJjHjFjUiCjZiOjBjNjFiSXzJjBjSjUiMjBjZjFjSj RnftJiLnABXzBhQiYVhdGXiUXhQjhRnfJiMnABXzBhRiZVhdGXzFjWjBjMjVjFiaXiYViWgcnfJyiMn
    hAiJhAjIjBjWjFhAjOjPhAjJjEjFjBhAjXjIjBjUhAjUjPhAjEjPhBffJjCnABXhIXhJjhKVhHAnfZj
    ABXzBhSibVhdGXiaXiZViWgcnfJiNnABXzBhTicVhdGXiaXibViWgcnfJyiNnABXzBhUidVhdGXiaXi cViWgcnfJiOnAEXhUVhcFRBVhdGffJiPnAShdGAnnffAViVgbAXhWVhSDByBMJiRnAShcFEXzEjTjPj SjUieVhcFnfnffJyiSnAEXieVhcFRBNyBnAMiSbyBn0ABZiSnACzBhNifXibViVAXibVzBjCjABnnAC iV40BhAjA4B0AhAC0AgaCiSffJiTnASzLjBjSjSjBjZiOjVjNjCjFjSjBgdndBftJiUnAEXhUVheHRB XiYVhcFffaiVbyiWn0ABOiWbyiXn0ABJiXnAEXhUEjzEjFjWjBjMjCRBCzBhLjDnVjBgdeDjSjPjXnf fRBQgaVhcFVzBjGjEgeffAUzChGhGjFCVXibQgaVhcFVjEgeCifXibQgaVhcFCifVjEgenndBnndhSn nCMXibQgaVhcFVjEgeCjDXibQgaVhcFCifVjEgenndBnndhSnnnnbiZn0ACJiZnATjBgdBtJianAEXh UEjjCRBCjDnVjBgdeDjSjPjXnffRBQgaVhcFVjEgeffAVjEgeBXhWVhcFByBMaidbyien0ABJyienAE XieEjjCRBCjDnCjDVzBjEjGgfnndBeDjSjPjXnffRBNyBnAMiebyBn0ABZienACifXiZViVAXiZVjAB nnACiV40BhAjA4B0AhAC0AgaCieffAVjGgfAVjBgdByBMOjAbjBn0ADJjBnAEjLRBFehAiTjPjSjSjZ DnAnAChCCzBhKjHXhWVheHVjBgdnnXhWVhcFnnnajFbjGn0ACJjGnASzKjMjFjGjUiBjOjDjIjPjSjI
    hHnnEjhERBXibQgaEjjCRBCjDnCjDViVgbnndBeDjSjPjXnffVjJhAffnnnftJjVnAEXjNXhQjhRRCF
    hBEjhERBXicXiYEjjCRBCjDnCjDVzBjMjJhAnndBeDjSjPjXnffffnftajHbjIn0AFJjInABXhQjhRE XiSXiTjhRRBXiYQgaEjjCRBCjDnCjDVjJhAnndBeDjSjPjXnffViVgbffnfJjJnASzFiXjJjEjUjIjK hCCifEjhERBXicQgaEjjCRBCjDnCjDVjJhAnndBeDjSjPjXnffViVgbffEjhERBXiZQgaEjjCRBCjDn CjDVjJhAnndBeDjSjPjXnffViVgbffnnnftJjKnASzLjTjIjJjGjUiQjJjYjFjMjTjLhDCifCjDVjIh BVzIjTjQjBjDjJjOjHiBjMhGnnEjhERBXiZQgaEjjCRBCjDnCjDVjJhAnndBeDjSjPjXnffViVgbffn nnftJjLnAEXzJjUjSjBjOjTjMjBjUjFjNXhQjhRRCVjLhDFdAffJjMnASjIhBCjDnCjDVjKhCVjMhGn nnnntfAViVgbBXhWEjjCRBCjDnCjDVjJhAnndBeDjSjPjXnffByBMAVjJhAAVjBgdByBMajPbjQn0AC JjQnASzJjUjPjQiBjOjDjIjPjSjOhEEjhERBXidQgaVheHVjJhAffnftajRbjSn0AFJjSnABXhQjhRE XiSXiTjhRRBXiYQgaEjjCRBCjDnCjDViVgbnndBeDjSjPjXnffVjJhAffnfJjTnASzGiIjFjJjHjIjU jPhFCifEjhERBXidQgaEjjCRBCjDnCjDViVgbnndBeDjSjPjXnffVjJhAffEjhERBXibQgaEjjCRBCj DnCjDViVgbnndBeDjSjPjXnffVjJhAffnnnftJjUnASjLhDCifCjDVjOhEVzIjTjQjBjDjJjOjHiEjQ dAVjLhDffJjWn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read in the forums that Paul has stopped being active anymore which is a big shame. I did find his site with the source file for this distribute script. I just hope maybe someone here can help to support CC version, work properly and make it more accurate. It's a great script but its very important to make exact spacing values. Other wise, this is no better than the built in distribute tools of Photoshop.
    here's the script code:
    function main(){
    if(!documents.length) return;
    var win = new Window('dialog','Space Layers');
    g = win.graphics;
    var myBrush = g.newBrush(g.BrushType.SOLID_COLOR, [0.99, 0.99, 0.99, 1]);
    g.backgroundColor = myBrush;
    win.p1= win.add("panel", undefined, undefined, {borderStyle:"black"});
    win.g1 = win.p1.add('group');
    win.g1.orientation = "row";
    win.title = win.g1.add('statictext',undefined,'Space Layers');
    win.title.alignment="fill";
    var g = win.title.graphics;
    g.font = ScriptUI.newFont("Georgia","BOLDITALIC",22);
    win.g5 =win.p1.add('group');
    win.g5.orientation = "row";
    win.g5.alignment='fill';
    win.g5.spacing=3;
    win.g5.st1 = win.g5.add('statictext',undefined,'Horizontal');
    win.g5.et1 = win.g5.add('edittext',undefined,'20');
    win.g5.et1.preferredSize=[50,20];
    win.g5.st1a = win.g5.add('statictext',undefined,'px');
    win.g5.st10 = win.g5.add('statictext',undefined,'');
    win.g5.st10.preferredSize=[55,20];
    win.g5.st2 = win.g5.add('statictext',undefined,'Vertical');
    win.g5.et2 = win.g5.add('edittext',undefined,'20');
    win.g5.et2.preferredSize=[50,20];
    win.g5.st2a = win.g5.add('statictext',undefined,'px');
    win.g10 =win.p1.add('group');
    win.g10.orientation = "row";
    win.g10.alignment='fill';
    win.g10.spacing=10;
    win.g10.st1 = win.g10.add('statictext',undefined,'Plus ~ Minus Pixels ,Top of Layers');
    win.g10.et1 = win.g10.add('edittext',undefined,'50');
    win.g10.et1.helpTip="This is the amount of top pixels can differ\nFor a low res document use a lower number\rFor a high res document use a higher number"
    win.g10.et1.preferredSize=[50,20];
    win.g10.et1.onChanging = function() {
      if (this.text.match(/[^\-\.\d]/)) {
        this.text = this.text.replace(/[^\-\.\d]/g, '');
    win.g15 =win.p1.add('group');
    win.g15.orientation = "row";
    win.g15.alignment='fill';
    win.g15.spacing=10;
    win.g15.bu1 = win.g15.add('button',undefined,'Space Layers');
    win.g15.bu1.preferredSize=[150,30];
    win.g15.bu2 = win.g15.add('button',undefined,'Cancel');
    win.g15.bu2.preferredSize=[150,30];
    if(version.substr(0,version.indexOf('.'))<10){
        alert("Sorry this script is only valid for Photoshop CS3 or higher");
        return;
    win.g5.et1.onChanging = function() {
      if (this.text.match(/[^\-\.\d]/)) {
        this.text = this.text.replace(/[^\-\.\d]/g, '');
    win.g5.et2.onChanging = function() {
      if (this.text.match(/[^\-\.\d]/)) {
        this.text = this.text.replace(/[^\-\.\d]/g, '');
    win.g15.bu1.onClick=function(){
    if(win.g5.et1.text== ''){
        alert("No horizontal pixels entered");
        return;
    if(win.g5.et2.text== ''){
        alert("No vertical pixels entered");
        return;
    var plusMinus =0;
    if(Number(win.g10.et1.text) < 1) {
        plusMinus=2;
        }else{
            plusMinus=Number(win.g10.et1.text);
    win.close(1);
    spaceMasks(Number(win.g5.et1.text),Number(win.g5.et2.text),plusMinus)
    win.center();
    win.show()
    function spaceMasks(spacingA,spacingD,plusMinus){
    var startRulerUnits = app.preferences.rulerUnits;
    app.preferences.rulerUnits = Units.PIXELS;
    var selectedLayers = getSelectedLayersIdx();
    if(selectedLayers.length <2){
        alert("Not enough layers selected!");
        return;
    var boundsList=[];
    var tempbnds=[];
    showFX(false);
    for(var a=0;a<selectedLayers.length;a++){
        var LB =getLayerBoundsByIndex(selectedLayers[a] );
        boundsList.push([[selectedLayers[a]],[LB[0]],[LB[1]],[LB[2]],[LB[3]]]);
        tempbnds=[];
    showFX(true);
    boundsList.sort(function(a,b){return a[2]-b[2];});
    var row1=[]; var row2=[]; var row3=[]; var row4=[]; var row5=[];
    var row6=[]; var row7=[]; var row8=[]; var row9=[]; var row10=[];
    var row11=[]; var row12=[]; var row13=[]; var row14=[]; var row15=[];
    var row16=[]; var row17=[]; var row18=[]; var row19=[]; var row20=[];
    var row21=[]; var row22=[]; var row23=[]; var row24=[]; var row25=[];
    var row26=[]; var row27=[]; var row28=[]; var row29=[]; var row30=[];
    var row31=[]; var row32=[]; var row33=[]; var row34=[]; var row35=[];
    var row36=[]; var row37=[]; var row38=[]; var row39=[]; var row40=[];
    var row41=[]; var row42=[]; var row43=[]; var row44=[]; var row45=[];
    var row46=[]; var row47=[]; var row48=[]; var row49=[]; var row50=[];
    var row51=[]; var row52=[]; var row53=[]; var row54=[]; var row55=[];
    var row56=[]; var row57=[]; var row58=[]; var row59=[]; var row60=[];
    var row61=[]; var row62=[]; var row63=[]; var row64=[]; var row65=[];
    var row66=[]; var row67=[]; var row68=[]; var row69=[]; var row70=[];
    var row71=[]; var row72=[]; var row73=[]; var row74=[]; var row75=[];
    var row76=[]; var row77=[]; var row78=[]; var row79=[]; var row80=[];
    var row81=[]; var row82=[]; var row83=[]; var row84=[]; var row85=[];
    var row86=[]; var row87=[]; var row88=[]; var row89=[]; var row90=[];
    var row91=[]; var row92=[]; var row93=[]; var row94=[]; var row95=[];
    var row96=[]; var row97=[]; var row98=[]; var row99=[]; var row100=[];
    var row101=[]; var row102=[]; var row103=[]; var row104=[]; var row105=[];
    var row106=[]; var row107=[]; var row108=[]; var row109=[]; var row110=[];
    var row111=[]; var row112=[]; var row113=[]; var row114=[]; var row115=[];
    var row116=[]; var row117=[]; var row118=[]; var row119=[]; var row120=[];
    var arrayNumber =1;
    var TOP =Number(boundsList[0][2]);
    for(var f =0;f<boundsList.length;f++){
        if(TOP > (boundsList[f][2]-plusMinus) && boundsList[f][2] < (boundsList[f][2]+plusMinus)){
            eval("row" +arrayNumber).push(boundsList[f]);
            }else{
                TOP =Number(boundsList[f][2]);
                arrayNumber++;
                eval("row" +arrayNumber).push(boundsList[f]);
    for(var d=0;d<arrayNumber;d++){
        eval("row" +(d+1)).sort(function(a,b){return a[1]-b[1];});
    if((row1.length*arrayNumber) != boundsList.length){
        alert("Unable to distribute this selection of layers!");
        return;
    for(var l=0;l<arrayNumber;l++){
    var leftAnchor =Number(eval("row"+(l+1))[0][3]);
    for(var a = 1;a<eval("row"+(l+1)).length;a++){
    makeActiveByIndex(Number(eval("row"+(l+1))[a][0]),false);
    var Width = Number(eval("row"+(l+1))[a][3]) - Number(eval("row"+(l+1))[a][1]);
    var shiftPixels = (leftAnchor+spacingA) - Number(eval("row"+(l+1))[a][1]);
    activeDocument.activeLayer.translate(shiftPixels,0);
    leftAnchor +=(Width+spacingA);
    for(var l=0;l<row1.length;l++){
    var topAnchor =Number(row1[l][4]);
    for(var a = 1;a<arrayNumber;a++){
    makeActiveByIndex(Number(eval("row"+(a+1))[l][0]),false);
    var Height = Number(eval("row"+(a+1))[l][4]) - Number(eval("row"+(a+1))[l][2]);
    var shiftPixels = (topAnchor+spacingD) - Number(eval("row"+(a+1))[l][2]);
    activeDocument.activeLayer.translate(0,shiftPixels);
    topAnchor +=(Height+spacingD);
    for(var a in selectedLayers){
        makeActiveByIndex(Number(selectedLayers[a]),false,true);
    app.preferences.rulerUnits = startRulerUnits;
    main();
    function selectLayerByIdx(idx, add) {
        var ref = new ActionReference();
        ref.putIndex(charIDToTypeID('Lyr '), idx);
        var desc = new ActionDescriptor();
        desc.putReference(charIDToTypeID('null'), ref);
        if(add) desc.putEnumerated(stringIDToTypeID('selectionModifier'), stringIDToTypeID('selectionModifierType'), stringIDToTypeID('addToSelection'));
        desc.putBoolean(charIDToTypeID('MkVs'), false);
        executeAction(charIDToTypeID('slct'), desc, DialogModes.NO);
    function makeActiveByIndex( idx, visible,add ){
        if(add == undefined) add=false;
        var desc = new ActionDescriptor();
          var ref = new ActionReference();
          ref.putIndex(charIDToTypeID( "Lyr " ), idx)
          desc.putReference( charIDToTypeID( "null" ), ref );
          if(add) desc.putEnumerated(stringIDToTypeID('selectionModifier'), stringIDToTypeID('selectionModifierType'), stringIDToTypeID('addToSelection'));
          desc.putBoolean( charIDToTypeID( "MkVs" ), visible );
       executeAction( charIDToTypeID( "slct" ), desc, DialogModes.NO );
    function getSelectedLayersIdx(){
          var selectedLayers = new Array;
          var ref = new ActionReference();
          ref.putEnumerated( charIDToTypeID("Dcmn"), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
          var desc = executeActionGet(ref);
          if( desc.hasKey( stringIDToTypeID( 'targetLayers' ) ) ){
             desc = desc.getList( stringIDToTypeID( 'targetLayers' ));
              var c = desc.count
              var selectedLayers = new Array();
              for(var i=0;i<c;i++){
                try{
                   activeDocument.backgroundLayer;
                   selectedLayers.push(  desc.getReference( i ).getIndex() );
                }catch(e){
                   selectedLayers.push(  desc.getReference( i ).getIndex()+1 );
           }else{
             var ref = new ActionReference();
             ref.putProperty( charIDToTypeID("Prpr") , charIDToTypeID( "ItmI" ));
             ref.putEnumerated( charIDToTypeID("Lyr "), charIDToTypeID("Ordn"), charIDToTypeID("Trgt") );
             try{
                activeDocument.backgroundLayer;
                selectedLayers.push( executeActionGet(ref).getInteger(charIDToTypeID( "ItmI" ))-1);
             }catch(e){
                selectedLayers.push( executeActionGet(ref).getInteger(charIDToTypeID( "ItmI" )));
          return selectedLayers;
    function getLayerBoundsByIndex( idx ) {
        var ref = new ActionReference();
        ref.putProperty( charIDToTypeID("Prpr") , stringIDToTypeID( "bounds" ));
        ref.putIndex( charIDToTypeID( "Lyr " ), idx );
        var desc = executeActionGet(ref).getObjectValue(stringIDToTypeID( "bounds" ));
        var bounds = [];
        bounds.push(desc.getUnitDoubleValue(stringIDToTypeID('left')));
        bounds.push(desc.getUnitDoubleValue(stringIDToTypeID('top')));
        bounds.push(desc.getUnitDoubleValue(stringIDToTypeID('right')));
        bounds.push(desc.getUnitDoubleValue(stringIDToTypeID('bottom')));
        return bounds;
    function showFX(FX) {
        var desc48 = new ActionDescriptor();
            var ref34 = new ActionReference();
            ref34.putProperty( charIDToTypeID('Prpr'), charIDToTypeID('lfxv') );
            ref34.putEnumerated( charIDToTypeID('Dcmn'), charIDToTypeID('Ordn'), charIDToTypeID('Trgt') );
        desc48.putReference( charIDToTypeID('null'), ref34 );
            var desc49 = new ActionDescriptor();
            desc49.putBoolean( charIDToTypeID('lfxv'), FX );
        desc48.putObject( charIDToTypeID('T   '), charIDToTypeID('lfxv'), desc49 );
        try{
        executeAction( charIDToTypeID('setd'), desc48, DialogModes.NO );
        }catch(e){}

  • Opening struts-config/ web.xml with Internet explorer

    Hi,
    I m facing a problem if i m tryin to open struts-config.xml or any other xml file using internet explorer.
    Following is the error which i got:
    The XML page cannot be displayed
    Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.
    The system cannot locate the resource specified. Error processing resource 'http://jakarta.apache.org/struts/dtds/struts-co...
    Please help me in finding the solution for this.
    Thanks in Advance.

    hi
    I think your IE's security settings are causing this error. If you check
    Internet options -> Security, you'll see an option
    "access data sources across domains". Enable this option and try once again.

Maybe you are looking for

  • "more info" in Get Info showing "--" instead of actual infos for newer videos and images

    I've just noticed that when I click on "Get Info" on my newer pictures and videos, the "more info" section is now showing "--" instead of the dimensions of the images and videos. However when I go to my older files, the info is showing. Also if I sea

  • Mac iPod charge on Windows PC?

    Will my Mac formatted iPod (Nano) charge when connected to a Windows PC? We all know you can't access a Mac-formatted iPod on a PC and vice versa, but would it still charge if connected? I just want it to charge, that's all. Or is the charging functi

  • Change font size on macbook pro 15 retina

    HELP... Cant see the words can someone please tell me how to change font size on macbook pro 15 retina... I have this HUGE screen but the font on the screen is SUPER small.... can someone help me

  • Conversion factor plant or any other organizational unit wise

    Dear Experts, Is it posible to maintain the conversion factor between base unit and alter nate unit plant or any other organizational unit wise? Please suggest. Rgds

  • How much does it cost for iphone4 ic?

    There seems to be a problem with my iphone4. I think it was the IC. How much does it cost for replacement? Or is it still repairable? Anyone out there knows my concern?