|
|
Choosing A Webhost: |
svn commit: r521206 - /lenya/trunk/src/modules-core/sitemanagement/java/src: msg#00025cms.lenya.cvs
Author: andreas Date: Thu Mar 22 03:58:32 2007 New Revision: 521206 URL: http://svn.apache.org/viewvc?view=rev&rev=521206 Log: Create usecase: allow to provide the sample name as parameter Modified: lenya/trunk/src/modules-core/sitemanagement/java/src/org/apache/lenya/cms/site/usecases/Create.java Modified: lenya/trunk/src/modules-core/sitemanagement/java/src/org/apache/lenya/cms/site/usecases/Create.java URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules-core/sitemanagement/java/src/org/apache/lenya/cms/site/usecases/Create.java?view=diff&rev=521206&r1=521205&r2=521206 ============================================================================== --- lenya/trunk/src/modules-core/sitemanagement/java/src/org/apache/lenya/cms/site/usecases/Create.java (original) +++ lenya/trunk/src/modules-core/sitemanagement/java/src/org/apache/lenya/cms/site/usecases/Create.java Thu Mar 22 03:58:32 2007 @@ -21,6 +21,7 @@ import java.util.Arrays; import java.util.Collections; import java.util.GregorianCalendar; +import java.util.List; import java.util.Map; import org.apache.avalon.framework.service.ServiceSelector; @@ -309,7 +310,17 @@ + "] doesn't provide any samples!"); } setParameter(SAMPLES, samples); - setParameter(SAMPLE, samples[0]); + String presetSample = getParameterAsString(SAMPLE); + if (presetSample == null) { + setParameter(SAMPLE, samples[0]); + } + else { + List sampleList = Arrays.asList(samples); + if (!sampleList.contains(presetSample)) { + getLogger().warn("Sample [" + presetSample + "] not defined, using default sample."); + setParameter(SAMPLE, samples[0]); + } + } } catch (Exception e) { throw new RuntimeException(e); } finally {
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | svn commit: r520954 - in /lenya/trunk/src/pubs/blog/config: ac/usecase-policies.xml menus/entry.xsp, andreas |
|---|---|
| Next by Date: | svn commit: r521330 - in /lenya/trunk/src/java/org/apache/lenya/cms/cocoon/source: SiteSource.java SiteSourceFactory.java, andreas |
| Previous by Thread: | svn commit: r520954 - in /lenya/trunk/src/pubs/blog/config: ac/usecase-policies.xml menus/entry.xsp, andreas |
| Next by Thread: | svn commit: r521330 - in /lenya/trunk/src/java/org/apache/lenya/cms/cocoon/source: SiteSource.java SiteSourceFactory.java, andreas |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business. subscribe Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field. subscribe The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business. subscribe Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company. subscribe Total Telecom Total Telecom is "The Economist of the communications industry". subscribe |