|
|
Choosing A Webhost: |
svn commit: r426233 - in /lenya/trunk/src: impl/java/org/apache/lenya/cms/p: msg#00203cms.lenya.cvs
Author: andreas Date: Thu Jul 27 13:52:06 2006 New Revision: 426233 URL: http://svn.apache.org/viewvc?rev=426233&view=rev Log: [minor change] removed unused imports Modified: lenya/trunk/src/impl/java/org/apache/lenya/cms/publication/DefaultResourcesManager.java lenya/trunk/src/modules-core/observation-impl/java/test/org/apache/lenya/cms/observation/ObservationTest.java Modified: lenya/trunk/src/impl/java/org/apache/lenya/cms/publication/DefaultResourcesManager.java URL: http://svn.apache.org/viewvc/lenya/trunk/src/impl/java/org/apache/lenya/cms/publication/DefaultResourcesManager.java?rev=426233&r1=426232&r2=426233&view=diff ============================================================================== --- lenya/trunk/src/impl/java/org/apache/lenya/cms/publication/DefaultResourcesManager.java (original) +++ lenya/trunk/src/impl/java/org/apache/lenya/cms/publication/DefaultResourcesManager.java Thu Jul 27 13:52:06 2006 @@ -108,18 +108,19 @@ * org.apache.cocoon.servlet.multipart.Part, java.util.Map) */ public void addResource(Document document, Part part, Map metadata) throws Exception { - addResource(document,part,metadata,null); + addResource(document, part, metadata, null); } - + protected static final String METADATA_IMAGE_WIDTH = "width"; protected static final String METADATA_IMAGE_HEIGHT = "height"; protected static final String METADATA_MEDIA_NAMESPACE = "http://apache.org/lenya/metadata/media/1.0"; - + /** * @see org.apache.lenya.cms.publication.ResourcesManager#addResource(org.apache.lenya.cms.publication.Document, * org.apache.cocoon.servlet.multipart.Part, java.util.Map) */ - public void addResource(Document document, Part part, Map metadata, MetaData customMeta) throws Exception { + public void addResource(Document document, Part part, Map metadata, MetaData customMeta) + throws Exception { if (getLogger().isDebugEnabled()) getLogger().debug("DefaultResourcesManager::addResource() called"); @@ -144,13 +145,13 @@ /* * complement and create the meta description for the resource. */ - + MetaData mediaMetaData = resource.getMetaData(METADATA_MEDIA_NAMESPACE); - + mediaMetaData.setValue("filename", fileName); mediaMetaData.setValue("format", mimeType); mediaMetaData.setValue("extent", Integer.toString(fileSize)); - + MetaData lenyaMetaData = resource.getMetaData(DocumentImpl.METADATA_NAMESPACE); lenyaMetaData.setValue(DocumentImpl.METADATA_CONTENT_TYPE, "asset"); @@ -160,7 +161,7 @@ String height = Integer.toString(input.getHeight()); mediaMetaData.setValue(METADATA_IMAGE_WIDTH, width); mediaMetaData.setValue(METADATA_IMAGE_HEIGHT, height); - } + } saveResource(resource, part); } catch (final MetaDataException e) { @@ -178,7 +179,8 @@ public static boolean canReadMimeType(String mimeType) { Iterator iter = ImageIO.getImageReadersByMIMEType(mimeType); return iter.hasNext(); - } + } + /** * Saves the resource to a file. * @param resource The resource. @@ -274,7 +276,9 @@ } resources = new Resource[files.length]; for (int i = 0; i < files.length; i++) { - resources[i] = new Resource(document, files[i].getName(), this.manager, + resources[i] = new Resource(document, + files[i].getName(), + this.manager, getLogger()); } } else { @@ -318,9 +322,8 @@ throws Exception { if (getLogger().isDebugEnabled()) { - getLogger().debug( - "Copying resources from [" + sourceDocument + "] to [" + destinationDocument - + "]"); + getLogger().debug("Copying resources from [" + sourceDocument + "] to [" + + destinationDocument + "]"); } SourceResolver resolver = null; @@ -328,8 +331,10 @@ Resource[] resources = getResources(sourceDocument); for (int i = 0; i < resources.length; i++) { Resource sourceResource = resources[i]; - Resource destinationResource = new Resource(destinationDocument, sourceResource - .getName(), this.manager, getLogger()); + Resource destinationResource = new Resource(destinationDocument, + sourceResource.getName(), + this.manager, + getLogger()); Source sourceSource = null; ModifiableSource destSource = null; @@ -338,8 +343,7 @@ try { resolver = (SourceResolver) this.manager.lookup(SourceResolver.ROLE); sourceSource = resolver.resolveURI(sourceResource.getSourceURI()); - destSource = (ModifiableSource) resolver.resolveURI(destinationResource - .getSourceURI()); + destSource = (ModifiableSource) resolver.resolveURI(destinationResource.getSourceURI()); SourceUtil.copy(sourceSource, destSource, true); } finally { @@ -401,8 +405,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 + + "]"); deleteResource(theResource); } Modified: lenya/trunk/src/modules-core/observation-impl/java/test/org/apache/lenya/cms/observation/ObservationTest.java URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules-core/observation-impl/java/test/org/apache/lenya/cms/observation/ObservationTest.java?rev=426233&r1=426232&r2=426233&view=diff ============================================================================== --- lenya/trunk/src/modules-core/observation-impl/java/test/org/apache/lenya/cms/observation/ObservationTest.java (original) +++ lenya/trunk/src/modules-core/observation-impl/java/test/org/apache/lenya/cms/observation/ObservationTest.java Thu Jul 27 13:52:06 2006 @@ -16,14 +16,6 @@ */ package org.apache.lenya.cms.observation; -import java.io.IOException; -import java.net.MalformedURLException; - -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.TransformerConfigurationException; -import javax.xml.transform.TransformerException; - -import org.apache.avalon.framework.service.ServiceException; import org.apache.lenya.ac.impl.AbstractAccessControlTest; import org.apache.lenya.cms.cocoon.source.SourceUtil; import org.apache.lenya.cms.publication.Document; @@ -32,7 +24,6 @@ import org.apache.lenya.cms.publication.DocumentUtil; import org.apache.lenya.cms.publication.Publication; import org.apache.lenya.cms.publication.PublicationUtil; -import org.apache.lenya.cms.repository.RepositoryException; import org.apache.lenya.cms.repository.RepositoryUtil; import org.apache.lenya.cms.repository.Session; import org.apache.lenya.xml.NamespaceHelper;
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
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 |