Package com.axelor.meta.loader
Class ViewLoader
- java.lang.Object
-
- com.axelor.meta.loader.ViewLoader
-
public class ViewLoader extends Object
-
-
Constructor Summary
Constructors Constructor Description ViewLoader()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addResolveTask(Class<?> type, String name, Long entityId, BiConsumer<Long,Long> consumer)
protected void
doLast(com.axelor.meta.loader.Module module, boolean update)
protected void
doLoad(com.axelor.meta.loader.Module module, boolean update)
Implement this method the load the data.protected void
doLoad(URL file, com.axelor.meta.loader.Module module, boolean update)
protected void
feedTransactionExecutor(ParallelTransactionExecutor transactionExecutor, com.axelor.meta.loader.Module module, boolean update, Set<Path> paths)
protected List<URL>
findFiles(com.axelor.meta.loader.Module module)
protected List<URL>
findFiles(com.axelor.meta.loader.Module module, Set<Path> paths)
protected Set<String>
getDuplicates()
Returns items that have been visited several times.protected void
importAction(Action action, com.axelor.meta.loader.Module module, boolean update)
protected void
importActionMenu(MenuItem menuItem, com.axelor.meta.loader.Module module, boolean update)
protected void
importMenu(MenuItem menuItem, com.axelor.meta.loader.Module module, boolean update)
protected void
importSelection(Selection selection, com.axelor.meta.loader.Module module, boolean update)
protected boolean
isVisited(Class<?> type, String name, Class<?> baseType, String xmlId)
Checks whether an element is already visited.protected boolean
isVisited(Class<?> type, String name, String xmlId)
Checks whether an element is already visited.protected void
linkMissingGroups()
void
load(com.axelor.meta.loader.Module module, boolean update)
protected <T> Set<Long>
resolve(Class<T> type, String unresolvedKey)
Resolve the given unresolved key.
All the pending values of the unresolved key are returned for further processing.protected void
runResolveTasks()
protected <T> void
setUnresolved(Class<T> type, String unresolvedKey, Long entityId)
Put a value of the given type for resolution for the given unresolved key.
The value is put inside aMap
with unresolvedKey as the key.protected void
terminate(boolean update)
protected Set<String>
unresolvedKeys()
Return set of all the unresolved keys.
-
-
-
Method Detail
-
doLoad
protected void doLoad(URL file, com.axelor.meta.loader.Module module, boolean update)
-
doLast
protected void doLast(com.axelor.meta.loader.Module module, boolean update)
-
terminate
protected void terminate(boolean update)
-
linkMissingGroups
protected void linkMissingGroups()
-
importSelection
protected void importSelection(Selection selection, com.axelor.meta.loader.Module module, boolean update)
-
importAction
protected void importAction(Action action, com.axelor.meta.loader.Module module, boolean update)
-
importMenu
protected void importMenu(MenuItem menuItem, com.axelor.meta.loader.Module module, boolean update)
-
importActionMenu
protected void importActionMenu(MenuItem menuItem, com.axelor.meta.loader.Module module, boolean update)
-
doLoad
protected void doLoad(com.axelor.meta.loader.Module module, boolean update)
Implement this method the load the data.- Parameters:
module
- the module for which to load the dataupdate
- whether to force update while loading
-
feedTransactionExecutor
protected void feedTransactionExecutor(ParallelTransactionExecutor transactionExecutor, com.axelor.meta.loader.Module module, boolean update, Set<Path> paths)
-
isVisited
protected boolean isVisited(Class<?> type, String name, Class<?> baseType, String xmlId)
Checks whether an element is already visited. Element can be either identified the pairtype
/name
or by itsxmlId
.- Parameters:
type
- element typename
- element namebaseType
- element base typexmlId
- element xmlId- Returns:
- whether the element is already visited or not
-
isVisited
protected boolean isVisited(Class<?> type, String name, String xmlId)
Checks whether an element is already visited. Element can be either identified the pairtype
/name
or by itsxmlId
.- Parameters:
type
- element typename
- element namexmlId
- element xmlId- Returns:
- whether the element is already visited or not
-
getDuplicates
protected Set<String> getDuplicates()
Returns items that have been visited several times.- Returns:
- duplicate items
-
setUnresolved
protected <T> void setUnresolved(Class<T> type, String unresolvedKey, Long entityId)
Put a value of the given type for resolution for the given unresolved key.
The value is put inside aMap
with unresolvedKey as the key.- Parameters:
type
-unresolvedKey
-entityId
-
-
resolve
protected <T> Set<Long> resolve(Class<T> type, String unresolvedKey)
Resolve the given unresolved key.
All the pending values of the unresolved key are returned for further processing. The values are removed from the backingMap
.- Parameters:
type
- the type of pending objectsunresolvedKey
- the unresolved key- Returns:
- a set of all the pending objects
-
addResolveTask
protected void addResolveTask(Class<?> type, String name, Long entityId, BiConsumer<Long,Long> consumer)
-
runResolveTasks
protected void runResolveTasks()
-
unresolvedKeys
protected Set<String> unresolvedKeys()
Return set of all the unresolved keys.- Returns:
- set of unresolved keys
-
load
public final void load(com.axelor.meta.loader.Module module, boolean update)
-
-