Need to get filename from custom extension

Hello,
I am currently writing a custom extension and I'm having a tough time trying to get the filename of the document (java file) of the currently selected (and opened) file. So I have a java file open and right click on it to launch my extension. How do I get information on that document?
Also is there javadocs for the extsnsion API's? If so where are they located.
Thanks in advance!
Bill

Hi Bill,
You can find javadoc on the extension API via the help system (JDeveloper Extension SDK topic under the Reference section). Alternatively, you can extract the contents of the ${jdevhome}/jdev/doc/ohj/jdev-doc.jar to a directory somewhere to view the javadoc in a browser.
To get the filename of a document, assuming you're using 10g (not much different from 9.0.x), you need to get an instance of oracle.ide.addin.Context. Normally, you'll have a Context instance because you're implementing your logic in a Controller or a Command subclass. If not, you can obtain one using:
Ide.getMainWindow().getLastActiveView().getContext()Once you have the context, you can get the current selection from it. If that selection implements oracle.ide.model.Locatable, it has a URL. From the URL, you can get the filename:
import oracle.ide.model.Element;
import oracle.ide.model.Locatable;
import java.net.URL;
import oracle.ide.net.URLFileSystem;
Element[] selection = context.getSelection();
if ( selection != null )
  if ( selection[0] instanceof Locatable )
    URL url = ((Locatable)selection[0]).getURL();
    String filePath = URLFileSystem.getPlatformPathName(
      url
}One final thing, if the current view is an editor, the selection may be empty or will not contain Locatables. If that's the case, you might want to get the Document from the Context instead. I.e.:
URL url = context.getDocument().getURL();
String filePath = URLFileSystem.getPlatformPathName(
  url
);Thanks,
Brian
JDev Team

