XPages Resource Servlet - xpages

my xPages app (with oneUI theme set) works perfect when I use e.g. this URL:
https://testserver.xxxx.xxxx.com/app_folder/Home.xsp
and then our Domino admin mapped it to a new URL
https://myApp.xxxx.xxxx.com
that by default opens Home.xsp page
but now I see several UI issues - some icons/images are not shown, some controls displayed incorrectly.
What could cause this problem? It's the same Domino server but just two different ways to log in. Is it something related to "XPages Resource Servlet" configuration? Where can I check it?
For example. I have an image on xPage that has following resource:
"../../oneuiv2/images/sortDescending.png"
then when I log in through https://myApp.xxxx.xxxx.com - it doesn't show the image...
OK, then I replaced it with:
"/.ibmxspres/domino/oneuiv2/images/sortDescending.png"
same result.
but this works:
"/.ibmxspres/global/theme/oneui/images/sortDescending.gif"
I can replace all images/icons with new resource URLs but anyway other standard controls are not shown correctly..

Based on our short discussion your problem is in wrong URLs.
So why one URL works and the other one doesn't? Concatenation, in my opinion. Browser, JS frameworks (DOJO) and JS programmers in general tend to use either relative URLs or cut/concatenate URL string. This my result into URL that is not understandable by server.
In your case check URL mapping made by your admin - does it apply to all URL formats used by XPages? Are those transformed URLs accessible on server (enter them in URL bar of browser)? That is the key to get your XPage working.

OK.. it's fixed. The problem was in Virtual Server Mapping document.
Names.nsf -> Web -> Web Configuration -> Virtual Server -> Mapping tab...
we had to set
HTML directory: domino\html
which was
HTML directory: /myappdbname.nsf
instead

Related

How do I make Outlook-addins maintain URL fragments to support single page applications?

I've found that when launching an Outlook add-in, the URL that you configure in the manifest does not persist the fragment URL and this breaks Single Page Applications (SPAs). It works fine if you are just trying to go to the default route of the SPA e.g. index.html but if you try and go directly to a fragment URL (route) within the app then it doesn't work e.g. index.html#mypage
The index.html#mypage actually gets changed to this:
index.html?et=&_host_Info=Outlook|Web|1…_1480636166782|ocii1|https://outlook.office.com/owa/?realm=XYZ.com#&_serializer_version=1mypage&_xdm_Info=-133b2041_-3d735892_1480636166782|ocii1|https://outlook.office.com/owa/?realm=XYZ.com
Further explanation of the issue can be found here:
https://camerondwyer.wordpress.com/2016/12/02/issues-launching-outlook-add-ins-directly-to-a-spa-route-using-fragment-urls/
Moving to HTML5 style URLs is not currently an option for me so routing within the SPA needs to use the Fragment URL (hashbang). I imagine anyone trying to start an add-in and pass parameters in the URL would be seeing a similar problem.

friendly URL remap format in DNN

we have a custom module on our DNN site that creates unique URLs for each entry from an underlying database. The URLs would look something like this:
something/afn/something_else
A snippet from a full URL:
tabid/66/afn/160529-David%20Lewis-000258-010-003-00001
Without a trailing /Default.aspx. The module would see the /afn/, process the something_else, and if valid, render the unique page accordingly.
We just upgraded to DNN 8.0.3, and this is no longer working, instead we are getting 404 errors from IIS. We discovered if we append /Default.aspx to the URL, it works as it's supposed to. Changing the module to put /Default.aspx when the page is generated is simple. However that leaves countless links on our page, and on the web, that no longer work.
After much research I found the Friendly URL Settings in DNN under Host -> Host Settings -> Advanced Settings. This appears to have a way to remap URLs. The trouble I'm having is formatting the remap correctly.
My question:
What can I enter in the Friendly URL Settings so that if a user clicks on a url formatted like this:
ourwebsite.org/something/afn/something_else
it changes it to:
ourwebsite.org/something/afn/something_else/Default.aspx
Thank you very much.
EDITED: to add real life example URL.
WIth current DNN this should not be the case as the Default.aspx at the end isn't needed. In your upgrade, depending on the prior version, you will want to validate the "Url Settings" for the portal to ensure that for some reason that you don't have extensions turned on. Otherwise, when you upgraded did you see any errors? What version did you upgrade from.
Based on the standard setup of DNN URL's, this should work as desired assuming that /something/afn is the URL to a particular page. Or that something is the page and afn is the querystring.
Example /something?afn=something_else
Whereby you are expecting to see a Request.QueryString["afn"] value for the something_else value.

html base tag with different domain from the top domain gives security issue

I've a website which displays and edits the contents of a different web pages like adding css codes to them.
It works like this, i use curl to get the contents of webpages then i edit the content and add base tag with href attribute which points the url that i got the contents of it. Then i put the edited content to an iframe on my website. It was working for a year, but yesterday i noticed an error that google chrome shows me the security warning page.
I've tried so many things to fix this problem but i couldn't fix it. when i use the base tag with different domain from the top domain, it shows the warning page. Do u have any idea how can a pass this problem. I have to use base tag with a different domain from the base tag.
It looks that was google side error :D We contact with them and the problem is fixed :)

