13 Replies Latest reply: Feb 8, 2013 6:25 AM by rgouw RSS

    Absolute url in html content at UCM

    carlos.aaf
      I created an weblogic portal application and some pages use composer. If I put an image within a page at UCM, composer put absolute URL. This pages in UCM will be transfered to other app server. Is it possible to configure composer to use relative URL?


      Using a application at URL http://localhost:7001/myapp and putting an image in a page, generate a HTML tag like this

      <img alt="Penguins.jpg" resourceid="UCM#dDocName:DEV006851" src="http://localhost:7001/myapp/content/conn/UCM/uuid/dDocName%3aDEV006851" />

      If I transfer this content to another server, I will must to change src="http://localhost:7001/myapp/... in content.

      Is it possible to do composer generate a relative URL?
        • 1. Re: Absolute url in html content at UCM
          Jiri.Machotka-Oracle
          I created an weblogic portal application and some pages use composer.
          Did you mean WebCenter portal?
          If I put an image within a page at UCM, composer put absolute URL. This pages in UCM will be transfered to other app server. Is it possible to configure composer to use relative URL?
          I believe it should work if you display your image via Content Presenter. Alternatively, you could also use a static resource (not from UCM), that is a part of your application as is deployed as such.

          Can you describe what image you want to display ("business meaning"), and why you want it in UCM (use cases)?
          • 2. Re: Absolute url in html content at UCM
            carlos.aaf
            Yes, I use Webcenter Portal.

            I need to display HTML content that is stored in UCM. In HTML there is an image referenced by an absolute URL.
            I can update HTML to use relative URL but, if I use compose in RichText mode, it put an absolute URL.
            • 3. Re: Absolute url in html content at UCM
              Jiri.Machotka-Oracle
              Hi Carlos,

              sorry to reiterate, but you didn't write much about what this HTML, image, etc. are good for, and what you need to do with them in your application. From your description I'd assume that your use case is similar to a page with company profile and logo.

              The simplest way would be to make it a part of your application - both HTML and image can be treated as static resources.
              But, if you mentioned RichText mode I assume that you want to give your users a chance to modify it, right? And the same might be true for the image. Note that the HTML might be constructed in different ways:
              - as a Wiki page
              - as a site studio data file

              If I got your message, you state that if you migrate both HTML and image to a new environment, the link is broken. Curiously, today's threads seems to be all about this topic - see pass webcenter space name to UCM , Displaying word doc in a iFrame/inlineFrame

              If you please describe your scenario in the common language - what objects you work with and what you want to do with them. I'm sure people here will be able to help you.
              • 4. Re: Absolute url in html content at UCM
                carlos.aaf
                Ok, sorry my poor english.

                We have an application with many pages stored at UCM. This pages will be create in development environment and tranfer to productive enviroment. When in productive, users will update this pages.
                My problem occurs when this pages are transfer to productive environment. All URL in this pages, refering images or other contents will be wrong.

                Look this scenario

                This is JSPX page source:
                ...
                <af:pageTemplate value="#{bindings.pageTemplateBinding.templateModel}" id="pt1">
                <f:facet name="content">
                <pe:pageCustomizable id="pageCustomizable1" styleClass="principal">
                <cust:panelCustomizable id="panelCustomizable1" layout="scroll">
                <af:region value="#{bindings.doclibcontentpresenter1.regionModel}" id="r1"/>
                </cust:panelCustomizable>
                <f:facet name="editor">
                <pe:pageEditorPanel id="pep1"/>
                </f:facet>
                </pe:pageCustomizable>
                </f:facet>
                </af:pageTemplate>
                ...

                doclibcontentpresenter1 refers to a HTML fragment stored in UCM like this:

                <h1>Page Example</h1>
                <p>My page have this image</p>
                <img alt="Penguins.jpg" resourceid="UCM#dDocName:DEV006851" src="http://localhost:7001/MyApplication/content/conn/UCM/uuid/dDocName%3aDEV006851" />


                Pay attencion in: src="http://localhost:7001/MyApplication/content/conn/UCM/uuid/dDocName%3aDEV006851".

                "http://localhost:7001/MyApplication" is the URL of my webcenter portal application in development environment and composer automatically put this in image URL, fixing the server address in HTML fragment.

                In production environment this page must be:

                <h1>Page Example</h1>
                <p>My page have this image</p>
                <img alt="Penguins.jpg" resourceid="UCM#dDocName:DEV006851" src="http://myserver.mycorp.com:7001/MyApplication/content/conn/UCM/uuid/dDocName%3aDEV006851" />

                Pay attencion in: src="http://myserver.mycorp.com:7001/MyApplication/content/conn/UCM/uuid/dDocName%3aDEV006851"

                I need to change the image URL whenever I transfer the page from development environment to productive environment or create all pages directly in productive environment.

                I seek a way to avoid composer to put absolute URLs in this page. Some like <img alt="Penguins.jpg" resourceid="UCM#dDocName:DEV006851" src="/content/conn/UCM/uuid/dDocName%3aDEV006851" />.
                • 5. Re: Absolute url in html content at UCM
                  Jaap Spiering
                  Good point. The URL should be relative, e.g. just the /MyApplication/content/conn/UCM/uuid/dDocName%3aDEV006851 part.

                  When migrating your portal to another environment, you should migrate the content too, so the dDocName in there is not an issue.
                  However, the host name and port number should not be in there as they may differ from environment to environment.
                  • 6. Re: Absolute url in html content at UCM
                    Imran Mirza
                    We have same issue when we move from DEV to UAT to PROD. I am sure that you must have some WebServer or load balancer that will your single host name for different application deployed on different machines like http://xyz.com/WebCenter or http://xyz.com/cs.

                    The solution of this issue is put //CS in case of page template or HTML pages. Like

                    <img alt="Penguins.jpg" resourceid="UCM#dDocName:DEV006851" src="//cs/content/conn/UCM/uuid/dDocName%3aDEV006851" />

                    In case of skin or other resources start your URL from /cs like.

                    Regards,
                    Imran
                    • 7. Re: Absolute url in html content at UCM
                      carlos.aaf
                      My problem still alive.

                      Webcenter Content Presenter give this absolute URL.
                      When a user change a page content and put an image or other resource in page at UCM, content presenter change to absolute URL.

                      This is page source at UCM before user change it

                      ...
                      &lt;p&gt;
                      &lt;a href="/intranet/content/conn/UCM/uuid/dDocName%3aDEV006883"&gt;Click here&lt;/a&gt; to download.
                      &lt;/p&gt;
                      ...


                      And this is page source after user change its contents
                      ...
                      &lt;p&gt;
                      &lt;a href="http://localhost:7001/intranet/content/conn/UCM/uuid/dDocName%3aDEV006883"&gt;Click here&lt;/a&gt; to download.
                      &lt;/p&gt;
                      ...

                      I need to configure content presenter (or composer) to use relative URL. If it is possible.
                      Can someone help me?

                      Edited by: carlos.aaf on 10/10/2012 11:51
                      • 8. Re: Absolute url in html content at UCM
                        916484
                        Hello Carlos,

                        We had this same problem with the Webservice´s proxy generator for JDeveloper (it generate the proxies putting the address as hardcoded).

                        So, as last you can consider our solution:

                        - Create the same DNS entry for all your environments (sample: ucm.yourdomain.com) and for each one you configure this DNS entry in the server hosts to follow the current server.

                        Ex:

                        Developer machine:

                        localhost ucm.mycompany.com

                        Development machine:

                        128.1.1.3 ucm.mycompany.com

                        UAT machine:

                        128.1.1.9 ucm.mycompany.com

                        etc.

                        And then, follow the 'images.mycompany.com' into your code.
                        • 9. Re: Absolute url in html content at UCM
                          Jaap Spiering
                          This may not be a desirable solution in some cases. If you need assistance with this problem you may want to open an SR in My Oracle Support and have an Enhancement Request filed.
                          At least I would be interested in an out-of-the-box solution.
                          • 10. Re: Absolute url in html content at UCM
                            carlos.aaf
                            Solution adopted: Don't use content presenter (composer). Don't use ADF. Migrate to another JSF implementation and use RIDC API to connect to UCM. Much more simple and works fine.
                            • 11. Re: Absolute url in html content at UCM
                              rgouw
                              I'm not sure if I understand the issue...

                              When you look at the HTML source that the content presenter component generates, it contains an absolute URL right?
                              If you check out the HTML file from UCM, what does the HTML source contain?
                              The absolute URL as well?
                              How do you edit the HTML file to contain an image?

                              Kind regards,

                              Rob
                              • 12. Re: Absolute url in html content at UCM
                                carlos.aaf
                                Hi Rob,

                                * When you look at the HTML source that the content presenter component generates, it contains an absolute URL right? Yes

                                * If you check out the HTML file from UCM, what does the HTML source contain? Any reference to resources (images) within html still in absolute url.

                                * How do you edit the HTML file to contain an image? I use content presenter ADF component. It's is a rich text editor. It's automatically does check out, edit and check in.

                                JSPX source:
                                ...
                                <f:facet name="content">
                                     <pe:pageCustomizable id="pageCustomizable1">
                                     <cust:panelCustomizable id="panelCustomizable1" layout="auto">
                                          <div class="clearfix">
                                          <af:panelGroupLayout styleClass="container" layout="horizontal" id="pgl1">
                                               *<af:region value="#{bindings.doclibcontentpresenter1.regionModel}" id="r1"/>*
                                          </af:panelGroupLayout>
                                          </div>
                                     </cust:panelCustomizable>
                                     *<f:facet name="editor">*
                                *          <pe:pageEditorPanel id="pep1"/>*
                                *     </f:facet>*
                                     </pe:pageCustomizable>
                                </f:facet>
                                ...
                                • 13. Re: Absolute url in html content at UCM
                                  rgouw
                                  Carlos,

                                  I assume you are using the contribution mode to edit the file..
                                  When you have added the image to the HTML, could you switch to HTML view by clicking the HTML tab.
                                  In HTML mode, you can make the link relative.

                                  I know it is an additional burden, but this should work.
                                  In addition, I would recommend to log a service request for this as I agree, this should not be happening.

                                  Kind regards,

                                  Rob