Handling file objects in the EJB layer

It is seen that file handling in the EJB violates the specs.
But, I have the requirement to read and parse some xpdl(xml specification) file in EJB.
The parsing function is already in the EJB layer and the filepath is obtained as input from jsp(in the request) in a servlet.
Im passing the filepath as a parameter to the bean method before parsing.
Now the requirement is to construct the File object out of xpdl file and pass it as a parameter to EJB method. How can this be achieved?

Hi,
I'm not sure if this is helpful or not, but I just wanted to ask: If you know you need to parse the file on the EJB side, why not just go and do it? If you can always guarantee that files will be present in the same location that the beans are deployed to, then I don't think there is anything stopping you from reading them, if you know the full path to each file?
You wrote that the path to the file is obtained from a JSP page. If those files need to be parsed anyway, you could move the parsing code to your JSPs (servlets), and use ServletContext.getResourceAsStream to read the contents. Then you could send the contents as a parameter to your EJB call.
One last thing: if the files are large, you might want to consider using JMS and message-driven beans to do the reading/parsing job. Your MDBs could then call the EJBs, but you would have to return your results in an asynchronous manner.
Just a couple of thoughts.
Mark

Similar Messages

  • Getting the Request Object in the EJB published as a Web Service

    Hi experts,
    I have a Portal Service that call a BAPI in a back-end system with the Connector Framework. I have a Portal Component that calls the Portal Service, passing the Locale (request.getLocale()) and the User (request.getUser()) object. It's work fine!
    I need to call the Portal Service by an EJB that is published as a Web Service. The connection between the EJB and Portal Service is ok, but I don't know how to get the Locale and the User object in the EJB to pass to the Portal Service.
    Is possible to get the request object from the HTTP SOAP Request?
    Thanks,
    Gustavo

    Hey Alice!
    The Feature Hashing module is actually a wrapper around
    Vowpal Wabbit's implementation of the murmurhash. Thus, it takes text in, and produces 2^N new features based on the text, where N is the bitsize specified in the module. These features (and not the original text!) should be used during model training.
    The Learner will then keep track of these features behind the scenes.
    When you publish your web service and these features are recomputed for new input text (same N), they are used as the features for scoring.
    Does that make sense?
    Regards,
    AK

  • Mvc structure in the ejb layer

    hello
    i am familiar with the mvc structure in the web layer,but i wonder how can i implement the mvc struction in the ejb layer.
    i can use the stateless session bean as the controller,but in the web layer,i can use the url to identify the different request,and path information,but in the ejb container,it seem like there isn't such machanism,how can the controller(session bean) reforward the different request?where can i find the sample code of the sessin bean controller?is it included within the petstore?
    thank you!

    Hi,
    If u have got the code for the same, please let me know.
    Seetesh

  • How do I use "Generate" to produce multiple file formats from the "Default" layer?

    I have a Photoshop file with ~50 layers, each with unique file names for images I want to create.  I want to produce in both .png and .svg file formats for each layer.
    Rather than adding the code to each layer individually can multiple file formats be assigned on the "Default" layer? What is the correct syntax to do that?
    Something like:
    default  100% .png, svg/ *.svg
    ... to generate the .png versions and then also create a folder called "svg" that contains all the .svg versions of those images?

    Dear Thomas,
    I entered TM and found the sparsebundle under the Filesync library. However, it appears NOT to be recoverable and I tried double clicking on it but it doesnt do anything other than show a summary of what it is.
    By the way, I really do appreciate your comments and agree completely. Something strange happened with my syncing of Idisk (which is set to "automatic"). It has been working fine for years. But for some reason, it stopped two days ago and did not let me know. When I tried to put something manually on it (through drag/drop), it never showed up on the Idisk on the cloud which made me notice and check it out by going to Mobileme through the browser. I then went to the tech service for Idisk and they explained that something probably got corrupted so just hit STOP syncing and then hit Automatic again. Which is what I did. Then everything from the cloud went to my Idisk on my computer and for some reason, the latest version of my excel spread sheet for attendance showed two days ago, not last night. so I lost wed/thursday classes. I KNOW it was on my Laptop which is backed up to TM every morning.. Thats why I believe that the latest file IS on my TM backup for this morning. But I can't get to it. Any other help would be appreciated.
    Skip

  • How to bind Hibernate domain objects to the UI layer

    Dear All,
    I am trying to bind FX UI controls to properties of a Hibernate Domain object. Is there any good example to refer to for this purpose?
    Thanks & Regards,
    Nitin Gupta

    Assuming you do not formulate your hibernate objects as pojos with javafx properties directly, if the hibernate object is a pojo with or without PCL, you can convert the properties of the pojo to observable values (or properties) directly. These are used in a bind statement.
    Check out what jgoodies does with BeanAdapter or PresentationModel. You need the same concept. I've attached a class that does this for a pojo already (its an incomplete port of jgoodies PresentationModel). It will work for any pojo. It does not have setter support as it was just a demonstration. Its efficient for a pojo with a large number of properties. You could also write a very short property connector to produce one observable value per property. The value of the class below is to be able to swap out the bean being observed without having to change or reset the property observable values each time. Bind once and then just reset the bean (think master detail).
    package scenegraphdemo;
    import java.beans.PropertyChangeEvent;
    import java.beans.PropertyChangeListener;
    import java.lang.reflect.Method;
    import java.util.HashMap;
    import java.util.Map;
    import javafx.beans.property.ObjectProperty;
    import javafx.beans.property.ObjectPropertyBase;
    import javafx.beans.property.Property;
    import javafx.beans.property.StringProperty;
    import javafx.beans.value.ChangeListener;
    import javafx.beans.value.ObservableValue;
    import javafx.beans.value.WritableValue;
    * An object binding object that creates object bindings based on property names
    * specified as strings. This is a convenience class to avoid having observable
    * values directly dependent on the underlying bean. The actual bean the
    * properties connect can be changed dynamically using the channel or
    * <code>setBean</code>. This allows you to setup binding when you don't have
    * the bean to bind to or the bean to bind to will change as in the detail part
    * of a master-detail screen. Generally, the return values from
    * <code>getProperty()</code> should be used for binding not the factory itself.
    * The object should be a domain object bean with bean methods to get or set the
    * value using java bean naming conventions OR it should use javafx property
    * definition conventions. The factory will automatically listen for standard
    * java bean changes using <code>PropertyChangeListener</code> approaches unless
    * you indicate to not to.
    * <p>
    * When the bean itself changes, the properties fire to indicate that their
    * values may have changed and the observing object should update itself. This
    * object allows you to integrate your javafx/POJOs into the binding
    * infrastructure without being dependent on the actual underlying bean. If you
    * are familiar with jgoodies <code>BindingAdapter</code> this is a similar
    * class.
    * <p>
    * This only handles reading bean properties. Need to add set() logic.
    * <p>
    * TODO: Make this work better. Many corner cases to cover.
    * <p>
    * TODO: Instead of just method calls on POJOs, also check for PCL. Note that
    * javafx properties won't work easily they are always tied to the underlying
    * object so I would have to write another CaptiveObjectProperty object that is
    * essentially a delegator.
    public class BeanPropertyFactory<T> extends ObjectProperty<T> {
         ObservableValue<T> channel;
         Map<String, CaptiveObjectProperty> properties = new HashMap<String, CaptiveObjectProperty>();
         boolean listenForBeanPCLEvents = true;
         public boolean isListenForBeanPCLEvents() {
              return listenForBeanPCLEvents;
         public void setListenForBeanPCLEvents(boolean listenForBeanPCLEvents) {
              this.listenForBeanPCLEvents = listenForBeanPCLEvents;
              if (getBean() != null)
                   removeBeanPCLListener(getBean());
          * The bean channel where the bean is obtained.
          * @return
         public ObservableValue<T> getChannel() {
              return channel;
         public BeanPropertyFactory() {
              setChannel(new ObjectProperty());
         public BeanPropertyFactory(ObservableValue<T> channel) {
              if (channel == null)
                   setChannel(new ObjectProperty());
              else
                   setChannel(channel);
         protected void setChannel(ObservableValue<T> channel) {
              if (this.channel != null) {
                   removeBeanChangeListener(this.channel);
              this.channel = channel;
              if (this.channel != null) {
                   addBeanChangeListener(this.channel);
                   updateStringProperty(getBean());
              invalidateProperties();
              fireValueChangedEvent();
         protected StringProperty stringProperty = new StringProperty();
          * The string property is an observable toString property. It cannot be set.
          * @return
         public StringProperty beanStringProperty() {
              return stringProperty;
         public String getBeanString() {
              return beanStringProperty().getValue();
          * A listener that listens to changes in the bean channel. This only fires
          * when the bean changes not when the properties on the bean change. The
          * default actions updates the "string" property representation of this
          * object as well as attaches property change listeners.
          * @author Mr. Java
         protected class BeanChangeListener implements ChangeListener {
              @Override
              public void changed(ObservableValue arg0, Object arg1, Object arg2) {
                   if (arg1 != null) {
                        BeanPropertyFactory.this.removeBeanPCLListener(arg1);
                   if (arg2 != null) {
                        BeanPropertyFactory.this.addBeanPCLListener(arg2);
                   updateStringProperty(arg2);
         protected void updateStringProperty(Object obj) {
              if (obj != null)
                   beanStringProperty().setValue(obj.toString());
              else
                   beanStringProperty().setValue("null");
         protected void removeBeanChangeListener(ObservableValue<T> obj) {
              if (beanChangeListener == null)
                   beanChangeListener = createBeanChangeListener();
              if (obj != null) {
                   obj.addListener(beanChangeListener);
         protected void addBeanChangeListener(ObservableValue<T> obj) {
              if (beanChangeListener == null)
                   beanChangeListener = createBeanChangeListener();
              if (obj != null)
                   obj.removeListener(beanChangeListener);
          * The instance of a change listener for detecting when the bean in the bean
          * channel changes.
         ChangeListener beanChangeListener = new BeanChangeListener();
          * Subclass can override to create their bean change listener.
          * @return
         protected ChangeListener createBeanChangeListener() {
              return new BeanChangeListener();
         public BeanPropertyFactory(T bean) {
              setChannel(new ObjectProperty(bean));
         public Property getProperty(String property) {
              if (property == null || property.isEmpty())
                   throw new IllegalArgumentException("Property cannot be null");
              if (properties.containsKey(property))
                   return properties.get(property);
              CaptiveObjectProperty p = new CaptiveObjectProperty(this, property);
              properties.put(property, p);
              return p;
         @Override
         public T getValue() {
              return getBean();
          * A listener that listens for property change events on the bean. When the
          * bean changes, the listener must be removed then attached to the new bean
          * but can use the same instance of this class. The action is to inform any
          * existing property objects that the property has changed. The detection of
          * property changes is centralized in the factory class for efficiency.
         protected class BeanPropertyListener implements PropertyChangeListener {
              @Override
              public void propertyChange(PropertyChangeEvent evt) {
                   if (properties.containsKey(evt.getPropertyName())) {
                        CaptiveObjectProperty p = properties.get(evt.getPropertyName());
                        p.propertyChanged();
                   updateStringProperty(getBean());
          * The cached listener instance to listen to the bean (in the bean channel)
          * property change events if it supports PCL.
         PropertyChangeListener beanPropertyListener;
          * Subclasses can override to implement their own behavior. Its best to
          * extend from <code>BeanPropertyListiner</code> to include the default
          * behavior.
          * @return
         protected PropertyChangeListener createBeanPropertyListener() {
              return new BeanPropertyListener();
          * Add a listener only if the PCL methods exist. This listens for property
          * changes on the bean's property not changes in the actually bean held by
          * the bean channel.
         protected void addBeanPCLListener(Object obj) {
              if (!isListenForBeanPCLEvents())
                   return;
              if (obj != null) {
                   if (BeanPropertyUtils.hasPCL(obj.getClass())) {
                        if (beanPropertyListener == null)
                             beanPropertyListener = createBeanPropertyListener();
                        BeanPropertyUtils.addPCL(obj, beanPropertyListener, null);
          * Remove a listener only if the PCL methods exist.
          * @see #attachBeanPCLListener
         protected void removeBeanPCLListener(Object obj) {
              if (obj != null) {
                   if (BeanPropertyUtils.hasPCL(obj.getClass())) {
                        if (beanPropertyListener == null)
                             beanPropertyListener = createBeanPropertyListener();
                        BeanPropertyUtils.removePCL(obj, beanPropertyListener, null);
          * Invalidate the properties in the property cache. Then changed the bean in
          * the bean channel. Then fire a value changed event.
          * @param bean
         public void setBean(T bean) {
              invalidateProperties();
              if (getChannel() instanceof WritableValue) {
                   ((WritableValue) getChannel()).setValue(bean);
              } else {
                   throw new IllegalArgumentException(
                             "Could not set bean value into a non-writable bean channel");
              fireValueChangedEvent();
          * Called to indicate that the underlying bean changed.
         protected void invalidateProperties() {
              for (CaptiveObjectProperty p : properties.values()) {
                   p.invalidate();
         public T getBean() {
              return getChannel().getValue();
          * Lazily get the method representing the property prior to getting or
          * setting. Because this is a property, it can also be bound to.
          * @author Mr. Java
          * @param <T>
         protected static class CaptiveObjectProperty<T> extends
                   ObjectPropertyBase<T> {
               * The string name of the property.
              String readPropertyName, writePropertyName;
               * If the property is really a javafx property, it is stored here.
              Property<T> enhancedProperty;
               * Used if the property is not an enhanced property.
              Method readMethod, writeMethod;
               * The factory that holds the bean we obtain values against.
              BeanPropertyFactory factory;
              public CaptiveObjectProperty(BeanPropertyFactory factory,
                        String property) {
                   this.readPropertyName = property;
                   this.factory = factory;
              public CaptiveObjectProperty(BeanPropertyFactory factory,
                        String property, String writePropertyName) {
                   this.readPropertyName = property;
                   this.writePropertyName = writePropertyName;
                   this.factory = factory;
              @Override
              public Object getBean() {
                   if (factory == null || factory.getBean() == null)
                        return null;
                   return factory.getBean();
              @Override
              public void store(T value) {
                   if (writeMethod == null && enhancedProperty == null) {
                        getWriteMethod(value.getClass());
                   if (writeMethod == null && enhancedProperty == null) {
                        return;
                   try {
                        if (enhancedProperty != null) {
                             enhancedProperty.setValue(value);
                             return;
                        if (getBean() == null)
                             return;
                        writeMethod.invoke(getBean(), value);
                        return;
                   } catch (Exception e) {
                        e.printStackTrace();
              @Override
              public T getValue() {
                   if (readMethod == null && enhancedProperty == null) {
                        getReadMethod();
                   if (readMethod == null && enhancedProperty == null)
                        return null;
                   try {
                        if (enhancedProperty != null)
                             return enhancedProperty.getValue();
                        if (factory.getBean() == null)
                             return null;
                        Object rval = readMethod.invoke(getBean());
                        return (T) rval;
                   } catch (Exception e) {
                        e.printStackTrace();
                   return null;
              @Override
              public String getName() {
                   return readPropertyName;
               * Invalidate the method. Perhaps the bean changed to another object and
               * we should find the method on the new object. This is called prior to
               * the <code>getBean()</code> being changed.
              public void invalidate() {
                   readMethod = null;
                   fireValueChangedEvent();
               * This is used to externally signal that the property has changed. It
               * is quite possible that this object does not detect those changes and
               * hence, an external object (in all cases the BeanPropertyFactory) will
               * signal when a change occurs. Property change detection is centralized
               * in the factory for efficiency reasons.
              public void propertyChanged() {
                   fireValueChangedEvent();
              protected Property getJavaFXReadProperty(String propertyName) {
                   if (factory.getBean() == null)
                        return null;
                   String methodName = getName() + "Property";
                   try {
                        Method mtmp = factory.getBean().getClass()
                                  .getMethod(methodName, new Class<?>[0]);
                        enhancedProperty = (Property) mtmp.invoke(factory.getBean(),
                                  new Object[0]);
                        return enhancedProperty;
                   } catch (Exception e) {
                        // e.printStackTrace();
                        // silently fail here
                   return null;
              protected void getWriteMethod(Class<?> argType) {
                   if (factory == null || factory.getBean() == null)
                        return;
                   if (enhancedProperty == null)
                        enhancedProperty = getJavaFXReadProperty(getName());
                   if (enhancedProperty != null)
                        return;
                   writeMethod = getPojoWriteMethod(getName(), argType);
               * Sets the method, either an enhanced property or the POJO method via
               * reflection.
               * @return
              protected void getReadMethod() {
                   if (factory == null || factory.getBean() == null)
                        return;
                   enhancedProperty = getJavaFXReadProperty(getName());
                   if (enhancedProperty != null)
                        return;
                   // Look for standard pojo method.
                   readMethod = getPOJOReadMethod(getName());
               * Return a get method using reflection.
               * @param propertyName
               * @return
              protected Method getPOJOReadMethod(String propertyName) {
                   if (factory.getBean() == null)
                        return null;
                   // Look for standard pojo method.
                   String methodName = getGetMethodName();
                   try {
                        Method mtmp = factory.getBean().getClass()
                                  .getMethod(methodName, new Class<?>[0]);
                        return mtmp;
                   } catch (Exception e) {
                        // silently fail here
                        // e.printStackTrace();
                   return null;
              protected String getGetMethodName() {
                   String methodName = "get"
                             + Character.toUpperCase(getName().charAt(0));
                   if (getName().length() > 1)
                        methodName += getName().substring(1);
                   return methodName;
               * Return a set method using reflection.
               * @param propertyName
               * @param argType
               * @return
              protected Method getPojoWriteMethod(String propertyName,
                        Class<?> argType) {
                   if (factory.getBean() == null)
                        return null;
                   String methodName = getSetMethodName();
                   try {
                        Method mtmp = factory.getBean().getClass()
                                  .getMethod(methodName, argType);
                        return mtmp;
                   } catch (Exception e) {
                        // silently fail here
                        // e.printStackTrace();
                   return null;
              protected String getSetMethodName() {
                   String methodName = "set"
                             + Character.toUpperCase(getName().charAt(0));
                   if (getName().length() > 1)
                        methodName += getName().substring(1);
                   return methodName;
          * Obtain a property using the binding path. The binding path should be
          * simple property names separated by a dot. The bean has to specified
          * because the return value is a property that can be used directly for
          * binding. The first property specified in the binding path should be a
          * property on the bean.
          * <p>
          * The difference between this and <code>Bindings.select()</code> is not
          * much other that it uses the bean factory machinery and the path can be
          * specified as a string. Of course, the bean can be a plain pojo.
          * @param bindingPath
          * @return
         public static Property propertyFromBindingPath(Object bean,
                   String bindingPath) {
              if (bindingPath == null || bindingPath.isEmpty())
                   return null;
              BeanPropertyFactory lastFactory = null;
              Property lastProperty = null;
              String[] parts = bindingPath.split("\\.");
              if (parts.length > 0) {
                   for (int i = 0; i < parts.length; i++) {
                        if (parts.length() <= 0 || parts[i].isEmpty()) {
                             throw new IllegalArgumentException("Binding path part " + i
                                       + " has no length");
                        BeanPropertyFactory newFactory;
                        if (i == 0)
                             newFactory = new BeanPropertyFactory(bean);
                        else
                             newFactory = new BeanPropertyFactory(
                                       (WritableValue) lastProperty);
                        lastProperty = newFactory.getProperty(parts[i].trim());
                        lastFactory = newFactory;
              return lastProperty;
         * Alot like <code>Bindings.select</code> but also handles pojos.
         * @param bean
         * @param path
         * @return
         public static Property propertyFromBindingPath(Object bean, String... path) {
              String tmp = "";
              for (int i = 0; i < path.length; i++) {
                   tmp += path[i];
                   if (i <= path.length - 1)
                        tmp += ".";
              return propertyFromBindingPath(bean, tmp);
    and a supporting classpackage scenegraphdemo;
    import java.beans.PropertyChangeListener;
    * Static methods for manipulating PCL for standard java beans.
    * @author Mr. Java
    public class BeanPropertyUtils {
         protected final static Class<?>[] NO_ARGS = new Class<?>[] { PropertyChangeListener.class };
         protected final static Class<?>[] ARGS = new Class<?>[] { String.class,
                   PropertyChangeListener.class };
         protected final static String pclAddMethodName = "addPropertyChangeListener";
         protected final static String pclRemoveMethodName = "removePropertyChangeListener";
         * Return true if the class has PCL methods. Does not check for remove.
         * <p>
         * addPropertyChangeListener(PropertyChangeListener)
         * <p>
         * addPropertyChangeListener(String, PropertyChangeListener)
         * @param bean
         * @return
         public static boolean hasPCL(Class<?> clazz) {
              try {
                   if (clazz.getMethod(pclAddMethodName, NO_ARGS) != null) {
                        return true;
              } catch (Exception e) {
                   // silently fail
              try {
                   if (clazz.getMethod(pclAddMethodName, ARGS) != null) {
                        return true;
              } catch (Exception e) {
                   // silently fail
              return false;
         * Add a listener.
         * @param bean
         * @param listener
         * @param propertyName
         public static void addPCL(Object bean, PropertyChangeListener listener,
                   String propertyName) {
              try {
                   if (propertyName == null) {
                        bean.getClass().getMethod(pclAddMethodName, NO_ARGS)
                                  .invoke(bean, new Object[] { listener });
                   } else {
                        bean.getClass()
                                  .getMethod(pclAddMethodName, ARGS)
                                  .invoke(bean,
                                            new Object[] { propertyName, listener });
              } catch (Exception e) {
                   e.printStackTrace();
         * Remove a listener.
         * @param bean
         * @param listener
         * @param propertyName
         public static void removePCL(Object bean, PropertyChangeListener listener,
                   String propertyName) {
              try {
                   if (propertyName == null) {
                        bean.getClass().getMethod(pclRemoveMethodName, NO_ARGS)
                                  .invoke(bean, new Object[] { listener });
                   } else {
                        bean.getClass()
                                  .getMethod(pclRemoveMethodName, ARGS)
                                  .invoke(bean,
                                            new Object[] { propertyName, listener });
              } catch (Exception e) {
                   e.printStackTrace();
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              

  • Making the Form File Object Look in Specific Folder

    Hi, I am using a form to identify attachments that will be
    sent with an email use webserver CDOSYS once the form has been
    submitted. So, I have made the user first upload the attahments to
    an 'Attachments' folder on the web and now I want him to be able to
    browse to that folder so I can identify them such as
    MailObj.AddAttachment
    "E:\Webs\Myweb\wwwroot\Attachments\Test.xls
    On my DWMX form, how do i get the Form 'File' object (with
    the browse button) to browse to my webserver attachemt folder only
    please as they will have previously been uploaded as CDOSYS
    requires the attachemts to be on the webserver.
    Thanks
    Dave

    You can't. That Browse button only looks on the users
    local/networked
    drives.
    You could create a routine that would display the list of
    files on the web
    server and they could select it from that list.
    "Dave(UK)" <[email protected]> wrote in
    message
    news:e8h1fj$nlb$[email protected]..
    > On my DWMX form, how do i get the Form 'File' object
    (with the browse
    > button)
    > to browse to my webserver attachemt folder only please
    as they will have
    > previously been uploaded as CDOSYS requires the
    attachemts to be on the
    > webserver.
    >
    > Thanks
    > Dave
    >

  • Correct Principal not showing up in the Session and Entity EJB layer

    In our app a user is authenticated via the web container. The web layer then makes
    calls to various session EJB's.
    In our session bean, calls to sessionContext.getCallerPrincipal().getName() sometimes
    returns "SYSTEM" instead of
    the principal's name that was authenticated at the web container level.
    In our entity beans, calls to entityContext.getCallerPrincipal().getName()
    sometimes returns "<anonymous>" instead of the principal's
    name.
    A) Why isn't the principal's name = context's principal's name?
    B) Can we ensure that principal's name isn't lost?
    As per the documentation, the user principal is associated with the current thread,
    so why is it that when calls are made in the same thread of execution from the
    web layer to the EJB layer we are losing the right principal. Btw, the Principal
    is always correct in the Web layer. We do not have any RunAs options set in our
    EJB deployment descriptors.
    What are we doing wrong?

    You aren't doing anything wrong. This is a bug in the webservices.
    kapil khanna wrote:
    In our app a user is authenticated via the web container. The web layer then makes
    calls to various session EJB's.
    In our session bean, calls to sessionContext.getCallerPrincipal().getName() sometimes
    returns "SYSTEM" instead of
    the principal's name that was authenticated at the web container level.
    In our entity beans, calls to entityContext.getCallerPrincipal().getName()
    sometimes returns "<anonymous>" instead of the principal's
    name.
    A) Why isn't the principal's name = context's principal's name?
    B) Can we ensure that principal's name isn't lost?
    As per the documentation, the user principal is associated with the current thread,
    so why is it that when calls are made in the same thread of execution from the
    web layer to the EJB layer we are losing the right principal. Btw, the Principal
    is always correct in the Web layer. We do not have any RunAs options set in our
    EJB deployment descriptors.
    What are we doing wrong?

  • Can I create a File object without writing it to the disk?

    I need construct a mechanism where I can "write" instructions to a file and then FTP this file to a remote system. It is basically a Telnet-like integration for a system that does not support Telnet. Once the file is on the remote device, it knows how to read the file and process its instructions.
    I would like to logically create this File object, by that I mean that I would like to use a FileWriter object to write the text instructions to the File, then use the Jakarta Commons NET API to FTP the file to the remote system. My question: can I create this File object without the file actually being written to the file system? Can the File just be memory resident for this creation and FTP?
    There could be tens of thousands of these transactions per day and I would like to just avoid any kind of deletion strategy, if I can. Thanks.

    Apart from the questionable decision to try and mess with the File object, I think the answer to (my guess at) your original question is "Yes".
    Jakarta Commons/Net FTP can upload to a server from any input stream you like. It doesn't have to be a FileInputStream. In particular it could be a ByteArrayInputStream, which reads from a byte array in memory.

  • XML over HTTP out of the EJB container

    I need to communicate with a legacy system via XML over HTTP from the EJB layer. I created a custom solution for this on a previous assignment using Castor for the marshaling etc. and standard JDK classes for the opening the HTTP connection, posting etc. I am thinking of implementing a similar solution in the using the DAO pattern. Are there any new open-source implementations for such XML/HTTP connectivity (non-SOAP)? Surely there is somethign out there!
    Thanks,
    -Chris

    In general, it is bad design to make network calls from the EJB layer, just as it is against the spec to do things such as create threads, write to the file system, etc.
    I know this doesn't answer your question but it is something to consider.

  • Is there a way to read/write original .xmp settings of a CR2 loaded as smart object onto a .psd layer?

    Hello all. This has been asked in varying degrees before, but many of the discussions I found relative to my question are from the period 2010 to 2013. Thought I would throw this out there again medio 2014 to see if anything new has developed that I'm somehow missing.
    Here's the situation:
    1. In the filesystem, a CR2 file and a sidecar .xmp file with ACR settings applied via Bridge (CS6).
    2. CR2 file is opened in Photoshop (CS6) as a smart object (.xmp sidecar settings are applied in the process).
    3. CR2 file and .xmp now exist on a .psd layer as a smart object...in some unknown form.
    4. File is saved as .psd
    My question is this:
    Is there ANY way at all via Bridge and/or Photoshop scripting to read/write/access/touch/poke/prod the original ACR "development" settings, originally stored in the .xmp sidecar file, that apparently now exist in some form on the smart object layer in the .psd? Via scripting in Bridge, one can alter the metadata on this saved .psd file, no problem, but this is not the same .xmp data that is being referenced by the image loaded as a smart object onto the .psd layer in that file. Where is this second set of data? Can it be accessed?
    Any info, enlightenment would be much appreciated. Thanks.

    No, not too late.
    InDesign is for layout for press in this case.
    Photoshop is for design, which is using the .jpg's.
    I'm half way there, but stuck at:
    Getting a file location reference when the .jpg is first brought into PS as a layer.
    Getting a script to write the location of the file into the medata for the PSD in some field
    Reading back the metadata file location for the .jpg and bringing it back into the PSD again.
    Any help would really be appreciated.
    I can make the completed script(s) available when its complete, as this has possibilities for other uses, batch process, and more.

  • Several layered effects of the same kind but with different adjustments for the same layer

    Hi,
    I wonder if it there is an easy way to have several different instances of e.g. glow or bevel and emboss on the same layer.
    I know I can achieve this by using smart objects or a duplicate layer with zero blending.
    I just wondered if there is a way to do this directly in the layer effects.

    Hi emil emil,
    thx for your answer!
    I wasn't even refering to different objects on the same layer, btw. it would be enough if I was able to layer e.g. different bevel and emboss on top of each other (With different colors, softness  and size.)  But I guess the answer remains the same.

  • How to passing object to the applet?

    Dear All,
    My project is needed to read the xml file (include the form content) and then parse the xml file to create the related object, so using the applet to display this dynamic form.
    Due to cannot directly open the file object and the applet, the following is my idea:
    1. ) In the servlet, first to new the fileinputstream object , then pass the object into the applet. But this idea is not allowed.
    Only String value can use the param to to pass the parameter value to the applet using <param name = \"cis_auditID\" value = \""+inputsource+"\">.
    2. ) Firstly , read the file and then create specific object before call applet class. I know some people said that using the URLConnection, but i don't know for this. Can only one give more detail description about that.
    So how can i pass the fileinputstream or the own created object into the applet?
    Urgent! Please help!

    Where is the xml file located??
    If it's on the same server that serves the applet or if it's dynamically generated
    by making a http request to a servlet you should use URL and URLConnection.
    URL u = new URL(this.getCodeBase(),"../relativeDir/xmlFile.xml");
    URLConnection uc = u.openConnection();
    InputStream = uc.getInputStream();
    // read the rest of the struff.
    You might want to take a look at this example if you want to send (POST data) to
    the server when you make a http request to a servlet:
    http://forums.java.sun.com/thread.jspa?threadID=645830&tstart=0
    3rd post

  • File objects in jar file

    Hi!
    Is their some kind of way one can use File objects in a jar file plz? I have a project which is complete and working well on the IDE but now that I have jarred it, i've come to realize that apparently file objects do not relate well with .jar files. The problem is that the program makes a lot of file manipulations and changing everything to getResource, InputStream etc would be very lengthy. So there's absolutely no way in which one can use File objects in jar files?
    Any help would be very much appreciated!
    Thanks and regards,
    Krt_Malta

    You can use the java.net.JarURLConnection class (use file:/// when creating the URL) to get a URL to a jar entry, create a URI from the URL, and then create a File object on the URI.
    Or use java.util.jar.JarFile methods and its associated classes to get jar entry contents.
    While you can use these approaches to create File objects from a jar, they are not any easier than what's already been mentioned.
    And all you can do is read or delete a jar - jar entries can't be rewritten.

  • Handling static objects

    Hi,
    I would like to know how are static objects handled in java
    Questions:
    1) What is the lifetime of a static object.
    2) can a static object called through any class on the jvm be reclaimed
    to phrase the above question better, If a class has a static object can i free the memory at anytime.
    3) Can i have links to handling of objects by the jvm if any.
    Any pointers are highly appreciated.
    Thanks and regards,
    myraid_77

    Static variables are associated with a class, not an instance.
    So, as long as the class is loaded, the static variable will remain.
    You would have to create your own classloader, and load a class ( containing the static variable ), through the classloader..... then later on null all references to the classloader, to unload the class from memory.
    The easiest way to reclaim memory from a static variable is to set it to null.
    regards,
    Owen

  • How to extract the red layer from BayerRG8 file with VBAI?

    Dear readers,
    We're currentely trying to build a inspection program using a CVS and two cameras.
    A first question to help us: How can we extract the red layer from a Bayer RG8 image?
    To illustrate a lit bit more: lets take a picture of chilis and tomatoes plants. We would like to extract the red color of the picture to know where the vegetable are and if they are eatable.
    So, in a first time, we just want to see the red layer of the picture.
    On a second step, we would like to extract the poistion of the red areas and rank them according to intensities and store all the relevant data in a .txt file.
    Thank in advance for the time you will spend on that topic.
    Regards

    Maybe including a picture with the info you want would help. It sounds like you could use a detect object step (which works with color images), and you could get the position of all red objects. I would also recommend using the Hue plane instead of the Red plane to look for color since this is more robust to lighting changes. Once you have the bounding box for each red object, you can create a programmatic ROI around it and use the Measure Color step to get detailed color information about your reb objects. Here's a sample inspection that uses colored candy to give you an example of what I'm suggesting. Let us know if more specifically what you are looking for if this doesn't help. The example is in VBAI 2012. Let us know what version of VBAI you are using because this may affect what functionality you can use.
    Thanks,
    Brad
    Attachments:
    Color Example.zip ‏358 KB

Maybe you are looking for

  • Error in calling a custom page in Oracle MSCA Mobile Web Application

    A custom page which is extended from a standard MWA page needs to be called. While doing this, the following error shows up. "Parent page type 4 is unacceptable in pageEntered handler of MenuPageBean!" in the $INST_TOP/logs/*system.log file. Your inp

  • Can I get an HP Laserjet pro 300 Color laserjet multifunction printer to work in OSX 10.7.5.  the disk says it only supports OS.6

    Help. I just purchased an HP Laserjet Pro 300 multifunction laserjet printer for a new home office. I tried to load it on my Macbook Pro which has the OSX 10.7.5 operating system and the disk says it only goes to OSX 10.6.  Do I need to return this h

  • Issues while generating Schema DAT files

    We are facing two type of issues when generating Schema ".dat" files from Informix Database on Solaris OS using the "IDS9_DSML_SCRIPT.sh " file. We are executing the command on SOLARIS pormpt as follows.. "IDS9_DSML_SCRIPT.sh <DBName> <DB Server Name

  • Mail package: missing end tag error

    Hi All I am using mail package for my receiver mail adapter. I have the required configuration for mail package as shown below: <ns1:Mail xmlns:ns1="http://sap.com/xi/XI/Mail/30">   <Subject>Test Subject</Subject>   <From>From Sender</From>   <To>To

  • 9.2 deployment problem.

    I created a simple portal on 9.2 beta and deployed. Deployment was not successful and here is the dump in console. Pl. help. \weblogic.policy weblogic.Server Listening for transport dt_socket at address: 8453 <Jun 8, 2006 10:57:11 AM EDT> <Notice> <W