Using a Web Site Document with an XPage - how to setup correctly?

I have set up a small XPage and have until now used the full path to the Xpage for testing, i.e.
http://devsrv1.magerman.ch/Development/Schulungen/Schulungen1_0/Schulungen_(1_0)_Dev.nsf/HomeWithDataView.xsp
I then tried to apply a Web Site Document
But the links are no longer currently functioning. I have the feeling that I'm missing something pretty basic, and am unsure as to what the best practice is. I'm quite happy with having the original request to the hostname resolve to a full path, i.e.
input
schulungen.magerman.com
and have it resolve to
schulungen.magerman.com//Development/Schulungen/Schulungen1_0/Schulungen_(1_0)_Dev.nsf
but haven't found a way to do this elegantly.
At the moment, my relative links '/OtherXpage.xsp' fail as they try to get to schulungen.magerman.com/OtherXpage.xsp
Any pointers?
Create a Web Site Rule. You can create it from your Web Site document in edit mode with action button " Web Site ... / Create Rule".
You can find a description how to fill the fields here.
The problem is usually that you need to add a trailing slash to the hostname
http://www.xpagedeveloper.com/2013/quicktip-get-right-path-when-autolaunching-an-xpage

Some SharePoint pages serve as http in https environment

I have a WSS 3.0 system using SSL where every page is supposed to be served as https. Almost all pages do come out as https, but in certain cases I click on a link and that brings up an http version of a page (which does not load). In those cases I have to put the 's' in by hand to get the page to load. Places where this happens are:
/_layouts/newgrp.aspx : when I try to create a new group, it takes me to http://server/_layouts/newgroup.aspx, although it should be https. The page does not load at http. It does load if I change the url by hand.
/_layouts/edtgrp.aspx : same thing as newgrp.aspx
if I go into a document library and view version history for a file, the URLs to the individual versions of that file are http. Interestingly, the browser status bar also indicates http when I hover over them (so it seems that SharePoint gets confused when it generates the links, rather than when I click on them)
To fix this, I have tried adding some javascript to the DOM that searches for instances of http and replaces them with https. This works in some cases, but there are some places where javascript can't reach, for example when SharePoint provides the target URL in response to a POST request, which I think is the case with newgrp/edtgrp.aspx.
I have also tried adding ISAPI filters to redirect pages from http to https. This seems to cause redirect loops, and in any case I'm not sure if such filters would preserve querystring or POST information.
Has anyone seen this problem?
Update: We have switched to ISA from Squid, and the problem continues in the version history, but not on new group or edit group. We have not seen any improvement yet from changing AAM settings.
Places where this is happening in ISA:
"Version History" under item in list or document library
"Manage Permissions" under item in list or document library
"Alert Me" under item in list or document library
"Add Users" menuitem in "People and Groups" page
"Group Settings" menuitem in "People and Groups" page
"Edit Group Quick Launch" menuitem in "People and Groups" page
"Set Up Groups" menuitem in "People and Groups" page
"List Settings" menuitem in "People and Groups" page
Not sure if this is it, but have you checked your alternate access mappings to make sure they say https instead of http?
I would echo the suggestion to check your Alternate Access Mappings. Is the SSL being done on the SharePoint Front Ends, or is it being done via a piece of dedicated SSL hardware?
Use an HTTP Module to modify SharePoint's output so that links are always changed to https. Such a module can plug into IIS and modify the HTML of anything rendered. I've used this technique to make SharePoint XHTML compliant and it works well.
Even better, almost all of the work has already been done for you. The UrlRewritingNet module is open source and available for free download. It should work fine for your SharePoint site. This tool has great documentation and uses regular expressions to match which URLs to alter. It should be pretty easy to write one for your case, e.g. ^http://. There's also many more advanced options you can take advantage of if necessary.
If you'd prefer to write your own then there is a good article called Rewrite.NET -- A URL Rewriting Engine for .NET on the 15 Seconds site.
Finally, if you're using IIS 7 you could try its URL Rewrite Module. I've never used this myself and don't know if it works with SharePoint, but it's the most UI-driven solution available.
Add a redirect in IIS from http to https. Every time you access that page it will redirect you to your https page instead.
I would also suggest placing WSS on another server to see if you have the same problems. If you don't, you might need to rebuild/migrate your stuff over.
Alex answered this question with an approach that I think will generally work. Here is how I fixed this specifically.
It looks like when a SharePoint aspx page is loaded, it populates a javascript structure of type ContextInfo (defined in init.js), which is instantiated in the variable ctx. That structure has a member called httpRoot, which is later used in core.js to build menuitems in various dropdown.
This ctx.httpRoot is for some reason populated in javascript in the aspx files created by SharePoint with a line like this:
ctx.HttpRoot = "http:\u002f\u002fsubdomain.domain.com";
Yes, it has Unicode slashes and it has http instead of https. I have no idea why. But, fixing this line of javascript seems to fix the problem.
I changed the line by adding a URL translation rule in ISA that converts http:\u002f\u002f\ to https:\u002f\u002f\ . I suspect that an HTTP module that makes the same replacement would also work. Or possibly some well placed javascript that reassigns the variable at some point.
I still believe this is not ideal and there must be a more appropriate way to fix these links.

Resources