Class FileAttribute
- All Implemented Interfaces:
Viewable,Cacheable,Observed,Retrievable,Serializable,ColumnAccessByName,ObjectModel,Persistent
- Direct Known Subclasses:
AudioAttribute,ParentsStoreAttribute,PreBuildAttribute,PreBuildScheduleAttribute,TestSheetFileAttribute
- Author:
- Youngho Cho
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.easydesk.om.AttributeValue
AttributeValue.AccessEnum -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected byte[]DOCUMENT ME!protected static final Stringmethod results cache keyFields inherited from class com.easydesk.om.AttributeValue
activitySet, chainedFields inherited from interface com.easydesk.validator.Retrievable
KEY_SEPERATOR -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncopy()copy 시 file 도 같이 복사.voidcopyFileTo(File toFile) Repository 의 파일을 주어진 파일로 복사한다.voidcopyFileTo(String path) DOCUMENT ME!extra info to save description in activity record and save File into filesystembyte[]getByte()DOCUMENT ME!getData()File Data 를 UTF-8 로 읽어서 구한다.File Data 를 구한다.File Data 를 구한다.getDisplayedValue(String type) 기본 locale(아이템의 locale)로 화면에 표시할 값을 구한다.getDisplayedValue(String type, Locale locale) 지정한 locale 로 화면에 표시할 값을 구한다.일단 FileAttribute 는 indexing 을 하지 않는다.이 속성과 연관된 파일의 Extension 을 구한다.getFile()Repository 의 File 을 구한다.org.apache.commons.fileupload.FileItem업로드된 FileItem 을 구한다.getFormatter(Locale locale) formatter 를 구한다.Deprecated.please use getResource(getValue()).getPath() insteadRepository 에 대한 첨부 파일의 상대 경로를 구한다.booleanhasFile()DOCUMENT ME!booleanDOCUMENT ME!saveFile()속성에 따라 File 을 저장하는 Mechenism 을 달리 구현한다.voidsetByte(byte[] bt) DOCUMENT ME!voidsetFileItem(org.apache.commons.fileupload.FileItem v) Set the value of file.voidsetProperties(AttributeValue attVal1) Sets the properties of one attribute value based on another NOTE: Does not copy the deleted fieldvoidrandom 값으로 value 를 설정한다.Methods inherited from class com.easydesk.attribute.FreeFormAttribute
init, loadResources, setResourcesMethods inherited from class com.easydesk.om.AttributeValue
alwaysNeedActivity, clear, copy, copy, endActivitySet, getActivity, getAttachment, getChainedValue, getChainedValue, getChainedValue, getInputValue, getLocalizedValue, getLocalizedValue, getLocalizedValue, getLocalizedValue, getLocalizedValues, getLocalizedValues, getMethodCache, getModuleAttribute, getNewInstance, getNewInstance, getNumericValues, getNumericValues, getNumericValuesAsString, getNumericValuesAsString, getObserverOption, getOptionIdAsString, getOptionIds, getOptionIds, getOptionIdsAsString, getOptionIdsAsString, getOptionValues, getPossibleTransitionCount, getPossibleTransitionCount, getPrimitiveOptionIds, getPrimitiveUserIds, getQueryKey, getRelativePath, getRelativePath, getRepository, getResource, getTransactionId, getUser, getUserIds, getValueList, getValueList, getValues, getValues, getValuesAsString, getValuesAsString, hasAlreadyChained, isModified, isQuickSearchAttribute, isSet, isSetOnly, needActivity, performAfter, performBefore, register, save, setActivity, setActivityDescription, setAttachment, setChainedValue, setInputValue, setNumericValue, setNumericValueOnly, setNumericValues, setOptionId, setOptionIdOnly, setOptionIds, setOptionValues, setPrimitiveOptionIds, setPrimitiveUserIds, setTransactionId, setUser, setUserId, setUserIdOnly, setUserIds, setValue, setValueOnly, setValues, startActivitySet, toStringMethods inherited from class com.easydesk.om.BaseAttributeValue
copy, copyInto, copyInto, copyInto, copyInto, equals, getAttribute, getAttribute, getAttributeId, getAttributeOption, getAttributeOption, getByName, getByPeerName, getByPosition, getDepend, getDepend, getDependId, getEasyDeskUserImpl, getEasyDeskUserImpl, getFieldNames, getForeignKeyForAttribute, getForeignKeyForAttributeOption, getForeignKeyForDepend, getForeignKeyForEasyDeskUserImpl, getForeignKeyForItem, getItem, getItem, getItemId, getNumericValue, getOptionId, getPeer, getPrimaryKey, getTableMap, getUserId, getValue, getValueId, hashCode, isCacheOnSave, isDeleted, isLoading, isModified, isNew, isRemoved, isSaving, resetModified, save, save, setAttribute, setAttributeId, setAttributeKey, setAttributeOption, setAttributeOptionKey, setByName, setByPeerName, setByPosition, setDeleted, setDepend, setDependId, setDependKey, setEasyDeskUserImpl, setEasyDeskUserImplKey, setItem, setItemId, setItemKey, setLoading, setModified, setNew, setPrimaryKey, setPrimaryKey, setRemoved, setSaving, setValueId, valueEqualsMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.easydesk.attribute.Viewable
getComponentName
-
Field Details
-
GET_DATA
method results cache key- See Also:
-
bt
protected transient byte[] btDOCUMENT ME!
-
-
Constructor Details
-
FileAttribute
public FileAttribute()Creates a new FileAttribute object.
-
-
Method Details
-
setByte
public void setByte(byte[] bt) DOCUMENT ME!- Parameters:
bt- DOCUMENT ME!
-
getByte
public byte[] getByte()DOCUMENT ME!- Returns:
- DOCUMENT ME!
-
getFileItem
public org.apache.commons.fileupload.FileItem getFileItem()업로드된 FileItem 을 구한다.- Returns:
- value of fileItem.
-
setFileItem
public void setFileItem(org.apache.commons.fileupload.FileItem v) Set the value of file.- Parameters:
v- Value to assign to file.
-
getActivityDescription
extra info to save description in activity record and save File into filesystem- Overrides:
getActivityDescriptionin classAttributeValue- Returns:
- activity 설명
- Throws:
TorqueException- 조회 중 오류가 발생한 경우
-
saveFile
속성에 따라 File 을 저장하는 Mechenism 을 달리 구현한다.- Returns:
- saved location
- Throws:
Exception- DOCUMENT ME!
-
hasFile
DOCUMENT ME!- Returns:
- DOCUMENT ME!
- Throws:
Exception- DOCUMENT ME!
-
getFullPath
Deprecated.please use getResource(getValue()).getPath() insteadPrepends the base repository path to the path returned by getRelativePath().- Returns:
- DOCUMENT ME!
- Throws:
Exception- DOCUMENT ME!
-
getRelativePath
Repository 에 대한 첨부 파일의 상대 경로를 구한다.The path to an attachment file relative to the base file repository. Files are saved according to:
moduleId/(item_IdCount/100)/itemID_attID_filenamewhere moduleId and attId are primary keys of the related module and this attachment. itemID is the unique id generally used to specify the item within the ui. item_IdCount is the numerical suffix of the unique id. So if the pk of module PACS is 201 and this attachment pk is 123 the path would be: 201/0/PACS5_123_diff.txt or if the item count were higher: 201/2/PACS2115_123_diff.txt. The first two directories are used to keep the number of files per directory reasonable while the item unique id and the final textual filename allow someone browsing the file system to be better able to pick out relevant files.- Returns:
- relativePath String
- Throws:
Exception- 경로를 구하는 중 오류가 발생한 경우
-
copyFileTo
DOCUMENT ME!- Parameters:
path- DOCUMENT ME!- Throws:
Exception- DOCUMENT ME!
-
copyFileTo
Repository 의 파일을 주어진 파일로 복사한다.- Parameters:
toFile- 복사할 대상 파일- Throws:
Exception- 복사 중 오류가 발생한 경우
-
getData
File Data 를 UTF-8 로 읽어서 구한다.- Returns:
- 파일 내용
- Throws:
Exception- 파일을 읽는 중 오류가 발생한 경우
-
getData
File Data 를 구한다.- Parameters:
encoding- 파일의 문자 인코딩- Returns:
- 파일 내용
- Throws:
Exception- 파일을 읽는 중 오류가 발생한 경우
-
getData
File Data 를 구한다. TODO : UTF-8 로 고정- Parameters:
file- 읽을 파일encoding- 파일의 문자 인코딩- Returns:
- 파일 내용
- Throws:
Exception- 파일을 읽는 중 오류가 발생한 경우
-
copy
copy 시 file 도 같이 복사.- Overrides:
copyin classBaseAttributeValue- Returns:
- 복사된 AttributeValue
- Throws:
TorqueException- 복사 중 오류가 발생한 경우
-
setProperties
Sets the properties of one attribute value based on another NOTE: Does not copy the deleted field- Overrides:
setPropertiesin classAttributeValue- Parameters:
attVal1- DOCUMENT ME!- Throws:
TorqueException- DOCUMENT ME!
-
getFile
Repository 의 File 을 구한다.- Returns:
- File
- Throws:
Exception- 파일을 구하는 중 오류가 발생한 경우
-
getExtension
이 속성과 연관된 파일의 Extension 을 구한다.- Returns:
- 파일 확장자
- Throws:
Exception- 파일을 구하는 중 오류가 발생한 경우
-
setRandomValue
random 값으로 value 를 설정한다.- Throws:
Exception- 값 설정 중 오류가 발생한 경우
-
getDisplayedValue
기본 locale(아이템의 locale)로 화면에 표시할 값을 구한다.- Overrides:
getDisplayedValuein classFreeFormAttribute- Parameters:
type- 표시 형식- Returns:
- 화면에 표시할 값
- Throws:
Exception- 값을 구하는 중 오류가 발생한 경우
-
getDisplayedValue
지정한 locale 로 화면에 표시할 값을 구한다. 기본 구현은 저장된 값을 그대로 반환한다.- Overrides:
getDisplayedValuein classFreeFormAttribute- Parameters:
type- 표시 형식locale- 표시에 사용할 locale- Returns:
- 화면에 표시할 값
- Throws:
Exception- 값을 구하는 중 오류가 발생한 경우
-
getFormatter
formatter 를 구한다. 기본 구현은 value 를 그대로 반환한다.- Overrides:
getFormatterin classFreeFormAttribute- Parameters:
locale- 표시에 사용할 locale- Returns:
- object
- Throws:
Exception- 값을 구하는 중 오류가 발생한 경우
-
getDocument
일단 FileAttribute 는 indexing 을 하지 않는다. 추후 FileAttribute 의 특성에 맞게 indexing 을 처리한다.- Returns:
- document
-
hasValue
DOCUMENT ME!- Specified by:
hasValuein classAttributeValue- Parameters:
checkValue- DOCUMENT ME!- Returns:
- DOCUMENT ME!
- Throws:
Exception- DOCUMENT ME!
-