Can I change the logo of an IBM community through the REST API - ibm-connections

I found this piece of documentation that suggests that we should be able to PUT a new logo in a community.
But the documentation also states that it is ignored on input.
Before we start intensive troubleshooting, it would help if someone could confirm that we can indeed change the logo programmatically.
Use the web address in the href attribute to obtain an image that represents the community's logo. The following operations are supported:
GET
Use the web address in the href attribute to obtain the community logo image file. If a logo has not been set, a default image is returned.
PUT
Use the web address in the href attribute to upload a new community logo image and replace the current one.
Attention: Specify the content type of the image file being sent with the request. For example: "Content-Type: image/jpeg"
This is the source:
http://www-10.lotus.com/ldd/appdevwiki.nsf/xpDocViewer.xsp?lookupName=IBM+Connections+4.5+API+Documentation#action=openDocument&res_title=Community_entry_content_ic45&content=pdcontent

Using the IBM SBT SDK 1.0.1 I was able to call CommunityService.updateCommunityLogo(new File("/path/to/my.jpeg"), communityUuid) without any error, but the JPEG I referred to was not set as the community logo however.
Maybe the size was not correct?
Sorry for this "non-answer", but it may help other people anyway: To fix the SBT SDK code at least :-/
UPDATE 2014-JUN-25:
I took a deeper dive into the http.wire logs, and surprisingly the call seems to trigger a logout (or session invalidation) without further notice. The REST request receives 200 OK but also some JavaScript looking like "hey guy, confirm who you are", and the browser prompts with a full-window Connections login prompt, although the LTPA token should not have timed out yet.
This is annoying, too, for another reason: If Connections is used inside a framed UI, the "main" application is wiped away after that, forcing Connections to full-window mode.

With IBM SBT SDK 1.0.3 (as of July 17, 2014) and IC5 it is working now. I had no opportunity to test this feature with 1.0.3 and IC45 however, but with 1.0.2 and IC5 it did NOT work; so it seems that something in 1.0.3 has been fixed here.

#mpjjonker you can look at CommunityService.java
the method updateCommunityLogo talks about using /communities/service/html/image URL to put the image.
String url = "/communities/service/html/image";
getClientService().put(url, parameters, headers, file, ClientService.FORMAT_NULL);

Related

Linked in previews not working

I have searched all over the internet for an answer and although I can find a million people with the same question I cannot find an official solution to the problem im experiencing.
I always get "Cannot display preview. You can post as is, or try another link." displayed.
I've stripped a page down to only the required open graph meta tags so I know they work (run through multiple OG validators), Ive disabled any kind of robots blocking, any kind of redirects, disabled the firewall on a test server, made sure the LinkedIn bot requests are hitting the server. All I see in the browser console all the time is a status 500 being returned from LinkedIn's preview generator API.
We are hosting on Windows Server in IIS 8.5, it seems if I create a demo and host it somewhere else it works, which makes me think it is server related or IIS settings.
Reading this Linkedin post's picture doesn't appear in summary its seems like a similar issue. We are not serving over SSL so nothing to do with that.
I have already asked this question on LinkedIn's forum but having no luck, so im hoping someone on here can help or someone from LinkedIn's tech team can help.
Thanks
So we had this issue as well and it turns out parts of our system that use user generated themes were not adding the "Content-Type" header to the response.
So examine the response headers coming from your server and make absolutely sure they are correct and that they include the correct "Content-Type" (with correct encoding) and "Content-Length".

THREDDS Server NetCDF file via WMS

I have setup TomCat and THREDDS server (loaded war file) and attempted to serve up some *.nc files using via WMS protocol.
I can request the file but all I seem to get back is a black image.
I had something similar in geoserver but I was able to update the styles layer and setup ranges so that various colours were applied.
I have tried editing the 'wmsConfig.xml'and alter options such as the 'defaultColorScaleRange' but it doesn't seem to have the desired effect.
I have read the documentation a few times but I may be missing something , has anyone overcome this problem ? Any help would be great.
Cheers
Update 1
So as suggest below using the built in viewer I can see the image and this is what I would like to get by requesting via WMS.
Using built in viewer
address : http://10.19.38.63:8080/thredds/godiva2/godiva2.html?server=http://10.19.38.63:8080/thredds/wms/testAll/testData.nc#
Requesting initial attempt
http://10.19.38.63:8080/thredds/wms/testAll/testData.nc?service=WMS&version=1.3.0&request=GetMap&CRS=EPSG:4326&width=150&height=150&bbox=-10097025.688358642,-12875664.540581377,20037508.342789244,313086.06785608194&LAYERS=precipitation&format=image/png&STYLES=boxfill/red
Which returns just the black square :(
I will carry on and look at the WMS url used by th eopenlayers example, maybe thats the key... ill continue to update my questions as my journey begins :).
Update 2
Managed to work out that the SRS being passed in was incorrect and needed altering.
now next stage is to work out how to request a time series over a batch of NCDF files.....
Update 3
Managed to work out a way to automate requesting WMS services and with the aid of this great plugin for leaflet maps I have the desired output.
https://github.com/socib/Leaflet.TimeDimension
Basically call the WMS endpoint with getmap that I require building up the url relevant for the file I need to request.
The next step for me is looking at styled for the returned raster at this point seems like some Java code modification, but at least my initial problems have gone. phew!
Update 4
Gone away and tried to rebuild the Java on a project ncWMS which I found was standalone but now incorporated into THREDDS. Still having no joy with transparency raster created from NETCDF.
Looking at THREDDS code a bit more after I also tried changing palletes that didnt seem to work , issue raised
https://github.com/Unidata/thredds/issues/631
You haven't shared the full url of your THREDDS request, but 10.19.38.63/thredds/wms/.... is the service url for the WMS GetCapabilities file. Which is an XML file describing the WMS service. That is not the THREDDS url for viewing the WMS via ncWMS. You need to scroll down the page to the Viewers: section and choose the Godiva2 (browser-based) link.

