open social embeded experience - ibm-connections

I've developed an iWidget that creates a status update with an open social embeded experience gadget but it's not working.
This is the open social part data that I send to the server:
"openSocial": {
"embed": {
"gadget": "http://questionmine.com/app1/design/template/widgets/openSocial.xml?__dev_proxyPolicy__=intranet_access&__dev_policySet__=GADGET_TRUSTED%2CGADGET_SSO&__dev_appContexts__=EMBEDXP",
"context": {
"communityid":"urn:lsid:lconn.ibm.com:communities.community:' . $key . '",
"id": "' . $_POST['project'] . '",
"video":"' . $video . '",
"design":"' . $design . '",
"headline":"' . $headline . '"
}
}
}
This has worked before on another connections server, do I need to do any extra settings to allow the gadget ?

there is a file called opensocial-config.xml
For instance on the Deployment Manager it may be...
/local/con/opt/IBM/WebSphere/AppServer/profiles/Dmgr01/config/cells/localhostCell01/LotusConnections-config/opensocial-config.xml
<developer enabled="true" allowSSOFeature="true" allowIntranetProxyAccess="true">
<developer-hosts-whitelist allServers="true">
<!--
List of base URLs that are allowed to publish 'developer-mode' gadgets
<host url="http://{host.com}/base/url/1" />
...
<host url="http://{another.host.com}/base/url/N" />
-->
</developer-hosts-whitelist>
</developer>
You want to switch to true enabled allowSSOFeature allowIntranetProxyAccess
also switch whitelist AllServers to True
Edit the /local/con/opt/IBM/WebSphere/AppServer/profiles/AppSrv01/config/cells/localhostCell01/LotusConnections-config/opensocial-config.xml
Restart your Connections Server
It should come back up and enable all gadgets posted to render as EE

Related

Azure Web App File Download - Problem with special characters

i have a problem downloading files with special characters...
My web site (mvc.net framework) can upload files with the name "dummy _ + [] ## # ##] [#] 3.pdf", i can see it physically on my FTP server but when i try to download with url "https://fakeurl.con/Attachments/dummy _ + [] ## # ##] [#] 3.pdf" i have a 404 (The resource cannot be found.).
I tried adding in web.config file:
requestPathInvalidCharacters=""
system.webServer -> security --> requestFiltering -> allowDoubleEscaping="true"
system.webServer -> security --> requestFiltering -> allowHighBitCharacters="true"
But nothing has changed...
Someone can help me?
Thanks
Valerio
The allowDoubleEscaping setting actually works, however there are some reasons causing the file could not be open.
Firstly I try without allowHighBitCharacters setting and set the allowDoubleEscaping, eventually only the # could not be recognized, so I change it to %23 and the it will work.
Secondly I add the allowHighBitCharacters and then all special character won't work.
So just only use the allowDoubleEscaping and if don't mind convert # to %23.

Yii2 Framework to Azure Web App (404 Page Not Found)

Thank for reading my post.
I'm having an issue making my Website Application(Yii2) works correctly in Azure Web Apps. I've migrated my Yii2 Websites from an existing server to the Azure Web Apps. After lots of manipulation listed below, I’m able to access the Website.
The main theme loads successfully but throwing "404 Page not found
The requested page is missing, or the address has been changed" Error in the body and others links in the "Menu Bar" not working too. "The resource you are looking for has been removed, had its name changed, or is temporarily unavailable."
The Azure Resources are configured as below:
1 x App Service Plan : S1:1 (Windows Base)
1 x Azure Database for MySQL server
1 x App Service (The Web App)
App Service Application Setting:
.Net Framwork: v4.7
PHP Version: 7.0
Platform: 32bit
Migration Steps:
FTP all files/folder from htdocs in my existing server to my App Service Plan (\site/wwwroot)
Generate the SQL Table creation in PhpAdmin
Find and Replace ENGINE=InnoDB DEFAULT CHARSET=utf8; in the script
Connect to Azure Database for MySQL server, create new Schema and Run the Script
From Azure, KUDU Inferface browse (\site\wwwroot\config) and change the db.php to
<?php
return [
'class' => 'yii\db\Connection',
'dsn' => 'mysql:host=xxxx.mysql.database.azure.com;dbname=xxxxx',
'username' => 'xxxxxxx#xxxxxxxxxxxxxxxxxx',
'password' => 'xxxxxx',
'charset' => 'utf8',
];
Restart the Web App
Check the https://yourdomain.com/requirements.php (Passed without any Error)
"The resource you are looking for has been removed, had its name changed, or is temporarily unavailable" when trying to browse the new Web App.
KUDO PowerShell windows browse back to site/wwwroot and executed the following line of codes
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php composer-setup.php
php composer.phar global require "fxp/composer-asset-plugin:^1.2.0"
Browse to the Directory (\site\wwwroot\web) and change index.php with the following line of codes:
if (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] !== 'on') {
if(!headers_sent()) {
header("Status: 301 Moved Permanently");
header(sprintf(
'Location: https://%s%s',
$_SERVER['HTTP_HOST'],
$_SERVER['REQUEST_URI']
));
exit();
}
}
// comment out the following two lines when deployed to production
('YII_DEBUG') or define('YII_DEBUG', false);
defined('YII_ENV') or define('YII_ENV', 'prod');
require(__DIR__ . '/../vendor/autoload.php');
require(__DIR__ . '/../vendor/yiisoft/yii2/Yii.php');
$config = require(__DIR__ . '/../config/web.php');
(new yii\web\Application($config))->run();
From the Azure Portal / Web App / Application settinh, .change the default directory from site\wwwroot to site\wwwroot\web
Restart the Web App.
The home page them now loads successfully but with a 404 Error within the body and "The resource you are looking for has been removed, had its name changed, or is temporarily unavailable." when trying to access other pages in the header.
I also noted that I have 2 .htacss file
1x in my \site\wwwroot and 1x in my \site\wwwroot\web
Haved tried deleting them and configure a web.config file in (site\wwwroot\web) but still not working.
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Redirect rquests to default azure websites domain" stopProcessing="true">
<match url="(.*)" />
<conditions logicalGrouping="MatchAny">
<add input="{HTTP_HOST}" pattern="^yoursite\.azurewebsites\.net$" />
</conditions>
<action type="Redirect" url="https://mysitename.azurewebsites.net/{R:0}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
As Yii2 is not famous in Azure Web App, can't find a solution anywhere. Will appreciate if you can help along.

