|
|
Choosing A Webhost: |
svn commit: r225768 - /lenya/trunk/src/java/org/apache/lenya/cms/publicatio: msg#00106cms.lenya.cvs
Author: andreas Date: Thu Jul 28 06:39:48 2005 New Revision: 225768 URL: http://svn.apache.org/viewcvs?rev=225768&view=rev Log: Initialize source resolver properly (fixes bug #35874), applied patch by Josias Thoeny Modified: lenya/trunk/src/java/org/apache/lenya/cms/publication/DefaultResourcesManager.java Modified: lenya/trunk/src/java/org/apache/lenya/cms/publication/DefaultResourcesManager.java URL: http://svn.apache.org/viewcvs/lenya/trunk/src/java/org/apache/lenya/cms/publication/DefaultResourcesManager.java?rev=225768&r1=225767&r2=225768&view=diff ============================================================================== --- lenya/trunk/src/java/org/apache/lenya/cms/publication/DefaultResourcesManager.java (original) +++ lenya/trunk/src/java/org/apache/lenya/cms/publication/DefaultResourcesManager.java Thu Jul 28 06:39:48 2005 @@ -94,7 +94,6 @@ } } - /** * Constructor */ @@ -129,7 +128,6 @@ String mimeType = part.getMimeType(); int fileSize = part.getSize(); - /* * complement and create the meta description for the resource. */ @@ -154,9 +152,12 @@ /** * Saves the resource to a file. - * @param resource The resource. - * @param part The part of the multipart request. - * @throws IOException if an error occurs. + * @param resource + * The resource. + * @param part + * The part of the multipart request. + * @throws IOException + * if an error occurs. */ protected void saveResource(Resource resource, Part part) throws IOException { OutputStream out = null; @@ -205,7 +206,6 @@ } } - /** * @see org.apache.lenya.cms.publication.ResourcesManager#getResources(org.apache.lenya.cms.publication.Document) */ @@ -226,8 +226,10 @@ /** * Returns the resources that are matched by a certain file filter. - * @param document The document. - * @param filter A file filter. + * @param document + * The document. + * @param filter + * A file filter. * @return A resource array. */ protected Resource[] getResources(Document document, FileFilter filter) { @@ -238,7 +240,7 @@ Source source = null; try { Resource[] resources; - + resolver = (SourceResolver) this.manager.lookup(SourceResolver.ROLE); source = resolver.resolveURI(tempResource.getBaseURI()); if (source.exists()) { @@ -248,10 +250,10 @@ } resources = new Resource[files.length]; for (int i = 0; i < files.length; i++) { - resources[i] = new Resource(document, files[i].getName(), this.manager, getLogger()); + resources[i] = new Resource(document, files[i].getName(), this.manager, + getLogger()); } - } - else { + } else { resources = new Resource[0]; } return resources; @@ -293,8 +295,9 @@ throws Exception { if (getLogger().isDebugEnabled()) { - getLogger().debug("Copying resources from [" + sourceDocument + "] to [" - + destinationDocument + "]"); + getLogger().debug( + "Copying resources from [" + sourceDocument + "] to [" + destinationDocument + + "]"); } SourceResolver resolver = null; @@ -311,7 +314,7 @@ ModifiableSource destMetaSource = null; try { - + resolver = (SourceResolver) this.manager.lookup(SourceResolver.ROLE); sourceSource = resolver.resolveURI(sourceResource.getSourceURI()); sourceMetaSource = resolver.resolveURI(sourceResource.getMetaSourceURI()); destSource = (ModifiableSource) resolver.resolveURI(destinationResource @@ -384,7 +387,8 @@ public void deleteResource(Document document, String name) throws Exception { Resource theResource = getResource(document, name); if (theResource == null) - throw new Exception("no such resource [" + name + "] exists for document [ " + document.getId() + "]"); + throw new Exception("no such resource [" + name + "] exists for document [ " + + document.getId() + "]"); deleteResource(theResource); }
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | svn commit: r225676 - /lenya/docu/src/documentation/content/xdocs/1_2_x/how-to/cms_menus.xml, antonio |
|---|---|
| Next by Date: | svn commit: r225769 - /lenya/trunk/src/java/org/apache/lenya/cms/publication/DefaultResourcesManager.java, andreas |
| Previous by Thread: | svn commit: r225676 - /lenya/docu/src/documentation/content/xdocs/1_2_x/how-to/cms_menus.xml, antonio |
| Next by Thread: | svn commit: r225769 - /lenya/trunk/src/java/org/apache/lenya/cms/publication/DefaultResourcesManager.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 |