Similar Messages

  • Need to Get Data From Siebel On Demand ( I am new to Siebel Please Help)

    Hi All,
    I have a project in which i need to get data from Siebel On Demand and Automate this process.
    I have downloaded the Custom WSDL file and the Schema file from Oracle Siebel On Demand. I am using IDE WSAD and when i import these files into WSAD i am getting an error stating the schema definitions are wrong. Can anyone help me.....
    I need to complete it asap....
    Edited by: user491578 on Nov 11, 2008 6:50 PM

    You should probably ask Advantech. This question really has nothing to do with LabVIEW SE or NI-ELVIS. You could try posting to the LabVIEW board but there have only ever been two posts regarding 'advantech 4716'.

  • I got a new laptop (Macbook Pro) and my IPhone is synced with my previous laptop. I've recorded dozens of very long (un-emailable) Voice Memos over the last few weeks and need to get them from my IPhone onto my new laptop. How do I do this?

    I got a new laptop (Macbook Pro) and my IPhone is synced with my previous laptop (which I no longer have). I've recorded dozens of very long (un-emailable) Voice Memos over the last few weeks and need to get them from my IPhone onto my new laptop.
    How do I do this?
    (when I click on the Sync option I get the warning: "Are you sure you want to sync music? All existing songs and playlists on the iPhone will be replaced with songs and playlists from your iTunes library." I fear that if I click this I will lose all of my important Voice Memos as well)

    Just to add to what ChrisJ4203 said.  You can sync them to your new computer using iTunes by selecting to Include Voice Memos on the Music tab of your iTunes sync settings and syncing.  However, you still need to re-establish syncing with the new computer without iTunes erasing all the iTunes media from your phone (as the warning mentioned).
    If you copy your entire iTunes folder (not just your music) from your old computer to your new one, along with other non-iTunes media you may be syncing with iTunes (such as contacts, calendars and any photos synced to your phone from your old computer) by using migration assistant of following one of these methods: http://support.apple.com/kb/HT4527, then when you sync again with your new computer it will recognize your phone and sync as it did before.  You will still have to authorize the new computer for any Apple IDs used to purchase from the iTunes and App stores (in iTunes>Store>Authorize this computer). 
    After that you can sync your voice memos to your computer as mentioned earlier.
    If you want to archive your voice memos before you do anything with iTunes, you can use a 3rd party program such as PhoneView or Touch Copy.

  • How to get FILENAME from FILE PATH

    does anyone know how to get filename from a file path for example
    FILE PATH: C:\Project\uploadbean\web\uploads\Button.txt
    returns
    FILENAME: Button.txt

    @BalusC
    ust for a reference cause i'm new in JSP This has nothing to do with JSP, but with basic knowledge of an essential API. I have given you the link to the File API. Are you saying that you refused to read the API documentation, which clearly explains you how to use the File and shows which methods are all available to you undereach the straightforward getName() method, and expecting that the others may chew the answers for you? Loser.

  • What software do I need to get music from a vinyl record into ITunes

    What software do I need to get music from a vinyl record into ITunes

    When I used Audacity to digitize some of my LPs I would record the whole album, then trim the lead in, select and export the first track, delete that, then export the next track, and so on. You can zoom in and out to locate the track breaks. There is a snap to zero point option which should prevent clicks on track transitions. If you want to go deeper you can add fade in and out so you don't snap into the sound of the groove. (I was using a pretty ropey turntable). There are other tools that chop up audio but you should be able to do it all in Audacity reasonably quickly once you get your eye in. I'm sure there are tools that can chop audio at pre-specified points, or even calculate where those points should be, but they are unlikely to be free and probably still need a degree of supervision.
    tt2

  • How to get username from customer email id.

    Hi experts,
    How to get username from customer email id.I am using transaction XD02.
    I would be thankful for your kind replies .
    Regards,
    Sachin Hada

    Hi sachin,
    Re: Email id field
    Regards,
    Sravanthi

  • Partner roles not getting copied from customer.

    Hi ,
    Partner Roles not getting copied from customer to delivery Document .
    we have created one delivery document from a purchase order and when trying to create billing document from that delivery document it is giving log "payer" and ' Bill to party " not maintained.
    when checked in partner tab in delivery document these partner roles are not present there . so what can be the probable reason . These partner functions are maintained in customer.
    thanks!!!!!!
    which customizing seeting to check for this

    Hello Payal,
    Please go to T.code VOPA i.e. Maintain Partner Determination and select Delivery from the list and then click Partner Procedurers and select the relevant delivery type and double click you will get mandatory Partner Functions like Sold To, ship To, Bill to are ticked or not.
    Reward if useful

  • How to get filename from mail attachment

    Hi all,
    I have a XI scenario Mail->XI->RFC. I have created my own adapter module which handle all attachments from incoming mail.
    Everything work fine, but in my module I try to get information about filename of mail attachment. I use getContentType() metod to get the filename but this method return only the mimetype of the document. The getDescription() method return olny string "mail attachment". I need to get the original filename of the attachment or at least the file extension. 
    Is it possible to get the whole filename from mail attachment?
    Thanks
    Peter

    Hi,
    You can tryout with adapter modules . You can make use of following Adapter attributes also -
    http://help.sap.com/saphelp_nw2004s/helpdata/en/ad/bf93409c663228e10000000a1550b0/content.htm
    Similar discussion-
    Email attachment file names
    PayloadSwapBean-
    /people/michal.krawczyk2/blog/2005/12/18/xi-sender-mail-adapter--payloadswapbean--step-by-step
    Regards,
    Moorthy

  • Get filename from file sender adapter

    Hi Experts,
    I have a question regarding the file/ftp adapter (sender).
    I have a directory with xml and pdf files. for every xml file there is a pdf file with the same filename. for example:
    file1.xml
    file1.pdf
    file2.xml
    file2.pdf
    file3.xml
    file3.pdf
    Now I want to read the xml file with the file sender adapter. afterwards I want to read the related pdf file. for example: If I read the file file1.xml afterwards I want to read the pdf file file1.pdf with the file sender adapter. For this it is nessessary to get the filename from the xml file so that I can read afterwards the pdf file. How can I realise it?
    Thanks and best regards
    Christopher

    Hi srinivas,
    thanks for your quick answer.
    That the file adapter is not able to read pdf files is clear to me. In this case I only want to transport the pdf. that works fine. I tested it.
    the problem is the following:
    I have a xml file with the name "file1.xml". I read the xml file with the sender file/ftp adapter configured with filename "*.xml". Then I want to import the pdf file with the name "file1.pdf". Therefor I need the filename from the xml file.do you know what I mean? So XI has to know the filename of the xml to import the pdf with the same name ...
    regards

  • Getting filename from ahref

    Hi guys...
    <a href="<%=retrieveFileFromDatabase%> target="main">Hello!</a>
    I need to get the filename of the file retrieve from database (that is retrieveFileFromDatabase) at the time the user clicks the link but all i get is all the filename of the files retrieve... Not the filename the user click at that time... Any help here? Thanks in advance...

    <a href="<%=(((Recordset1_data =
    Recordset1.getObject(file_doc"))==null ||
    Recordset1.wasNull())?"":Recordset1_data)%>"
    target="main" ><%=(((Recordset1_data =
    Recordset1.getObject("topic"))==null ||
    Recordset1.wasNull())?"":Recordset1_data)%></a>
    This is the actual code in my program..Okay, got that. First step done.
    I need to get the value, "<%=(((Recordset1_data =
    Recordset1.getObject("file_doc"))==null ||
    Recordset1.wasNull())?"":Recordset1_data)%>, once the
    user clicks the link...Right, and that is what the code says, in JSP scriptlet. So you execute this on a page, and the HTML is sent to your browser, and ...
    What Happens? An error? Or it just doesn't give you what you want. For instance, Take a look at the source code, find that link, and see what is there. Compare this to what you think it should look like. For instance, I would guess, what you think should happen is the html should be:
    Topic Of Document
    But what you are actually getting is:
    Topic of Document
    Is this correct?

  • Getting filename from HttpServletRequest

    hi,
    i am doing a simple servlet for uploading file.
    i have been googling around, but i could't find a way to retrieve the filename from the HttpServletRequest object. most solution uses another party's code.
    below is the simple code from the html that takes in the file
    <form action="/TestJSP/test2" method="post" enctype="multipart/form-data">           
                <input type="file" name="test">
                <p>
                <input type="submit" value="Upload File!">
    </form>on the servlet side, i tried using
    String filename = request.getParameter("test") ;but i keep getting a null value for the filename.
    thanks in advance!

    of lots of apache package, like the FileItemFactory
    and ServletFileUpload, even the FileItem class.The package is written for a much wider audience, it is designed to do a lot more than just read the name of the file being uploaded. I don't know if you read their Guide.
    Keep in mind that the solution posted on the other thread was custom written to solve the posters problem, which is a lot more than reading the file name.
    If you want shrunken code, then it's not that difficult:
    package test71;
    import org.apache.commons.fileupload.disk.DiskFileItemFactory;
    import org.apache.commons.fileupload.servlet.ServletFileUpload;
    import org.apache.commons.fileupload.*;
    import javax.servlet.http.*;
    import java.util.List;
    public class AnotherFileUploadServlet extends HttpServlet {
        public void doPost(HttpServletRequest request, HttpServletResponse response) {
            FileItemFactory factory = new DiskFileItemFactory();
            ServletFileUpload upload = new ServletFileUpload(factory);
            List<FileItem> items = null;
            try {
                items = upload.parseRequest(request);
                for (FileItem item : items) {
                    if (!item.isFormField()) {
                        String fileName = item.getName();
                        System.out.println("File Name is: " + fileName);
            } catch (FileUploadException e) {
                e.printStackTrace();
    }

  • Getting filename from a string including filepath and filename

    How I can get a filename from a string which includes both
    filepath and filename? The filepath is not always the same. For
    example, the variable could include a "C:\temp\test.doc" or
    "C:\files\docfiles\test.doc" and I need to get the filename
    "test.doc" and save it to another variable. Thanks in
    advance.

    on getFilenameFromPath vPath
    oldDelim=the itemDelimiter
    the itemDelimiter=the last char of the moviePath
    iFilename=the last item of vPath
    the itemDelimiter=oldDelim
    return iFilename
    end
    Put that into a movie script. Then you can call the function
    any time
    to retrieve the last part of the path- like this:
    put getFilenameFromPath("C:\temp\test.doc")
    -- "test.doc"
    As an added bonus, it is cross-platform so it will work on a
    Mac as well
    as a PC.

  • Need to get data from multiple database instances in a single query

    Hi,
    I need a small favour from you guys. The prob is as follows:
    I need to get name, row_id from table A from schema 1 and gbu_name, name from table B from schema 2 where a.name = b.name. I wrote the query in the following manner:
    SELECT a.name, a.row_id, b.gbu_name
    FROM Schema1.A as a, Schema2.B as b
    Where a.name = b.name
    But this query is not working and the error is like " The table does not exists".
    Please update me how to avoid the error and get the right sort of result.
    Thanks & Regards,
    Debabrata

    Ah, youre actually asking different things.
    In your topic title, you say youre running separate instances
    In your body text, you say you are under different user/schema
    So tell me, do you have more than one database or not? How many entries in your TNS file?
    I would say, for "multiple database instances"
    SELECT
      a.id, b.id
    FROM
      tableA a
      INNER JOIN
      tableB@OTHER_DATABASE_LINK_NAME b  <--NOTE!
      USING(id)And of course you will have to look up CREATE PUBLIC DATABASE LINK sql..
    Message was edited by:
    charred

  • I need to get away from iphoto.   I use pixelmator for editing almost exclusively.  I have a Sony disc hx200v camera and a Kodak.   I will need to know if my cameras (on mac) will be seamlessly supported and how to get all my existing photos safely to lig

    I have several questions.   iPhoto does not meet my needs.    I would use lightroom mainly for organization and downloading photos from my camera cards.   My cameras are Sony disc-hx200v and a little Kodak  I will need to know if they are fine with light room.  Also I use pixelmator for photo editing and likely will use iskysoft dvd maker for mac to create my dvds once edited.      I am desperate to find a way to make my work flow work.   i.e.   I need to get photos somewhere on my mac,  in this case it would be lightroom then I need to edit them in lightroom and pixelmator,  then be able to get that  album/slideshow/folder whatever you call it Into the dvd maker to voiceover and finish the project.      It looks like aperture would have been more to my taste but they are
    also taking that away.   Yeah!  Go Apple.   About all I will have left of use is an operating system and mail.     Will appreciate any help.  I am 73 and doing dvd's for Amazon so I really can't afford any more programs that are snatched away and learning curves that change every 6 months. 

    Are you shooting in raw or jpeg?
    I’m not sure there is raw support for your Sony model and you don’t say which Kodak you have. But for jpegs Lightroom will normally work.
    For your existing photos it would usually be necessary to export versions to the desktop or create new folders in Finder. Those duplicates will contain the editing adjustments you have already made and can be imported into Lightroom using “Add” in the import dialog.
    I would suggest you download Lightroom and use it free for 30 days. You can then test it to ensure it meets your needs. You can download from this link:
    http://www.adobe.com/support/downloads/detail.jsp?ftpID=5856

  • HT1349 My itunes account has been hacked? I can't access my account or any support thru itunes. I have reset my password but I need to get info from support about my account

    Why can't I get help from support???
    Apple has my account with over $100 in the account and now it's gone and no one will talk to me???
    What do I do???
    and..this is an itunes problem,
    I have 2 iphones, 4 ipods...but it's ITUNES!!! It's been hacked and apple acts like it's so incapable of being hacked!!!
    I NEED HELP....where's my money in my account???
    this is the best apple can do, i'm sorry but this aint no support service!!!
    goodbye

    I can login to my account, after that I see message 
    Your account has been closed
    It looks like the Terms of Use may have been violated. To have our support team look into this, please click the support link below.
    <input class="UiButton default" style="line-height:19px;color:#ffffff;font-family:'Segoe UI Web Semibold', 'Segoe UI Web Regular', 'Segoe UI', 'Segoe UI Symbol', HelveticaNeue-Medium, 'Helvetica Neue', Arial, sans-serif;height:2.142em;padding:4px 12px
    5px;margin:0px 0.5em 0px 0px;cursor:pointer;min-width:6em;background-color:#0072c6;border:0px;" type="button" value="More info" />
    So How Can go to my mail box? I already changed my password 3 time in this week.
    What can I do or What I have to do?
    When I go to Security info I'll got this massage but my email er*****@live.com
    have been closed also (Can't login to that mail).
    We're not ready for you yet
    Your 30 day waiting period ends on 1/15/2014. Please continue to wait and we'll send you an email when you can sign back in.
    If you've regained access to your old security info listed before, click "I found my security info" to get back in to your account and cancel any changes.
    Your old security info
    er*****@live.com

Maybe you are looking for

  • When extracting a page from a PDF, I lost nearly 1KB of data. What exactly is changing here?

    I have a project in which I compile content from scanned documents. Usually I send the scans in packets of 15-50 pages at a time, and extract the pages (using Document > Extract Pages...) into a separate folder for compiling and tagging. Sometimes, u

  • SOLVED:Dmenu not launching correctly in Xmonad

    I am running xmonad and I am having issues getting the dmenu_run to execute properly. It was working fine before but now it just launches with a white bar and nothing autocompletes. I am running Xmonad 0.9.2-2.1 and dmenu 4.4-1. Here is my entry in x

  • HP Pavillion g6 2303sm switchable graphicks problem

    Pozdrav! Prije oko godinu dana nabavio sam jedan hp-ov notebook HP Pavillion g6-2303sm (D1P03EA) i sve je radilo super sa win 8-icom kad sam ga kupio ali nakon nekog vremena odlucio sam se za update na win 8.1 i nakon update-a vise uopce nije koristi

  • Re: Crack on the screen;

    I have an Iphone 4 which is less than a year old, unfortunately my little son threw it on the ground and a single crack formed on the screen. I would like to ask if Apple can help me to repair the phone while I pay the cost? Osman

  • Arch Linux Podcast

    I have read the old posts about someone starting an Arch Linux podcast in other places but I haven't found one yet. If there is one out there please correct me. I am part of a crew of hosts that do the Linux Basix podcast and to compliment the main c