Abstract:
Techniques are disclosed for customizing a context structure such as a context menu based on content associated with an object such as a computer file. For example, a computer-implemented method for customizing a context structure associated with an object comprises the following steps. A content analysis is performed on the object. The context structure associated with the object is modified based on at least a portion of results of the content analysis.

Description:
FIELD OF THE INVENTION 
       [0001]    The present invention relates to computer object management and, more particularly, to techniques for customizing a context structure such as a context menu based on content associated with a computer object such as a computer file. 
       BACKGROUND OF THE INVENTION 
       [0002]    In an operating system, such as Windows™ Operating System (trademark of Microsoft Corporation, Redmond, Wash.), a context menu is the menu that is opened on the screen when the user clicks on the right mouse button when the cursor is on or in the vicinity of a file, folder, application title bar, or nearly any other object on the screen. Most of the time, this menu includes a list of actions appropriate to the object on which the user has clicked. Options in the context menu are fixed and typically do not change, e.g., “Copy,” “Paste,” “Delete,” “Rename,” “Open,” and “Properties,” to name a few. 
         [0003]    Options depend upon the type of file that is defined by its extension. For example, in Windows™, an executable file has an “.exe” extension at the end of the filename. Thus, the context menu for an “.exe” file will also typically include a “Run as” option item. 
         [0004]    Some applications, e.g., Winzip™ (trademark of Winzip Computing, Mansfield, CT) are able to add their own items (e.g., add to zip file), extending the power of the context menu paradigm. 
       SUMMARY OF THE INVENTION 
       [0005]    Principles of the present invention provide techniques for customizing a context structure such as a context menu based on content associated with an object such as a computer file. 
         [0006]    For example, in one embodiment, a computer-implemented method for customizing a context structure associated with an object comprises the following steps. A content analysis is performed on the object. The context structure associated with the object is modified based on at least a portion of results of the content analysis. 
         [0007]    In an illustrative embodiment wherein the object is a computer file and the context structure is a context menu, the operating system uploads the computer file and runs a set of one or more in accordance with one or more content analyzers. A successful result from a test produces an event which is stored in a description file of the computer file. The context menu is modified by the steps of the operating system detecting a selection of the computer file (e.g., a user right-clicking on the computer file), the operating system reading from the description file the stored event, the operating system extracting from an association file at least one function, and the operating system adding the extracted function to the context menu. 
         [0008]    These and other objects, features, and advantages of the present invention will become apparent from the following detailed description of illustrative embodiments thereof, which is to be read in connection with the accompanying drawings. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0009]      FIG. 1A  is a diagram illustrating a first XML file for use in understanding principles of the invention. 
           [0010]      FIG. 1B  is a diagram illustrating a second XML file for use in understanding principles of the invention. 
           [0011]      FIG. 2  is a diagram illustrating a third XML file for use in understanding principles of the invention. 
           [0012]      FIG. 3  is a diagram illustrating a file system for implementing context menu customization according to an embodiment of the invention. 
           [0013]      FIG. 4  is a diagram illustrating a methodology for implementing context menu customization according to an embodiment of the invention. 
           [0014]      FIG. 5  is another diagram illustrating a methodology for implementing context menu customization according to an embodiment of the invention. 
           [0015]      FIG. 6  is a diagram illustrating an illustrative implementation of a computing system in accordance with which one or more components/methodologies of the present invention may be implemented, according to an embodiment of the present invention. 
       
    
    
     DETAILED DESCRIPTION OF PREFERRED EMBODIMENTS 
       [0016]    Illustrative embodiments of the present invention will be described below from the perspective of a file and its context menu; however, it is to be understood that principles of this invention are generally applicable to other context structures associated with other computer objects. 
         [0017]    It is realized that the file context menu is a very handy tool to perform operations on files in a file system, such as is supported by an operating system. The context menu depends upon the type of file and, in some cases, some applications are able add their own items. However, existing context menus are not dependent on the content of the files with which they are associated. 
         [0018]    Since a given file extension can contain two types of files, principles of the invention realize that it would be advantageous for each file to have its own context menu wherein content of the files is taken into account in creating the separate context menus. Thus, a main idea of the present invention is to enable customization of file context menu based on file content analysis. Before describing detailed methodologies for achieving such an advantageous result, we give a few examples of files and how they are treated with respect to existing context menu approaches: 
         [0019]    1. Mp3 files can contain voice and music. Files which contain voice might have options which are not relevant to music, such as transcription, and vice versa. However, under existing approaches, they are treated the same way from the file system perspective, and therefore have the same context menu. 
         [0020]    2. XML (eXtensible Markup Language) is a general file type for structured and semi-structured data. There are many types of data stored in XML files. They can be web-services, electronic health record of patients, configuration files for Java project, etc. However, under existing approaches, they are treated the same way from the file system perspective, and therefore have the same context menu. Principles of the invention realize that it would be better that a double-click on an electronic health record would open the file in an electronic health record viewer, while the configuration Java project file would best be opened in a Java Integrated Development Environment (IDE), e.g., such as the open source software platform known as Eclipse. 
         [0021]    3. Java files can contain a main method and will therefore be able to be run, while some others do not. The first type would rather have a “run” option, while the others would not. 
         [0022]    There are many ways to determine the file type. Some rely on the file extension, and some on some file content. Different operating systems have traditionally taken different approaches to this problem, with each approach having its own advantages and disadvantages. Among these, the well-known approaches use the file-extension, use so-called “magic numbers,” or use file metadata. 
         [0023]    The Unix (a trademark of the Open Group, San Francisco, Calif.) utility program file can read and interpret magic numbers from files, and indeed, the file which is used to parse the information is called magic. For Windows™, there is a freeware utility called “TrID” that has a similar purpose. 
         [0024]    On top of these technologies, we propose to add an additional layer of content analysis in order to extend the classification granularity. The results of the analysis could be cached with the file using file system extended attributes or other mechanisms in order to offset the cost of analysis. File-system notification mechanisms such as “inotify” (Linux) could be used to invalidate the cached data once the file content changed. 
         [0025]    We propose to use content analysis technologies in order to customize the file context menu according to the file classification. Once files have been classified based on their content, many new operations become possible and can be added to the content-sensitive context menu, by way of example only: “show me all other files which have pictures of grandma,” or more generally, “do to this file whatever I did to the last file that had the same content.” 
         [0026]    We present the following example. Assume we have two XML files. An operating system would recognize them both as the same type, i.e., XML files. However, content-based analysis would infer that: 
         [0027]    XML documents similar to the first one are opened with an application for clinical documents; and 
         [0028]    XML documents similar to the second one are opened with a UIMA (Unstructured Information Management Architecture) plug-in of Eclipse. 
         [0029]    For example, in the context menu of the two XML files respectively shown in  FIGS. 1A and 1B , the “open” command will open the XML files using a different application—a clinical application in  FIG. 1A  and a UIMA application in  FIG. 1B . 
         [0030]    As we describe illustrative embodiments for customizing a context menu based on a content analysis, we use the following illustrative definitions: 
         [0031]    Event: an event is an occurrence in a file, and is associated with a certain function of an application. Example: speech, music, UIMA XML file, etc. 
         [0032]    Function: a function is a portion of code within a larger application, which performs a specific task. Example: play, transcribe, open, etc. 
         [0033]    Analyzer: a program that performs tests (one or more) and assigns their results as events of the file. In a narrative way, such tests could answer the following questions when examining the file: “is it a speech file?”, “is it a clinical document?”, etc. The events could be, again in a narrative way, “it&#39;s a speech file”, etc. The operating system will save such events as codes, with an appropriate name explaining the event, as shown in  FIG. 2 . 
         [0034]    Application software: Application software is a subclass of computer software that applies the capabilities of a computer directly and thoroughly to tasks (associated to functions) that the user wishes to perform. 
         [0035]    Description File: A description file is a metadata file associated to a content file f in which the events of f are stored. 
         [0036]    Association File: The operating system owns a relation &lt;event, function&gt; storing the association between any event and the list of functions that are able to support it. This function name will appear in the context menu opened when the file is clicked. For example: when the event “medical document” was determined, it is associated with the function “summarize” of the application “myMedicalDocument”. This relation is being updated dynamically, and is stored as a dynamic XML document, called association file, as shown in  FIG. 2 . 
         [0037]    In accordance with an illustrative embodiment, as illustrated in  FIG. 3 , operating system  30  stores a set of one or more analyzers in container  32  which will be run on any file being uploaded to the system from applications  33 - 1  through  33 -N. When a file is uploaded to the file system, the operating system runs the set of analyzers, in order to identify the list of events  34 - 1  through  34 -P, that occur in the file. It can be done during IDLE time or at the time of upload. 
         [0038]    The analyzer&#39;s results, i.e., the events, are cached in a description file  35  which is associated with the file. On a modern Linux file system, we could use the file&#39;s extended attributes to store the analysis, and then use “inotify” to invalidate them when the file&#39;s contents changed. 
         [0039]    The flow chart of  FIG. 4  describes the list of actions being performed when a file is uploaded to the file system. As shown, file  41  is uploaded to operating system  42 . The operating system runs a set of one or more tests being provided by analyzer  43 . A successful result from a test produces an event  44  which is being stored in the file&#39;s description file  45 . 
         [0040]    As shown in  FIG. 5 , when right-clicking  52  on file  51 , the operating system reads from description file  53  the associated event(s)  54  and then extracts from association file  55  the relevant functions and/or applications  56 . These functions and/or applications are then added to the context menu  57 . 
         [0041]    Thus, to summarize: 
         [0042]    1. The right click is done on a file. 
         [0043]    2. The list of events is extracted from the description file of the file being clicked. 
         [0044]    3. The functions associated with the events are extracted from the association file. 
         [0045]    4. The functions context menu items are being added to the context menu of the file. 
         [0046]    5. Context menu of the file is shown. 
         [0047]    When a new application is added to the system, the type of events it supports and the functions that will be invoked when these events are determined, are extracted from its specification. The association file is updated with the matching record of association: if the event exists, the application is added as one that supports it. If not, a new event is added to the file, associated with this application as supporting it. In this case where the event is new to the system, the application should also provide the analyzer(s) that, given a file, can identify whether this event occurs. 
         [0048]    Furthermore, analyzers could be associated with the file based on the known metadata—e.g., file name extension, magic signature and known patterns. On a Linux machine, one could run magic(1) and then based on its output run a type-specific analyzer. The list of analyzers is handled by the operating system. In case the analyzer is new to the system, the list of analyzers is updated with the name and path of the new analyzer. 
         [0049]    Referring lastly to  FIG. 6 , an exemplary implementation  60  of a computing system in accordance with which one or more components/methodologies of the invention (e.g., components/methodologies described in the context of  FIGS. 1-5 ) may be implemented, according to an embodiment of the present invention. For example, the exemplary implementation may represent the computing system used to implement a customization of a context menu. 
         [0050]    As shown, the context menu customization techniques may be implemented in accordance with a processor  61 , a memory  62 , I/O devices  63 , and a network interface  64 , coupled via a computer bus  65  or alternate connection arrangement. 
         [0051]    It is to be appreciated that the term “processor” as used herein is intended to include any processing device, such as, for example, one that includes a CPU (central processing unit) and/or other processing circuitry. It is also to be understood that the term “processor” may refer to more than one processing device and that various elements associated with a processing device may be shared by other processing devices. 
         [0052]    The term “memory” as used herein is intended to include memory associated with a processor or CPU, such as, for example, RAM, ROM, a fixed memory device (e.g., hard drive), a removable memory device (e.g., diskette), flash memory, etc. It is understood that a memory device mentioned here is example of “computer readable storage medium,” which may constitute an article of manufacture when software instructions or code for implementing techniques of the invention are stored for execution thereon. 
         [0053]    In addition, the phrase “input/output devices” or “I/O devices” as used herein is intended to include, for example, one or more input devices (e.g., keyboard, mouse, scanner, etc.) for entering data to the processing unit, and/or one or more output devices (e.g., speaker, display, printer, etc.) for presenting results associated with the processing unit. 
         [0054]    Still further, the phrase “network interface” as used herein is intended to include, for example, one or more transceivers to permit the computer system to communicate with another computer system via an appropriate communications protocol. 
         [0055]    Thus, as mentioned above, software components including instructions or code for performing the methodologies described herein may be stored in one or more of the associated memory devices (e.g., ROM, fixed or removable memory) and, when ready to be utilized, loaded in part or in whole (e.g., into RAM) and executed by a CPU. 
         [0056]    Although illustrative embodiments of the present invention have been described herein with reference to the accompanying drawings, it is to be understood that the invention is not limited to those precise embodiments, and that various other changes and modifications may be made by one skilled in the art without departing from the scope or spirit of the invention.