How can I activate the Friendly Service in eXo platform? - url-rewriting

Ive been trying a few days to activate the FriendlyService in exo-platfom 3.5.x but have been unsuccessful so far.
In the section:
administration > management
There is a service called Friendly Service which allows eXo to rewrite a request URL to another URL (in a more readable format). However, this service is inactivated.
Can someone tell me how activate it?

1.When starting server, you need to enable the profile 'friendly':
Example: ./start_eXo.sh -Dfriendly
2.When registering FriendlyService, you need to provide parameter enable as true:
<component>
<key>org.exoplatform.services.wcm.friendly.FriendlyService</key>
<jmx-name>exo-service:type=FriendlyService</jmx-name>
<type>org.exoplatform.services.wcm.friendly.impl.FriendlyServiceImpl</type>
<init-params>
<value-param>
<name>enabled</name>
<value>true</value>
</value-param>
</init-params>
</component>
Hope it helps..

Related

C# - Services how to set the start parameters

I am currently working on a windows service (which starts so that is a good thing).
The big question is how can I get parameters in the start parameter field (without doing it manual ofcourse).
So what I would like to see is the following. Upon installation of the service I would like it if the following happens.
The services gets installed and the start parameters are set.
How would one do such a thing (already been browsing StackOverflow but it doesn't comply with what I want)
The reason I ask the question is the following: The service is part of a communication layer between GUI and a receiving backend. If the backend location differs (e.g. another IP address) the service needs to have the new address accordingly.
If you would like to have some more info please ask (don't down the post if something is not in order 'just ask :)')
Thanks in advance
After the update of your question, I understand what you are trying to accomplish. As far as I currently know, it is not possible to set these start parameters without using the registry. You'll have to do it manually from the services console or by using an installer. When you look at the MSDN page covering ServiceBase.OnStart (MSDN ServiceBase.OnStart method) it clearly states:
Process initialization arguments for the service in the OnStart method, not in the Main method. The arguments in the args parameter array can be set manually in the properties window for the service in the Services console. The arguments entered in the console are not saved; they are passed to the service on a one-time basis when the service is started from the control panel. Arguments that must be present when the service is automatically started can be placed in the ImagePath string value for the service's registry key (HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\). You can obtain the arguments from the registry using the GetCommandLineArgs method, for example: string[] imagePathArgs = Environment.GetCommandLineArgs();
Thing is that you will still have to keep track of these registry settings when removing the service.
Therefore the link provided here ("Am I running as a service") might help out as well.
use sc.exe:
c:\>sc config <myservice> binPath= "\path\to\myservice.exe -param -param"
In your OnStart() or your service thread use something like:
string myArg = ConfigurationManager.AppSettings["MyArg"]
where in your App.Config you've added
<appSettings>
<!-- My keys -->
<add key="MyArg" value="xxx"/>
</appSettings>
Start a Windows Service passing arguments by using the System.ServiceProcess ServiceController Start(String[]) method like this:
ServiceController sc = new ServiceController("BDESVC");
sc.Start(new string[] { "argValue" });

WSO2 ESB - Dynamic value for proxy parameters (transport)

I need to be able to specify a dynamic value for proxy parameter. Actually, I have to specify each parameter with complete URL like :
<parameter name="transport.vfs.FileNamePattern">.*.txt</parameter>
I see some samples with property mediator and I guess it's working for next proxies but the problem here is that I need to change the proxy parameters value before its execution I think. I tried with a "trigger" proxy calling a custom mediator which change SynapseConfiguration of required proxy but this wasn't working.
Is there a way to replace these fixed value with lookups to create some deployment configuration ?
Many thanks.
You can check out this post How to dynamically route message in WSO2 ESB based on XML configuration file for an example how to dynamically set values in a proxy sequence.
You can do something this:
<parameter name="transport.vfs.FileNamePattern">
<script language="js">mc.getProperty('MY_DYNAMIC_VALUE')</script>
</parameter>
I am not sure this will help you much, as I suspect that the vfs parameters are set when initializing the proxy and not on the fly. If you give it a try, if possible please post back to this thread if it works or not.
Regards, nidkil
The Parameters in the Proxy service definitions are service level Parameters which is in the Axis2Service Configuration . They are used when you are initialing the Axis2Service in this case its the Synapse/WSO2 ESB proxy service. So you can't change the parameters dynamically on the fly.
But i can suggest following approach. It might or might not applicable to your scenario.
Have set of VFS proxies that listen for separate locations. Each will look at a give file extension. (one for .txt one for .foo etc..)
Use another generic vfs proxy to copy files to correct places dynamically(which accepts any extension).(You can use vfs sender).
Hope this helps.
cheers,
Charith

Custom RequireHttps and testing

I have a custom Authorize attribute. This attribute checks if the user also have permissions to that action based on the parameters of the attribute. In some times inside the custom Authorize attribute I want to requiere HTTPS or redirect to it. Is there any way to do this with the AuthorizationContext?
How can I test it? and debug it? Is there a simple tutorial to use SSL in my developer machine with VS 2010?
Thanks!
RequireHttps will redirect HOWEVER it doesn't stop the browser from sending data non-ssl first which could be captured. Note that for post actions this wont work right out of the box either.
To install ssl, simply generate your cert and import it. Do you have a subscription to pluralsight.com? i have a course up there where I go over the steps for requiressl and installing ssl on local machine (theres a 30 day free trial too)
If you just want the details here : )
theres a nice powershell script to use:
http://learn.iis.net/page.aspx/491/powershell-snap-in-configuring-ssl-with-the-iis-powershell-snap-in/

