-
1. Re: Method to link to admin pages update: Need nee method
TheBCMan Aug 6, 2014 2:38 AM (in response to Liam Dilley)Maybe I'm missing something from your question but why can't you just link directly to the page URL, for example:
https://SITE.worldsecuresystems.com/Utilities/ShopSettings.aspx
it will redirect to the login page (if not logged in) then after successful login redirect to the page you requested.
-
2. Re: Method to link to admin pages update: Need nee method
Liam Dilley Aug 6, 2014 4:37 AM (in response to TheBCMan)This is in apps TheBCMan, your already in the admin but apps are in the sanboxed environment.
-
3. Re: Method to link to admin pages update: Need nee method
Digital Fuel Web Aug 6, 2014 3:40 PM (in response to Liam Dilley)Not exactly sure this is what you are talking about, but I just yesterday I could not get this to work.
/Admin/AppLoader.aspx?client_id=app-name-folder&redirect_uri=THE_URL
You can do what I did link directly to a webapp menu item - https://site.worlsecuresystems.com/Admin/CustomContent_ItemList.aspx?CustomContentID=' + ID + '&t=t&CustomContent=Name.
The webapp loads inside the sandboxed iframe under the current Apps Page title. For me it causes a few formatting issues as I am using BC style html, css to style my app and alters made to the css effects the webapp now sitting inside the apps iframe.
Would be nice if the /Admin/AppLoader.aspx?client_id=app-name-folder&redirect_uri=THE_URL worked but it does not seem to for me either at the moment.
-
4. Re: Method to link to admin pages update: Need nee method
TheBCMan Aug 6, 2014 5:11 PM (in response to Liam Dilley)You didn't specify this was a BC app, pass the URL target the parent frame, but you'll have to ask the user on first run of the app, what is your url or thereabouts and save that to a config file.
-
5. Re: Method to link to admin pages update: Need nee method
Liam Dilley Aug 6, 2014 6:18 PM (in response to Digital Fuel Web)Menu is fine, I do not want to link in the menu
If you have a button or link in your app itself you can cross link to other files in the app itself but if you needed a feature in the admin to be enabled and you asked fine it is disabled in your app so you ask them to enable it, with the sandboxing I tried about 8/9 ways to properly link to a page in the admin. But it does not work. The above link as a button in an app file, even with an absolute url just loads a blank page.
-
6. Re: Method to link to admin pages update: Need nee method
Liam Dilley Aug 6, 2014 6:23 PM (in response to TheBCMan)I get you TheBCMan for the confusion, sorry,
The post was mainly aimed at the BC guys, App developers would have got me as well.
You can not pass URL's to the parent window in apps. This is not allowed. The app itself is under its own https domain and the admin itself switches to https on apps. You are not authorised to access the parent window. This is security they built in.
Config files have nothing to do with this and linking within an app to admin pages.
-
7. Re: Method to link to admin pages update: Need nee method
TheBCMan Aug 6, 2014 6:30 PM (in response to Liam Dilley)I've not had to do this in apps I did but why wouldn't something like work?
<a target="_parent" href="http://url.org">link</a>
or in javascript:
window.parent.location.href= "the link";
You're not accessing the parent window's content your targeting the browser's URL.
-
8. Re: Method to link to admin pages update: Need nee method
Digital Fuel Web Aug 6, 2014 6:45 PM (in response to TheBCMan)Yeah I did that used referrer for parent stored URL in sessionStorage and it works but not for &redirect_uri. Just did not show it in the post. If I am getting what you mean.
-
9. Re: Method to link to admin pages update: Need nee method
Liam Dilley Aug 6, 2014 6:46 PM (in response to TheBCMan)Yeah, Your cross domain access, anything like that is blocked - Part of the sandboxing TheBCMan.
Some things that worked, BC did another round of security enhancements including the https change and not just under secure worldsecuresystems domain apps are under their own subdomain.
So all of that is locked out, it is why they provided the URI parameter, if it was that simple I would be doing that
You also have similar issues like how pages are loaded in, going back and forward is not as normal etc. There is a bit list of this sort of thing with open platform that need solutions that make viable apps or apps that do not take twice as long as they should.
Your an API guy so for example, you know just getting the primary url of a catalog for example - You can not just get the url, because it does not exist.
-
10. Re: Method to link to admin pages update: Need nee method
Liam Dilley Aug 6, 2014 6:51 PM (in response to Digital Fuel Web)I used referrer url and /Utilities/ShopSettings.aspx
But it just was rendering blank, I Can have an app delete itself and load the dash for example but for some reason linking to some parts of the admin just will not load.
-
11. Re: Method to link to admin pages update: Need nee method
Digital Fuel Web Aug 6, 2014 6:56 PM (in response to Liam Dilley)I am using a button in the app iframe itself not in the menu called Advanced Settings. window.location.href = storedURL + '/Admin/CustomContent_ItemList.aspx?CustomContentID=' + _itemID + '&t=t&CustomContent=_itemName; and webapp loads in the sandboxed iframe for me.
-
12. Re: Method to link to admin pages update: Need nee method
Liam Dilley Aug 6, 2014 7:28 PM (in response to Digital Fuel Web)Yeah, it works for some pages, it is odd. I had to put a paramater on the end with random value form date and time and got it to work. I think it may have had something to do with the fact it is not under /admin but /utilities
-
13. Re: Method to link to admin pages update: Need nee method
Digital Fuel Web Aug 6, 2014 7:45 PM (in response to Liam Dilley)That is odd. Looks like two things might need looking at the direct url link to BC Items and &redirect_uri from inside the app which would be handy.
-
14. Re: Method to link to admin pages update: Need nee method
Liam Dilley Aug 6, 2014 9:07 PM (in response to Digital Fuel Web)The way I redirect on app deletion, what you posted, what I got going here for me are workarounds. So your right, we do need a proper method to link to parts of the admin within apps. You of course might need to go to sections etc.
-
15. Re: Method to link to admin pages update: Need nee method
RaduCos Aug 7, 2014 4:22 AM (in response to Liam Dilley)Hello everyone,
At the moment the only way to navigate from an app to an Admin section is to rely on document.referrer and build the url where you want to navigate. This approach was already mentioned in this forum, but we also have a functional example in sample applications from bcapi sdk: Redirect to dashboard page, _redirectToDashboard function (line 102).
redirect_uri query parameter is designed to allow Open Platform applications to have multiple start pages.
In the future we intend to provide a way to communicate with parent frame through messages. For instance, using the sdk you would be able to do something like:
BCAPI.sendAdminMessage("redirect_to", {"url": "/Utilities/ShopSettings.aspx"});
Regards,
Radu
-
16. Re: Method to link to admin pages update: Need nee method
Liam Dilley Aug 7, 2014 4:38 AM (in response to RaduCos)Thanks Radu, Yeah I knew about the methods, but for some reason some admin pages seem to need the extra random parameter appended to work properly, otherwise it just blanks the page and nothing happens. Like a few things at the moment, Open platform has lots of potential but everything takes twice as long as it should
I know you guys say in the documentation to use the BCAPI.js but things like the file API I have found it is actually quicker through the API endpoints for example. It will be a while before you guys can get back to open platform I know, but it will be a much needed sweep on this stuff and I think app development will remain light until then.
-
17. Re: Method to link to admin pages update: Need nee method
Adam Cook Aug 7, 2014 7:39 AM (in response to Liam Dilley)I agree with Liam about the SDK vs the APIs right now. In fact, I've been almost exclusively, with a few exceptions, using the APIs in my development because it's actually easier to simply build a function to handle the scenario.
-
18. Re: Method to link to admin pages update: Need nee method
RaduCos Aug 7, 2014 7:51 AM (in response to Adam Cook)Regarding the sdk, it would be great if you can post some samples about APIs consumptions. I am really curious why using the sdk is more complicated than a plain ajax request? I am asking this because one of the main reason we invested in sdk was to actually make developer life easier .
-
19. Re: Method to link to admin pages update: Need nee method
Digital Fuel Web Aug 7, 2014 3:04 PM (in response to RaduCos)I like the SDK but I am new at this. My thing is that the sdk is limited and the API still needs to be used to achieve a lot of thing. Being able to use the sdk for 95% of the tasks would be great.
-
20. Re: Method to link to admin pages update: Need nee method
Digital Fuel Web Aug 7, 2014 3:23 PM (in response to RaduCos)Radu
sendAdminMessage sounds good. Another question will future additions allow access to querys from the menu.json "attr":{"href":"/Admin/AppLoader.aspx?client_id=digifuel-app&appID=19439"} to the app iframe not the parent frame. This would allow one html file to be reused for many apps just like webapps in BC without referrer and extra code and issues.
menu.json
Menu item 1 "attr":{"href":"/Admin/AppLoader.aspx?client_id=digifuel-app&appID=11111"}
Menu item 2 "attr":{"href":"/Admin/AppLoader.aspx?client_id=digifuel-app&appID=22222"}
Read the query, then display correct webapp content. Apps using webapp without adding duplicate html files and delete old ones, keeping things concise.
-
21. Re: Method to link to admin pages update: Need nee method
Adam Cook Aug 7, 2014 3:28 PM (in response to RaduCos)One of the reasons I prefer to use the APIs over the SDK is because I'm so concerned with unnecessary calls. I've essentially been building my own SDK that works with my development patterns. Here's an example:
-
22. Re: Method to link to admin pages update: Need nee method
Liam Dilley Aug 7, 2014 5:01 PM (in response to Adam Cook)Lots of cases Radu,
Writing an xml file or json file - API endpoint is just faster every time for me.
The file API I find slow anyway, up to 32 seconds to save an xml file thats only 800/900kb in size. The file I can generate fast but when that data is saving it is slow. So using the API Endpoints shaves valuable seconds.
I have found things like the product feed XML wont be picked up by the BC file API so I just ajax that in myself and skip the api altogether.
-
23. Re: Method to link to admin pages update: Need nee method
TheBCMan Aug 7, 2014 5:40 PM (in response to RaduCos)As you all know document.referrer is extremely unreliable, so going back to my original suggestion, when the user first runs the app, detect that and ask a setup question of "what is your url?" Save it to disk as your own config file, you don't need to rely on anything else assuming they don't change their URL.
-
24. Re: Method to link to admin pages update: Need nee method
Liam Dilley Aug 7, 2014 8:41 PM (in response to TheBCMan)Really bad user experience and I am defiantly never going to do that. Got another method now that works and BC's proper solution coming the sooner the better will be the right way.
-
25. Re: Method to link to admin pages update: Need nee method
TheBCMan Aug 7, 2014 9:04 PM (in response to Liam Dilley)Bad user experience is using document.referrer and it not working 50% of the time If there is a better way to do it all good I'm just offering a suggestion that would 100% work everytime, if there is an official / better way go for it... but it is pretty standard to have a first install qquestionnaire or term or conditions for any app you install these days (not just BC) so I don't this it is a bad UX at all, you would only have to ask the question once.
-
26. Re: Method to link to admin pages update: Need nee method
Liam Dilley Aug 7, 2014 9:24 PM (in response to TheBCMan)I have a sollution that is working 100% in all browsers that open platform supports. So I am good
-
27. Re: Method to link to admin pages update: Need nee method
Liam Dilley Aug 7, 2014 9:25 PM (in response to Liam Dilley)And in terms of app UX - Asking someone to enter the url of the site they have already gone to and logged in, and asking them to login in again etc - those for me are defiantly things to avoid and I do consider those bad UX.
-
28. Re: Method to link to admin pages update: Need nee method
Adam Cook Aug 7, 2014 9:27 PM (in response to Liam Dilley)Alright boys, back to your corners.
-
29. Re: Method to link to admin pages update: Need nee method
TheBCMan Aug 7, 2014 9:29 PM (in response to Liam Dilley)Cool beans, what is your solution?
Agreed on asking the question, seems strange but if that was the ONLY way because of BC limitations (which it seems not if there you have a solution) to do it then it's a solution dude, don't get all defensive and dismissive about other people offering ideas
-
30. Re: Method to link to admin pages update: Need nee method
Liam Dilley Aug 7, 2014 11:16 PM (in response to TheBCMan)No Adam, just saying that we really are making very clear and strict guidelines in the UI of our apps and spending a lot of time it. Apps have limitations and TheBCMan is only providing alternate solutions. But for me, they are not ones I will undertake and I am just stating why I wont.
I want to avoid these double ups etc, and we have scrapped or put on hold a number of apps because the open platform will not allow us to deliver the experience we want.
TheBCMan is free to suggest what he likes as is anyone.
-
31. Re: Method to link to admin pages update: Need nee method
Adam Cook Aug 7, 2014 11:18 PM (in response to Liam Dilley) -
32. Re: Method to link to admin pages update: Need nee method
TheBCMan Aug 7, 2014 11:24 PM (in response to Liam Dilley)Liam: Care to share your solution? I'm interested to see what you did.
-
33. Re: Method to link to admin pages update: Need nee method
Liam Dilley Aug 7, 2014 11:51 PM (in response to TheBCMan)I tend not to, I also need to run it passed BC as well.
Done to many things, especially with Apps that we have had to scrap or not use because BC has decided, based on what I have done. I can understand them but I been quite frustrated but the open platform changes that have caused me to scrap lots of things.
-
34. Re: Method to link to admin pages update: Need nee method
RaduCos Aug 8, 2014 12:34 AM (in response to Liam Dilley)I really understand this issue causes painful experience for app developers. In order to fix this what do you think about the possibility to send messages to Admin from your app (one of the messages being redirect message)? Will this fix the problem you currently have?
BCAPI.sendAdminMessage("redirect_to", {"url": "/Utilities/ShopSettings.aspx"});
-
35. Re: Method to link to admin pages update: Need nee method
Digital Fuel Web Aug 8, 2014 12:51 AM (in response to RaduCos)Hi Radu
I think it is good it would help me.
As I noted above in regard to webapps I want to pass variables id of the webapp from the menu.json to the app
Currently I use this "attr":{"href":"/Admin/AppLoader.aspx?client_id=digifuel-app&itemID=19440" and use referrer which your solution will not work for.
But I have a solution if I am allowed. I have not fully test it on all browser etc. but it seems to work.
"attr":{"href":"/Admin/AppLoader.aspx?client_id=digifuel-app&redirect_uri=edit.html?itemID =17001" if you use &redirect_uri=PAGE.html?YOURQUERY it redirects and has the query included in the app url.
Question? is this legal use of redirect_uri if so I can use your sendAdminMessage() once available and redirect_uri and no referrer.
-
36. Re: Method to link to admin pages update: Need nee method
RaduCos Aug 8, 2014 1:08 AM (in response to Digital Fuel Web)It is perfectly fine to pass additionaly parameters to redirect uri (make sure you url encode redirect_uri value). Then you have access from your app to the uri and you can obtain all passed query parameters.
What is not currently clear for me right now is how you know item id upfront? Should this be a dynamic value which your app obtain (e.g list the items of a specific web app and choose an item id).
Nevertheless, you can pass query parameters through redirect_uri and your app will have access to them.
-
37. Re: Method to link to admin pages update: Need nee method
Digital Fuel Web Aug 8, 2014 1:42 AM (in response to RaduCos)I get the itemID by creating webapps from my app then appending the menu.json with a new menu items linking to the same page but with different webapp ID's (itemID). The page then renders the correct webapp content from json files.
As far as encode goes do you mean like this. redirect_uri=index.html%3FitemID%3D12345
-
38. Re: Method to link to admin pages update: Need nee method
RaduCos Aug 8, 2014 2:00 AM (in response to Digital Fuel Web)Got it. It should work.




