7 Replies Latest reply on Jan 24, 2013 8:39 AM by 951671

    Adding image From Html Editor

      Hi dears,

      I'm developing a Web Center Portal Application with using UCM. ( Jdev v)

      To add content from UCM, i use Html editor. When adding a picture into the html block the address of the img is just like this :<projName>/<connName>/...

      This works in my machine, but when the project deploys on a server, will not.

      Can you help me about this problem? How can I set the source of the image in a dynamic way?

      P.s : I thought i can set it with UCM server ip, but it isn't efficient and secure.

      Thanks in advance,

        • 1. Re: Adding image From Html Editor
          • 2. Re: Adding image From Html Editor
            Hi Erdo,

            My first question: where does this comes from? Do I guess right that it comes from your default Content Repository connection as described here: http://docs.oracle.com/cd/E21764_01/webcenter.1111/e10273/createconnect.htm#BGBDDHAA ? If so, is it feasible, that you use the same UCM server from your machine (dev environment) as you'd use once deployed to the server (test/prod environment)? Or is the resource somewhat versioned and this approach would invalidate the version used in the prod? If so, you could use a trick: use a server name (like my.contentserver.com) instead of IP address, and redirect the address to the proper server ( in you dev env, and whatever IP address is used in your test/prod env).

            Also, could you describe in detail steps how you add a picture? There is a tutorial on using Wiki documents from WebCenter Portal: http://www.yonaweb.be/webcenter_11g_ps3_tutorial_introduction_content_integration or even Contribution Data Files (presented via Content Presenter): http://www.yonaweb.be/webcenter_tutorial/using_content_presenter_templates
            Do you use either of these ways?

            • 3. Re: Adding image From Html Editor
              Hi jiri, Thanks for reply.

              Firstly, i have pages that have to be added from html editor on runtime.When i try to add picture from UCM server, code is like that :

              <img alt="aaa.jpg" resourceid="casgem#dDocName:SP000UCM02_444000601" src="" style="font-size: 12px; font-weight: normal;" />

              I mean the editor sets the src. If the application runs, it finds my machine ip, then the connection settings and the content. I don't want to do it like this. You know we move the project onto the server the src will be meaningless.


              • 4. Re: Adding image From Html Editor
                Could you elaborate on how html is created? Do you use either Wiki docs or CDFs?
                Could you also confirm my idea concerning where the IP address comes from?
                • 5. Re: Adding image From Html Editor
                  Frow JDev I added a content from UCM Connection (Application Resources). The html page is loaded on UCM Server before. Then i run the page, with the key combiantion of " Ctrl+Shift+C " i opened the UCM HTML Editor.

                  The ip is automatically added by HTML Editor. I don't write it.
                  • 6. Re: Adding image From Html Editor
                    I was able to replicate your behavior. I have also verified my assumption that Wiki documents will behave the same.

                    Well, it seems as soon as you add an image to html in the rich text editor, there is no way to prevent the observed behavior. If it is just a few html files I'd probably go and fix the links in the other environment (if you re-edit the html it should fix the issue). If you have many of such cases, you will have to try define separate element definitions for text and image - the link http://www.yonaweb.be/webcenter_tutorial/using_content_presenter_templates should give you enough guidance.

                    Interesting observation: in my system the link looks like <img alt="Fire Flower_jpg.jpg" resourceid="WebCenterSpaces-ucm#dDocName:OWCVM037001000807" src="http://owcvm03:8888/webcenter/content/conn/WebCenterSpaces-ucm/uuid/dDocName%3aOWCVM037001000807"></img>

                    where 8888 is the port of Spaces, not Content. I could change it to http://owcvm03:7001/cs/groups/personalspaces/@pewebcenter/@e5d7bc30-1375-423a-9a2f-d9a0aaf74ce6/documents/document/mdax/mdaw/~edisp/owcvm037001000807.jpg (using the Content's port), but it's no victory.
                    1 person found this helpful
                    • 7. Re: Adding image From Html Editor
                      Hi jiri, sorry for replying late. midnight i found a way then i read your post, it's almost same solutions.

                      Now, you know html editor assigns the src in a little bad way. I don't think it's efficient. In UCM server (16200/cs), if you want to see the file attributes, you can see the path. The path starts with an unique ID that means an ip.

                      Just like your example, path : http://ucms002e056:16200/cs/.../.../... (sth like this)

                      If you copy and paste to html editor image src, it will not work again. Because, if the weblogic server and ucm server are not in the same machine, WLS can't solve the id "ucms002e056" and can't find the page.

                      For preventing this situation, the host file in the OS (The platform of WLS is loaded) (For windows -> Windows/System32/drivers/etc/hosts) has to be updated.

             localhost (yes it's already been there)

                      ucms002e056 (It's added now.)

                      I hope, I'm clear and good at telling my solution.

                      Thanks for help again.