Integrating Optimizely with Adobe Analytics

I'm trying to Integrating Optimizely with Adobe Analytics. I have followed along with this guide: https://help.optimizely.com/Integrate_Other_Platforms/Integrating_Optimizely_with_Adobe_Analytics with no success.
The props(prop51) and evars(eVar51) that i'm choosing via the experiment integrations in Optimizely are never sent. I check via the wasp chrome add-on and via the Adobe account.
All other data (props & eVars) that we set manually are sent.
We are not using s_code.js but AppMeasurement.js version: 1.5.1. I don't know if we are using custom s variable. I guess not. So I have follow the guide and used:
window.optimizely.push("activateSiteCatalyst"); with no success.
I have also tried: window.optimizely.push(['activateSiteCatalyst', {"sVariable": s_c_il[0].account)}]); where s_c_il[0].account holds the account name, but with no success.
Tried following this guid as well: http://digitalinsightsworld.com/tag-manager/dtm/optimizely-implementation-check-list-adobe-sitecatalyst/
Does anyone have an idea of what is wrong? Or how to go forward?
Br,
Johan
I had the same problem... We're using AngularJS 1.4.x. The default value for sVariable is 's'. Generally stated, Optimizely expects window.s to be the omniture object. Angular abstracts this object to its own injectable item, and is therefore not a standard DOM/element off window. My quick hack was to set window.s = s from within the Omniture directive. I'm still working out the best location to do this assignment, but I can verify that I now see the custom eVar for Optimizely outgoing in our Omniture call (using Omnibug). Hope this helps!

Titanium: How to set referer when loading WebView

I currently use this
mywebview.setUrl(the_url);
to load a URL.
Can I, instead, load it in such as way as to include a referer in the http header?
EDIT: The reason for this is that the linked-to website should be able to see where the traffic is coming from even if the URL is loaded into a different webview than the one that contained the link. (I use multiple WebViews to create a tab UI.)
Edit:
The xcode equivalent seems to be this, although I'm not sure if this is also loading it into a new webview: Specifying HTTP referer in embedded UIWebView
It appears defining custom headers for WebViews is not available yet. You can watch ticket TIMOB-17467 to view updates.
It appears you will need a native module.
A quick check for iOS..
Safari Dialog module doesn't support headers (class limitation).
WKWebview module doesn't support headers (appears to be possible).
Perhaps you could extend these.
Android appears to be easier to implement, (but still not available in Titanium SDK), via extraHeaders: Read more: https://stackoverflow.com/a/5342527
I've looked at the Android Webview header (php getallheaders()) and there is x-requested-with: com.app.id
So in you page you could check for that value and know at least that it was visited by the app with the bundle identifier. Otherwise you could attach a get parameter to the url ?mobile and count this.
I'm trying to add a patch to the Android SDK and add a setHeader() method. The loadUrl() call is at:
https://github.com/appcelerator/titanium_mobile/blob/bc85170157d3bebc5de1d61a9fe6e34bce84a8c9/android/modules/ui/src/java/ti/modules/titanium/ui/widget/webview/TiUIWebView.java#L462
If you change it according to #tzmartin
extraHeaders.put("Referer", "http://www.referer.tld/login.html");
getWebView().loadUrl(finalUrl, extraHeaders);
then it already works but its hard coded.

Why does the Foursquare API JS not work with HTTPS?

In a system I have to maintain (didn't build it, just inherited it) we have a Foursquare implementation that hasn't been used in quite a while. Trying to revive it failed, because our page is now loaded via HTTPS, which it didn't used to be.
We are using the "Save to Foursquare" button as well as the API request to retrieve the number of Check-ins. I already switched all the JS includes and intent links from http to https and at least now it shows the number and the button correctly.
However, I can't click the button and checking the browser's console I found that it added a script tag to the head of this page which tries to access http://platform.foursquare.com/js/modules/widgets.asyncbundle.js. The browser obviously blocks this, because it's not using HTTPS.
The file we are explicitly loading is https://platform.foursquare.com/js/widgets.js. It seems to me like this script is not reacting correctly to HTTP vs. HTTPS. There is probably a very simple solution to this, so what am I missing?
I don't know if you've tried it yet but the foursquare website says this on the matter:
Change the source of the JavaScript file to https://platform-s.foursquare.com/js/widgets.js
Add {"secure":true} to the global configuration block (window.___fourSq)`
The same link (see below) has all the different ways to call the Save To Foursquare function using its .saveTo() function.
https://developer.foursquare.com/overview/widgets
I hope this information and links helps! Cheers.

Resources