CKEditor - pass existing image path to file browser - ckeditor

I am using the latest CKEditor (4.9.2). I have integrated it successfully with a file browser (DevExpress) and everything works fine.
I use an initial upload path, common for both files and images. This directory has a quite large and complex structure (usually up to 6-7 levels). If the user wants to replace an existing image or file the file browser opens and he has to open six or seven folders in order to get to the folder that the new image is stored. Usually, the images the users replace are stored in the same folder with the one they are replacing. In my opinion, that should be the default behavior. If I select to see an existing image’s properties and then I hit the “Browse Server” button, to have the file browser to open in the folder the image resides.
Is there any way to pass the current image path, in the image url field, to the file manager? In that case with a little parsing I can set the file browser’s initial path to the same folder the existing image is stored.
Is that possible? I imagine that we must first get the image path from the image URL field and alter the “Browse Server” button’s code to pass it as a url parameter to the file browser.

This is a bit 'hackish', but inside your file manager, you can use this to get the existing value of URL field:
window.opener.CKEDITOR.document.$.getElementsByClassName('cke_dialog_image_url')[0].querySelector('input').value
cke_dialog_image_url is the CSS classname of the table that has the URL input field.

Related

Images do not display on a static page hosted on AWS S3

In S3, I have an index.html, a CSS file and an images folder with 3 jpg files in it. I cut and pasted the jpgs into the S3 folder. They showed as being there. I set a display policy per the instructions to display to everyone. The page displayed, but the images did not. I get the alt text and the tooltips, but no images. On the page, when I right click the Open Image in New Tab, I get an Access Denied message in XML. The page is: http://s3.amazonaws.com/pittsfordcommunitycenter/index.html
Images display on my development PC. I've tried a lot of things in AWS, including what the documentation suggested. What do I need to change?
This is your index.html URL:
http://s3.amazonaws.com/pittsfordcommunitycenter/index.html
This is your first image URL, which is missing the bucket name:
http://s3.amazonaws.com/images/WheelchairInElevator_w_475.jpg
The image URL should actually be:
http://s3.amazonaws.com/pittsfordcommunitycenter/images/WheelchairInElevator_w_475.jpg
Viewing your page source it looks like, given the location of your index.html file, all your image paths should start with ./images/ instead of ../images/. Since it works on your local machine I'm guessing your local index.html location is different, relative to the image files.
AWS domain links are case sensitive unlike you local machine.
In AWS S3 static Webhosting
../images/WHEELCHAIRINELEVATOR_W_475.JPG is **NOT EQUAL** to
../images/wheelchairinelevator_w_475.jpg

How to get relative URL path for an image uploaded on Oracle WebCenter

We are working on a requirement where we have to show a signature image on an RTF Template. This signature changes for one bank to other, so we are thinking to upload them in UCM server and use the URL's relative path concatenated with Bank Account ID/Number to fetch the image into RTF.
But, when we upload image by following Note 1605094.1 we are not able to get a relative path to hard code in our template file.
Uploaded one image (5486173210.gif), and the URL generated is as below
http://<ucmhost>:<ucmport>/cs/groups/public/documents/digitalmedia/ndg2/mtcz/~edisp/5486173210.gif
And the second image (11223344.gif) got the URL like below
http://<ucmhost>:<ucmport>/cs/groups/public/documents/digitalmedia/mdex/mjiz/~edisp/11223344.gif
We are looking for a common relative URL path, so that we can hard code that in our RTF Template.
URL something like below helps us.
http://<ucmhost>:<ucmport>/cs/groups/public/documents/digitalmedia/logos/5486173210.gif
http://<ucmhost>:<ucmport>/cs/groups/public/documents/digitalmedia/logos/11223344.gif
How about using the GET_FILE service URL?
http://<ucmhost>:<ucmport>/cs/idcplg?IdcService=GET_FILE&RevisionSelectionMethod=LatestReleased&allowInterrupt=1&dDocName=

How to source images from my storage to NetSuite without uploading them to the file cabinet?

In order to place images in the web store, they have to be uploaded to the file cabinet and then the file name needs to be associated with the item.
What I am looking to do, is to source the images from my current internal storage to NetSuite and still be able to view the images on the website. I am trying to find a way to do this because I don't want to have to upload them all individually or with a mass upload.
You will need to create a custom item field of type "text" and associate the field to the item record.
You can then place the full path to your image in the field you just created and reference the custom field in your templates.
This will allow you to use urls from your own host, but dynamically be able to use them within the NetSuite web store.

How to backup Core Data sqlite file with image for my iphone app?

I use Core Data to store the URL path of the image file in my document, how to backup both of them to mac/PC, I copy the sqlite file and the image out through iTune, and when I copy them back to iPhone, the sqlite seem to be ok, but the image didn't show up. I think the path has changed.
what can I do?
I have done something similar. Two things were key to making this architecture work.
The image files must be stored in a consistent location relative to the Core Data store file.
The URL/path stored in Core Data for the image is a relative one, not absolute. The image path is made relative to the Core Data store file.
Relative Location on Filesystem
I stored all images in a subdirectory named "Images" that lived in the same directory as the Core Data store file. E.g.
parent directory/
--> MyCoreDataStore.sql
--> Images/
-----> SomeImage1.png
-----> SomeImage2.png
Essentially, I treat the application's data as a file package: a directory containing multiple related files that all together comprise the application data or data document.
Relative image URLs
URLs (or paths) to images must be constructed at runtime. The Core Data store holds a relative path/URL to each image's location. The location is relative to the location of the Core Data store file. Your app always knows the full path/URL to the Core Data store.
I build the full path to an image location when needed using the parent directory of the Core Data store file and the relative image path held in the Core Data db.

Is there any plugin or anything to limit specific user access media manager?

I need to make an account for people to edit a part of my website, but they just need to update a small part frequently.
However, when they upload an image for the article, they are able to access all of the images in my site.
Is there a way to limit the access of images? Can I preset another image root path which is the sub-path of the original image path for the specific user?
Thanks a lot!
Use JCE (JoomlaContentEditor), it's the best editor available and allows you to lock down image paths specific to your users. (i.e. JohnDoe is logged in --> in the config you've specified a path for all images --> JohnDoe folder doesn't exist in the image folder --> folder is created and JohnDoe only has access to those files that he places in there).
Great Editor: http://www.joomlacontenteditor.net/
Be sure to get the component and plugins.
JCE works great -BUT, if the user uses the images/links tab to insert a intro/full image, JCE profiles will not work. The images root is the default path for uploading images via the images/links tab. The user will need to be mindful of what folder they are loading the images to.

Resources