Spring Integration doesn't synchronize with FTP mainframe system

I am trying to sycronize an FTP folder with a local directory. This FTP server is running on z/OS, it's a mainframe with he MVS operating system.
So far I've had a lot of problems even to manage to connect to the folder I needed because this system doesn't have a "normal" folder system.
This is what I've done to change to the working directory where my files are:
public class DefaultFtpHostSessionFactory extends DefaultFtpSessionFactory {
protected void postProcessClientAfterConnect(FTPClient ftp) throws IOException {
ftp.changeToParentDirectory();
ftp.changeWorkingDirectory("E377D.");
}
}
Now I've defined an input-channel-adapter:
<int-ftp:inbound-channel-adapter
id="ljFtpInbound"
channel="ljFtpChannel"
session-factory="ljCachingSessionFactory"
auto-create-local-directory="true"
delete-remote-files="false"
filename-pattern="*"
remote-directory="*"
remote-file-separator=""
charset="UTF-8"
auto-startup="true"
preserve-timestamp="false"
local-filename-generator-expression="#this.toUpperCase()"
temporary-file-suffix=".writing"
local-directory="/tmp/">
<int:poller fixed-rate="1000" />
</int-ftp:inbound-channel-adapter>
As you can notice the remote directory is "*", that's for listing the directory, at least is the only way I've managed to do it.
But when FtpInboundFileSynchronizer tries to synchronize the folder I get an error because when it tries to copy the file the path is build with:
String remoteFilePath = remoteDirectoryPath + remoteFileSeparator + remoteFileName;
Which in my case would be "ASTERISK" + "BLANK" + "REMOTE_FILE_NAME", because I had to use "*" as the remote-directory, so it doesn't find the file.
¿Do you know if I can not to set the remote-directory (which I tried but didn't achieve)? Or there is another way to synchronized this weird FTP system.
Thank you.
How about this?
Starting with version 4.3, The remote-directory/remote-directory-expression attributes can be omitted assuming null. In this case, according to the FTP protocol, the Client working directory is used as a default remote directory.
That means you should try to upgrade to Spring Integration 4.3 and remove that strange * at all.

Register-ServiceFabricApplicationType on a secure cluster always times out

When this command is executed while connected to a secure cluster:
Register-ServiceFabricApplicationType -ApplicationPathInImageStore 'MyType' -TimeoutSec 600 -Debug -Verbose
...it throws a timeout exception. I can run Copy-ServiceFabricApplicationPackage without problems, so it's clearly possible to connect to the cluster.
Registering an app type shouldn't really be a heavy operation, I therefore suspect that there is some underlying problem.
Stack trace:
VERBOSE: System.TimeoutException: Operation timed out. ---> System.Runtime.InteropServices.COMException: Exception from HRESULT: 0x80071BFF
at System.Fabric.Interop.NativeClient.IFabricApplicationManagementClient6.EndProvisionApplicationType(IFabricAsyncOperationContext context)
at System.Fabric.Interop.Utility.<>c__DisplayClassa.<WrapNativeAsyncInvoke>b__9(IFabricAsyncOperationContext context)
at System.Fabric.Interop.AsyncCallOutAdapter2`1.Finish(IFabricAsyncOperationContext context, Boolean expectedCompletedSynchronously)
--- End of inner exception stack trace ---
Register-ServiceFabricApplicationType : Operation timed out.
At line:1 char:1
+ Register-ServiceFabricApplicationType -ApplicationPathInImageStore 'M ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OperationTimeout: (Microsoft.Servi...usterConnection:ClusterConnection) [Register-ServiceFabricApplicationType], TimeoutException
+ FullyQualifiedErrorId : RegisterApplicationTypeErrorId,Microsoft.ServiceFabric.Powershell.RegisterApplicationType
Any help greatly appreciated!
If this is a cluster that is hosted by Azure, these settings will be reverted to default values the next time cluster code or configuration upgrade is performed. Please change them by setting the value in the Service Fabric resource via Azure Resource Explorer or PowerShell. This will ensure that these settings are preserved.
"fabricSettings": [
{
"name": "EseStore",
"parameters": [
{
"name": "MaxCursors",
"value": "32768"
}
]
}
],
On the local development cluster you can modify the default cluster manifest XML files located in C:\Program Files\Microsoft SDKs\Service Fabric\ClusterSetup\ with following section and then recreate the cluster.
<Section Name="EseStore">
<Parameter Name="MaxCursors" Value="32768" />
</Section>
Here's what worked for us in a very similar situation:
Please apply the following mitigation steps (one node at a time) on all nodes:
Go to data root of cluster, by default it is “D:\SvcFab\” or C:\ProgramData\Microsoft\SF if you didn’t specify datapath attribute in deployment. Look for folder by name . Inside that folder you will see file Fabric.Package.current.xml. create a backup.
Open the Fabric.Package.current.xml file and look for Fabric.Config version:
Go to config folder for that version and look for Settings.xml file.
Take a backup of Settings.xml file and open the Settings.xml file.
Look for section named “EseStore”.
<Section Name="EseStore">
</Section>
If section is present, add this parameter to section (prefer to type these text in the Settings.xml file than copy-pasting as copy-pasting sometimes appends extra invalid characters at the end).
<Section Name="EseStore">
<Parameter Name="MaxCursors" Value="32768" />
</Section>
If the section with name “EseStore” is not present, add the section name with parameter as and save the file.
Kill FileStoreService.exe on the node.
Wait for the FileStoreService.exe to come back up and then proceed to next node.
After you are done applying mitigation to all nodes and cluster is back up healthy, please retry deploying the package. Please make sure for testing in testing machine first before use on production.

How to configure CGI on IIS 7?

I did this
http://reboltutorial.com/images/rebol-iis.png
as explained here but it was for IIS 6
http://rebolforum.com/index.cgi?f=printtopic&topicnumber=39&archiveflag=new
I also activated 32 bits for application pool as explained here
http://blogs.iis.net/wadeh/archive/2009/04/13/running-perl-on-iis-7.aspx
But when browsing to the test script it doesn't work, seems to take forever showing nothing, then in the end shows this message error:
502 - Web server received an invalid response while acting as a gateway or proxy server.
There is a problem with the page you are looking for, and it cannot be displayed. When the Web server (while acting as a gateway or proxy) contacted the upstream content server, it received an invalid response from the content server.
I used a dedicated server on windows 2008
Source code of the test script:
REBOL [Title: "Cgi Test in Rebol"]
print "HTTP/1.0 200 OK^/Content-type:text/html^/^/";
print []
print ["Date/time is:" now]
print []
Should I ask on serverfault rather as nobody seems to know here ?
Finally I got my answer, here are the steps:
Open Server Manager from Administrative Tools.
Add role "Web Server (IIS)"
Try http://localhost/ from your browser. You should see the IIS7 Welcome Page.
Copy core.exe to c:\ (or somewhere else), right click on core.exe and open Properties window, give Read & Execute access to IUSR_xxxx under Security tab. (If you've any problem, try to give Read & Execute for Everyone)
Open "Internet Information Services (IIS) Manager" from Administrator Tools.
Click on Default Web Sites, double click on Handler Mappings, click on Add Module Mapping from the right panel and type the followings:
Request Path: *.r
Module: c:\core.exe -cs %s %s
Name: Rebol
Select Yes when Add Script Map dialog box appears. It will add the c:\core.exe -cs "%s %s" as allowed under ISAPI and CGI Restrictions list.
Create a test.r file under wwwroot folder. My test.r file contains following script:
R E B O L [Title: "Server Time"]
print "content-type: text/html^/"
print [<HTML><BODY>]
print ["Date/time is:" now]
print [</pre></BODY></HTML>]
And type http://localhost/test.r on your browser.
If everything goes well then it should work.
If you are trying with View.exe then you may need to put --noinstall to command line, otherwise when View start with IUSR_xxx user account it will open desktop & installation window and it stays background (you can see it from Task Manager).
c:\view.exe -csi %s %s
You may also need to put double quotes around %s if your script is in a path with spaces. Use the following form:
c:\core.exe -cs "%s %s"
Instead of this:
c:\core.exe "-cs %s %s" (<-- this won't work!)
I hope this will help.
UPDATE: I've faced a problem on IIS6 (Windows 2003 Server), it gives 404 when I configure it as follow (it works on IIS7 as told above):
c:\core.exe -cs "%s %s"
But it runs as:
c:\core.exe" -cs "%s" %s
Here is the link for Perl installation.
http://www.howtogeek.com/50500/how-to-install-perl-on-iis-6-for-windows-server-2003/

Resources