From: <fa...@vh...> - 2005-09-12 15:19:31
|
Author: fabrice Date: 2005-09-12 17:10:24 +0200 (Mon, 12 Sep 2005) New Revision: 797 Added: ccm-core/trunk/src/com/arsdigita/web/HostDynamicHostProvider.java ccm-core/trunk/src/com/arsdigita/web/ServerDynamicHostProvider.java Log: Use dynamic host provider to get the host URL in emails Added: ccm-core/trunk/src/com/arsdigita/web/HostDynamicHostProvider.java =================================================================== --- ccm-core/trunk/src/com/arsdigita/web/HostDynamicHostProvider.java 2005-09-12 15:08:13 UTC (rev 796) +++ ccm-core/trunk/src/com/arsdigita/web/HostDynamicHostProvider.java 2005-09-12 15:10:24 UTC (rev 797) @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2005 RuntimeCollective Ltd. All Rights Reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ +package com.arsdigita.web; + +import com.arsdigita.util.servlet.HttpHost; + +public class HostDynamicHostProvider implements DynamicHostProvider { + + final HttpHost host = Web.getConfig().getHost(); + + public HostDynamicHostProvider() { + } + + public String getName() { + return host.getName(); + } + + public int getPort() { + return host.getPort(); + } +} Added: ccm-core/trunk/src/com/arsdigita/web/ServerDynamicHostProvider.java =================================================================== --- ccm-core/trunk/src/com/arsdigita/web/ServerDynamicHostProvider.java 2005-09-12 15:08:13 UTC (rev 796) +++ ccm-core/trunk/src/com/arsdigita/web/ServerDynamicHostProvider.java 2005-09-12 15:10:24 UTC (rev 797) @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2005 RuntimeCollective Ltd. All Rights Reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public License + * as published by the Free Software Foundation; either version 2.1 of + * the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ +package com.arsdigita.web; + +import com.arsdigita.util.servlet.HttpHost; + +public class ServerDynamicHostProvider implements DynamicHostProvider { + + final HttpHost host = Web.getConfig().getServer(); + + public ServerDynamicHostProvider() { + } + + public String getName() { + return host.getName(); + } + + public int getPort() { + return host.getPort(); + } +} |