Usung a href Tag, open the linked file in associated editor

Hi,
I have a functionality where a file location would be fetched from the database, shown to the user as a hyperlink. On clicking the hyperlink the file should open in its associated editor i.e if it is a .doc it should open in word, if it is an xls it should open in Excel.
I tried different ways but its opening in the IE browser itself ,Is there a way that it opens up in its associated editor.
Infact even if it opens in browser its ok, but then if a user modifies the xls and tries to "SAve AS" the pop up does not appears to save the file.How can i get the pop up so that user can save the modified file in it local computer.

Hi ,
Thanks a lot. What i have done is
File excelFile = new File("\full file name");
ServletOutputStream out = res.getOutputStream ();
// Set the output data's mime type
//res.setContentType( "application/text" ); // MIME type for pdf doc
res.setContentType( "application/vnd.ms-excel");
// create an input stream from fileURL
String fileURL =
full file name";
// Content-disposition header - don't open in browser and
// set the "Save As..." filename.
// *There is reportedly a bug in IE4.0 which ignores this...
res.setHeader("Content-disposition",
"attachment; filename=\"file name\"");
// PROXY_HOST and PROXY_PORT should be your proxy host and port
// that will let you go through the firewall without authentication.
// Otherwise set the system properties and use URLConnection.getInputStream().
BufferedInputStream bis = null;
BufferedOutputStream bos = null;
try {
// Use Buffered Stream for reading/writing.
bis = new BufferedInputStream(new FileInputStream(excelFile));
bos = new BufferedOutputStream(out);
byte[] buff = new byte[2048];
int bytesRead;
// Simple read/write loop.
while(-1 != (bytesRead = bis.read(buff, 0, buff.length))) {
bos.write(buff, 0, bytesRead);
} catch(final Exception e) {
System.out.println ( "Exception" );
throw e;
} finally {
if (bis != null)
bis.close();
if (bos != null)
bos.close();
This is the code for excel, and its doing what i needed.
I havent tested it for other formats hopefully it would work. :)

Similar Messages

  • Program to read html file and to open the links in that html file

    program to read html file and to open the links in that html file..
    ex:- to read automatically all next links in the html file and save it hard disk

    Start here;
    http://java.sun.com/products/jfc/tsc/articles/bookmarks/
    It gives you all of the information you need to parse the HTML file using the HTMLEditorKit that is a part of the Java SDK.
    Once you get the links from the file, then you can think about connecting to each.

  • Open the word file on the click of Link

    Hello,
    I have a requirement to open the word file on the click of LinkToUrl.
    Could anyone please explain the steps of doing that?
    Regards,
    Jyotsna

    Hi,
    Have a look at WD comp  WD_TEST_APPL_ACFEXECUTE. With that you can start applications on the frontend, such as Word. More information can be found in this thread: ACFEXECUTE
    Cheers, Roel

  • How to open the link in new firefox window for web desktop based application? Or how to open the mail/website/rss link in new firefox window

    I am using the firefox 3.6. My problem is that I am using the web desktop and few web desktop based application directly opens link. If I click on rss link than it opens in same window, so no longer access to web desktop. I want to open any kind of link in new window instead of same window. I have tired to change the value of browser.link.open_newwindow, browser.link.open_newwindow.restriction but doesn't work. Also gone through the https://developer.mozilla.org/en/window.open but not sure where to do this in web desktop based application or firefox where we connect the web desktop?
    Is there any way to open the link every time in new firefox window?

    Hi Joseph,
    the HTMLB link object misses the support for onClientClick through the tag lib, see hbj:link without onClientClick ? and OnClientClick Event for Link HTMLB Component for similiar problems and workarounds.
    With this workaround, you can call for example an AbstractPortalComponent, implement doOnNodeReady (with an empty doContent method) and return the PDF, settings the content type on the http before etc.
    Hope it helps
    Detlev
    PS: Please consider rewarding points for helpful answers on SDN. Thanks in advance!

  • Mac Word 2008 - hyperlink message "Word cannot open the specified file"

    I'm using WordMac 2008 version 12.2.5 and after following detailed instructions on how to hyperlink chapters in a Table of Contents to their respective chapters in a book, I can only get the message "Word cannot open the specified file".
    Any ideas what could be wrong?
    My OSX is 10.5.1.
    The instructions I followed are pasted below and are copied from the Smashwords Style Guide: http://www.smashwords.com/books/view/52
    START OF PASTE FROM SMASHWORDS STYLE GUIDE:
    How to create a linked Table of Contents. Consider this feature in “beta.” My
    thanks to Smashwords author Cheryl Anne Gardner for sharing these tips below,
    which I have augmented based on my own experience adding a ToC to the Style
    Guide (woo hoo!).
    By adding a linked table of contents, you can help readers navigate your
    document. This is especially useful for non-fiction. Most fiction doesn’t
    need it. If you follow the instructions below, the ToC should work in your
    EPUB, MOBI and PDF files, but it will not work in our other formats.
    First, create your table of contents where you want it by typing it out. Make
    sure the text is normalized just like the rest of your Smashwords’ Word
    document. Example:
    Contents
    Chapter 1
    Chapter 2
    Chapter 3
    Chapter 4
    Etc.
    Next, we are going to create the BookMarks. In Word 2000, 2003 and 2007, the
    Booksmark function is under the Insert tab. Go through your document, and at
    each Chapter Start or Indexed item, you will highlight it and then select
    Insert: bookmark. Name your bookmark corresponding to the Chapter/Indexed
    item and then click add. It’s very important to use the first word of your
    heading you’re linking to, because later on, when you add the hyperlinks,
    Word displays the bookmark shortcuts in alphabetical order. With many
    bookmarks, I found many of my bookmarks weren’t labeled properly, so it was
    tough to link to the correct bookmark. If you want to link to a chapter named
    How to Publish Ebooks, I’d recommend naming your bookmark
    “HowToPublishEbooks” to make it easy to locate. If you instead name it,
    “publishebooks,” you’ll frazzle your brain and make mistakes.
    Repeat the process above for every Chapter Start as well as for other matter
    in the book like index, bibliography, epilogue, prologue, etc. I didn’t link
    to every section in the Style Guide, because otherwise the ToC would have
    been three pages long. This is your call.
    Next, return to your table of contents and highlight the word “Contents.”
    Click insert, bookmark, and label this last bookmark “Contents”. Formatting
    note: Bookmarks cannot have spaces or odd characters. If instead of
    “Contents” you called the label in the document Table of Contents, as I did,
    then when you insert the bookmark, name the bookmark “TableofContents,” one
    word, or “toc.”
    Next, add the hyperlinks to your Chapter Starts. In your table of contents,
    if Chapter 1 is called Chapter 1, then highlight Chapter 1 and then click
    insert Hyperlink. As you can see in the Style Guide, I tried to use more
    descriptive labels. In Word’s Hyperlink menu on the left hand side, select
    “Place in this document.” You will now see your bookmarks listed in the main
    window. Select Chapter1 bookmark (or whatever you labeled it) and then click
    ok. Do this procedure for every chapter and piece of matter in the table of
    contents.
    Final step. Now you can link back to the Table of contents. Move through your
    document to each indexed item or Chapter start and highlight it. Then click
    insert, hyperlink, and then select “Place in this document.” When the
    bookmarks are showing in the main window, select the bookmark labeled
    “Contents,” assuming that’s what you named your Table of Contents. Do this
    for each and every chapter and or indexed item.
    After you are done, all your links will be underlined. You will need to test
    and make sure you linked everything properly. In most Word versions, you just
    click on the hyperlink to test. In Word 2007, you may need to Ctrl-Click each
    hyperlink and make sure it takes you where you need to go in the document.
    Advice: Word has an automatic ToC generation feature under the reference tab.
    Do not use this. It uses automated headings and formatting to generate the
    ToC and this will un-normalize your text and cause font conversion issues in
    your Smashwords files.
    END OF PASTE FROM SMASHWORDS STYLE GUIDE.
    I did all that as described but I still get the message "Word cannot open the specified file".
    Could you help please?

    This question would be better addressed to...
    http://www.microsoft.com/mac/help.mspx
    I think the operative phrase from that article is...
    *Consider this feature in “beta.”*
    -mj

  • Instance variable to hold the element of a tag in the xml file

    Hi I have an xml file that is handled using this parser
    <attr id="MY_NAME" >
    this parser hanled the above tag but now I want to have it handle
    <attr id="MY_NAME" desc="GOOD">
    but I need to create an instance variable to handle the desc element in the attr tag .
    Can some one help me out as this is not my file and I am having trouble to do please......
    import java.util.*;
    import java.io.*;
    import javax.xml.parsers.*;
    import org.xml.sax.*;
    import org.xml.sax.helpers.*;
       The SupportMatrix class provides static variables and methods to simplify
       the determination of whether or not a given attribute is supported for a
       certain object type (queue manager, channel, etc.), depending on the version
       and platform of the queue manager to which it belongs.
       The SupportMatrix class may not be instantiated. Its constructor is private.
       An instance of the class is created internally in the static initializer so
       that the XML parsing methods are available.
       A corresponding XML document, SupportMatrix.xml, is parsed to create the various
       HashMaps which contain the version/platform dependency information. A number of
       inner classes are used to represent the various elements of the XML matrix
       definition.
       Here's a sample document:
       <!-- The supportmatrix tag opens the document -->
       <supportmatrix>
         <!-- Objects are keyed by classid. "1" is the classid of a queue manager object. -->
         <object classid="1">
           <!-- Versions group attributes according to the queue manager version where they
                were introduced. The "base" cmdlevel encompasses all versions up to 5.1. -->
           <version cmdlevel="base">
             <!-- Attributes are defined by the attr tag. -->
             <attr id="MQCA_Q_MGR_NAME">
               <!-- Support elements define the platform-specific requirements for an attribute. -->
               <support platforms="UNIX,WINDOWS,OS400,VMS,NSK" maxlen="48" type="MQCFST"/>
               <support platforms="MVS" maxlen="4" type="MQCFST"/>
             </attr>
             <attr id="MQCA_Q_MGR_DESC">
               <!-- Specific attribute characteristics, most notably maximum len for string parms,
                    are defined in the support element. As shown in the following example, it may
                    apply to all platforms. -->
               <support platforms="all" maxlen="64" type="MQCFST"/>
             </attr>
             <!-- Support elements are optional. -->
             <attr id="MQIA_PLATFORM"/>
             <attr id="MQIA_COMMAND_LEVEL"/>
           </version>
           <!-- The version element may 'include' other versions. Note that object elements
                may also refer to other objects via the 'include' parm of the object tag.
                This is to allow common attributes (especially for queues and channels) to
                be shared by multiple definitions in order to reduce some of the
                redundancy. -->
           <version cmdlevel="520" include="base">
           </version>
         </object>
       </supportmatrix>
       The inner classes, and their hierarchical relationships are as follows:
         SupportObject - corresponds to the <object> element. Stored in a static HashMap, and
                         keyed by classid.
           VersionObject - corresponds to the <version> element. Stored in a HashMap instance
                           variable of the SupportObject class, keyed by cmdlevel.
             AttributeObject - corresponds to the <attr> element. Stored in a HashMap instance
                               variable of the VersionObject class, keyed by attribute name.
               PlatformObject - corresponds to the <support> element. Stored in HashMaps belonging
                                to the AttributeObjects, keyed by platform. A single PlatformObject
                                instance is created when the support tag is encountered. The
                                "platforms" attribute of the support element is then processed. For
                                each platform in the comma-delimited list, an entry is added to the
                                collection of PlatformObjects. This is to greatly simplify later
                                lookups.
       In order to support the 'include' feature of object and version elements, certain
       functions are recursive. If the attribute to be validated is not found for the passed
       cmdlevel, the 'parent' VersionObject is consulted by means of the 'include' value. If
       the chain of VersionObjects has been exhausted and the attribute in question has still not
       been located, the next SupportObject in the chain is consulted in a similar fashion.
    public class SupportMatrix extends DefaultHandler {
        /** The objects collection holds all the SupportObjects, keyed by classid. */
        private static HashMap objects;
        /** xmlFile will name the xml document to be parsed. Note that using the
            default class loader expects the string to be the path to the file. It must
            NOT begin with the '/' character. */
        private static String xmlFile =
            ResourceManager.getApplicationProperties().getProperty("SupportMatrixFile");
        private Stack stack;
        /** This static initializer allocates the static objects collection, creates an
            instance of the SupportMatrix class for xml parsing purposes, and initiates
            the parse operation to populate the collection. */
        static {
            objects = new HashMap();
            // Create a parser and process the xml doc
            SupportMatrix handler = new SupportMatrix();
            InputSource is = null;
            try {
                is = new InputSource(ClassLoader.getSystemClassLoader().getResourceAsStream(xmlFile));
                XMLReader xmlReader =
                    SAXParserFactory.newInstance().newSAXParser().getXMLReader();
                xmlReader.setFeature("http://xml.org/sax/features/namespaces", true);
                xmlReader.setContentHandler(handler);
                if (is == null) {
                    System.err.println("No input stream, dammit");
                xmlReader.parse(is);
            } catch(Exception e) {
                e.printStackTrace();
        /** Private constuctor, used only for XML parsing. */
        private SupportMatrix() {
            stack = new Stack();
        /** Add a SupportObject instance to the objects collection. */
        private void addObject(SupportObject obj) {
            String key = obj.getClassId();
            objects.put(key, obj);
        /* DefaultHandler methods                                              */
        /** Not used. */
        public void characters(char[] ch, int start, int length) {}
        /** Not used. */
        public void endDocument() {}
        /** For the version, object, and attr elements, pop the top element of the stack. */
        public void endElement(String uri, String localName, String qName) {
            if (localName.equals("version") || localName.equals("object") || localName.equals("attr")) {
                stack.pop();
        /** Not used. */
        public void setDocumentLocator(Locator locator) {}
        /** Not used. */
        public void startDocument() {}
        /** Most of the work is done here. Create the appropriate inner class instance for
            element; for object, version, and attr, push the element onto the stack so that
            child elements may be added to their collections as needed. */
        public void startElement(String uri, String localName, String qName,
                                 Attributes attributes) {
            String include = attributes.getValue("include");
            if (localName.equals("object")) {
                SupportObject obj = new SupportObject(attributes.getValue("classid"), include);
                addObject(obj);
                stack.push(obj);
            } else if ( localName.equals("version")) {
                VersionObject ver = new VersionObject(attributes.getValue("cmdlevel"), include);
                ((SupportObject)stack.peek()).addVersion(ver);
                stack.push(ver);
            } else if ( localName.equals("attr")) {
                AttributeObject a = new AttributeObject(attributes.getValue("id"));
                //String desc = StringFactory.getString(attributes.getValue("desc"));
                //if(desc != null)
                   //     a.setAttribute();
                String readonly = attributes.getValue("readonly");
                String exclude = attributes.getValue("exclude");
                if (include != null && exclude != null) {
                    Log.log(Log.ERROR, this, "include and exclude are mutually exclusive, exclude value ignored");
                    exclude = null;
                if (include != null) {
                    a.setCondition(include, true);
                if (exclude != null) {
                    a.setCondition(exclude, false);
                if (readonly != null)
                    a.setReadonly(readonly.equals("y"));
                ((VersionObject)stack.peek()).addAttr(a);
                stack.push(a);
            } else if (localName.equals("support")) {
                String platforms = attributes.getValue("platforms");
                String readonly = attributes.getValue("readonly");
                String maxlen = attributes.getValue("maxlen");
                String type = attributes.getValue("type");
                int attrType = 0;
                if (type != null) {
                    if (type.equals("MQCFIN")) {
                        attrType = CMQCFC.MQCFT_INTEGER;
                    } else if (type.equals("MQCFIL")) {
                        attrType = CMQCFC.MQCFT_INTEGER_LIST;
                    } else if (type.equals("MQCFST")) {
                        attrType = CMQCFC.MQCFT_STRING;
                    } else if (type.equals("MQCFSL")) {
                        attrType = CMQCFC.MQCFT_STRING_LIST;
                    } else if (type.equals("EXBIN")) {
                        attrType = MqcConstants.EXCFT_BINARY;
                    } else if (type.equals("EXPCF")) {
                        attrType = MqcConstants.EXCFT_PCF;
                PlatformObject p = null;
                if (readonly == null) {
                    p = new PlatformObject(platforms);
                } else {
                    p = new PlatformObject(platforms, readonly.equals("y"));
                String exclude = attributes.getValue("exclude");
                if (include != null && exclude != null) {
                    Log.log(Log.ERROR, this, "include and exclude are mutually exclusive, exclude value ignored");
                    exclude = null;
                if (include != null)
                    p.setCondition(include, true);
                if (exclude != null)
                    p.setCondition(exclude, false);
                if (attrType != 0)
                    p.setType(attrType);
                if (maxlen != null)
                    p.setLen(Integer.parseInt(maxlen));
                ((AttributeObject)stack.peek()).addPlatform(p);
        public static boolean isExported(int attribute, TopologyModelNode node) {
            String name = ResourceManager.getAttributeName(attribute);
            return isExported(name, node);
        public static boolean isExported(String attribute, TopologyModelNode node) {
            // Find the qmgr node to fetch platform and cmdlevel
            TopologyModelNode qmgr = node.getModel().getQMgrNode(node.getAddress());
            // If there's no qmgr for this node, it must be one of 'ours'.
            if (qmgr == null)
                return false;     // None of 'our' objects can be exported to MQSC.
            String classId = node.getClassId();
            String cmdLevel = qmgr.getAttributeValue("MQIA_COMMAND_LEVEL");
            String platform = qmgr.getAttributeValue("MQIA_PLATFORM");
            return isExported(attribute, classId, cmdLevel, platform, node);
        public static boolean isExported(int attribute, String classId, String cmdLevel, String platform,
                                         TopologyModelNode node) {
            String name = ResourceManager.getAttributeName(attribute);
            return isExported(name, classId, cmdLevel, platform, node);
        /** Determine if an attribute is exportable. The attribute name, the classid of the object to
            which it belongs, plus the command level and platform of the queue manager are all needed
            to make this determination.
            Start by finding the AttributeObject for the combination of attribute, classid, and
            command level. If we can't find the AttributeObject, we assume that the attribute
            is not exported. Otherwise, find out if it is exportable for the selected platform.
        public static boolean isExported(String attribute, String classId, String cmdLevel, String platform,
                                         TopologyModelNode node) {
            AttributeObject attr = getAttributeObject(attribute, classId, cmdLevel);
            if (attr == null) {
                return false;
            } else {
                return attr.isExported(platform, node);
        public static boolean isSupported(int attribute, TopologyModelNode node) {
            String name = ResourceManager.getAttributeName(attribute);
            return isSupported(name, node);
        public static boolean isSupported(String attribute, TopologyModelNode node) {
            // Find the qmgr node to fetch platform and cmdlevel
            TopologyModelNode qmgr = node.getModel().getQMgrNode(node.getAddress());
            // If there's no qmgr for this node, it must be one of 'ours'.
            if (qmgr == null)
                return true;
            String classId = node.getClassId();
            String cmdLevel = qmgr.getAttributeValue("MQIA_COMMAND_LEVEL");
            String platform = qmgr.getAttributeValue("MQIA_PLATFORM");
            return isSupported(attribute, classId, cmdLevel, platform);
        public static boolean isSupported(int attribute, String classId, String cmdLevel, String platform) {
            String name = ResourceManager.getAttributeName(attribute);
            return isSupported(name, classId, cmdLevel, platform);
        /** Determine if an attribute is supported. The attribute name, the classid of the object to
            which it belongs, plus the command level and platform of the queue manager are all needed
            to make this determination.
            Start by finding the SupportObject for the classid. If it isn't there, we make the assumption
            (for now) that the attribute is supported. The only classids for which this can occur are
            broker, agent, and the various container objects.
            Propagate the isSupported request to the chain of SupportObjects (based on 'include' values)
            until we get a 'true' result or we run out of SupportObjects. */
        public static boolean isSupported(String attribute, String classId, String cmdLevel, String platform) {
            if (attribute == null)
                return false;
            SupportObject obj = (SupportObject)objects.get(classId);
            // If the object type isn't even in the support matrix, we interpret that to
            // mean that it's a Broker or Agent, in which case all attributes are supported
            // at present.
            if (obj == null)
                return true;
            boolean result = false;
            while (result == false && obj != null) {
                result = obj.isSupported(attribute, cmdLevel, platform);
                if (result == false && obj.getInclude() != null) {
                    obj = (SupportObject)objects.get(obj.getInclude());
                } else
                    obj = null;
            return result;
        /** Locate an AttributeObject for a given attribute name, object type, and command level.
            This is a helper function for the getMaxLen and getType methods. */
        private static AttributeObject getAttributeObject(String attr, String classID, String cmdLevel) {
            AttributeObject result = null;
            SupportObject obj = (SupportObject)objects.get(classID);
            while (result == null && obj != null) {
                result = obj.getAttr(attr, cmdLevel);
                if (result == null && obj.getInclude() != null) {
                    obj = (SupportObject)objects.get(obj.getInclude());
                } else
                    obj = null;
            return result;
        /** Determine the maximum length for a given combintation of attribute name, object type,
            command level, and platform. If the AttributeObject can't be found, or if the length
            hasn't been set, return -1. */
        public static int getMaxLen(String attr, String classId, String cmdLevel, String platform) {
            AttributeObject a = getAttributeObject(attr, classId, cmdLevel);
            if (a == null)
                return -1;
            return a.getMaxLen(platform);
        /** Determine the PCF parm type for a given combintation of attribute name, object type,
            command level, and platform. If the AttributeObject can't be found, or if the length
            hasn't been set, return -1. */
        public static int getType(String attr, String classId, String cmdLevel, String platform) {
            AttributeObject a = getAttributeObject(attr, classId, cmdLevel);
            if (a == null)
                return -1;
            return a.getType(platform);
        /** Inner class to contain platform-specific info for an attribute. */
        class PlatformObject {
            /** This instance variable will contain the comma-delimited string of all
                platforms to which this object applies. */
            private String platform;
            private int maxlen;
            private String condition = null;
            private boolean include;
            private boolean readonly;
            private boolean lenSet;
            private int attrType;
            private boolean typeSet;
            public PlatformObject(String p, boolean readonly) {
                platform = p;
                this.readonly = readonly;
                lenSet = false;
                typeSet = false;
            public PlatformObject(String p) {
                this(p, false);
            public void setCondition(String condition, boolean include) {
                this.condition = condition;
                this.include = include;
            public boolean isReadonly() {
                return readonly;
            public boolean isExported(TopologyModelNode node) {
                if (condition != null) {
                    boolean test = false;
                    try {
                        test = Utilities.evaluateCondition(node, condition);
                    } catch (Exception e) {}
                    if (include ^ test)
                        return false;
                return !readonly;
            public void setLen(int len) {
                maxlen = len;
                lenSet = true;
            public void setType(int type) {
                attrType = type;
                typeSet = true;
            public String getPlatform() {
                return platform;
            public int getMaxLen() {
                if (!lenSet)
                    return -1;
                return maxlen;
            public int getType() {
                if (!typeSet)
                    return -1;
                return attrType;
        /** This class represents a specific MQSeries attribute. It can optionally contain
            instances of the PlatformObject class as needed. When the 'platforms' collection
            is empty, the attribute is supported on all platforms. It is also possible to
            include a PlatformObject for the 'all' platform, if specific attribute characteristics
            need representation. When the 'platforms' collection is non-empty, it will include one
            entry for each platform where the attribute is supported. */
        class AttributeObject {
            private String attribute;
            private String attrValue;
            private HashMap platforms;
            private String condition = null;
            private boolean include;
            private boolean readonly = false;
            public AttributeObject(String a) {
                this(a, false);
            public AttributeObject(String a, boolean readonly) {
                attribute = a;
                platforms = new HashMap();
                this.readonly = readonly;
            public void setCondition(String condition, boolean include) {
                this.condition = condition;
                this.include = include;
            public void setReadonly(boolean readonly) {
                this.readonly = readonly;
            public boolean isReadonly() {
                return readonly;
            public void addPlatform(PlatformObject p) {
                for (StringTokenizer st = new StringTokenizer(p.getPlatform(), ","); st.hasMoreTokens() ;) {
                    platforms.put(st.nextToken(), p);
            public PlatformObject getPlatform(String platform) {
                PlatformObject p = (PlatformObject)platforms.get(platform);
                if (p == null)
                    p = (PlatformObject)platforms.get("all");
                return p;
            public String getAttribute() {
                return attribute;
            public int getMaxLen(String platform) {
                PlatformObject p = getPlatform(platform);
                if (p == null)
                    return -1;
                return p.getMaxLen();
            public int getType(String platform) {
                PlatformObject p = getPlatform(platform);
                if (p == null)
                    return -1;
                return p.getType();
            public boolean isSupported(String platform) {
                if (platforms.isEmpty()) {
                    return true;
                if (platforms.containsKey(platform)) {
                    return true;
                if (platforms.containsKey("all")) {
                    return true;
                return false;
            public boolean isExported(String platform, TopologyModelNode node) {
                if (readonly) {
                    Log.log(Log.DEBUG, this, attribute + " is readonly, returning false");
                    return false;
                if (condition != null) {
                    Log.log(Log.DEBUG, this, "Testing condition = " + condition);
                    boolean test = false;
                    try {
                        test = Utilities.evaluateCondition(node, condition);
                        Log.log(Log.DEBUG, this, "Condition result is " + test);
                    } catch (Exception e) {
                        Log.log(Log.ERROR, this, "Condition through an exception");
                    if (include ^ test)
                        return false;
                if (platforms.isEmpty()) {
                    return true;
                PlatformObject p = getPlatform(platform);
                if (p == null) {
                    Log.log(Log.DEBUG, this, platform + " not found for " + attribute + ", returning false");
                    return false;
                return p.isExported(node);
        /** This class represents a specific value of a queue manager's command level. A
            given instance of this class may 'include' a 'parent' instance through its
            include instance variable. The traversal of the parent/child hierarchy is
            delegated to the SupportObject class, since that is where the collection of
            VersionObjects lives. */
        class VersionObject {
            private String cmdLevel;
            private String include;
            private HashMap attributes;
            public VersionObject(String cmdLevel, String include) {
                this.cmdLevel = cmdLevel;
                this.include = include;
                attributes = new HashMap();
            public void addAttr(AttributeObject attr) {
                attributes.put(attr.getAttribute(), attr);
            public AttributeObject getAttr(String attr) {
                return (AttributeObject)attributes.get(attr);
            public String getCmdLevel() {
                return cmdLevel;
            public String getInclude() {
                return include;
            public boolean isSupported(String attr, String platform) {
                AttributeObject obj = (AttributeObject)attributes.get(attr);
                if (obj == null) {
                    return false;
                } else
                    return obj.isSupported(platform);
        /** This class represents an MQSeries object type, as identified by its classid, e.g.
            queue manager or local queue. This class implements an include facility similar to
            that described for the VersionObject. The traversal of that hierarchy is delegated
            to the static isSupported method, because the collection of SupportObject instances
            is a static variable of the SupportMatrix class. */
        class SupportObject {
            private String classId;
            private String include;
            private HashMap versions;
            public SupportObject(String classId, String include) {
                this.classId = classId;
                this.include = include;
                versions = new HashMap();
            public void addVersion(VersionObject obj) {
                String key = obj.getCmdLevel();
                versions.put(key, obj);
            public String getClassId() {
                return classId;
            public String getInclude() {
                return include;
            public boolean isSupported(String attr, String cmdLevel, String platform) {
                boolean result = false;
                VersionObject obj = (VersionObject)versions.get(cmdLevel);
                if (obj == null)
                    obj = (VersionObject)versions.get("base");
                // I don't actually know what it means if obj is null at this point.
                // It probably can't happen.
                if (obj == null)
                    return false;
                while (result ==  false && obj != null) {
                    result = obj.isSupported(attr, platform);
                    if (result == false && obj.getInclude() != null) {
                        obj = (VersionObject)versions.get(obj.getInclude());
                    } else
                        obj = null;
                return result;
            public AttributeObject getAttr(String attr, String cmdLevel) {
                AttributeObject result = null;
                VersionObject obj = (VersionObject)versions.get(cmdLevel);
                if (obj == null)
                    obj = (VersionObject)versions.get("base");
                // I don't actually know what it means if obj is null at this point.
                // It probably can't happen.
                if (obj == null)
                    return null;
                while (result ==  null && obj != null) {
                    result = obj.getAttr(attr);
                    if (result == null && obj.getInclude() != null)
                        obj = (VersionObject)versions.get(obj.getInclude());
                    else
                        obj = null;
                return result;
    }

    Are you the one who commented out the code you're looking for ?//String desc = StringFactory.getString(attributes.getValue("desc"));You just have to modify you AttributeObject class to hold a new field : String description. And then, it's up to you to create a new constructor or a new setter method.
    Btw, this is not a Swing related question.

  • Safari always opens a linked file rather than download it.

    Safari always opens a linked file rather than download it. Can't always Right Click for menu option as the web page is not setup that way.
    Have tried trashing the Downloads.plist from the user library. Still no joy.
    Thanks anyone

    Hi guys
    Thanks for suggestions. Carolyn, I did as you suggested but didn't solve problem. KeeChan, as explained in original post, that is my usual fallback but not all web sites work like that. Try downloading Safari - right click (Ctrl Click) on download button and all you get is the "Download.png" image.
    I finally found the answer. A long time ago I had downloaded and used "SpeedDownload" and had deleted it. Somehow, some trace of the app was left behind and the mime association with dmg files was messed up.
    You can not get rid of Speed Download by throwing its files away or by using an app cleaner product. You MUST run the Speed Download installer program and select the "uninstall" option to remove it.
    My browsers now download dmg files correctly.

  • Folio Builder: An error has occurred opening the source file for the article layout.

    I have been working on a Folio. When I sat down to work on my folio, I was instructed by indesign to update my Folio producer tools, which I did.
    Since then I can no longer view any article layout from that folio in indesign. Indeed any folio that I create that does not reside on my desktop give the same problem. I can import articles, add articles and they all upload to the proper place at adobe and I can view them. But I simply cannot open them up through folio builder as I previously.
    The exact error message is as below:
    An error has occurred opening the source file for the article layout.
    The InDesign file for the layout cannot be found.
    Another strange thing that seems to be happening is that the folio will randomly reoder the articles in the folio.
    I have dumped my indesign prefs, tried creating an entirely new project, made a new account and even reinstalled the entire software.
    But the problem of opening an article that I have imported or added to a folio, simply not being found to open has got me stumped. I can't proceed with a major project until I can sort this out.
    Can anyone help.
    Many thanks
    Steve
    The problem initially seemed very similar to the one linked below, but I dont get the content generation error
    http://forums.adobe.com/thread/901804?decorator=print&displayFullThread=true

    Questions about the Adobe Digital Publishing Suite should be posted in the DPS Forum.
    http://forums.adobe.com/community/dps

  • Problem while opening the excel files

    Hi
    In my system , i have excel reports in my server disk . And i am opening the excel files through an action class like /viewReport.do?id=23 .....and thus from the action class i open my excel file .
    After opening one excel file , i try to open another excel by clicking that link , then my system often hangs else excel shows an error saying "a report with name viewReport.do is already open " even though both of these files are different on the server
    How can i avoid this ??
    The reason why i am opening the excel file through an action class is , i need to perform some operations before opening that excel report
    i tried by setting the
    response.setHeader("Content-disposition","attachment; filename=myWorksheet.xls");
    and i kept on changing the names but that doesnt work
    Can any one let me know how to go abt this ??

    Hi Sir,
    I found you posted the issue in the
    APS.NET forum, and you seems use some code to open the file. Have you tried the last link in the thread?
    Then, let's do some test to narrow down the issue.
    I notice that you are using Office 2010, does the issue occur only with 'Reachlocal.xlsx' or every existed file?
    If every Excel file has the issue, please try the following methods:
    Open the file in
    safe mode.
    Repair Office 2010.
    On the other hand, this problem might be caused by malware on the affected machine. There are now two known variants of malware which causes this problem: Win32/Crilock.A and
    Win32/Buma!rts. They have both been identified as a new family of
    ransomware.  
    http://blogs.technet.com/b/the_microsoft_excel_support_team_blog/archive/2013/09/07/quot-cannot-open-the-file-because-the-file-format-or-extension-is-invalid-quot-opening-office-files.aspx                                   
    If you have any further assistance about code/program, I recommend you post the question to MSDN forum:
    http://social.msdn.microsoft.com/Forums/en-US/home?forum=exceldev&filter=alltypes&sort=lastpostdesc
    Regards,
    George Zhao
    TechNet Community Support

  • Content generation error. Failed to open the InDesign file.

    Hey all -
    In importing an article to a folio, I just received this error:
    "Content generation error.
    Failed to open the InDesign file. Please confirm the file can be opened in InDesign."
    The file is open right now in InDesign. I can close it and reopen it with no errors.
    I've tried resaving the article to a new file. No help.
    I tried creating a new folio and importing the article there. No help.
    All links are good. It's a simple file with images, a scrolling pane, and some buttons that link to other articles.
    Anyone else run into this problem? Any solutions?
    Thanks!

    Im getting this error also....?
    Want to avoid inporting each artical on at a time. Need to import multiple articals at once.
    Thanks.

  • Left click on a link does not open the link; a small blue window opens saying loading then closes.

    Left click on any link in a web page does not open the link. A very small blue window appears with the word loading and a few moving dots. In a few seconds the blue window closes but the link does not open. Links used to open. If I right click the link, I can open the link in a new window. Many new windows pile up. This is a nuisance.
    I am using Firefox 3.6.8 for Canonical 1.0 in Ubuntu 9.10.

    Start Firefox in [[Safe Mode]] to check if one of your add-ons is causing your problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    See [[Troubleshooting extensions and themes]] and [[Troubleshooting plugins]]
    If it does work in Safe-mode then disable all your extensions and then try to find which is causing it by enabling one at a time until the problem reappears.
    You can use "Disable all add-ons" on the ''Safe mode'' start window.
    You have to close and restart Firefox after each change via "File > Exit" (on Mac: "Firefox > Quit")

  • Launching Microsoft Access from Internet Explorer to view a downloaded MDB file opens the wrong file (not a problem if I use Firefox)

    When clicking on a link (in Internet Explorer 9) to download an Access MDB file and then choosing to open the file directly in Microsoft Access (2007) instead of saving it, the file is copied to Temporary Internet Files but Microsoft Access tries to open
    a different file and displays an (Unrecognized database format) error.
    When I click on the option to open the file, the MDB file is copied to Temporary Internet Files\Content.IE5 but instead of that file, Access tries to open a different (incorrect) file located in Temporary Internet Files\Content.MSO (e.g. in the above error
    message, NativeView.do is an XML file containing an error message).
    I don't see this problem with Word, Excel or PowerPoint files. When opening a Word file (without saving) the Word file is copied to Content.IE5 but an identical .tmp file is created in Content.MSO which when opened in Microsoft Word displayed the required file
    correctly. The same happens for Excel files. PowerPoint appears to be handled a little differently (no .tmp file created in Content.MSO but the required file is still copied to Content.IE5) but the PPT file is still opened correctly in Microsoft PowerPoint.
    I think the Content-Type "application/msaccess" is fine because Internet Explorer does launch Microsoft Access. It just tries to open the wrong file (or so I think). However, it looks like the file type is not being determined. Here is what I noticed
    when trying to open different Microsoft Office files using Internet Explorer:
    The last one is the MDB file. As you can see, only for this type of file, the "Type" (Microsoft Office Access 2007?) is not displayed in this Open/Save dialog box.
    On Firefox, I don't see this problem. When I tried clicking on the link to the MDB file in Firefox, Microsoft Access was launched and the file was opened correctly. Is there something I can do so the MDB file is opened properly using IE? I can add/change headers
    in the HTTP response that writes this file to the output stream (on disk) if that helps.
    Thanks for your time!

    Sounds like a problem symptom to be discussed in either an IE forum or an Access forum, not here.  How did you come to post here?  ForumsRedesign.  That might be an on-topic issue for this forum.  <eg>
    Can you find your way to either of those other forums easily from here?  Another on-topic question for here I think.   ; )
    Robert Aldwinckle
    Oops, my bad. Thanks for letting me know! :)
    I've re-posted it here: http://social.technet.microsoft.com/Forums/ie/en-US/1a818501-296c-42fb-8abb-ba914629c962/launching-microsoft-access-from-internet-explorer-to-view-a-downloaded-mdb-file-opens-the-wrong-file?forum=ieitprocurrentver
    Hopefully that's the right place for this.
    Cheers!

  • When I open an encryted pdf file in my Hp  Slate 7 voice Tab it was unable to open the pdf file.Tje same file was opening with other pdf reader software.Kindly Help.

    When I open an encryted pdf file in my Hp  Slate 7 voice Tab it was unable to open the pdf file.Tje same file was opening with other pdf reader software.Kindly Help.
    [spam link removed]

    Could you please send the pdf to [email protected] so that we may investigate the issue?
    Thanks,
    Adobe Reader Team

  • I click a link but it doesn't open. Instead I get a popup saying "Open the link in a new window," "Open link in a new tab," etc. How can I kill this popup or whatever it is forever?

    I click a link but it doesn’t open. Instead I get a popup saying “Open the link in a new window,” “Open link in a new tab,” etc. How can I kill this popup or whatever it is forever?

    That happens if the server sends the file as text/plain.
    You can see this if you open "Tools > Page Info > General": Content-Type: text/plain
    Files send this way will always open in a tab.
    *https://developer.mozilla.org/Tools/Web_Console

  • Firefox opens the air file !?!!

    I have made an air application and uploaded it to my web
    server. However, when I enter the URL to the air file, Firefox
    opens it up instead of downloading it.
    Here's the link to my app:
    http://www.jashsayani.com/Development/RememberTheTask.air
    (Firefox opens the air file and shows garbeled text. But the
    file works when downloaded with a download manager)
    Here are other air file links that show the download pop-up
    when opened:
    WebKut:
    http://toki-woki.net/p/WebKut/WebKut-v1.2.2.air
    DestroyTwitter:
    http://www.destroytoday.com/releases/DestroyTwitter130B.air
    What is wrong ? and how do I fix it ?

    Sounds like you need to assign a MIME type foe AIR files on
    your web server.
    (application/vnd.adobe.air-application-installer-package+zip)
    See
    http://www.davidtucker.net/2008/01/08/update-your-air-mime-type/

Maybe you are looking for

  • Premiere CC 7.2.2 crashes when trying to export via Media Encoder

    Hello, My computer is a: 2x Intel Xeon Processor E5-2650 (2000 MHz, 20MB); 16x Kingston DIMM 8 GB PC3-8500 ECC Reg.; PNY Quadro 4000 with 2048 MB GDDR5-RAM; PNY Tesla C 2075 2x 2000 GB Western Digital RE4 (7200 UPM/S-ATA II) as a RAID I 1x 120 GB OCZ

  • I want to sell my iphone 4 for parts but....

    I cannot delete my personal data. Can I remove something particular from the logic board or the whole board itself to not have my personal data compromised?

  • Mac Pro freezes up; temporarily fixed by reboot

    I have a Mac Pro 2x3 GHz Quad core with 8 GB RAM. I'm experiencing bizarre freeze ups and other malfunctions that are temporarily fixed by rebooting. The computer is used for live broadcasting twice a week.  Between broadcasting events it sits mostly

  • Adding a function module in BSP

    Hi all, I want to add a call to an exisitng function module to run once a user exits the BSP page. Any body has idea on how this is done ? Uche

  • I want run multiple report in d2k report 6i

    hi when i run a report then i tried to run another report. but i could not run it. cause two report dont run at a time. how can i run both report at a time. pls help me. thanks Mostafiz