How to get the local file system path of an image that loaded into the image component in cq5?

Hi,
I'm having hard time uploading image from filesystem where as drag and drop works.
I'm not getting a path of image selected from filesystem.
here is my code..
private String populateImage() throws Exception {
                    if (currentNode != null && currentNode.isNode()) {
                                   Node ImageNode = JcrResourceUtil.createPath(currentNode, "image",
                                                                      null, "nt:unstructured", true);
                                   imageUrl = ImageNode.hasProperty("fileReference") ? ImageNode.getProperty("fileReference").getValue().getString() : "";
       imageUrl = imageUrl.trim();
        log.info("MANAGE PROFILE BEAN IMAGE URL INSIDE IF IS: " + imageUrl);
                    } else {
                                        imageUrl = properties.get("fileReference", "");
                                        imageUrl = imageUrl.trim();
                                        log.info("MANAGE PROFILE BEAN IMAGE URL INSIDE ELSE IS: " + imageUrl);
                    return imageUrl;
So if I drag and drop..
ImageNode.hasProperty("fileReference") is returning a valid path
but if I upload an image  it is returning Null.
So how to get the path? any suggestions around would be appreciated...

When you say path you mean you want the path to print out in your HTML? Is that accurate? If so you generally need to constructe that path based on the path to the current component. So if you component is located at /content/mysite/en/about/mypage/jcr:content/parsys/image then the path to the image would generally be something like /content/mysite/en/about/mypage/jcr:content/parsys/image.img.jpg/1283829292873.jpg. The .img. selector triggers the servlet associated with the foundation parbase - /libs/foundation/components/parbase/img.GET.java. The reason you reference it this way is that there is no filesystem path to the image - it is stored in the repository not on the file system, and it requires a servlet or script to ge the binary from the repository and steam it.
Normally the way you'd construct this is to use the out of the box Image class - so look at /libs/foundation/components/image/image.jsp. Now this example assumes that your component where you loaded the image extends /libs/foundation/components/parbase. If it doesn't then you either have to change your sling:superResourceType to /libs/foundation/components/parbase or some other component that does exten /libs/foundation/components/parbase.

Similar Messages

  • How to get current local  file system volume sizes information from OMS?

    Hi
    I know I can get this information from the table SYSMAN.MGMT$STORAGE_REPORT_LOCALFS.
    But info stored in this table is not always up to date, but when going to the page em/console/monitoring/hostFilesystemOverview$target=xxxhostnamexxx$type=host$pageType=current$ctxType=Hosts the information is current.
    I have accessed mentioned table in apex, from outside OMS, I would like to have current information instead of old.
    How to do that?
    Thanks

    I think that there is nothing wrong with this table, just that the data is not collected every 5 minutes or so, only on a daily basis.
    But as ca107207 said - when you go to the page, showing information about the files system, from the host home page - the data is up to date to the current second.
    Therefore I think that OMS ask agent to send this value, but it is then not stored anywhere.
    My question would be how to ask agent from outside OMS to get this information?
    I have done a little reverse engineering on OMS packages and there should be a way to get this, using some procedures, pl/sql code with generating some cursors etc.
    I'm not that good in pl/sql to create something like that, it would take too much time for me. I think that it can't be done without OMS at all, I just have another database with apex on the same host and apex display some information for other users about the file systems etc. It would be nice to have information about file system usage current.
    Thanks

  • How to get access to the local file system when running with Web Start

    I'm trying to create a JavaFX app that reads and writes image files to the local file system. Unfortunately, when I run it using the JNLP file that NetBeans generates, I get access permission errors when I try to create an Image object from a .png file.
    Is there any way to make this work in Netbeans? I assume I need to sign the jar or something? I tried turning "Enable Web Start" on in the application settings, and "self-sign by generated key", but that made it so the app wouldn't launch at all using the JNLP file.

    Same as usual as with any other web start app : sign the app or modify the policies of the local JRE. Better sign the app with a temp certificate.
    As for the 2nd error (signed app does not launch), I have no idea as I haven't tried using JWS with FX 2.0 yet. Try to activate console and loggin in Java's control panel options (in W7, JWS logs are in c:\users\<userid>\appdata\LocalLow\Sun\Java\Deployment\log) and see if anything appear here.
    Anyway JWS errors are notoriously not easy to figure out and the whole technology in itself is temperamental. Find the tool named JaNeLA on the web it will help you analyze syntax error in your JNLP (though it is not aware of the new syntax introduced for FX 2.0 and may produce lots of errors on those) and head to the JWS forum (Java Web Start & JNLP Andrew Thompson who dwells over there is the author of JaNeLA).

  • Hyperlink to pdf on the local file system

    Hello,
    I'm using Oracle Reports 6i. I'm trying to set hyperlinks in my report through the pl/sql command srw.set_hyperlink to another pdf document.
    When I set the hyperlink to a URL, eg, http://localhost/document.pdf#dest, it works fine, the pdf opens in IE to the destination. Now when I specify the link to a file on the local file system, eg, file:///c|/document.pdf#dest, I get a file not found within IE. If I take out the destination, it works ok, that is, it opens up the document with IE.
    What am I doing wrong here? Is there a way to link a report to another pdf to a named destination within the local file system?
    Thanks,
    Ricky

    Ricky,
    This is more of IE - PDF issue I guess. Also this problem is seen more specifically for IE + File protocol + PDF
    Nothing related to the Reports PDF here. You can try by just referring a PDF section through file protocal in IE and you would see the same behaviour
    Thanks
    Rajesh

  • Sharing the local file system on another machine

    Version : 5.10
    We have an HP Proliant machine and a SunFire V40 machine. Both installed with solaris 5.10 (x86 AMD).
    In HP proliant machine we have filesystem with 600gb . We would like to mount this file system in the SunFire V40 machine . Is this possible? If yes, could you guys point me an URL where steps are mentioned to do this.

    Hope this is how one determines Filesystem type (got this from googling)Nope. There are several ways to determine the filesystem currently being used:
    $ mount | grep filesystem (where 'filesystem' is all or part of the mount point)
    /etc/vfstab will normally tell you (so long as it's not zfs)
    $ fstyp {mountpoint}
    sun.com links i get by Googling are taking me Oracle documentation homepage !We moved from docs.sun.com to the Oracle Documentation site last week and not all links have been updated. It's work in progress at this time. The Solaris 10 documentation can be found here - http://download.oracle.com/docs/cd/E19253-01/index.html
    And this is the link to the start of the NFS section - http://download.oracle.com/docs/cd/E19253-01/816-4555/rfsintro-2/index.html
    I wouldn't worry too much about getting the systems to auto-mount at boot until you've tested it manually. I'll assume this is a UFS/VxFS filesystem (ZFS requires a slightly different approach). If everything works, you can use the dfstab on the server and the vfstab on the client to automatically share and mount the filesystem so it persists across reboots.
    You'll need to do something like this as a test:
    On the HP System (the NFS Server) you'll need to enable the NFS Server SMF Service:
    server> $ svcadm enable svc:/network/nfs/server:default
    On the client enable the NFS Client SMF Service:
    client> $ svcadm enable svc:/network/nfs/client:default
    Back on the NFS Server you now need to share out the /foobar filesystem:
    server> $ share -F nfs -o rw /foobar
    Check the share using dfshares or mount
    server> $ dfshares
    server> $ mount
    On the client you can then mount the filesystem:
    client> $ mount -F nfs -o rw nfsserver:/foobar /foobar2
    The above is saying mount the exported /foobar filesystem residing on 'nfsserver' host to a local mountpoint of /foobar2 on this client.
    As a test you can also use the Automounter by simply cd'ing to the exported filesystem:
    client> $ cd /net/nfsserver/foobar
    Hopefully after reading the documentation you should get a working setup.
    Regards,
    Steve

  • Why does the local dimming system work differently in different picture modes on the w950b?

    Basically I was wondering why the local dimming is much more effective in the cinema mode than in other picture modes like game mode. For example, using the Disney World of Wonder advanced brightness test pattern, the blacks were very nice and dark with full clarity and detail of the test stars with local dimming turned on while in the game mode, all the local dimming seemed to do was get rid of some clouding but left the blacks looking greyish and hazy which obscured the clarity of the test stars. This is my first Sony tv and I really like the general picture quality but I've had tvs from other brands with local dimming that worked the same in all picture modes but the sony is the only tv where there is such a radical difference in how the local dimming is implemented in different picture modes and I was wondering why that is the case.

    On the Home screen, double-tap with three fingers to exit zoom.
    Then go to Settings > General > Accessibility and make sure Zoom is turned Off.
    http://support.apple.com/kb/ts3129

  • How the applet can access local file system?

    1. I want to plugin the applet into the JSP. That applet should access the local file system. How to enable this programmatically.
    2. Is it is possible to embed a frame inside the JSP. If so how?
    Thanks in advance..
    K G Vinoth

    1: If you want the applet to access the client's local file system you'll have to sign the applet. There is a tutorial some where on the java.sun.com that explains how to sign an applet.
    2: No you;ll need to use an applet to display swing or awt components on the client browser.

  • IOS: (not) playing sound from local file system - Error #2032

    Dear all,
    I am working on an app where I want to (among others) play sound files from the local file system.
    I have added a few mp3 files into my .ipa file.
    With a small file browser in my app I can select any one of them which returns me a File object.
    I then use this File object to do a URLRequest to load the sound:
    var req:URLRequest = new URLRequest(file.nativePath);
    sound = new Sound();
    sound.addEventListener(IOErrorEvent.IO_ERROR, soundLoadError);
    sound.addEventListener(Event.COMPLETE, soundLoaded);
    sound.load(req);
    It works in flash, but fails on the iPAD. Everytime I try to load, I get a IOErrorEvent with error code Error #2032
    When I replace new URLRequest(file.nativePath) with URLRequest("http://.../testfile.mp3"), everything works fine!
    Any help appreciated.
    Is this a matter of Security settings? Can I change those?
    Something to do with Sandboxing (whatever that is)?
    or something to do with cross-domain access?
    I have been looking around for days now and any help would be appreciated!
    I am using Flash CS5.5 & AIR 2.7
    Thanks, Marcus.

    Hi Sanika,
    this was something closer to that paragraph for "nativePath":
    Some Flex APIs, such as the source property of the SWFLoader class, use a URL (the url property of a File object), not a native path (the nativePath property).
    http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/filesystem/File.h tml#nativePath
    but that is not exactly what I've read (maybe that was A-blog or post on someone from A-team on his personal blog or post on stackoverflow).
    (myself I'm using and providing solutions for paths using FILE protocol - file URI schemes - mostly whenever I can and where it is supported)
    regards,
    Peter

  • Duplication of file folders in local file system Navigator

    My colleague and I have just noticed that in DIAdem 2010 we have duplication of file folders and network drives in the local file system window of Navigator. In the attached screen dump you can see folders that have duplicated - sometimes more than once as they are shown with full network path and with alloted drive letter (e.g. K&C, Project Info, Proposals 2010, SQEQUELData).
    You can also see where our 'N drive' is repeated part way down the folder tree. Needless to say, these are all rubbish.
    Any ideas?
    Thanks, Si.
    Attachments:
    folders.jpg ‏81 KB

    Hi Brad,
    Regarding not showing a Win Explorer screen dump, you'll have to trust me. I can assure you they are phantom, especially as there would not be a network drive shortcut letter part way through a folder tree structure. I don't know how much it has to do with the DataFinder either as we don't use it (unless it runs automatically in the background).
    Here are the answers to your other questions:
    Do you have DIAdem / DataFinder running continuously, or do you shut them down from time to time? DIAdem is only run when required - it spends more time shut than open.
    How do you have the DataFinder set up-- will it notice file system changes automatically? I haven't set DataFinder up at all so it is exactly as it came out of the factory. I ran a test by adding a new folder and it didn't show up until I hit the refresh button.
    Have you tried the <Index Now> button in the DataFinder configuration to force a re-indexing of all Search Areas? I tried this and it made no difference.
    Cheers, Si.

  • Access to local file system for desktop application

    As a .NET and VBA developer/user, I have found Flash to be a
    great RAD development solution for certain desktop app. projects...
    if only actionscript could access the local file system and talk to
    local (preferably non-XML) data-sources!
    I'm not familiar with the latest version of Flash CS3 &
    Actionscript 3.0
    Is there any reliable way Flash CS3 can be programmed to access
    the user's local file system - that is, as a stand-alone desktop
    application????

    Thanks for the response.
    I hope Adobe catches a clue ... with Microsoft's Windows
    Presentation Framework and the new ability of easily implementing
    Flash-like animation on .NET apps, Adobe is going to have to get
    busy. Stand-alone desktop apps still rule (as opposed to web-based)
    in the business world, and they are driven by data. If Flash was
    capable of easily talking to local data-sources (Access, Excel,
    Text etc.), it could significantly increase its adoption as a
    widely used business RAD tool. The Flash IDE is great and rivals
    any Microsoft RAD IDE + users love the slick Flash GUIs.

  • Zerofree: Shrinking ARCH guest VMDK--'remount the root file-system'?

    Hi!
    [using ZEROFREE]
    Getting great results with and extra ARCH install running as a VMDK in Workstation.
    REALLY need tips on shrinking the VMDK. obviously have deleted unneeded files
    and now rather urgently need to learn what's eluding me so far.
    1) zerofree is install IN the virtual machine (VMDK)workstation  running on windows 8.
    2) Here's the instructions for zerofree:
           filesystem has to be unmounted or mounted  read-only  for  zerofree  to
           work.  It  will exit with an error message if the filesystem is mounted
           writable.
           To remount the  root  file-system  readonly,  you  can  first
           switch to single user runlevel (telinit 1) then use mount -o remount,ro
           filesystem.
    As it a VMDK and it's running would the only/best option be to: "remount the  root  file-system  readonly" ??
    OR, could i add the VMDK to another running arch system that I do have and NOT mount the VMachine thereby
    allowing zero free to run even better on that?
    Are both method JUST as efficive at shrinking? My guess would be the remount root file-system as read only
    would NOT be as efficient at shrinking.
    I could really use a brief walk-through on this as all attempts have failed so far.
    I boot the ARCH virtual machine and do what may I ask?
    Last edited by tweed (2012-06-05 07:43:41)

    How did you use/test unison? In my case, unison, of course, is used in the cpio image, where there are no cache files, because unison has not been run yet in the initcpio image, before it had a chance to be used during boot time, to generate them; and during start up is when it is used; when it creates the archives. ...a circular dependency. Yet, files changed by the user would still need to be traversed to detect changes. So, I think that even providing pre-made cache files would not guarantee that they would be valid at start up, for all configurations of installation. -- I think, though, that these cache files could be copied/saved from the initcpio image to the root (disk and RAM), after they have been created, and used next time by copying them in the initcpio image during each start up. I think $HOME would need to be set.
    Unison was not using any cache previously anyway. I was aware of that, but I wanted to prove it by deleting any cache files remaining.
    Unison, actually, was slower (4 minutes) the first time it ran in the VM, compared to the physical hardware (3:10s). I have not measured the time for its subsequent runs, but It seemed that it was faster after the first run. The VM was hosted on a newer machine than what I have used so far: the VM host has an i3-3227U at 1.9 GHz CPU with 2 cores/4 threads and 8 GB of RAM (4 GB ware dedicated to the VM); my hardware has a Pentium B940 at 2 GHz CPU with 2 cores/2 threads and 4 GB of RAM.
    I could see that, in the VM, rsync and cp were copying faster than on my hardware; they were scrolling quicker.
    Grub, initially complains that there is no image, and shows a "Press any key to continue" message; if you continue, the kernel panics.
    I'll try using "poll_device()". What arguments does it need? More than just the device; also the number of seconds to wait?
    Last edited by AGT (2014-05-20 16:49:35)

  • Can an applet loading from a browser read from local file system?

    I have to load my applet from a browser, and the "browse" button on it should be able to select and read certain files in the local file system( or the files located under the server's home directory). Is there a way to address the security issue? I know there are ways to enable an appletviewer to do it, but how about a browser?

    You'll need to have a signed applet.

  • In WL Cluster JMS Persistent Storefiles on local file system.

    Hi Gurus,
      We have Weblogic cluster 10.3.4.1 (3 nodes) on Linux 5 which is setup for Oracle Services Bus.  Cluster has 3 machines configured.  Currently JMS Persistent Storefiles are on shared file system but we are having some issue with the shared file system and wanna move JMS Persistent Storefiles on the local filesystem instead of shared file system.  Is it possible in Clustered WL env or not.
    Thanks All.

    The data will be uploaded to the server and a PHP program will read the data and use it. I've already implemented it using JSON. I had to install a JSON stringifer and a JSON parser in a subfolder of configuration/shared/common/scripts. It's working well.
    Thanks
    mitzy_kitty

  • Btrfs May Be The Default File-System For Fedora 16

    Having a somewhat odd interest in different types of filesystems, I'd thought I'd share this snippet I wondered across.
    Brought up on the Fedora development list are the plans for Btrfs in Fedora, which provides a target of Fedora 16 when EXT4 will be replaced by Btrfs as the default Linux file-system on new installations.
    Fedora was one of the first distributions to deploy support for installing the Linux distribution to a Btrfs root file-system, while the Moblin/MeeGo camp has already turned to it as the default file-system, and now Fedora may finally have everything ready and are comfortable with the state of this Oracle-sponsored file-system.
    With the intended Fedora deployment of Btrfs, they will also switch from using LVM as the disk's volume manager to instead relying upon the volume management abilities built into Fedora itself. Fedora / Red Hat developers have previously already worked on taking advantage of other Btrfs features, like snapshots, to provide system roll-back support by creating a copy-on-write snapshot prior to each yum/RPM package transaction.
    In order to meet the Fedora 16 Btrfs target, Btrfs support needs to be merged into Fedora's GRUB package (or a separate non-Btrfs /boot file-system must be used), Red Hat's Anaconda must be hooked in to properly utilize Btrfs and its volume management features, and the Fedora LiveCD must be re-worked a bit to handle Btrfs. Additionally, the fsck support for Btrfs must be completed. Oracle's Chris Mason is nearly (circa 90%) complete with this task.
    Before Fedora 16 arrives we still have Fedora 15 to worry about, which will continue to offer Btrfs as a file-system option while EXT4 remains the default.
    Canonical is also evaluating when to switch to the Btrfs file-system and we may see that move similarly happen for Ubuntu 11.10.
    This would seem to imply that fedora is giving btrfs the big thumbs up! They currently release twice a year, and  fedora 15 is (I believe) Due out this May, so it wouldnt be too wrong to surmise that come Christmas btrfs would be the standard install option. However, I have always thought of fedora as being a little bit of a testing bed for red hat enterprise, so reading between the lines, I am thinking they want to release btrfs to the wild, and get the bugs sqwished so it can be incorporated into red hat, which is a good thing all round, for all concerned.
    Quote blatantly ripped from phoronix.
    wikipedia btrfs
    kernel.org btrfs

    There are, as I understand it, three big issues keeping Btrfs from hitting its final "stable" release:
    1) No true fsck (as of November, a fix is due "any time now")
    2) The logic used for subvolumes (a sort of "virtual LVM" setup) in Btrfs is wholly different from that used in Ext*, JFS, NTFS, HFS, etc; because of this, there isn't yet a single script/program that will accurately display space consumption.  Instead, the user needs to run a couple different commands and extrapolate.  A little annoying, but it doesn't affect stability.
    3) A bug in the COW aspect of the defrag command which, if run with an incorrect flag, can cause a doubling in the amount of metadata on the filesystem (and thus the amount of space it consumes).  Again, it won't wreck anything, but would make management tedious if one needs to restore a snapshot to get rid of extra cruft.
    These are all mentioned in the FAQ's on the Btrfs wiki, though the wiki doesn't give priority to any of them.  I'm guessing that, if Fedora 16 will be using this later in the year, the Oracle folks have told the Red Hat folks that they're planning on plowing through these issues very soon.
    Last edited by ANOKNUSA (2011-03-01 14:55:46)

  • [SOLVED] Find modified files from a package in local file system

    Is there a quick pacman command doing a diff between the local file system and a pacman package?
    Say I have installed a package foo and modified /etc/foo.conf. Now I want to find what's the difference between the file in my local file system and that in a clean package.
    If there's not a quick pacman command, what would you use in this case?
    Last edited by cyker (2014-10-10 05:18:46)

    amish wrote:
    Size difference does not always work!
    Lets say original conf file had two lines:
    Alert=true
    #Alert=false
    Now you changed it to:
    #Alert=true
    Alert=false
    So size will remain same!!
    So mod time is possibly better way to check!
    Right. Actually diff is the best way to check but doesn't seem to be there.

Maybe you are looking for