org.nuiton.scmwebeditor
Class ScmWebEditorBaseAction

java.lang.Object
  extended by com.opensymphony.xwork2.ActionSupport
      extended by org.nuiton.web.struts2.BaseAction
          extended by org.nuiton.scmwebeditor.ScmWebEditorBaseAction
All Implemented Interfaces:
com.opensymphony.xwork2.Action, com.opensymphony.xwork2.LocaleProvider, com.opensymphony.xwork2.TextProvider, com.opensymphony.xwork2.Validateable, com.opensymphony.xwork2.ValidationAware, Serializable
Direct Known Subclasses:
LogoutAction, PreviewAction, ResetAction, ScmWebEditorCommitAction, ScmWebEditorMainAction, SearchAction, UploadAction

public class ScmWebEditorBaseAction
extends org.nuiton.web.struts2.BaseAction

User: chemit Date: 24 nov. 2009 Time: 21:24:39

See Also:
Serialized Form

Field Summary
protected static String ATTRIBUTE_BAD_LOGIN
           
protected static String ATTRIBUTE_FILESEARCH_SERVLET_URL
           
protected static String ATTRIBUTE_INVALIDATE_MAX_TIME
           
protected static String ATTRIBUTE_IS_LOGIN
           
protected static String ATTRIBUTE_LOGIN
           
protected static String ATTRIBUTE_ORIG_TEXT
           
protected static String ATTRIBUTE_PREVIEW_SERVLET_URL
           
protected static String ATTRIBUTE_PRIVATE_SERVLET_URI
           
protected static String ATTRIBUTE_PROJECT_URL
           
protected static String ATTRIBUTE_REDIRECT_URL
           
protected static String ATTRIBUTE_REDIRECTION_URL
           
protected static String ATTRIBUTE_SCM_EDITOR_URI
           
static String AUTH_ERROR
           
protected static String CONTEXT_ACTION_KEY
           
protected static info.monitorenter.cpdetector.io.CodepageDetectorProxy detector
           
protected static String EDITABLESFILES
           
static String ERROR_PATH
           
protected static String PARAMETER_ADDRESS
           
protected static String PARAMETER_COMMIT_MESSAGE
           
protected static String PARAMETER_DEFAULT_LANG
           
protected static String PARAMETER_FILE_NAME
           
protected static String PARAMETER_FORMAT
           
protected static String PARAMETER_LANG
           
protected static String PARAMETER_MYTEXT
           
protected static String PARAMETER_ORIG_TEXT
           
protected static String PARAMETER_PROJECT_URL
           
protected static String PARAMETER_PW
           
protected static String PARAMETER_SCM_EDITOR_URL
           
protected static String PARAMETER_TEXT
           
protected static String PARAMETER_USERNAME
           
protected static String PROPERTIESFILES
           
protected  Map<String,Object> session
           
 
Fields inherited from class com.opensymphony.xwork2.ActionSupport
LOG
 
Fields inherited from interface com.opensymphony.xwork2.Action
ERROR, INPUT, LOGIN, NONE, SUCCESS
 
Constructor Summary
ScmWebEditorBaseAction()
           
 
Method Summary
 void checkout(SvnConnection svnSess, File checkoutdir)
           
 void checkout(SvnConnection svnSess, File checkoutdir, String numVersion)
           
protected  void convertToUnicode(File... files)
          Convert all files to UTF-8.
 void delTempDirectory(File checkoutdir)
          Use to delete the checkout temp directory
protected  info.monitorenter.cpdetector.io.CodepageDetectorProxy getCodepageDetector()
           
 String getHeadcommiter(String address, String login, String password)
           
 String getHeadNumberRevision(String address, String login, String password)
           
 String getHeadRevision(String address, String login, String password)
           
protected  String getMimeType(File file)
           
protected  String getMimeType(String content, String filename)
           
protected  String[] getMimeTypes(String content, String filename)
           
 String getPassword(String url)
           
 ScmSession getScmSession()
           
protected  SvnConnection getSvnSession(javax.servlet.http.HttpSession httpSession)
           
protected  File getTempDir(javax.servlet.http.HttpSession httpSession)
           
 String getUsername(String url)
           
static Properties loadProperties(InputStream inStream)
          Recuperation des propriétés dans un fichier properties