Cocoa System Services: Name of calling app

First of all I would like to thank all of the contributors of this site.
Now for the questions:
I have implemented a simple system service using the System Services Guide and posts on this site.
I would like to find out the name of the application that initiated the call to my service either in my - (void)handleServices:(NSPasteboard *)pboard or via some other means.
The application that initiated the call to your service has to be the most active.
So you can get information about it via NSWorkSpace:
[[[NSWorkspace sharedWorkspace] activeApplication] valueForKey:#"NSApplicationName"] // you might also be interested via #"NSApplicationBundleIdentifier
I just tested this with a very basic Service, and it works as expected.

How entity edit URL from within plug-in in MS Dynamics CRM 4.0

I would like to have a workflow create a task, then email the assigned user that they have a new task and include a link to the newly created task in the body of the email. I have client side code that will correctly create the edit URL, using the entities GUID and stores it in a custom attribute. However, when the task is created from within a workflow, the client script isn't run.
So, I think a plug-in should work, but I can't figure out how to determine the URL of the CRM installation. I'm authoring this in a test environment and definitely don't want to have to change things when I move to production. I'm sure I could use a config file, but seems like the plug-in should be able to figure this out at runtime.
Anyone have any ideas how to access the URL of the crm service from within a plug-in? Any other ideas?
There is no simple way to do this. However, there is one.
The MSCRM_Config is the deployment database that handle physical deployment properties, like the URL from which users are accessing the CRM deployment. The url that you might want is the one stored in "ADWebApplicationRootDomain", in the MSCRM_CONFIG.dbo.DeploymentProperties table. You may need some permission to access this database.
Note that this doesn't work in a deployment that is an Internet Facing Deployment.
Another way could be to query the discovery service to retrieve the same information (in the case that you are on the Online edition of MSCRM4).
What do you mean by "change things"?
If you create a custom workflow assembly, you can give it a server url input. Once you register it with CRM, you can simply type in the server url when you configure the workflow. You'll have to update the url for any workflows that use the custom workflow assembly once you move to production, but you'll only have to do that once.
My apologies if this is what you meant you wanted to avoid.
Edit: Sounds like you may be able to use the CustomConfiguration attribute when you register the plugin. Here's some more info.
http://blogs.msdn.com/crm/archive/2008/10/24/storing-configuration-data-for-microsoft-dynamics-crm-plug-ins.aspx
String Url = ((string)(Registry.LocalMachine.OpenSubKey(
"Software\\Microsoft\\MSCRM").GetValue("ServerUrl"))
).Replace("MSCRMServices", "");

Resources