org.ektorp.support
Class DesignDocument
java.lang.Object
org.ektorp.support.CouchDbDocument
org.ektorp.support.OpenCouchDbDocument
org.ektorp.support.DesignDocument
- All Implemented Interfaces:
- Serializable
public class DesignDocument
- extends OpenCouchDbDocument
Representation of a CouchDb design document.
Design documents can contain fields currently not handled by Ektorp, such as update handlers and validators. These
fields are still accessible through the methods getAnonymous() and setAnonymous(String key, Object value)
- Author:
- henrik lundgren
- See Also:
- Serialized Form
|
Nested Class Summary |
static class |
DesignDocument.View
Definition of a view in a design document. |
|
Method Summary |
void |
addFilter(String name,
String function)
|
void |
addListFunction(String name,
String function)
|
void |
addShowFunction(String name,
String function)
|
void |
addView(String name,
DesignDocument.View v)
|
boolean |
containsView(String name)
|
DesignDocument.View |
get(String viewName)
|
Map<String,String> |
getFilters()
|
String |
getLanguage()
|
Map<String,String> |
getLists()
|
Map<String,String> |
getShows()
|
Map<String,String> |
getUpdates()
|
Map<String,DesignDocument.View> |
getViews()
|
boolean |
mergeWith(DesignDocument dd)
This method will check for the two system properties boolean
AUTO_UPDATE_VIEW_ON_CHANGE and UPDATE_ON_DIFF, then call
mergeWith(DesignDocument, boolean). |
boolean |
mergeWith(DesignDocument dd,
boolean updateOnDiff)
Merge this design document with the specified document, the result being
stored in this design document. |
void |
removeFilter(String name)
|
void |
removeListFunction(String name)
|
void |
removeShowFunction(String name)
|
void |
removeView(String name)
|
void |
setLanguage(String s)
|
| Methods inherited from class org.ektorp.support.CouchDbDocument |
addInlineAttachment, getAttachments, getConflicts, getId, getRevision, getRevisions, hasConflict, isNew, removeAttachment, setId, setRevision |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ID_PREFIX
public static final String ID_PREFIX
- See Also:
- Constant Field Values
AUTO_UPDATE_VIEW_ON_CHANGE
public static final String AUTO_UPDATE_VIEW_ON_CHANGE
- See Also:
- Constant Field Values
UPDATE_ON_DIFF
public static final String UPDATE_ON_DIFF
- See Also:
- Constant Field Values
DesignDocument
public DesignDocument()
DesignDocument
public DesignDocument(String id)
getViews
public Map<String,DesignDocument.View> getViews()
getLists
public Map<String,String> getLists()
getShows
public Map<String,String> getShows()
getFilters
public Map<String,String> getFilters()
getUpdates
public Map<String,String> getUpdates()
getLanguage
public String getLanguage()
setLanguage
public void setLanguage(String s)
containsView
public boolean containsView(String name)
get
public DesignDocument.View get(String viewName)
addView
public void addView(String name,
DesignDocument.View v)
removeView
public void removeView(String name)
addListFunction
public void addListFunction(String name,
String function)
removeListFunction
public void removeListFunction(String name)
addShowFunction
public void addShowFunction(String name,
String function)
removeShowFunction
public void removeShowFunction(String name)
addFilter
public void addFilter(String name,
String function)
removeFilter
public void removeFilter(String name)
mergeWith
public boolean mergeWith(DesignDocument dd,
boolean updateOnDiff)
- Merge this design document with the specified document, the result being
stored in this design document.
- Parameters:
dd - the design document to merge withupdateOnDiff - true to overwrite existing views/functions in this document
with the views/functions in the specified document; false will
only add new views/functions.
- Returns:
- true if there was any modification to this document, false otherwise.
mergeWith
public boolean mergeWith(DesignDocument dd)
- This method will check for the two system properties boolean
AUTO_UPDATE_VIEW_ON_CHANGE and UPDATE_ON_DIFF, then call
mergeWith(DesignDocument, boolean). The default value is false for both.
Copyright © 2017. All rights reserved.