static Properties loadProperties(String file)
          Recuperation des propriétés dans un fichier properties
protected  void setSvnSession(javax.servlet.http.HttpSession httpSession, SvnConnection svnSess)
           
 
Methods inherited from class org.nuiton.web.struts2.BaseAction
_, _
 
Methods inherited from class com.opensymphony.xwork2.ActionSupport
addActionError, addActionMessage, addFieldError, clearActionErrors, clearErrors, clearErrorsAndMessages, clearFieldErrors, clearMessages, clone, doDefault, execute, getActionErrors, getActionMessages, getErrorMessages, getErrors, getFieldErrors, getLocale, getText, getText, getText, getText, getText, getText, getText, getText, getText, getTexts, getTexts, hasActionErrors, hasActionMessages, hasErrors, hasFieldErrors, hasKey, input, pause, setActionErrors, setActionMessages, setContainer, setFieldErrors, validate
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AUTH_ERROR

public static final String AUTH_ERROR
See Also:
Constant Field Values

ERROR_PATH

public static final String ERROR_PATH
See Also:
Constant Field Values

session

protected Map<String,Object> session

CONTEXT_ACTION_KEY

protected static final String CONTEXT_ACTION_KEY
See Also:
Constant Field Values

PARAMETER_ADDRESS

protected static final String PARAMETER_ADDRESS
See Also:
Constant Field Values

PARAMETER_SCM_EDITOR_URL

protected static final String PARAMETER_SCM_EDITOR_URL
See Also:
Constant Field Values

PARAMETER_PROJECT_URL

protected static final String PARAMETER_PROJECT_URL
See Also:
Constant Field Values

PARAMETER_FILE_NAME

protected static final String PARAMETER_FILE_NAME
See Also:
Constant Field Values

PARAMETER_LANG

protected static final String PARAMETER_LANG
See Also:
Constant Field Values

PARAMETER_DEFAULT_LANG

protected static final String PARAMETER_DEFAULT_LANG
See Also:
Constant Field Values

PARAMETER_FORMAT

protected static final String PARAMETER_FORMAT
See Also:
Constant Field Values

PARAMETER_USERNAME

protected static final String PARAMETER_USERNAME
See Also:
Constant Field Values

PARAMETER_PW

protected static final String PARAMETER_PW
See Also:
Constant Field Values

PARAMETER_MYTEXT

protected static final String PARAMETER_MYTEXT
See Also:
Constant Field Values

PARAMETER_ORIG_TEXT

protected static final String PARAMETER_ORIG_TEXT
See Also:
Constant Field Values

PARAMETER_COMMIT_MESSAGE

protected static final String PARAMETER_COMMIT_MESSAGE
See Also:
Constant Field Values

PARAMETER_TEXT

protected static final String PARAMETER_TEXT
See Also:
Constant Field Values

ATTRIBUTE_REDIRECTION_URL

protected static final String ATTRIBUTE_REDIRECTION_URL
See Also:
Constant Field Values

ATTRIBUTE_ORIG_TEXT

protected static final String ATTRIBUTE_ORIG_TEXT
See Also:
Constant Field Values

ATTRIBUTE_INVALIDATE_MAX_TIME

protected static final String ATTRIBUTE_INVALIDATE_MAX_TIME
See Also:
Constant Field Values

ATTRIBUTE_LOGIN

protected static final String ATTRIBUTE_LOGIN
See Also:
Constant Field Values

ATTRIBUTE_IS_LOGIN

protected static final String ATTRIBUTE_IS_LOGIN
See Also:
Constant Field Values

ATTRIBUTE_BAD_LOGIN

protected static final String ATTRIBUTE_BAD_LOGIN
See Also:
Constant Field Values

ATTRIBUTE_PROJECT_URL

protected static final String ATTRIBUTE_PROJECT_URL
See Also:
Constant Field Values

ATTRIBUTE_SCM_EDITOR_URI

protected static final String ATTRIBUTE_SCM_EDITOR_URI
See Also:
Constant Field Values

ATTRIBUTE_PREVIEW_SERVLET_URL

protected static final String ATTRIBUTE_PREVIEW_SERVLET_URL
See Also:
Constant Field Values

