Alfresco notification mail link modify - java

I am using Alfresco community edition-5.1.x set up SMTP configuration in my production server whenever user doing activity in alfresco user get notifications mail, We able to get all the information but in the mail notification mail down alfresco url is there with my domain name (i.e http://mydomainxx.com:5038) when click the link not working browser because its wrong url how can i change to (http://mydomainxx.com) only domainname not with port number , I am stuck on that any can help out.

You should change the default alfresco-global.properties:
alfresco.context=alfresco
alfresco.host=127.0.0.1
alfresco.port=8080
alfresco.protocol=http
share.context=share
share.host=127.0.0.1
share.port=8080
share.protocol=http
In your case just changing the port to 80 would be sufficient.

There's a couple of places mentioned here that you could try out (haven't tried them myself). If that proves to not work, IMHO the easiest way is to simply change the notification FTL's with the URL you want (found at "Company Home/Data Dictionary/Email Templates").
However, it is not the cleanest one, so decide for yourself whether you want to take that route.

Hope this helps someone.
#
# URL Parameters(SSL)
# -------------------------
alfresco.context=alfresco
alfresco.host=yourdomain.com
alfresco.port=443
alfresco.protocol=https
share.context=share
share.host=yourdomain.com
share.port=443
share.protocol=https
## Non-ssl
alfresco.context=alfresco
alfresco.host=yourdomain.com
alfresco.port=8080
#<YOUR_PORT_NUMBER>
alfresco.protocol=http
share.context=share
share.host=yourdomain.com
share.port=8080
#<YOUR_PORT_NUMBER>
share.protocol=http

Related

How do you set up a redirect from www to non-www with Play! Java 2.3 running the default server?

I recently set up a website and pushed it to production using Digital Ocean. However, I noticed that for both SEO purposes and to make Facebook Share work appropriately, I should set up my server to redirect www. requests to non-www. I'm running Play! Java 2.3 with a PostgreSQL database and the default Netty server. Any advice would be greatly appreciated.
There are lots of ways of redirecting. I wouldn't say DNS-redirects are the correct and only way of doing it, it's one way. Google is just fine with you doing a 301 redirect with Play.
Here's one way of accomplishing it with Play! filters (scala):
object NonWwwFilter extends Filter {
def apply(f:RequestHeader => Future[Result])(rh: RequestHeader): Future[Result] =
if (rh.host.startsWith("www.")) {
Future.successful(Results.MovedPermanently("https://" + rh.host.substring(4) + rh.uri))
} else {
f(rh)
}
}
The right way to do it is to do in not on the framework/webserver side, but on the DNS-server side.
You can do it in DNS-management area of GoDaddy or any other domain name registrar.

How to change proxy programmatically?

I wish to test my web server which have checking to detect abusive API usage by IP address. One IP address is limited to a few hundred API calls per day.
As part of testing & simulation procedure, I need to be able to switch IP frequently & programmatically. How to do this? I am thinking of using publicly available free proxy service (or even TOR) to hide my IP. But I am not sure how to change the proxy settings programmatically.
I am using Ruby but any languages are welcome.
In ruby you can make calls to the command prompt. If I were you I would make a method that uses these calls. To do this use %x command.
Edit----
This is the code I made.
def ipChanger(name,ip)
return %x(netsh interface ip set address #{name} static #{ip} 255.255.255.0)
end
The syntax is "netsh interface ip set address "Your adapter name here" static "new ip" "new netmask" "optional default gateway"

Spring IAMP Mail receiver not reading all emails everytime [duplicate]

I have a piece of code which uses spring integration's IMAP adapter to poll an inbox to read all incoming emails which are unread and that works perfectly. But if I open any email message and and then mark it as "unread" in my outlook inbox the poller doesn't fetch the marked email.
I can use the pop3 adapter which fetches all the email, but deletes them afterwords, but I want to keep the emails in my inbox and I want the poller to fetch all the email which are unseen.
Any suggestions to handle this problem? I been searching and reading articles on email adapters but didn't find anything useful.
Thanks in advance.
Looks like you need custom 'search-term-strategy'. From Spring Integration (SI) documentation:
By default, the ImapMailReceiver will search for Messages based on the default SearchTerm which is All mails that are RECENT (if supported), that are NOT ANSWERED, that are NOT DELETED, that are NOT SEEN and have not been processed by this mail receiver (enabled by the use of the custom USER flag or simply NOT FLAGGED if not supported). Since version 2.2, the SearchTerm used by the ImapMailReceiver is fully configurable via the SearchTermStrategy which you can inject via the search-term-strategy attribute. SearchTermStrategy is a simple strategy interface with a single method that allows you to create an instance of the SearchTerm that will be used by the ImapMailReceiver.
And here is a post from SI forum with funtastic Oleg's explanation: Server does not support RECENT or USER flags
And here you can find SI DefaultSearchTermStrategy: it's a place to determine how you should implement your own strategy. I guess, you case is:
This email server does not support RECENT flag, but it does support USER flags which will be used to prevent duplicates during email fetch.
Switch SI-mail logging level to DEBUG and take a look, which flag supports your email server.

What is the easiest way to create a HostAndPort-Instance if the hostname is "localhost"?

I want to use the class HostAndPort from guava, to store a host and a port. What is the easiest way to create a valid HostAndPort-Instance, if the host is "localhost" and not "127.0.0.1" ?
It tried HostSpecifier.isValid(String) to validate the host, before i create a HostAndPort-Instance, but it returns false for "localhost". So in my case i can't use HostSpecifier, except i transform "localhost" to "127.0.0.1".
Is there an other way to validate a host name without a DNS-lookup?
java.net.InetAddress.getByName(String hostname) is the one. http://docs.oracle.com/javase/6/docs/api/java/net/InetAddress.html
The local address lookups are done via lmhosts on windows if enabled and on linux/unix using name service switch config(/etc/nsswitch.conf) in order to check where to lookup first - files,dns,nis.... and so on (man nsswitch.conf). The java api call will resolve it depending on a system configuration.
EDIT:
you probably want to take a look at this library too
http://www.xbill.org/dnsjava/
hope this helps abit.

How do I maintain session state with a Google Earth client?

I'm playing with dynamic updates to Google Earth KML files.
The updates are of the form
<kml...>
<NetworkLinkControl>
<Update>
<targetHref="...">
<Change>
<Placemark targetId="...">
...stuff to update...
</Placemark>
</Change>
</Update>
</NetworkLinkControl>
</kml>
And it all works greatm from my Java Servlet - except that GE doesn't seem to support HTTP Sessions, and I need to provide only the updates that have occurred since the last request from a given client.
Am I doing something wrong? Does GE support sessions and I'm too stupid to work out how? If I need to provide client-specific updates without sessions, how can I do that? (I know I could use the source IP address as a coarse measure but that feels kinda nasty...)
Thanks!
Old question, but you need to encode the session ID as part of the URLs. GE does not maintain cookies.
It seems that I can use the kml/NetworkLinkControl/cookie element to give the client a parameter to send back to me. Trying to use this to get the client to tell me when it last requested an update and use this instead of sessions...

Categories

Resources