| |
|
| java.lang.Object org.opencms.workplace.tools.database.CmsHtmlImport
CmsHtmlImport | public class CmsHtmlImport (Code) | | This class implements the HTML->OpenCms Template converter for OpenCms 6.x.
The HTML files can lay in a directory or in a zip file. The entries in the zip file
are saved temporary in the tmp-directory of the system. Every file is stored into the
correct location in the OpenCms VFS.
author: Michael Emmerich author: Armen Markarian author: Peter Bonrad author: Anja Röttgers version: $Revision: 1.20 $ since: 6.0.0 |
META_PROPERTIES | final public static String META_PROPERTIES(Code) | | filename of the meta.properties file.
|
CmsHtmlImport | public CmsHtmlImport()(Code) | | Default Constructor.
|
CmsHtmlImport | public CmsHtmlImport(CmsObject cms)(Code) | | Creates a new import object for the given cms object.
Parameters: cms - the current cms context |
createTempFolder | public static File createTempFolder(String name) throws Exception(Code) | | This function creates a folder in the temporary-directory.
Parameters: name - the name of the folder the folder file throws: Exception - if the folder can not create |
getAbsoluteUri | public String getAbsoluteUri(String relativeUri, String baseUri)(Code) | | Calculates an absolute uri from a relative "uri" and the given absolute "baseUri".
If "uri" is already absolute, it is returned unchanged.
This method also returns "uri" unchanged if it is not well-formed.
Parameters: relativeUri - the relative uri to calculate an absolute uri for Parameters: baseUri - the base uri, this must be an absolute uri an absolute uri calculated from "uri" and "baseUri" |
getDestinationDir | public String getDestinationDir()(Code) | | Returns the destinationDir.
the destinationDir |
getDownloadGallery | public String getDownloadGallery()(Code) | | Returns the downloadGallery.
the downloadGallery |
getElement | public String getElement()(Code) | | Returns the element.
the element |
getEndPattern | public String getEndPattern()(Code) | | Returns the endPattern.
the endPattern |
getHttpDir | public String getHttpDir()(Code) | | Returns the httpDir.
the httpDir |
getImageGallery | public String getImageGallery()(Code) | | Returns the imageGallery.
the imageGallery |
getInputDir | public String getInputDir()(Code) | | Returns the inputDir.
the inputDir |
getInputEncoding | public String getInputEncoding()(Code) | | Returns the inputEncoding.
the inputEncoding |
getLinkGallery | public String getLinkGallery()(Code) | | Returns the linkGallery.
the linkGallery |
getLocale | public String getLocale()(Code) | | Returns the local.
the local |
getStartPattern | public String getStartPattern()(Code) | | Returns the startPattern.
the startPattern |
getTemplate | public String getTemplate()(Code) | | Returns the template.
the template |
isKeepBrokenLinks | public boolean isKeepBrokenLinks()(Code) | | Returns the keepBrokenLinks.
the keepBrokenLinks |
isOverwrite | public boolean isOverwrite()(Code) | | Returns the overwrite.
the overwrite |
setCmsObject | public void setCmsObject(CmsObject cmsObject)(Code) | | Sets the cmsObject.
Parameters: cmsObject - the cmsObject to set |
setDestinationDir | public void setDestinationDir(String destinationDir)(Code) | | Sets the destinationDir.
Parameters: destinationDir - the destinationDir to set |
setDownloadGallery | public void setDownloadGallery(String downloadGallery)(Code) | | Sets the downloadGallery.
Parameters: downloadGallery - the downloadGallery to set |
setElement | public void setElement(String element)(Code) | | Sets the element.
Parameters: element - the element to set |
setEndPattern | public void setEndPattern(String endPattern)(Code) | | Sets the endPattern.
Parameters: endPattern - the endPattern to set |
setHttpDir | public void setHttpDir(String httpDir)(Code) | | Sets the httpDir.
Parameters: httpDir - the httpDir to set |
setImageGallery | public void setImageGallery(String imageGallery)(Code) | | Sets the imageGallery.
Parameters: imageGallery - the imageGallery to set |
setInputDir | public void setInputDir(String inputDir)(Code) | | Sets the inputDir.
Parameters: inputDir - the inputDir to set |
setInputEncoding | public void setInputEncoding(String inputEncoding)(Code) | | Sets the inputEncoding.
Parameters: inputEncoding - the inputEncoding to set |
setKeepBrokenLinks | public void setKeepBrokenLinks(boolean keepBrokenLinks)(Code) | | Sets the keepBrokenLinks.
Parameters: keepBrokenLinks - the keepBrokenLinks to set |
setLinkGallery | public void setLinkGallery(String linkGallery)(Code) | | Sets the linkGallery.
Parameters: linkGallery - the linkGallery to set |
setLocale | public void setLocale(String locale)(Code) | | Sets the local.
Parameters: locale - the local to set |
setOverwrite | public void setOverwrite(boolean overwrite)(Code) | | Sets the overwrite.
Parameters: overwrite - the overwrite to set |
setStartPattern | public void setStartPattern(String startPattern)(Code) | | Sets the startPattern.
Parameters: startPattern - the startPattern to set |
setTemplate | public void setTemplate(String template)(Code) | | Sets the template.
Parameters: template - the template to set |
startImport | public void startImport(I_CmsReport report) throws Exception(Code) | | Imports all resources from the real file system, stores them into the correct locations
in the OpenCms VFS and modifies all links. This method is called form the JSP to start the
import process.
Parameters: report - StringBuffer for reporting throws: Exception - if something goes wrong |
storeExternalLink | public String storeExternalLink(String externalLink)(Code) | | Add a new external link to the storage of external links.
All links in this storage are later used to create entries in the external link gallery.
Parameters: externalLink - link to an external resource the complete path to the external link file, if one is created. |
storeImageInfo | public void storeImageInfo(String image, String altText)(Code) | | Add a new image info to the storage of image info's.
The image info's are later used to set the description properties of the images.
Parameters: image - the name of the image Parameters: altText - the alt-text of the image |
translateLink | public String translateLink(String link)(Code) | | Translated a link into the real file system to its new location in the OpenCms VFS.
This is needed by the HtmlConverter to get the correct links for link translation.
Parameters: link - link to the real file system string containing absolute link into the OpenCms VFS |
validate | public void validate(FileItem fi, boolean isdefault) throws CmsIllegalArgumentException(Code) | | Tests if all given input parameters for the HTML Import are valid, that is that all the
given folders do exist.
Parameters: fi - a file item if a file is uploaded per HTTP otherwise null Parameters: isdefault - if this sets, then the destination and input directory can be empty throws: CmsIllegalArgumentException - if some parameters are not valid |
|
|
|