ATTRIBUTE_FILESEARCH_SERVLET_URL

protected static final String ATTRIBUTE_FILESEARCH_SERVLET_URL
See Also:
Constant Field Values

ATTRIBUTE_REDIRECT_URL

protected static final String ATTRIBUTE_REDIRECT_URL
See Also:
Constant Field Values

ATTRIBUTE_PRIVATE_SERVLET_URI

protected static final String ATTRIBUTE_PRIVATE_SERVLET_URI
See Also:
Constant Field Values

PROPERTIESFILES

protected static final String PROPERTIESFILES
See Also:
Constant Field Values

EDITABLESFILES

protected static final String EDITABLESFILES
See Also:
Constant Field Values

detector

protected static info.monitorenter.cpdetector.io.CodepageDetectorProxy detector
Constructor Detail

ScmWebEditorBaseAction

public ScmWebEditorBaseAction()
Method Detail

getCodepageDetector

protected info.monitorenter.cpdetector.io.CodepageDetectorProxy getCodepageDetector()

convertToUnicode

protected void convertToUnicode(File... files)
Convert all files to UTF-8.

Parameters:
files - fiels to convert

checkout

public void checkout(SvnConnection svnSess,
                     File checkoutdir,
                     String numVersion)
              throws org.tmatesoft.svn.core.SVNException
Parameters:
svnSess -
checkoutdir -
Throws:
org.tmatesoft.svn.core.SVNException

checkout

public void checkout(SvnConnection svnSess,
                     File checkoutdir)
              throws org.tmatesoft.svn.core.SVNException
Parameters:
svnSess -
checkoutdir -
Throws:
org.tmatesoft.svn.core.SVNException

getHeadRevision

public String getHeadRevision(String address,
                              String login,
                              String password)
                       throws org.tmatesoft.svn.core.SVNException,
                              IllegalArgumentException
Parameters:
svnFile -
username -
password -
Returns:
Throws:
org.tmatesoft.svn.core.SVNException
IOException
IllegalArgumentException

getHeadNumberRevision

public String getHeadNumberRevision(String address,
                                    String login,
                                    String password)
                             throws org.tmatesoft.svn.core.SVNException
Throws:
org.tmatesoft.svn.core.SVNException

getHeadcommiter

public String getHeadcommiter(String address,
                              String login,
                              String password)
                       throws org.tmatesoft.svn.core.SVNException
Throws:
org.tmatesoft.svn.core.SVNException

delTempDirectory

public void delTempDirectory(File checkoutdir)
Use to delete the checkout temp directory

Parameters:
checkoutdir - The dir temp directory

getSvnSession

protected SvnConnection getSvnSession(javax.servlet.http.HttpSession httpSession)

setSvnSession

protected void setSvnSession(javax.servlet.http.HttpSession httpSession,
                             SvnConnection svnSess)

getTempDir

protected File getTempDir(javax.servlet.http.HttpSession httpSession)

getMimeType

protected String getMimeType(File file)
                      throws IOException,
                             SAXException,
                             org.apache.tika.exception.TikaException
Throws:
IOException
SAXException
org.apache.tika.exception.TikaException

getMimeType

protected String getMimeType(String content,
                             String filename)
                      throws IOException
Throws:
IOException

getMimeTypes

protected String[] getMimeTypes(String content,
                                String filename)
                         throws IOException,
                                SAXException,
                                org.apache.tika.exception.TikaException
Throws:
IOException
SAXException
org.apache.tika.exception.TikaException

loadProperties

public static Properties loadProperties(String file)
                                 throws IOException
Recuperation des propriétés dans un fichier properties

Parameters:
file - le fichier contenant les propriétés
Returns:
un objet Properties contenant les propriétés du fichier
Throws:
IOException

loadProperties

public static Properties loadProperties(InputStream inStream)
                                 throws IOException,
                                        NullPointerException
Recuperation des propriétés dans un fichier properties

Parameters:
inStream - le fichier contenant les propriétés
Returns:
un objet Properties contenant les propriétés du fichier
Throws:
IOException
NullPointerException

getScmSession

public ScmSession getScmSession()

getUsername

public String getUsername(String url)

getPassword

public String getPassword(String url)


Copyright © 2009-2011 CodeLutin. All Rights Reserved.