repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
partition
stringclasses
1 value
buschmais/jqa-maven3-plugin
src/main/java/com/buschmais/jqassistant/plugin/maven3/impl/scanner/MavenModelScannerPlugin.java
MavenModelScannerPlugin._addProfileDependencies
private void _addProfileDependencies(MavenProfileDescriptor profileDescriptor, List<Dependency> dependencies, ScannerContext scannerContext) { for (Dependency dependency : dependencies) { MavenArtifactDescriptor dependencyArtifactDescriptor = getMavenArtifactDescriptor(dependency, scannerContext); ...
java
private void _addProfileDependencies(MavenProfileDescriptor profileDescriptor, List<Dependency> dependencies, ScannerContext scannerContext) { for (Dependency dependency : dependencies) { MavenArtifactDescriptor dependencyArtifactDescriptor = getMavenArtifactDescriptor(dependency, scannerContext); ...
[ "private", "void", "_addProfileDependencies", "(", "MavenProfileDescriptor", "profileDescriptor", ",", "List", "<", "Dependency", ">", "dependencies", ",", "ScannerContext", "scannerContext", ")", "{", "for", "(", "Dependency", "dependency", ":", "dependencies", ")", ...
Adds information about profile dependencies. @param profileDescriptor The descriptor for the current profile. @param dependencies The dependencies information. @param scannerContext The scanner context.
[ "Adds", "information", "about", "profile", "dependencies", "." ]
6c6e2dca56de6d5b8ceeb2f28982fb6d7c98778f
https://github.com/buschmais/jqa-maven3-plugin/blob/6c6e2dca56de6d5b8ceeb2f28982fb6d7c98778f/src/main/java/com/buschmais/jqassistant/plugin/maven3/impl/scanner/MavenModelScannerPlugin.java#L543-L552
train
buschmais/jqa-maven3-plugin
src/main/java/com/buschmais/jqassistant/plugin/maven3/impl/scanner/MavenModelScannerPlugin.java
MavenModelScannerPlugin.addProfiles
private void addProfiles(MavenPomDescriptor pomDescriptor, Model model, ScannerContext scannerContext) { List<Profile> profiles = model.getProfiles(); Store store = scannerContext.getStore(); for (Profile profile : profiles) { MavenProfileDescriptor mavenProfileDescriptor = store.cre...
java
private void addProfiles(MavenPomDescriptor pomDescriptor, Model model, ScannerContext scannerContext) { List<Profile> profiles = model.getProfiles(); Store store = scannerContext.getStore(); for (Profile profile : profiles) { MavenProfileDescriptor mavenProfileDescriptor = store.cre...
[ "private", "void", "addProfiles", "(", "MavenPomDescriptor", "pomDescriptor", ",", "Model", "model", ",", "ScannerContext", "scannerContext", ")", "{", "List", "<", "Profile", ">", "profiles", "=", "model", ".", "getProfiles", "(", ")", ";", "Store", "store", ...
Adds information about defined profile. @param pomDescriptor The descriptor for the current POM. @param model The Maven Model. @param scannerContext The scanner context.
[ "Adds", "information", "about", "defined", "profile", "." ]
6c6e2dca56de6d5b8ceeb2f28982fb6d7c98778f
https://github.com/buschmais/jqa-maven3-plugin/blob/6c6e2dca56de6d5b8ceeb2f28982fb6d7c98778f/src/main/java/com/buschmais/jqassistant/plugin/maven3/impl/scanner/MavenModelScannerPlugin.java#L564-L579
train
buschmais/jqa-maven3-plugin
src/main/java/com/buschmais/jqassistant/plugin/maven3/impl/scanner/MavenModelScannerPlugin.java
MavenModelScannerPlugin.addProperties
private void addProperties(BaseProfileDescriptor pomDescriptor, Properties properties, Store store) { Set<Entry<Object, Object>> entrySet = properties.entrySet(); for (Entry<Object, Object> entry : entrySet) { PropertyDescriptor propertyDescriptor = store.create(PropertyDescriptor.class); ...
java
private void addProperties(BaseProfileDescriptor pomDescriptor, Properties properties, Store store) { Set<Entry<Object, Object>> entrySet = properties.entrySet(); for (Entry<Object, Object> entry : entrySet) { PropertyDescriptor propertyDescriptor = store.create(PropertyDescriptor.class); ...
[ "private", "void", "addProperties", "(", "BaseProfileDescriptor", "pomDescriptor", ",", "Properties", "properties", ",", "Store", "store", ")", "{", "Set", "<", "Entry", "<", "Object", ",", "Object", ">", ">", "entrySet", "=", "properties", ".", "entrySet", "(...
Adds information about defined properties. @param pomDescriptor The descriptor for the current POM. @param properties The properties information. @param store The database.
[ "Adds", "information", "about", "defined", "properties", "." ]
6c6e2dca56de6d5b8ceeb2f28982fb6d7c98778f
https://github.com/buschmais/jqa-maven3-plugin/blob/6c6e2dca56de6d5b8ceeb2f28982fb6d7c98778f/src/main/java/com/buschmais/jqassistant/plugin/maven3/impl/scanner/MavenModelScannerPlugin.java#L614-L623
train
buschmais/jqa-maven3-plugin
src/main/java/com/buschmais/jqassistant/plugin/maven3/impl/scanner/MavenModelScannerPlugin.java
MavenModelScannerPlugin.getMavenArtifactDescriptor
private MavenArtifactDescriptor getMavenArtifactDescriptor(Dependency dependency, ScannerContext context) { DependencyCoordinates coordinates = new DependencyCoordinates(dependency); return getArtifactResolver(context).resolve(coordinates, context); }
java
private MavenArtifactDescriptor getMavenArtifactDescriptor(Dependency dependency, ScannerContext context) { DependencyCoordinates coordinates = new DependencyCoordinates(dependency); return getArtifactResolver(context).resolve(coordinates, context); }
[ "private", "MavenArtifactDescriptor", "getMavenArtifactDescriptor", "(", "Dependency", "dependency", ",", "ScannerContext", "context", ")", "{", "DependencyCoordinates", "coordinates", "=", "new", "DependencyCoordinates", "(", "dependency", ")", ";", "return", "getArtifactR...
Creates a MavenArtifactDescriptor and fills it with all information from given dependency. @param dependency Dependency. @param context The scanner context. @return The MavenArtifactDescriptor.
[ "Creates", "a", "MavenArtifactDescriptor", "and", "fills", "it", "with", "all", "information", "from", "given", "dependency", "." ]
6c6e2dca56de6d5b8ceeb2f28982fb6d7c98778f
https://github.com/buschmais/jqa-maven3-plugin/blob/6c6e2dca56de6d5b8ceeb2f28982fb6d7c98778f/src/main/java/com/buschmais/jqassistant/plugin/maven3/impl/scanner/MavenModelScannerPlugin.java#L635-L638
train
buschmais/jqa-maven3-plugin
src/main/java/com/buschmais/jqassistant/plugin/maven3/impl/scanner/MavenModelScannerPlugin.java
MavenModelScannerPlugin.getConfigChildNodes
private ValueDescriptor<?> getConfigChildNodes(Xpp3Dom node, Store store) { Xpp3Dom[] children = node.getChildren(); if (children.length == 0) { PropertyDescriptor propertyDescriptor = store.create(PropertyDescriptor.class); propertyDescriptor.setName(node.getName()); ...
java
private ValueDescriptor<?> getConfigChildNodes(Xpp3Dom node, Store store) { Xpp3Dom[] children = node.getChildren(); if (children.length == 0) { PropertyDescriptor propertyDescriptor = store.create(PropertyDescriptor.class); propertyDescriptor.setName(node.getName()); ...
[ "private", "ValueDescriptor", "<", "?", ">", "getConfigChildNodes", "(", "Xpp3Dom", "node", ",", "Store", "store", ")", "{", "Xpp3Dom", "[", "]", "children", "=", "node", ".", "getChildren", "(", ")", ";", "if", "(", "children", ".", "length", "==", "0",...
Returns information about child config entries. @param node Current config node. @param store The database. @return Child config information.
[ "Returns", "information", "about", "child", "config", "entries", "." ]
6c6e2dca56de6d5b8ceeb2f28982fb6d7c98778f
https://github.com/buschmais/jqa-maven3-plugin/blob/6c6e2dca56de6d5b8ceeb2f28982fb6d7c98778f/src/main/java/com/buschmais/jqassistant/plugin/maven3/impl/scanner/MavenModelScannerPlugin.java#L649-L663
train
buschmais/jqa-maven3-plugin
src/main/java/com/buschmais/jqassistant/plugin/maven3/api/scanner/MavenRepositoryResolver.java
MavenRepositoryResolver.resolve
public static MavenRepositoryDescriptor resolve(Store store, String url) { MavenRepositoryDescriptor repositoryDescriptor = store.find(MavenRepositoryDescriptor.class, url); if (repositoryDescriptor == null) { repositoryDescriptor = store.create(MavenRepositoryDescriptor.class); ...
java
public static MavenRepositoryDescriptor resolve(Store store, String url) { MavenRepositoryDescriptor repositoryDescriptor = store.find(MavenRepositoryDescriptor.class, url); if (repositoryDescriptor == null) { repositoryDescriptor = store.create(MavenRepositoryDescriptor.class); ...
[ "public", "static", "MavenRepositoryDescriptor", "resolve", "(", "Store", "store", ",", "String", "url", ")", "{", "MavenRepositoryDescriptor", "repositoryDescriptor", "=", "store", ".", "find", "(", "MavenRepositoryDescriptor", ".", "class", ",", "url", ")", ";", ...
Finds or creates a repository descriptor for the given url. @param store the {@link Store} @param url the repository url @return a {@link MavenRepositoryDescriptor} for the given url.
[ "Finds", "or", "creates", "a", "repository", "descriptor", "for", "the", "given", "url", "." ]
6c6e2dca56de6d5b8ceeb2f28982fb6d7c98778f
https://github.com/buschmais/jqa-maven3-plugin/blob/6c6e2dca56de6d5b8ceeb2f28982fb6d7c98778f/src/main/java/com/buschmais/jqassistant/plugin/maven3/api/scanner/MavenRepositoryResolver.java#L20-L27
train
OnyxDevTools/onyx-database-parent
onyx-database-examples/indexes/src/main/java/com/onyxdevtools/index/Main.java
Main.seedData
private static void seedData(PersistenceManager manager) throws OnyxException { // Create test data Book harryPotter = new Book(); harryPotter.setTitle("Harry Potter, Deathly Hallows"); harryPotter.setDescription("Story about a kid that has abnormal creepy powers that seeks revenge o...
java
private static void seedData(PersistenceManager manager) throws OnyxException { // Create test data Book harryPotter = new Book(); harryPotter.setTitle("Harry Potter, Deathly Hallows"); harryPotter.setDescription("Story about a kid that has abnormal creepy powers that seeks revenge o...
[ "private", "static", "void", "seedData", "(", "PersistenceManager", "manager", ")", "throws", "OnyxException", "{", "// Create test data", "Book", "harryPotter", "=", "new", "Book", "(", ")", ";", "harryPotter", ".", "setTitle", "(", "\"Harry Potter, Deathly Hallows\"...
Insert test data into a test database @param manager Persistence Manager used to insert data
[ "Insert", "test", "data", "into", "a", "test", "database" ]
474dfc273a094dbc2ca08fcc08a2858cd538c920
https://github.com/OnyxDevTools/onyx-database-parent/blob/474dfc273a094dbc2ca08fcc08a2858cd538c920/onyx-database-examples/indexes/src/main/java/com/onyxdevtools/index/Main.java#L45-L73
train
buschmais/jqa-maven3-plugin
src/main/java/com/buschmais/jqassistant/plugin/maven3/impl/scanner/MavenProjectScannerPlugin.java
MavenProjectScannerPlugin.getMavenArtifactDescriptor
private <T extends MavenArtifactDescriptor> T getMavenArtifactDescriptor(Coordinates coordinates, ArtifactResolver artifactResolver, Class<T> type, Scanner scanner) { MavenArtifactDescriptor mavenArtifactDescriptor = artifactResolver.r...
java
private <T extends MavenArtifactDescriptor> T getMavenArtifactDescriptor(Coordinates coordinates, ArtifactResolver artifactResolver, Class<T> type, Scanner scanner) { MavenArtifactDescriptor mavenArtifactDescriptor = artifactResolver.r...
[ "private", "<", "T", "extends", "MavenArtifactDescriptor", ">", "T", "getMavenArtifactDescriptor", "(", "Coordinates", "coordinates", ",", "ArtifactResolver", "artifactResolver", ",", "Class", "<", "T", ">", "type", ",", "Scanner", "scanner", ")", "{", "MavenArtifac...
Returns a resolved maven artifact descriptor for the given coordinates. @param coordinates The artifact coordinates. @param artifactResolver The artifact resolver. @param type The expected type. @param scanner The scanner. @return The artifact descriptor.
[ "Returns", "a", "resolved", "maven", "artifact", "descriptor", "for", "the", "given", "coordinates", "." ]
6c6e2dca56de6d5b8ceeb2f28982fb6d7c98778f
https://github.com/buschmais/jqa-maven3-plugin/blob/6c6e2dca56de6d5b8ceeb2f28982fb6d7c98778f/src/main/java/com/buschmais/jqassistant/plugin/maven3/impl/scanner/MavenProjectScannerPlugin.java#L121-L125
train
buschmais/jqa-maven3-plugin
src/main/java/com/buschmais/jqassistant/plugin/maven3/impl/scanner/MavenProjectScannerPlugin.java
MavenProjectScannerPlugin.resolveProject
protected <T extends MavenProjectDescriptor> T resolveProject(MavenProject project, Class<T> expectedType, ScannerContext scannerContext) { Store store = scannerContext.getStore(); String id = project.getGroupId() + ":" + project.getArtifactId() + ":" + project.getVersion(); MavenProjectDescript...
java
protected <T extends MavenProjectDescriptor> T resolveProject(MavenProject project, Class<T> expectedType, ScannerContext scannerContext) { Store store = scannerContext.getStore(); String id = project.getGroupId() + ":" + project.getArtifactId() + ":" + project.getVersion(); MavenProjectDescript...
[ "protected", "<", "T", "extends", "MavenProjectDescriptor", ">", "T", "resolveProject", "(", "MavenProject", "project", ",", "Class", "<", "T", ">", "expectedType", ",", "ScannerContext", "scannerContext", ")", "{", "Store", "store", "=", "scannerContext", ".", ...
Resolves a maven project. @param project The project @param expectedType The expected descriptor type. @param scannerContext The scanner context. @param <T> The expected descriptor type. @return The maven project descriptor.
[ "Resolves", "a", "maven", "project", "." ]
6c6e2dca56de6d5b8ceeb2f28982fb6d7c98778f
https://github.com/buschmais/jqa-maven3-plugin/blob/6c6e2dca56de6d5b8ceeb2f28982fb6d7c98778f/src/main/java/com/buschmais/jqassistant/plugin/maven3/impl/scanner/MavenProjectScannerPlugin.java#L140-L156
train
buschmais/jqa-maven3-plugin
src/main/java/com/buschmais/jqassistant/plugin/maven3/impl/scanner/MavenProjectScannerPlugin.java
MavenProjectScannerPlugin.addProjectDetails
private void addProjectDetails(MavenProject project, MavenProjectDirectoryDescriptor projectDescriptor, Scanner scanner) { ScannerContext scannerContext = scanner.getContext(); addParent(project, projectDescriptor, scannerContext); addModules(project, projectDescriptor, scannerContext); ...
java
private void addProjectDetails(MavenProject project, MavenProjectDirectoryDescriptor projectDescriptor, Scanner scanner) { ScannerContext scannerContext = scanner.getContext(); addParent(project, projectDescriptor, scannerContext); addModules(project, projectDescriptor, scannerContext); ...
[ "private", "void", "addProjectDetails", "(", "MavenProject", "project", ",", "MavenProjectDirectoryDescriptor", "projectDescriptor", ",", "Scanner", "scanner", ")", "{", "ScannerContext", "scannerContext", "=", "scanner", ".", "getContext", "(", ")", ";", "addParent", ...
Add project specific information. @param project The project. @param projectDescriptor The project descriptor.
[ "Add", "project", "specific", "information", "." ]
6c6e2dca56de6d5b8ceeb2f28982fb6d7c98778f
https://github.com/buschmais/jqa-maven3-plugin/blob/6c6e2dca56de6d5b8ceeb2f28982fb6d7c98778f/src/main/java/com/buschmais/jqassistant/plugin/maven3/impl/scanner/MavenProjectScannerPlugin.java#L199-L204
train
buschmais/jqa-maven3-plugin
src/main/java/com/buschmais/jqassistant/plugin/maven3/impl/scanner/MavenProjectScannerPlugin.java
MavenProjectScannerPlugin.addModel
private void addModel(MavenProject project, MavenProjectDirectoryDescriptor projectDescriptor, Scanner scanner) { File pomXmlFile = project.getFile(); FileDescriptor mavenPomXmlDescriptor = scanner.scan(pomXmlFile, pomXmlFile.getAbsolutePath(), MavenScope.PROJECT); projectDescriptor.setModel(mav...
java
private void addModel(MavenProject project, MavenProjectDirectoryDescriptor projectDescriptor, Scanner scanner) { File pomXmlFile = project.getFile(); FileDescriptor mavenPomXmlDescriptor = scanner.scan(pomXmlFile, pomXmlFile.getAbsolutePath(), MavenScope.PROJECT); projectDescriptor.setModel(mav...
[ "private", "void", "addModel", "(", "MavenProject", "project", ",", "MavenProjectDirectoryDescriptor", "projectDescriptor", ",", "Scanner", "scanner", ")", "{", "File", "pomXmlFile", "=", "project", ".", "getFile", "(", ")", ";", "FileDescriptor", "mavenPomXmlDescript...
Scan the pom.xml file and add it as model. @param project The Maven project @param projectDescriptor The project descriptor. @param scanner The scanner.
[ "Scan", "the", "pom", ".", "xml", "file", "and", "add", "it", "as", "model", "." ]
6c6e2dca56de6d5b8ceeb2f28982fb6d7c98778f
https://github.com/buschmais/jqa-maven3-plugin/blob/6c6e2dca56de6d5b8ceeb2f28982fb6d7c98778f/src/main/java/com/buschmais/jqassistant/plugin/maven3/impl/scanner/MavenProjectScannerPlugin.java#L216-L227
train
buschmais/jqa-maven3-plugin
src/main/java/com/buschmais/jqassistant/plugin/maven3/impl/scanner/MavenProjectScannerPlugin.java
MavenProjectScannerPlugin.addParent
private void addParent(MavenProject project, MavenProjectDirectoryDescriptor projectDescriptor, ScannerContext scannerContext) { MavenProject parent = project.getParent(); if (parent != null) { MavenProjectDescriptor parentDescriptor = resolveProject(parent, MavenProjectDescriptor.class, sca...
java
private void addParent(MavenProject project, MavenProjectDirectoryDescriptor projectDescriptor, ScannerContext scannerContext) { MavenProject parent = project.getParent(); if (parent != null) { MavenProjectDescriptor parentDescriptor = resolveProject(parent, MavenProjectDescriptor.class, sca...
[ "private", "void", "addParent", "(", "MavenProject", "project", ",", "MavenProjectDirectoryDescriptor", "projectDescriptor", ",", "ScannerContext", "scannerContext", ")", "{", "MavenProject", "parent", "=", "project", ".", "getParent", "(", ")", ";", "if", "(", "par...
Add the relation to the parent project. @param project The project. @param projectDescriptor The project descriptor.
[ "Add", "the", "relation", "to", "the", "parent", "project", "." ]
6c6e2dca56de6d5b8ceeb2f28982fb6d7c98778f
https://github.com/buschmais/jqa-maven3-plugin/blob/6c6e2dca56de6d5b8ceeb2f28982fb6d7c98778f/src/main/java/com/buschmais/jqassistant/plugin/maven3/impl/scanner/MavenProjectScannerPlugin.java#L237-L243
train
buschmais/jqa-maven3-plugin
src/main/java/com/buschmais/jqassistant/plugin/maven3/impl/scanner/MavenProjectScannerPlugin.java
MavenProjectScannerPlugin.addModules
private void addModules(MavenProject project, MavenProjectDirectoryDescriptor projectDescriptor, ScannerContext scannerContext) { File projectDirectory = project.getBasedir(); Set<File> modules = new HashSet<>(); for (String moduleName : project.getModules()) { File module = new File...
java
private void addModules(MavenProject project, MavenProjectDirectoryDescriptor projectDescriptor, ScannerContext scannerContext) { File projectDirectory = project.getBasedir(); Set<File> modules = new HashSet<>(); for (String moduleName : project.getModules()) { File module = new File...
[ "private", "void", "addModules", "(", "MavenProject", "project", ",", "MavenProjectDirectoryDescriptor", "projectDescriptor", ",", "ScannerContext", "scannerContext", ")", "{", "File", "projectDirectory", "=", "project", ".", "getBasedir", "(", ")", ";", "Set", "<", ...
Add relations to the modules. @param project The project. @param projectDescriptor The project descriptor. @param scannerContext The scanner context.
[ "Add", "relations", "to", "the", "modules", "." ]
6c6e2dca56de6d5b8ceeb2f28982fb6d7c98778f
https://github.com/buschmais/jqa-maven3-plugin/blob/6c6e2dca56de6d5b8ceeb2f28982fb6d7c98778f/src/main/java/com/buschmais/jqassistant/plugin/maven3/impl/scanner/MavenProjectScannerPlugin.java#L255-L268
train
buschmais/jqa-maven3-plugin
src/main/java/com/buschmais/jqassistant/plugin/maven3/impl/scanner/MavenProjectScannerPlugin.java
MavenProjectScannerPlugin.scanClassesDirectory
private void scanClassesDirectory(MavenProjectDirectoryDescriptor projectDescriptor, MavenArtifactDescriptor artifactDescriptor, final String directoryName, Scanner scanner) { File directory = new File(directoryName); if (directory.exists()) { scanArtifact(projectDescriptor, arti...
java
private void scanClassesDirectory(MavenProjectDirectoryDescriptor projectDescriptor, MavenArtifactDescriptor artifactDescriptor, final String directoryName, Scanner scanner) { File directory = new File(directoryName); if (directory.exists()) { scanArtifact(projectDescriptor, arti...
[ "private", "void", "scanClassesDirectory", "(", "MavenProjectDirectoryDescriptor", "projectDescriptor", ",", "MavenArtifactDescriptor", "artifactDescriptor", ",", "final", "String", "directoryName", ",", "Scanner", "scanner", ")", "{", "File", "directory", "=", "new", "Fi...
Scan the given directory for classes and add them to an artifact. @param projectDescriptor The maven project. @param artifactDescriptor The artifact. @param directoryName The name of the directory. @param scanner The scanner.
[ "Scan", "the", "given", "directory", "for", "classes", "and", "add", "them", "to", "an", "artifact", "." ]
6c6e2dca56de6d5b8ceeb2f28982fb6d7c98778f
https://github.com/buschmais/jqa-maven3-plugin/blob/6c6e2dca56de6d5b8ceeb2f28982fb6d7c98778f/src/main/java/com/buschmais/jqassistant/plugin/maven3/impl/scanner/MavenProjectScannerPlugin.java#L282-L288
train
buschmais/jqa-maven3-plugin
src/main/java/com/buschmais/jqassistant/plugin/maven3/impl/scanner/MavenProjectScannerPlugin.java
MavenProjectScannerPlugin.scanFile
private <F extends FileDescriptor> F scanFile(MavenProjectDirectoryDescriptor projectDescriptor, File file, String path, Scope scope, Scanner scanner) { scanner.getContext().push(MavenProjectDirectoryDescriptor.class, projectDescriptor); try { return scanner.scan(file, path, scope); ...
java
private <F extends FileDescriptor> F scanFile(MavenProjectDirectoryDescriptor projectDescriptor, File file, String path, Scope scope, Scanner scanner) { scanner.getContext().push(MavenProjectDirectoryDescriptor.class, projectDescriptor); try { return scanner.scan(file, path, scope); ...
[ "private", "<", "F", "extends", "FileDescriptor", ">", "F", "scanFile", "(", "MavenProjectDirectoryDescriptor", "projectDescriptor", ",", "File", "file", ",", "String", "path", ",", "Scope", "scope", ",", "Scanner", "scanner", ")", "{", "scanner", ".", "getConte...
Scan a given file. <p> The current project is pushed to the context. </p> @param projectDescriptor The maven project descriptor. @param file The file. @param path The path. @param scope The scope. @param scanner The scanner.
[ "Scan", "a", "given", "file", "." ]
6c6e2dca56de6d5b8ceeb2f28982fb6d7c98778f
https://github.com/buschmais/jqa-maven3-plugin/blob/6c6e2dca56de6d5b8ceeb2f28982fb6d7c98778f/src/main/java/com/buschmais/jqassistant/plugin/maven3/impl/scanner/MavenProjectScannerPlugin.java#L360-L367
train
OnyxDevTools/onyx-database-parent
onyx-database-examples/spring-example/src/main/java/com/onyxdevtools/spring/MeetingController.java
MeetingController.findBoringMeetings
@SuppressWarnings({"unchecked", "SpellCheckingInspection"}) List<Meeting> findBoringMeetings() { Query query = new Query(Meeting.class, new QueryCriteria("notes", QueryCriteriaOperator.CONTAINS, "Boring")); List<Meeting> boringMeetings = null; try { boringMeetings = persisten...
java
@SuppressWarnings({"unchecked", "SpellCheckingInspection"}) List<Meeting> findBoringMeetings() { Query query = new Query(Meeting.class, new QueryCriteria("notes", QueryCriteriaOperator.CONTAINS, "Boring")); List<Meeting> boringMeetings = null; try { boringMeetings = persisten...
[ "@", "SuppressWarnings", "(", "{", "\"unchecked\"", ",", "\"SpellCheckingInspection\"", "}", ")", "List", "<", "Meeting", ">", "findBoringMeetings", "(", ")", "{", "Query", "query", "=", "new", "Query", "(", "Meeting", ".", "class", ",", "new", "QueryCriteria"...
Method used to stream all meetings at work that are snoozers and are really hard to stay awake but, you still have to pay attention because someone is going to call on you and ask you a dumb question. @return A list of really boring meetings
[ "Method", "used", "to", "stream", "all", "meetings", "at", "work", "that", "are", "snoozers", "and", "are", "really", "hard", "to", "stay", "awake", "but", "you", "still", "have", "to", "pay", "attention", "because", "someone", "is", "going", "to", "call",...
474dfc273a094dbc2ca08fcc08a2858cd538c920
https://github.com/OnyxDevTools/onyx-database-parent/blob/474dfc273a094dbc2ca08fcc08a2858cd538c920/onyx-database-examples/spring-example/src/main/java/com/onyxdevtools/spring/MeetingController.java#L43-L54
train
OnyxDevTools/onyx-database-parent
onyx-database-examples/spring-example/src/main/java/com/onyxdevtools/spring/MeetingApplicationConfiguration.java
MeetingApplicationConfiguration.persistenceManagerFactory
@Bean protected PersistenceManagerFactory persistenceManagerFactory() throws InitializationException { CacheManagerFactory cacheManagerFactory = new CacheManagerFactory(); cacheManagerFactory.initialize(); return cacheManagerFactory; }
java
@Bean protected PersistenceManagerFactory persistenceManagerFactory() throws InitializationException { CacheManagerFactory cacheManagerFactory = new CacheManagerFactory(); cacheManagerFactory.initialize(); return cacheManagerFactory; }
[ "@", "Bean", "protected", "PersistenceManagerFactory", "persistenceManagerFactory", "(", ")", "throws", "InitializationException", "{", "CacheManagerFactory", "cacheManagerFactory", "=", "new", "CacheManagerFactory", "(", ")", ";", "cacheManagerFactory", ".", "initialize", ...
Persistence Manager factory. This determines your database connection. This would have the same usage if you were connecting to an embedded or remote database. The only difference would be the factory type. @return Initialized Persistence Manager Factory
[ "Persistence", "Manager", "factory", ".", "This", "determines", "your", "database", "connection", ".", "This", "would", "have", "the", "same", "usage", "if", "you", "were", "connecting", "to", "an", "embedded", "or", "remote", "database", ".", "The", "only", ...
474dfc273a094dbc2ca08fcc08a2858cd538c920
https://github.com/OnyxDevTools/onyx-database-parent/blob/474dfc273a094dbc2ca08fcc08a2858cd538c920/onyx-database-examples/spring-example/src/main/java/com/onyxdevtools/spring/MeetingApplicationConfiguration.java#L20-L26
train
OnyxDevTools/onyx-database-parent
onyx-database-examples/remote-persistence-manager/onyx-database-server/src/main/java/com/onyxdevtools/server/Main.java
Main.main
public static void main(String[] args) throws Exception { String pathToOnyxDB = System.getProperty("user.home") + File.separatorChar + ".onyxdb" + File.separatorChar + "sandbox" + File.separatorChar +"remote-db.oxd"; DatabaseServer server1 = new Datab...
java
public static void main(String[] args) throws Exception { String pathToOnyxDB = System.getProperty("user.home") + File.separatorChar + ".onyxdb" + File.separatorChar + "sandbox" + File.separatorChar +"remote-db.oxd"; DatabaseServer server1 = new Datab...
[ "public", "static", "void", "main", "(", "String", "[", "]", "args", ")", "throws", "Exception", "{", "String", "pathToOnyxDB", "=", "System", ".", "getProperty", "(", "\"user.home\"", ")", "+", "File", ".", "separatorChar", "+", "\".onyxdb\"", "+", "File", ...
Run Database Server ex: executable /Database/Location/On/Disk 8080 admin admin @param args Command line arguments @throws Exception General exception
[ "Run", "Database", "Server" ]
474dfc273a094dbc2ca08fcc08a2858cd538c920
https://github.com/OnyxDevTools/onyx-database-parent/blob/474dfc273a094dbc2ca08fcc08a2858cd538c920/onyx-database-examples/remote-persistence-manager/onyx-database-server/src/main/java/com/onyxdevtools/server/Main.java#L19-L34
train
OnyxDevTools/onyx-database-parent
onyx-database-examples/partition/src/main/java/com/onyxdevtools/partition/Main.java
Main.seedData
private static void seedData(PersistenceManager manager) throws OnyxException { // Create a call log for area code (555) CellPhone myPhoneNumber = new CellPhone(); myPhoneNumber.setCellPhoneNumber("(555) 303-2322"); myPhoneNumber.setAreaCode(555); manager.saveEntity(myPhoneNu...
java
private static void seedData(PersistenceManager manager) throws OnyxException { // Create a call log for area code (555) CellPhone myPhoneNumber = new CellPhone(); myPhoneNumber.setCellPhoneNumber("(555) 303-2322"); myPhoneNumber.setAreaCode(555); manager.saveEntity(myPhoneNu...
[ "private", "static", "void", "seedData", "(", "PersistenceManager", "manager", ")", "throws", "OnyxException", "{", "// Create a call log for area code (555)", "CellPhone", "myPhoneNumber", "=", "new", "CellPhone", "(", ")", ";", "myPhoneNumber", ".", "setCellPhoneNumber"...
Seed Cell phone log data @param manager Persistence Manager to use to seed data @throws OnyxException Generic exception from persistence manager
[ "Seed", "Cell", "phone", "log", "data" ]
474dfc273a094dbc2ca08fcc08a2858cd538c920
https://github.com/OnyxDevTools/onyx-database-parent/blob/474dfc273a094dbc2ca08fcc08a2858cd538c920/onyx-database-examples/partition/src/main/java/com/onyxdevtools/partition/Main.java#L76-L121
train
OnyxDevTools/onyx-database-parent
onyx-database-examples/performance-benchmarks/src/main/java/com/onyxdevtools/provider/manager/OnyxPersistenceManager.java
OnyxPersistenceManager.update
public void update(Object object) { try { persistenceManager.saveEntity((IManagedEntity) object); } catch (InitializationException ignore){} catch (Exception e) { e.printStackTrace(); } }
java
public void update(Object object) { try { persistenceManager.saveEntity((IManagedEntity) object); } catch (InitializationException ignore){} catch (Exception e) { e.printStackTrace(); } }
[ "public", "void", "update", "(", "Object", "object", ")", "{", "try", "{", "persistenceManager", ".", "saveEntity", "(", "(", "IManagedEntity", ")", "object", ")", ";", "}", "catch", "(", "InitializationException", "ignore", ")", "{", "}", "catch", "(", "E...
Update an entity that must already exist. Within onyx there is no differentiation between inserting and updating so either way it will call the saveEntity method @param object Object to update
[ "Update", "an", "entity", "that", "must", "already", "exist", ".", "Within", "onyx", "there", "is", "no", "differentiation", "between", "inserting", "and", "updating", "so", "either", "way", "it", "will", "call", "the", "saveEntity", "method" ]
474dfc273a094dbc2ca08fcc08a2858cd538c920
https://github.com/OnyxDevTools/onyx-database-parent/blob/474dfc273a094dbc2ca08fcc08a2858cd538c920/onyx-database-examples/performance-benchmarks/src/main/java/com/onyxdevtools/provider/manager/OnyxPersistenceManager.java#L38-L45
train
OnyxDevTools/onyx-database-parent
onyx-database-examples/performance-benchmarks/src/main/java/com/onyxdevtools/provider/manager/OnyxPersistenceManager.java
OnyxPersistenceManager.list
public List list(Class clazz, String key, Object value) { QueryCriteria criteria = new QueryCriteria(key, QueryCriteriaOperator.EQUAL, value); Query query = new Query(clazz, criteria); try { return persistenceManager.executeLazyQuery(query); } catch (InitializationExcepti...
java
public List list(Class clazz, String key, Object value) { QueryCriteria criteria = new QueryCriteria(key, QueryCriteriaOperator.EQUAL, value); Query query = new Query(clazz, criteria); try { return persistenceManager.executeLazyQuery(query); } catch (InitializationExcepti...
[ "public", "List", "list", "(", "Class", "clazz", ",", "String", "key", ",", "Object", "value", ")", "{", "QueryCriteria", "criteria", "=", "new", "QueryCriteria", "(", "key", ",", "QueryCriteriaOperator", ".", "EQUAL", ",", "value", ")", ";", "Query", "que...
Execute query with criteria of key = key @param clazz Entity to query @param key Attribute to predicate upon @param value Attribute key to predicate upon @return List of entities that match the criteria
[ "Execute", "query", "with", "criteria", "of", "key", "=", "key" ]
474dfc273a094dbc2ca08fcc08a2858cd538c920
https://github.com/OnyxDevTools/onyx-database-parent/blob/474dfc273a094dbc2ca08fcc08a2858cd538c920/onyx-database-examples/performance-benchmarks/src/main/java/com/onyxdevtools/provider/manager/OnyxPersistenceManager.java#L105-L117
train
OnyxDevTools/onyx-database-parent
onyx-database-examples/performance-benchmarks/src/main/java/com/onyxdevtools/provider/manager/JPAPersistenceManager.java
JPAPersistenceManager.insert
public void insert(Object object) { EntityManager entityManager = null; try { entityManager = entityManagers.poll(); entityManager.getTransaction().begin(); try { entityManager.persist(object); entityManager.getTransaction().commit(); ...
java
public void insert(Object object) { EntityManager entityManager = null; try { entityManager = entityManagers.poll(); entityManager.getTransaction().begin(); try { entityManager.persist(object); entityManager.getTransaction().commit(); ...
[ "public", "void", "insert", "(", "Object", "object", ")", "{", "EntityManager", "entityManager", "=", "null", ";", "try", "{", "entityManager", "=", "entityManagers", ".", "poll", "(", ")", ";", "entityManager", ".", "getTransaction", "(", ")", ".", "begin",...
Insert an entity that must not already exist within the database. Within JPA this uses the persist method as opposed to the merge. @param object Object to insert
[ "Insert", "an", "entity", "that", "must", "not", "already", "exist", "within", "the", "database", ".", "Within", "JPA", "this", "uses", "the", "persist", "method", "as", "opposed", "to", "the", "merge", "." ]
474dfc273a094dbc2ca08fcc08a2858cd538c920
https://github.com/OnyxDevTools/onyx-database-parent/blob/474dfc273a094dbc2ca08fcc08a2858cd538c920/onyx-database-examples/performance-benchmarks/src/main/java/com/onyxdevtools/provider/manager/JPAPersistenceManager.java#L73-L90
train
OnyxDevTools/onyx-database-parent
onyx-database-examples/performance-benchmarks/src/main/java/com/onyxdevtools/provider/manager/JPAPersistenceManager.java
JPAPersistenceManager.list
public List list(Class clazz, String key, Object value) { EntityManager entityManager = null; try { entityManager = entityManagers.poll(); Query query = entityManager.createQuery("SELECT c FROM " + clazz.getCanonicalName() + " c where c." + key + " = :param"); qu...
java
public List list(Class clazz, String key, Object value) { EntityManager entityManager = null; try { entityManager = entityManagers.poll(); Query query = entityManager.createQuery("SELECT c FROM " + clazz.getCanonicalName() + " c where c." + key + " = :param"); qu...
[ "public", "List", "list", "(", "Class", "clazz", ",", "String", "key", ",", "Object", "value", ")", "{", "EntityManager", "entityManager", "=", "null", ";", "try", "{", "entityManager", "=", "entityManagers", ".", "poll", "(", ")", ";", "Query", "query", ...
Execute query with criteria of key = key. This will auto generate a sql statement. @param clazz Entity to query @param key Attribute to predicate upon @param value Attribute key to predicate upon @return List of entities that match the criteria
[ "Execute", "query", "with", "criteria", "of", "key", "=", "key", ".", "This", "will", "auto", "generate", "a", "sql", "statement", "." ]
474dfc273a094dbc2ca08fcc08a2858cd538c920
https://github.com/OnyxDevTools/onyx-database-parent/blob/474dfc273a094dbc2ca08fcc08a2858cd538c920/onyx-database-examples/performance-benchmarks/src/main/java/com/onyxdevtools/provider/manager/JPAPersistenceManager.java#L152-L171
train
OnyxDevTools/onyx-database-parent
onyx-database-examples/relationships/src/main/java/com/onyxdevtools/relationship/AbstractDemo.java
AbstractDemo.assertNotNull
static void assertNotNull(String message, Object nonNullObject) { if(nonNullObject == null) { System.err.println(message); } }
java
static void assertNotNull(String message, Object nonNullObject) { if(nonNullObject == null) { System.err.println(message); } }
[ "static", "void", "assertNotNull", "(", "String", "message", ",", "Object", "nonNullObject", ")", "{", "if", "(", "nonNullObject", "==", "null", ")", "{", "System", ".", "err", ".", "println", "(", "message", ")", ";", "}", "}" ]
Helper method to verify an the object is not null. @param message Message displayed if the object is null @param nonNullObject Object to assert
[ "Helper", "method", "to", "verify", "an", "the", "object", "is", "not", "null", "." ]
474dfc273a094dbc2ca08fcc08a2858cd538c920
https://github.com/OnyxDevTools/onyx-database-parent/blob/474dfc273a094dbc2ca08fcc08a2858cd538c920/onyx-database-examples/relationships/src/main/java/com/onyxdevtools/relationship/AbstractDemo.java#L12-L18
train
OnyxDevTools/onyx-database-parent
onyx-database-examples/relationships/src/main/java/com/onyxdevtools/relationship/AbstractDemo.java
AbstractDemo.assertEquals
static void assertEquals(String message, Object comparison1, Object comparison2) { if(comparison1 == comparison2) { return; } if(comparison1.equals(comparison2)) { return; } System.err.println(message); }
java
static void assertEquals(String message, Object comparison1, Object comparison2) { if(comparison1 == comparison2) { return; } if(comparison1.equals(comparison2)) { return; } System.err.println(message); }
[ "static", "void", "assertEquals", "(", "String", "message", ",", "Object", "comparison1", ",", "Object", "comparison2", ")", "{", "if", "(", "comparison1", "==", "comparison2", ")", "{", "return", ";", "}", "if", "(", "comparison1", ".", "equals", "(", "co...
Helper method to verify 2 objects have the same key @param message Message to display if the assert fails @param comparison1 First object to compare @param comparison2 Second object to compare against
[ "Helper", "method", "to", "verify", "2", "objects", "have", "the", "same", "key" ]
474dfc273a094dbc2ca08fcc08a2858cd538c920
https://github.com/OnyxDevTools/onyx-database-parent/blob/474dfc273a094dbc2ca08fcc08a2858cd538c920/onyx-database-examples/relationships/src/main/java/com/onyxdevtools/relationship/AbstractDemo.java#L27-L39
train
OnyxDevTools/onyx-database-parent
onyx-database-examples/performance-benchmarks/src/main/java/BenchmarkRunner.java
BenchmarkRunner.deleteDirectory
@SuppressWarnings("ResultOfMethodCallIgnored") static private void deleteDirectory(File path) { if (path.exists()) { //noinspection ConstantConditions for (File f : path.listFiles()) { if (f.isDirectory()) { deleteDirectory(f); } ...
java
@SuppressWarnings("ResultOfMethodCallIgnored") static private void deleteDirectory(File path) { if (path.exists()) { //noinspection ConstantConditions for (File f : path.listFiles()) { if (f.isDirectory()) { deleteDirectory(f); } ...
[ "@", "SuppressWarnings", "(", "\"ResultOfMethodCallIgnored\"", ")", "static", "private", "void", "deleteDirectory", "(", "File", "path", ")", "{", "if", "(", "path", ".", "exists", "(", ")", ")", "{", "//noinspection ConstantConditions", "for", "(", "File", "f",...
Helper method for deleting the database directory @param path Directory path of database
[ "Helper", "method", "for", "deleting", "the", "database", "directory" ]
474dfc273a094dbc2ca08fcc08a2858cd538c920
https://github.com/OnyxDevTools/onyx-database-parent/blob/474dfc273a094dbc2ca08fcc08a2858cd538c920/onyx-database-examples/performance-benchmarks/src/main/java/BenchmarkRunner.java#L77-L89
train
OnyxDevTools/onyx-database-parent
onyx-database-examples/webservice-client/java-client/src/main/java/io/swagger/client/api/PersistenceApi.java
PersistenceApi.countPost
public Integer countPost(Query query) throws ApiException { ApiResponse<Integer> resp = countPostWithHttpInfo(query); return resp.getData(); }
java
public Integer countPost(Query query) throws ApiException { ApiResponse<Integer> resp = countPostWithHttpInfo(query); return resp.getData(); }
[ "public", "Integer", "countPost", "(", "Query", "query", ")", "throws", "ApiException", "{", "ApiResponse", "<", "Integer", ">", "resp", "=", "countPostWithHttpInfo", "(", "query", ")", ";", "return", "resp", ".", "getData", "(", ")", ";", "}" ]
Get count for query Get the number of items matching query criteria @param query Query defined with criteria (required) @return Integer @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
[ "Get", "count", "for", "query", "Get", "the", "number", "of", "items", "matching", "query", "criteria" ]
474dfc273a094dbc2ca08fcc08a2858cd538c920
https://github.com/OnyxDevTools/onyx-database-parent/blob/474dfc273a094dbc2ca08fcc08a2858cd538c920/onyx-database-examples/webservice-client/java-client/src/main/java/io/swagger/client/api/PersistenceApi.java#L140-L143
train
OnyxDevTools/onyx-database-parent
onyx-database-examples/webservice-client/java-client/src/main/java/io/swagger/client/api/PersistenceApi.java
PersistenceApi.deleteEntitiesPostWithHttpInfo
public ApiResponse<Void> deleteEntitiesPostWithHttpInfo(DeleteEntitiesRequest request) throws ApiException { com.squareup.okhttp.Call call = deleteEntitiesPostValidateBeforeCall(request, null, null); return apiClient.execute(call); }
java
public ApiResponse<Void> deleteEntitiesPostWithHttpInfo(DeleteEntitiesRequest request) throws ApiException { com.squareup.okhttp.Call call = deleteEntitiesPostValidateBeforeCall(request, null, null); return apiClient.execute(call); }
[ "public", "ApiResponse", "<", "Void", ">", "deleteEntitiesPostWithHttpInfo", "(", "DeleteEntitiesRequest", "request", ")", "throws", "ApiException", "{", "com", ".", "squareup", ".", "okhttp", ".", "Call", "call", "=", "deleteEntitiesPostValidateBeforeCall", "(", "req...
Bulk Delete Managed Entities This is used to batch delete entities in order to provide optimized throughput. @param request Save Entities Request (required) @return ApiResponse&lt;Void&gt; @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
[ "Bulk", "Delete", "Managed", "Entities", "This", "is", "used", "to", "batch", "delete", "entities", "in", "order", "to", "provide", "optimized", "throughput", "." ]
474dfc273a094dbc2ca08fcc08a2858cd538c920
https://github.com/OnyxDevTools/onyx-database-parent/blob/474dfc273a094dbc2ca08fcc08a2858cd538c920/onyx-database-examples/webservice-client/java-client/src/main/java/io/swagger/client/api/PersistenceApi.java#L275-L278
train
OnyxDevTools/onyx-database-parent
onyx-database-examples/webservice-client/java-client/src/main/java/io/swagger/client/api/PersistenceApi.java
PersistenceApi.executeUpdatePost
public Integer executeUpdatePost(Query query) throws ApiException { ApiResponse<Integer> resp = executeUpdatePostWithHttpInfo(query); return resp.getData(); }
java
public Integer executeUpdatePost(Query query) throws ApiException { ApiResponse<Integer> resp = executeUpdatePostWithHttpInfo(query); return resp.getData(); }
[ "public", "Integer", "executeUpdatePost", "(", "Query", "query", ")", "throws", "ApiException", "{", "ApiResponse", "<", "Integer", ">", "resp", "=", "executeUpdatePostWithHttpInfo", "(", "query", ")", ";", "return", "resp", ".", "getData", "(", ")", ";", "}" ...
Execute Update Query Execute update query with defined criteria and update instructions @param query Query defined with criteria and update instructions (required) @return Integer @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
[ "Execute", "Update", "Query", "Execute", "update", "query", "with", "defined", "criteria", "and", "update", "instructions" ]
474dfc273a094dbc2ca08fcc08a2858cd538c920
https://github.com/OnyxDevTools/onyx-database-parent/blob/474dfc273a094dbc2ca08fcc08a2858cd538c920/onyx-database-examples/webservice-client/java-client/src/main/java/io/swagger/client/api/PersistenceApi.java#L761-L764
train
OnyxDevTools/onyx-database-parent
onyx-database-examples/webservice-client/java-client/src/main/java/io/swagger/client/api/PersistenceApi.java
PersistenceApi.saveEntitiesPostWithHttpInfo
public ApiResponse<Void> saveEntitiesPostWithHttpInfo(SaveEntitiesRequest request) throws ApiException { com.squareup.okhttp.Call call = saveEntitiesPostValidateBeforeCall(request, null, null); return apiClient.execute(call); }
java
public ApiResponse<Void> saveEntitiesPostWithHttpInfo(SaveEntitiesRequest request) throws ApiException { com.squareup.okhttp.Call call = saveEntitiesPostValidateBeforeCall(request, null, null); return apiClient.execute(call); }
[ "public", "ApiResponse", "<", "Void", ">", "saveEntitiesPostWithHttpInfo", "(", "SaveEntitiesRequest", "request", ")", "throws", "ApiException", "{", "com", ".", "squareup", ".", "okhttp", ".", "Call", "call", "=", "saveEntitiesPostValidateBeforeCall", "(", "request",...
Bulk Save Managed Entities This is used to batch save entities in order to provide optimized throughput. @param request Save Entities Request (required) @return ApiResponse&lt;Void&gt; @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
[ "Bulk", "Save", "Managed", "Entities", "This", "is", "used", "to", "batch", "save", "entities", "in", "order", "to", "provide", "optimized", "throughput", "." ]
474dfc273a094dbc2ca08fcc08a2858cd538c920
https://github.com/OnyxDevTools/onyx-database-parent/blob/474dfc273a094dbc2ca08fcc08a2858cd538c920/onyx-database-examples/webservice-client/java-client/src/main/java/io/swagger/client/api/PersistenceApi.java#L1271-L1274
train
OnyxDevTools/onyx-database-parent
onyx-database-examples/model-updates/model-before-update/src/main/java/com/onyxdevtools/modelUpdate/before/Main.java
Main.seedData
private static void seedData(PersistenceManager manager) throws OnyxException { Account account = new Account(); //noinspection SpellCheckingInspection account.setAccountName("Timbob's Lawn Care"); account.setBalanceDue(55.43f); Invoice marchLawnInvoice = new Invoice(); ...
java
private static void seedData(PersistenceManager manager) throws OnyxException { Account account = new Account(); //noinspection SpellCheckingInspection account.setAccountName("Timbob's Lawn Care"); account.setBalanceDue(55.43f); Invoice marchLawnInvoice = new Invoice(); ...
[ "private", "static", "void", "seedData", "(", "PersistenceManager", "manager", ")", "throws", "OnyxException", "{", "Account", "account", "=", "new", "Account", "(", ")", ";", "//noinspection SpellCheckingInspection", "account", ".", "setAccountName", "(", "\"Timbob's...
Fill the database with some test data, so that we can show how the data model updates impact the changes to the values. @param manager Persistence Manager used to save the entities @throws OnyxException Failure to persist entities
[ "Fill", "the", "database", "with", "some", "test", "data", "so", "that", "we", "can", "show", "how", "the", "data", "model", "updates", "impact", "the", "changes", "to", "the", "values", "." ]
474dfc273a094dbc2ca08fcc08a2858cd538c920
https://github.com/OnyxDevTools/onyx-database-parent/blob/474dfc273a094dbc2ca08fcc08a2858cd538c920/onyx-database-examples/model-updates/model-before-update/src/main/java/com/onyxdevtools/modelUpdate/before/Main.java#L69-L106
train
OnyxDevTools/onyx-database-parent
onyx-database-examples/model-updates/model-before-update/src/main/java/com/onyxdevtools/modelUpdate/before/Main.java
Main.deleteDatabase
private static void deleteDatabase(String pathToDb) { File database = new File(pathToDb); if (database.exists()) { delete(database); } database.delete(); }
java
private static void deleteDatabase(String pathToDb) { File database = new File(pathToDb); if (database.exists()) { delete(database); } database.delete(); }
[ "private", "static", "void", "deleteDatabase", "(", "String", "pathToDb", ")", "{", "File", "database", "=", "new", "File", "(", "pathToDb", ")", ";", "if", "(", "database", ".", "exists", "(", ")", ")", "{", "delete", "(", "database", ")", ";", "}", ...
Delete a database so you have a clean slate prior to testing @param pathToDb Path to onyx database
[ "Delete", "a", "database", "so", "you", "have", "a", "clean", "slate", "prior", "to", "testing" ]
474dfc273a094dbc2ca08fcc08a2858cd538c920
https://github.com/OnyxDevTools/onyx-database-parent/blob/474dfc273a094dbc2ca08fcc08a2858cd538c920/onyx-database-examples/model-updates/model-before-update/src/main/java/com/onyxdevtools/modelUpdate/before/Main.java#L129-L136
train
buschmais/jqa-maven3-plugin
src/main/java/com/buschmais/jqassistant/plugin/maven3/api/artifact/MavenArtifactHelper.java
MavenArtifactHelper.setCoordinates
public static void setCoordinates(MavenArtifactDescriptor artifactDescriptor, Coordinates coordinates) { artifactDescriptor.setGroup(coordinates.getGroup()); artifactDescriptor.setName(coordinates.getName()); artifactDescriptor.setVersion(coordinates.getVersion()); artifactDescriptor.set...
java
public static void setCoordinates(MavenArtifactDescriptor artifactDescriptor, Coordinates coordinates) { artifactDescriptor.setGroup(coordinates.getGroup()); artifactDescriptor.setName(coordinates.getName()); artifactDescriptor.setVersion(coordinates.getVersion()); artifactDescriptor.set...
[ "public", "static", "void", "setCoordinates", "(", "MavenArtifactDescriptor", "artifactDescriptor", ",", "Coordinates", "coordinates", ")", "{", "artifactDescriptor", ".", "setGroup", "(", "coordinates", ".", "getGroup", "(", ")", ")", ";", "artifactDescriptor", ".", ...
Apply the given coordinates to an artifact descriptor. @param artifactDescriptor The artifact descriptor. @param coordinates The coordinates.
[ "Apply", "the", "given", "coordinates", "to", "an", "artifact", "descriptor", "." ]
6c6e2dca56de6d5b8ceeb2f28982fb6d7c98778f
https://github.com/buschmais/jqa-maven3-plugin/blob/6c6e2dca56de6d5b8ceeb2f28982fb6d7c98778f/src/main/java/com/buschmais/jqassistant/plugin/maven3/api/artifact/MavenArtifactHelper.java#L29-L35
train
buschmais/jqa-maven3-plugin
src/main/java/com/buschmais/jqassistant/plugin/maven3/api/artifact/MavenArtifactHelper.java
MavenArtifactHelper.setId
public static void setId(MavenArtifactDescriptor artifactDescriptor, Coordinates coordinates) { artifactDescriptor.setFullQualifiedName(MavenArtifactHelper.getId(coordinates)); }
java
public static void setId(MavenArtifactDescriptor artifactDescriptor, Coordinates coordinates) { artifactDescriptor.setFullQualifiedName(MavenArtifactHelper.getId(coordinates)); }
[ "public", "static", "void", "setId", "(", "MavenArtifactDescriptor", "artifactDescriptor", ",", "Coordinates", "coordinates", ")", "{", "artifactDescriptor", ".", "setFullQualifiedName", "(", "MavenArtifactHelper", ".", "getId", "(", "coordinates", ")", ")", ";", "}" ...
Set the fully qualified name of an artifact descriptor. @param artifactDescriptor The artifact descriptor. @param coordinates The coordinates.
[ "Set", "the", "fully", "qualified", "name", "of", "an", "artifact", "descriptor", "." ]
6c6e2dca56de6d5b8ceeb2f28982fb6d7c98778f
https://github.com/buschmais/jqa-maven3-plugin/blob/6c6e2dca56de6d5b8ceeb2f28982fb6d7c98778f/src/main/java/com/buschmais/jqassistant/plugin/maven3/api/artifact/MavenArtifactHelper.java#L45-L47
train
buschmais/jqa-maven3-plugin
src/main/java/com/buschmais/jqassistant/plugin/maven3/api/artifact/MavenArtifactHelper.java
MavenArtifactHelper.getId
public static String getId(Coordinates coordinates) { StringBuilder id = new StringBuilder(); if (StringUtils.isNotEmpty(coordinates.getGroup())) { id.append(coordinates.getGroup()); } id.append(':'); id.append(coordinates.getName()); id.append(':'); i...
java
public static String getId(Coordinates coordinates) { StringBuilder id = new StringBuilder(); if (StringUtils.isNotEmpty(coordinates.getGroup())) { id.append(coordinates.getGroup()); } id.append(':'); id.append(coordinates.getName()); id.append(':'); i...
[ "public", "static", "String", "getId", "(", "Coordinates", "coordinates", ")", "{", "StringBuilder", "id", "=", "new", "StringBuilder", "(", ")", ";", "if", "(", "StringUtils", ".", "isNotEmpty", "(", "coordinates", ".", "getGroup", "(", ")", ")", ")", "{"...
Creates the id of an coordinates descriptor by the given items. @param coordinates The maven coordinates. @return The id.
[ "Creates", "the", "id", "of", "an", "coordinates", "descriptor", "by", "the", "given", "items", "." ]
6c6e2dca56de6d5b8ceeb2f28982fb6d7c98778f
https://github.com/buschmais/jqa-maven3-plugin/blob/6c6e2dca56de6d5b8ceeb2f28982fb6d7c98778f/src/main/java/com/buschmais/jqassistant/plugin/maven3/api/artifact/MavenArtifactHelper.java#L56-L76
train
Metatavu/edelphi
edelphi/src/main/java/fi/metatavu/edelphi/utils/AuthUtils.java
AuthUtils.purgeOAuthAccessTokens
public static void purgeOAuthAccessTokens(RequestContext requestContext, String provider) { String key = String.format(PROVIDER_ACCESS_TOKENS, provider); HttpSession session = requestContext.getRequest().getSession(); OAuthAccessToken[] accessTokens = (OAuthAccessToken[]) session.getAttribute(key); if (...
java
public static void purgeOAuthAccessTokens(RequestContext requestContext, String provider) { String key = String.format(PROVIDER_ACCESS_TOKENS, provider); HttpSession session = requestContext.getRequest().getSession(); OAuthAccessToken[] accessTokens = (OAuthAccessToken[]) session.getAttribute(key); if (...
[ "public", "static", "void", "purgeOAuthAccessTokens", "(", "RequestContext", "requestContext", ",", "String", "provider", ")", "{", "String", "key", "=", "String", ".", "format", "(", "PROVIDER_ACCESS_TOKENS", ",", "provider", ")", ";", "HttpSession", "session", "...
Purges all OAuth tokens from given provider @param requestContext request context @param provider provider
[ "Purges", "all", "OAuth", "tokens", "from", "given", "provider" ]
d91a0b54f954b33b4ee674a1bdf03612d76c3305
https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/edelphi/src/main/java/fi/metatavu/edelphi/utils/AuthUtils.java#L138-L145
train
Metatavu/edelphi
edelphi/src/main/java/fi/metatavu/edelphi/utils/AuthUtils.java
AuthUtils.getOAuthAccessToken
public static OAuthAccessToken getOAuthAccessToken(RequestContext requestContext, String provider, String... scopes) { HttpSession session = requestContext.getRequest().getSession(); OAuthAccessToken[] accessTokens = (OAuthAccessToken[]) session.getAttribute(String.format(PROVIDER_ACCESS_TOKENS, provider))...
java
public static OAuthAccessToken getOAuthAccessToken(RequestContext requestContext, String provider, String... scopes) { HttpSession session = requestContext.getRequest().getSession(); OAuthAccessToken[] accessTokens = (OAuthAccessToken[]) session.getAttribute(String.format(PROVIDER_ACCESS_TOKENS, provider))...
[ "public", "static", "OAuthAccessToken", "getOAuthAccessToken", "(", "RequestContext", "requestContext", ",", "String", "provider", ",", "String", "...", "scopes", ")", "{", "HttpSession", "session", "=", "requestContext", ".", "getRequest", "(", ")", ".", "getSessio...
Returns OAuth previously stored access token from HTTP session Null is returned if token is present but does not have requested scopes or the token has been expired @param requestContext request context @param provider token provider @param scopes required scopes @return OAuth previously stored access token from HTTP...
[ "Returns", "OAuth", "previously", "stored", "access", "token", "from", "HTTP", "session" ]
d91a0b54f954b33b4ee674a1bdf03612d76c3305
https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/edelphi/src/main/java/fi/metatavu/edelphi/utils/AuthUtils.java#L173-L193
train
Metatavu/edelphi
edelphi/src/main/java/fi/metatavu/edelphi/auth/KeycloakAuthenticationStrategy.java
KeycloakAuthenticationStrategy.getRefreshToken
private String getRefreshToken(Token accessToken) { JSONObject rawJson = JSONObject.fromObject(accessToken.getRawResponse()); return rawJson.getString("refresh_token"); }
java
private String getRefreshToken(Token accessToken) { JSONObject rawJson = JSONObject.fromObject(accessToken.getRawResponse()); return rawJson.getString("refresh_token"); }
[ "private", "String", "getRefreshToken", "(", "Token", "accessToken", ")", "{", "JSONObject", "rawJson", "=", "JSONObject", ".", "fromObject", "(", "accessToken", ".", "getRawResponse", "(", ")", ")", ";", "return", "rawJson", ".", "getString", "(", "\"refresh_to...
Parses refresh token from the access token @param accessToken access token @return refresh token
[ "Parses", "refresh", "token", "from", "the", "access", "token" ]
d91a0b54f954b33b4ee674a1bdf03612d76c3305
https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/edelphi/src/main/java/fi/metatavu/edelphi/auth/KeycloakAuthenticationStrategy.java#L310-L313
train
Metatavu/edelphi
edelphi/src/main/java/fi/metatavu/edelphi/auth/OAuthAuthenticationStrategy.java
OAuthAuthenticationStrategy.extractLastName
protected String extractLastName(String name) { if (StringUtils.isBlank(name)) { return null; } int lastIndexOf = name.lastIndexOf(' '); if (lastIndexOf == -1) return null; else return name.substring(lastIndexOf + 1); }
java
protected String extractLastName(String name) { if (StringUtils.isBlank(name)) { return null; } int lastIndexOf = name.lastIndexOf(' '); if (lastIndexOf == -1) return null; else return name.substring(lastIndexOf + 1); }
[ "protected", "String", "extractLastName", "(", "String", "name", ")", "{", "if", "(", "StringUtils", ".", "isBlank", "(", "name", ")", ")", "{", "return", "null", ";", "}", "int", "lastIndexOf", "=", "name", ".", "lastIndexOf", "(", "'", "'", ")", ";",...
Extracts a last name of full name string @param name full name @return last name if it could be extracted
[ "Extracts", "a", "last", "name", "of", "full", "name", "string" ]
d91a0b54f954b33b4ee674a1bdf03612d76c3305
https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/edelphi/src/main/java/fi/metatavu/edelphi/auth/OAuthAuthenticationStrategy.java#L124-L135
train
Metatavu/edelphi
edelphi/src/main/java/fi/metatavu/edelphi/auth/OAuthAuthenticationStrategy.java
OAuthAuthenticationStrategy.extractFirstName
protected String extractFirstName(String name) { if (StringUtils.isBlank(name)) { return null; } int lastIndexOf = name.lastIndexOf(' '); if (lastIndexOf == -1) return null; else return name.substring(0, lastIndexOf); }
java
protected String extractFirstName(String name) { if (StringUtils.isBlank(name)) { return null; } int lastIndexOf = name.lastIndexOf(' '); if (lastIndexOf == -1) return null; else return name.substring(0, lastIndexOf); }
[ "protected", "String", "extractFirstName", "(", "String", "name", ")", "{", "if", "(", "StringUtils", ".", "isBlank", "(", "name", ")", ")", "{", "return", "null", ";", "}", "int", "lastIndexOf", "=", "name", ".", "lastIndexOf", "(", "'", "'", ")", ";"...
Extracts a first name of full name string @param name full name @return first name if it could be extracted
[ "Extracts", "a", "first", "name", "of", "full", "name", "string" ]
d91a0b54f954b33b4ee674a1bdf03612d76c3305
https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/edelphi/src/main/java/fi/metatavu/edelphi/auth/OAuthAuthenticationStrategy.java#L143-L154
train
Metatavu/edelphi
rest/src/main/java/fi/metatavu/edelphi/rest/AbstractApi.java
AbstractApi.createNotFound
protected Response createNotFound(String message) { ErrorResponse entity = new ErrorResponse(); entity.setMessage(message); return Response .status(Response.Status.NOT_FOUND) .entity(entity) .build(); }
java
protected Response createNotFound(String message) { ErrorResponse entity = new ErrorResponse(); entity.setMessage(message); return Response .status(Response.Status.NOT_FOUND) .entity(entity) .build(); }
[ "protected", "Response", "createNotFound", "(", "String", "message", ")", "{", "ErrorResponse", "entity", "=", "new", "ErrorResponse", "(", ")", ";", "entity", ".", "setMessage", "(", "message", ")", ";", "return", "Response", ".", "status", "(", "Response", ...
Constructs not found response @param message message @return response
[ "Constructs", "not", "found", "response" ]
d91a0b54f954b33b4ee674a1bdf03612d76c3305
https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/rest/src/main/java/fi/metatavu/edelphi/rest/AbstractApi.java#L72-L79
train
Metatavu/edelphi
rest/src/main/java/fi/metatavu/edelphi/rest/AbstractApi.java
AbstractApi.createForbidden
protected Response createForbidden(String message) { ErrorResponse entity = new ErrorResponse(); entity.setMessage(message); return Response .status(Response.Status.FORBIDDEN) .entity(entity) .build(); }
java
protected Response createForbidden(String message) { ErrorResponse entity = new ErrorResponse(); entity.setMessage(message); return Response .status(Response.Status.FORBIDDEN) .entity(entity) .build(); }
[ "protected", "Response", "createForbidden", "(", "String", "message", ")", "{", "ErrorResponse", "entity", "=", "new", "ErrorResponse", "(", ")", ";", "entity", ".", "setMessage", "(", "message", ")", ";", "return", "Response", ".", "status", "(", "Response", ...
Constructs forbidden response @param message message @return response
[ "Constructs", "forbidden", "response" ]
d91a0b54f954b33b4ee674a1bdf03612d76c3305
https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/rest/src/main/java/fi/metatavu/edelphi/rest/AbstractApi.java#L87-L94
train
Metatavu/edelphi
rest/src/main/java/fi/metatavu/edelphi/rest/AbstractApi.java
AbstractApi.createBadRequest
protected Response createBadRequest(String message) { ErrorResponse entity = new ErrorResponse(); entity.setMessage(message); return Response .status(Response.Status.BAD_REQUEST) .entity(entity) .build(); }
java
protected Response createBadRequest(String message) { ErrorResponse entity = new ErrorResponse(); entity.setMessage(message); return Response .status(Response.Status.BAD_REQUEST) .entity(entity) .build(); }
[ "protected", "Response", "createBadRequest", "(", "String", "message", ")", "{", "ErrorResponse", "entity", "=", "new", "ErrorResponse", "(", ")", ";", "entity", ".", "setMessage", "(", "message", ")", ";", "return", "Response", ".", "status", "(", "Response",...
Constructs bad request response @param message message @return response
[ "Constructs", "bad", "request", "response" ]
d91a0b54f954b33b4ee674a1bdf03612d76c3305
https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/rest/src/main/java/fi/metatavu/edelphi/rest/AbstractApi.java#L102-L109
train
Metatavu/edelphi
rest/src/main/java/fi/metatavu/edelphi/rest/AbstractApi.java
AbstractApi.createInternalServerError
protected Response createInternalServerError(String message) { ErrorResponse entity = new ErrorResponse(); entity.setMessage(message); return Response .status(Response.Status.INTERNAL_SERVER_ERROR) .entity(entity) .build(); }
java
protected Response createInternalServerError(String message) { ErrorResponse entity = new ErrorResponse(); entity.setMessage(message); return Response .status(Response.Status.INTERNAL_SERVER_ERROR) .entity(entity) .build(); }
[ "protected", "Response", "createInternalServerError", "(", "String", "message", ")", "{", "ErrorResponse", "entity", "=", "new", "ErrorResponse", "(", ")", ";", "entity", ".", "setMessage", "(", "message", ")", ";", "return", "Response", ".", "status", "(", "R...
Constructs internal server error response @param message message @return response
[ "Constructs", "internal", "server", "error", "response" ]
d91a0b54f954b33b4ee674a1bdf03612d76c3305
https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/rest/src/main/java/fi/metatavu/edelphi/rest/AbstractApi.java#L117-L124
train
Metatavu/edelphi
rest/src/main/java/fi/metatavu/edelphi/rest/AbstractApi.java
AbstractApi.streamResponse
protected Response streamResponse(byte[] data, String type) { try (InputStream byteStream = new ByteArrayInputStream(data)) { return streamResponse(type, byteStream, data.length); } catch (IOException e) { logger.error("Failed to stream data to client", e); return createInternalServerError("Fa...
java
protected Response streamResponse(byte[] data, String type) { try (InputStream byteStream = new ByteArrayInputStream(data)) { return streamResponse(type, byteStream, data.length); } catch (IOException e) { logger.error("Failed to stream data to client", e); return createInternalServerError("Fa...
[ "protected", "Response", "streamResponse", "(", "byte", "[", "]", "data", ",", "String", "type", ")", "{", "try", "(", "InputStream", "byteStream", "=", "new", "ByteArrayInputStream", "(", "data", ")", ")", "{", "return", "streamResponse", "(", "type", ",", ...
Creates streamed response from byte array @param data data @param type content type @return Response
[ "Creates", "streamed", "response", "from", "byte", "array" ]
d91a0b54f954b33b4ee674a1bdf03612d76c3305
https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/rest/src/main/java/fi/metatavu/edelphi/rest/AbstractApi.java#L160-L167
train
Metatavu/edelphi
rest/src/main/java/fi/metatavu/edelphi/rest/AbstractApi.java
AbstractApi.streamResponse
protected Response streamResponse(String type, InputStream inputStream, int contentLength) { return Response.ok(new StreamingOutputImpl(inputStream), type) .header("Content-Length", contentLength) .build(); }
java
protected Response streamResponse(String type, InputStream inputStream, int contentLength) { return Response.ok(new StreamingOutputImpl(inputStream), type) .header("Content-Length", contentLength) .build(); }
[ "protected", "Response", "streamResponse", "(", "String", "type", ",", "InputStream", "inputStream", ",", "int", "contentLength", ")", "{", "return", "Response", ".", "ok", "(", "new", "StreamingOutputImpl", "(", "inputStream", ")", ",", "type", ")", ".", "hea...
Creates streamed response from input stream @param inputStream data @param type content type @param contentLength content length @return Response
[ "Creates", "streamed", "response", "from", "input", "stream" ]
d91a0b54f954b33b4ee674a1bdf03612d76c3305
https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/rest/src/main/java/fi/metatavu/edelphi/rest/AbstractApi.java#L177-L181
train
Metatavu/edelphi
rest/src/main/java/fi/metatavu/edelphi/rest/AbstractApi.java
AbstractApi.getLoggedUserId
protected UUID getLoggedUserId() { HttpServletRequest httpServletRequest = getHttpServletRequest(); String remoteUser = httpServletRequest.getRemoteUser(); if (remoteUser == null) { return null; } return UUID.fromString(remoteUser); }
java
protected UUID getLoggedUserId() { HttpServletRequest httpServletRequest = getHttpServletRequest(); String remoteUser = httpServletRequest.getRemoteUser(); if (remoteUser == null) { return null; } return UUID.fromString(remoteUser); }
[ "protected", "UUID", "getLoggedUserId", "(", ")", "{", "HttpServletRequest", "httpServletRequest", "=", "getHttpServletRequest", "(", ")", ";", "String", "remoteUser", "=", "httpServletRequest", ".", "getRemoteUser", "(", ")", ";", "if", "(", "remoteUser", "==", "...
Returns logged user id @return logged user id
[ "Returns", "logged", "user", "id" ]
d91a0b54f954b33b4ee674a1bdf03612d76c3305
https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/rest/src/main/java/fi/metatavu/edelphi/rest/AbstractApi.java#L188-L196
train
Metatavu/edelphi
rest/src/main/java/fi/metatavu/edelphi/rest/AbstractApi.java
AbstractApi.getLoggedUser
protected User getLoggedUser() { UUID userId = getLoggedUserId(); if (userId == null) { return null; } return userController.findUserByKeycloakId(userId); }
java
protected User getLoggedUser() { UUID userId = getLoggedUserId(); if (userId == null) { return null; } return userController.findUserByKeycloakId(userId); }
[ "protected", "User", "getLoggedUser", "(", ")", "{", "UUID", "userId", "=", "getLoggedUserId", "(", ")", ";", "if", "(", "userId", "==", "null", ")", "{", "return", "null", ";", "}", "return", "userController", ".", "findUserByKeycloakId", "(", "userId", "...
Returns logged user @return logged user or null if user is not logged in
[ "Returns", "logged", "user" ]
d91a0b54f954b33b4ee674a1bdf03612d76c3305
https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/rest/src/main/java/fi/metatavu/edelphi/rest/AbstractApi.java#L203-L210
train
Metatavu/edelphi
edelphi/src/main/java/fi/metatavu/edelphi/utils/comments/TimelineReportPageCommentProcessor.java
TimelineReportPageCommentProcessor.getAnswerValue
private String getAnswerValue(QueryQuestionNumericAnswer answer) { return answer != null && answer.getData() != null ? String.valueOf(Math.round(answer.getData())) : null; }
java
private String getAnswerValue(QueryQuestionNumericAnswer answer) { return answer != null && answer.getData() != null ? String.valueOf(Math.round(answer.getData())) : null; }
[ "private", "String", "getAnswerValue", "(", "QueryQuestionNumericAnswer", "answer", ")", "{", "return", "answer", "!=", "null", "&&", "answer", ".", "getData", "(", ")", "!=", "null", "?", "String", ".", "valueOf", "(", "Math", ".", "round", "(", "answer", ...
Returns answer value @param answer answer @return answer value
[ "Returns", "answer", "value" ]
d91a0b54f954b33b4ee674a1bdf03612d76c3305
https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/edelphi/src/main/java/fi/metatavu/edelphi/utils/comments/TimelineReportPageCommentProcessor.java#L79-L81
train
Metatavu/edelphi
edelphi/src/main/java/fi/metatavu/edelphi/paytrail/PaytrailServiceFactory.java
PaytrailServiceFactory.createPaytrailService
public static PaytrailService createPaytrailService() { IOHandler ioHandler = new HttpClientIOHandler(); Marshaller marshaller = new JacksonMarshaller(); String merchantId = SystemUtils.getSettingValue("paytrail.merchantId"); String merchantSecret = SystemUtils.getSettingValue("paytrail.merchantSecret"); ...
java
public static PaytrailService createPaytrailService() { IOHandler ioHandler = new HttpClientIOHandler(); Marshaller marshaller = new JacksonMarshaller(); String merchantId = SystemUtils.getSettingValue("paytrail.merchantId"); String merchantSecret = SystemUtils.getSettingValue("paytrail.merchantSecret"); ...
[ "public", "static", "PaytrailService", "createPaytrailService", "(", ")", "{", "IOHandler", "ioHandler", "=", "new", "HttpClientIOHandler", "(", ")", ";", "Marshaller", "marshaller", "=", "new", "JacksonMarshaller", "(", ")", ";", "String", "merchantId", "=", "Sys...
Creates a paytrail service instance @return created paytrail service instance
[ "Creates", "a", "paytrail", "service", "instance" ]
d91a0b54f954b33b4ee674a1bdf03612d76c3305
https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/edelphi/src/main/java/fi/metatavu/edelphi/paytrail/PaytrailServiceFactory.java#L18-L24
train
Metatavu/edelphi
edelphi/src/main/java/fi/metatavu/edelphi/pages/panel/admin/report/util/ChartModelProvider.java
ChartModelProvider.createBubbleChart
@SuppressWarnings ("squid:S00107") public static Chart createBubbleChart(String chartCaption, String xLabel, List<String> xTickLabels, String yLabel, List<String> yTickLabels, int xAxisLabelRotation, int yAxisLabelRotation, Double[][] values) { return createBubbleChart(chartCaption, xLabel, xTickLabels, yLabel, y...
java
@SuppressWarnings ("squid:S00107") public static Chart createBubbleChart(String chartCaption, String xLabel, List<String> xTickLabels, String yLabel, List<String> yTickLabels, int xAxisLabelRotation, int yAxisLabelRotation, Double[][] values) { return createBubbleChart(chartCaption, xLabel, xTickLabels, yLabel, y...
[ "@", "SuppressWarnings", "(", "\"squid:S00107\"", ")", "public", "static", "Chart", "createBubbleChart", "(", "String", "chartCaption", ",", "String", "xLabel", ",", "List", "<", "String", ">", "xTickLabels", ",", "String", "yLabel", ",", "List", "<", "String", ...
Creates a bubble chart without averages and quartiles @param chartCaption chart caption @param xLabel x axis label @param xTickLabels x axis tick labels @param yLabel y axis label @param yTickLabels y axis tick labels @param xAxisLabelRotation x axis label rotation @param yAxisLabelRotation y axis label rotation @para...
[ "Creates", "a", "bubble", "chart", "without", "averages", "and", "quartiles" ]
d91a0b54f954b33b4ee674a1bdf03612d76c3305
https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/edelphi/src/main/java/fi/metatavu/edelphi/pages/panel/admin/report/util/ChartModelProvider.java#L598-L601
train
Metatavu/edelphi
edelphi/src/main/java/fi/metatavu/edelphi/pages/panel/admin/report/util/ChartModelProvider.java
ChartModelProvider.addMarkerLine
private static void addMarkerLine(String label, Double value, Double offset, Axis axis) { if (value != null) { MarkerLine markerLine = MarkerLineImpl.create(axis, NumberDataElementImpl.create(value + (offset != null ? offset : 0d))); markerLine.getLineAttributes().setStyle(LineStyle.DASHED_LITERAL); ...
java
private static void addMarkerLine(String label, Double value, Double offset, Axis axis) { if (value != null) { MarkerLine markerLine = MarkerLineImpl.create(axis, NumberDataElementImpl.create(value + (offset != null ? offset : 0d))); markerLine.getLineAttributes().setStyle(LineStyle.DASHED_LITERAL); ...
[ "private", "static", "void", "addMarkerLine", "(", "String", "label", ",", "Double", "value", ",", "Double", "offset", ",", "Axis", "axis", ")", "{", "if", "(", "value", "!=", "null", ")", "{", "MarkerLine", "markerLine", "=", "MarkerLineImpl", ".", "creat...
Creates a marker line into specified axis if value is not null. @param label line label @param value value @param offset value offset @param axis axis
[ "Creates", "a", "marker", "line", "into", "specified", "axis", "if", "value", "is", "not", "null", "." ]
d91a0b54f954b33b4ee674a1bdf03612d76c3305
https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/edelphi/src/main/java/fi/metatavu/edelphi/pages/panel/admin/report/util/ChartModelProvider.java#L763-L770
train
Metatavu/edelphi
edelphi/src/main/java/fi/metatavu/edelphi/pages/panel/admin/report/util/ChartModelProvider.java
ChartModelProvider.translateMarkerToRange
private static Double translateMarkerToRange(double size, Double min, Double max, Double value) { if (value != null && min != null && max != null) { return (size / (max - min)) * (value - min); } return value; }
java
private static Double translateMarkerToRange(double size, Double min, Double max, Double value) { if (value != null && min != null && max != null) { return (size / (max - min)) * (value - min); } return value; }
[ "private", "static", "Double", "translateMarkerToRange", "(", "double", "size", ",", "Double", "min", ",", "Double", "max", ",", "Double", "value", ")", "{", "if", "(", "value", "!=", "null", "&&", "min", "!=", "null", "&&", "max", "!=", "null", ")", "...
Translates marker value to be correct in given range @param size size of the range @param min min value @param max max value @param value original value @return translated value
[ "Translates", "marker", "value", "to", "be", "correct", "in", "given", "range" ]
d91a0b54f954b33b4ee674a1bdf03612d76c3305
https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/edelphi/src/main/java/fi/metatavu/edelphi/pages/panel/admin/report/util/ChartModelProvider.java#L781-L787
train
Metatavu/edelphi
edelphi-persistence/src/main/java/fi/metatavu/edelphi/dao/querydata/QueryQuestionOptionAnswerDAO.java
QueryQuestionOptionAnswerDAO.findTextByQueryReplyAndQueryField
public String findTextByQueryReplyAndQueryField(QueryReply queryReply, QueryField queryField) { EntityManager entityManager = getEntityManager(); CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder(); CriteriaQuery<String> criteria = criteriaBuilder.createQuery(String.class); Root<QueryQ...
java
public String findTextByQueryReplyAndQueryField(QueryReply queryReply, QueryField queryField) { EntityManager entityManager = getEntityManager(); CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder(); CriteriaQuery<String> criteria = criteriaBuilder.createQuery(String.class); Root<QueryQ...
[ "public", "String", "findTextByQueryReplyAndQueryField", "(", "QueryReply", "queryReply", ",", "QueryField", "queryField", ")", "{", "EntityManager", "entityManager", "=", "getEntityManager", "(", ")", ";", "CriteriaBuilder", "criteriaBuilder", "=", "entityManager", ".", ...
Finds answer text by query reply and query field @param queryReply reply @param queryField field @return answer text
[ "Finds", "answer", "text", "by", "query", "reply", "and", "query", "field" ]
d91a0b54f954b33b4ee674a1bdf03612d76c3305
https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/edelphi-persistence/src/main/java/fi/metatavu/edelphi/dao/querydata/QueryQuestionOptionAnswerDAO.java#L45-L63
train
Metatavu/edelphi
edelphi-persistence/src/main/java/fi/metatavu/edelphi/dao/querydata/QueryQuestionNumericAnswerDAO.java
QueryQuestionNumericAnswerDAO.countByQueryFieldQueryRepliesInAndData
public Long countByQueryFieldQueryRepliesInAndData(QueryField queryField, Collection<QueryReply> queryReplies, Double data) { if (queryReplies == null || queryReplies.isEmpty()) { return 0l; } EntityManager entityManager = getEntityManager(); CriteriaBuilder criteriaBuilder = entityManager.g...
java
public Long countByQueryFieldQueryRepliesInAndData(QueryField queryField, Collection<QueryReply> queryReplies, Double data) { if (queryReplies == null || queryReplies.isEmpty()) { return 0l; } EntityManager entityManager = getEntityManager(); CriteriaBuilder criteriaBuilder = entityManager.g...
[ "public", "Long", "countByQueryFieldQueryRepliesInAndData", "(", "QueryField", "queryField", ",", "Collection", "<", "QueryReply", ">", "queryReplies", ",", "Double", "data", ")", "{", "if", "(", "queryReplies", "==", "null", "||", "queryReplies", ".", "isEmpty", ...
Counts query question numeric answers @param queryField query field @param queryReplies query reply set must be in this set @param data data must equal this value @return count of query question numeric answers
[ "Counts", "query", "question", "numeric", "answers" ]
d91a0b54f954b33b4ee674a1bdf03612d76c3305
https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/edelphi-persistence/src/main/java/fi/metatavu/edelphi/dao/querydata/QueryQuestionNumericAnswerDAO.java#L99-L122
train
Metatavu/edelphi
rest/src/main/java/fi/metatavu/edelphi/users/UserController.java
UserController.findUserByKeycloakId
public User findUserByKeycloakId(UUID userId) { AuthSource authSource = authSourceDAO.findByStrategy(KEYCLOAK_AUTH_SOURCE); if (authSource == null) { logger.error("Could not find Keycloak auth source"); } UserIdentification userIdentification = userIdentificationDAO.findByExternalId(userId.to...
java
public User findUserByKeycloakId(UUID userId) { AuthSource authSource = authSourceDAO.findByStrategy(KEYCLOAK_AUTH_SOURCE); if (authSource == null) { logger.error("Could not find Keycloak auth source"); } UserIdentification userIdentification = userIdentificationDAO.findByExternalId(userId.to...
[ "public", "User", "findUserByKeycloakId", "(", "UUID", "userId", ")", "{", "AuthSource", "authSource", "=", "authSourceDAO", ".", "findByStrategy", "(", "KEYCLOAK_AUTH_SOURCE", ")", ";", "if", "(", "authSource", "==", "null", ")", "{", "logger", ".", "error", ...
Finds user by Keycloak id @param userId Keycloak user id @return user or null if not found
[ "Finds", "user", "by", "Keycloak", "id" ]
d91a0b54f954b33b4ee674a1bdf03612d76c3305
https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/rest/src/main/java/fi/metatavu/edelphi/users/UserController.java#L42-L54
train
Metatavu/edelphi
smvcj/src/main/java/fi/metatavu/edelphi/smvcj/controllers/BinaryRequestContext.java
BinaryRequestContext.writePostCommitResponse
@Override public void writePostCommitResponse(int statusCode) throws Exception { if (statusCode == StatusCode.OK) { if (fileName != null) { getResponse().setHeader("Content-Disposition", "attachment; filename=" + fileName); } if (contentType != null && content != null) { g...
java
@Override public void writePostCommitResponse(int statusCode) throws Exception { if (statusCode == StatusCode.OK) { if (fileName != null) { getResponse().setHeader("Content-Disposition", "attachment; filename=" + fileName); } if (contentType != null && content != null) { g...
[ "@", "Override", "public", "void", "writePostCommitResponse", "(", "int", "statusCode", ")", "throws", "Exception", "{", "if", "(", "statusCode", "==", "StatusCode", ".", "OK", ")", "{", "if", "(", "fileName", "!=", "null", ")", "{", "getResponse", "(", ")...
Writes the response to the binary request. @throws Exception If writing the response fails for any reason
[ "Writes", "the", "response", "to", "the", "binary", "request", "." ]
d91a0b54f954b33b4ee674a1bdf03612d76c3305
https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/smvcj/src/main/java/fi/metatavu/edelphi/smvcj/controllers/BinaryRequestContext.java#L80-L106
train
Metatavu/edelphi
edelphi/src/main/java/fi/metatavu/edelphi/pages/panel/admin/report/util/QueryReportPageController.java
QueryReportPageController.getRequestAnswerMap
protected Map<Long, Map<String, String>> getRequestAnswerMap(RequestContext requestContext) { @SuppressWarnings("unchecked") Map<Long,Map<String,String>> answers = (Map<Long,Map<String,String>>) requestContext.getRequest().getAttribute("commentAnswers"); if (answers == null) { answers = new HashMap<>(...
java
protected Map<Long, Map<String, String>> getRequestAnswerMap(RequestContext requestContext) { @SuppressWarnings("unchecked") Map<Long,Map<String,String>> answers = (Map<Long,Map<String,String>>) requestContext.getRequest().getAttribute("commentAnswers"); if (answers == null) { answers = new HashMap<>(...
[ "protected", "Map", "<", "Long", ",", "Map", "<", "String", ",", "String", ">", ">", "getRequestAnswerMap", "(", "RequestContext", "requestContext", ")", "{", "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "Map", "<", "Long", ",", "Map", "<", "String", ...
Returns comment answers map from the request context. If map is not yet defined, new is created. @param requestContext request contract @return answer map
[ "Returns", "comment", "answers", "map", "from", "the", "request", "context", ".", "If", "map", "is", "not", "yet", "defined", "new", "is", "created", "." ]
d91a0b54f954b33b4ee674a1bdf03612d76c3305
https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/edelphi/src/main/java/fi/metatavu/edelphi/pages/panel/admin/report/util/QueryReportPageController.java#L60-L69
train
Metatavu/edelphi
edelphi/src/main/java/fi/metatavu/edelphi/languagedetect/TextLanguageDetector.java
TextLanguageDetector.getLanguage
public String getLanguage (String text) { String language = null; TextObject textObject = textObjectFactory.forText(text); com.google.common.base.Optional<LdLocale> lang = languageDetector.detect(textObject); if (lang.isPresent()) { language = lang.get().toString(); } return lang...
java
public String getLanguage (String text) { String language = null; TextObject textObject = textObjectFactory.forText(text); com.google.common.base.Optional<LdLocale> lang = languageDetector.detect(textObject); if (lang.isPresent()) { language = lang.get().toString(); } return lang...
[ "public", "String", "getLanguage", "(", "String", "text", ")", "{", "String", "language", "=", "null", ";", "TextObject", "textObject", "=", "textObjectFactory", ".", "forText", "(", "text", ")", ";", "com", ".", "google", ".", "common", ".", "base", ".", ...
Get language from string @param text Detect language from this String @return String Detected language
[ "Get", "language", "from", "string" ]
d91a0b54f954b33b4ee674a1bdf03612d76c3305
https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/edelphi/src/main/java/fi/metatavu/edelphi/languagedetect/TextLanguageDetector.java#L51-L61
train
Metatavu/edelphi
edelphi/src/main/java/fi/metatavu/edelphi/query/AbstractQueryPageHandler.java
AbstractQueryPageHandler.renderComments
protected void renderComments(PageRequestContext requestContext, QueryPage queryPage, QueryReply queryReply, boolean commentable, boolean viewDiscussion) { Query query = queryPage.getQuerySection().getQuery(); Panel panel = ResourceUtils.getResourcePanel(query); RequiredQueryFragment queryFragment = ne...
java
protected void renderComments(PageRequestContext requestContext, QueryPage queryPage, QueryReply queryReply, boolean commentable, boolean viewDiscussion) { Query query = queryPage.getQuerySection().getQuery(); Panel panel = ResourceUtils.getResourcePanel(query); RequiredQueryFragment queryFragment = ne...
[ "protected", "void", "renderComments", "(", "PageRequestContext", "requestContext", ",", "QueryPage", "queryPage", ",", "QueryReply", "queryReply", ",", "boolean", "commentable", ",", "boolean", "viewDiscussion", ")", "{", "Query", "query", "=", "queryPage", ".", "g...
Renders comment list and comment editor @param requestContext request context @param queryPage query page @param queryReply query reply @param commentable whether to render comment editor @param viewDiscussion whether to render comment list
[ "Renders", "comment", "list", "and", "comment", "editor" ]
d91a0b54f954b33b4ee674a1bdf03612d76c3305
https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/edelphi/src/main/java/fi/metatavu/edelphi/query/AbstractQueryPageHandler.java#L141-L157
train
Metatavu/edelphi
rest/src/main/java/fi/metatavu/edelphi/permissions/PermissionController.java
PermissionController.hasDelfoiAccess
public boolean hasDelfoiAccess(User user, DelfoiActionName actionName) { if (isSuperUser(user)) { return true; } DelfoiAction action = delfoiActionDAO.findByActionName(actionName.toString()); if (action == null) { logger.info(String.format("ActionUtils.hasDelfoiAccess - undefined action...
java
public boolean hasDelfoiAccess(User user, DelfoiActionName actionName) { if (isSuperUser(user)) { return true; } DelfoiAction action = delfoiActionDAO.findByActionName(actionName.toString()); if (action == null) { logger.info(String.format("ActionUtils.hasDelfoiAccess - undefined action...
[ "public", "boolean", "hasDelfoiAccess", "(", "User", "user", ",", "DelfoiActionName", "actionName", ")", "{", "if", "(", "isSuperUser", "(", "user", ")", ")", "{", "return", "true", ";", "}", "DelfoiAction", "action", "=", "delfoiActionDAO", ".", "findByAction...
Returns whether user has required delfoi action access @param user user @param actionName action @return whether user role required action access
[ "Returns", "whether", "user", "has", "required", "delfoi", "action", "access" ]
d91a0b54f954b33b4ee674a1bdf03612d76c3305
https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/rest/src/main/java/fi/metatavu/edelphi/permissions/PermissionController.java#L62-L75
train
Metatavu/edelphi
rest/src/main/java/fi/metatavu/edelphi/permissions/PermissionController.java
PermissionController.hasPanelAccess
public boolean hasPanelAccess(Panel panel, User user, DelfoiActionName actionName) { if (panel == null) { logger.warn("Panel was null when checking panel access"); return false; } if (user == null) { logger.warn("User was null when checking panel access"); return false; } i...
java
public boolean hasPanelAccess(Panel panel, User user, DelfoiActionName actionName) { if (panel == null) { logger.warn("Panel was null when checking panel access"); return false; } if (user == null) { logger.warn("User was null when checking panel access"); return false; } i...
[ "public", "boolean", "hasPanelAccess", "(", "Panel", "panel", ",", "User", "user", ",", "DelfoiActionName", "actionName", ")", "{", "if", "(", "panel", "==", "null", ")", "{", "logger", ".", "warn", "(", "\"Panel was null when checking panel access\"", ")", ";",...
Returns whether user has required panel action access @param panel panel @param user user @param actionName action @return whether user role required action access
[ "Returns", "whether", "user", "has", "required", "panel", "action", "access" ]
d91a0b54f954b33b4ee674a1bdf03612d76c3305
https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/rest/src/main/java/fi/metatavu/edelphi/permissions/PermissionController.java#L85-L113
train
Metatavu/edelphi
rest/src/main/java/fi/metatavu/edelphi/permissions/PermissionController.java
PermissionController.getPanelRole
private UserRole getPanelRole(User user, Panel panel) { if (panel != null) { PanelUserDAO panelUserDAO = new PanelUserDAO(); PanelUser panelUser = panelUserDAO.findByPanelAndUserAndStamp(panel, user, panel.getCurrentStamp()); return panelUser == null ? getEveryoneRole() : panelUser.getRole(); ...
java
private UserRole getPanelRole(User user, Panel panel) { if (panel != null) { PanelUserDAO panelUserDAO = new PanelUserDAO(); PanelUser panelUser = panelUserDAO.findByPanelAndUserAndStamp(panel, user, panel.getCurrentStamp()); return panelUser == null ? getEveryoneRole() : panelUser.getRole(); ...
[ "private", "UserRole", "getPanelRole", "(", "User", "user", ",", "Panel", "panel", ")", "{", "if", "(", "panel", "!=", "null", ")", "{", "PanelUserDAO", "panelUserDAO", "=", "new", "PanelUserDAO", "(", ")", ";", "PanelUser", "panelUser", "=", "panelUserDAO",...
Returns user's panel role @param user user @param panel panel @return user's panel role
[ "Returns", "user", "s", "panel", "role" ]
d91a0b54f954b33b4ee674a1bdf03612d76c3305
https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/rest/src/main/java/fi/metatavu/edelphi/permissions/PermissionController.java#L122-L130
train
Metatavu/edelphi
rest/src/main/java/fi/metatavu/edelphi/permissions/PermissionController.java
PermissionController.getDelfoiRole
private UserRole getDelfoiRole(User user) { Delfoi delfoi = getDelfoi(); if (delfoi != null) { DelfoiUserDAO delfoiUserDAO = new DelfoiUserDAO(); DelfoiUser delfoiUser = delfoiUserDAO.findByDelfoiAndUser(delfoi, user); return delfoiUser == null ? getEveryoneRole() : delfoiUser.getRole(); }...
java
private UserRole getDelfoiRole(User user) { Delfoi delfoi = getDelfoi(); if (delfoi != null) { DelfoiUserDAO delfoiUserDAO = new DelfoiUserDAO(); DelfoiUser delfoiUser = delfoiUserDAO.findByDelfoiAndUser(delfoi, user); return delfoiUser == null ? getEveryoneRole() : delfoiUser.getRole(); }...
[ "private", "UserRole", "getDelfoiRole", "(", "User", "user", ")", "{", "Delfoi", "delfoi", "=", "getDelfoi", "(", ")", ";", "if", "(", "delfoi", "!=", "null", ")", "{", "DelfoiUserDAO", "delfoiUserDAO", "=", "new", "DelfoiUserDAO", "(", ")", ";", "DelfoiUs...
Returns user's Delfoi role @param user user @return user's Delfoi role
[ "Returns", "user", "s", "Delfoi", "role" ]
d91a0b54f954b33b4ee674a1bdf03612d76c3305
https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/rest/src/main/java/fi/metatavu/edelphi/permissions/PermissionController.java#L138-L147
train
Metatavu/edelphi
rest/src/main/java/fi/metatavu/edelphi/settings/SettingsController.java
SettingsController.getMqttSettings
public MqttSettings getMqttSettings() { MqttSettings settings = new MqttSettings(); settings.setServerUrl(getSettingValue("mqtt.serverUrl")); settings.setClientUrl(getSettingValue("mqtt.clientUrl")); settings.setTopic(getSettingValue("mqtt.topic")); settings.setWildcard(getSettingValue("mqtt.wil...
java
public MqttSettings getMqttSettings() { MqttSettings settings = new MqttSettings(); settings.setServerUrl(getSettingValue("mqtt.serverUrl")); settings.setClientUrl(getSettingValue("mqtt.clientUrl")); settings.setTopic(getSettingValue("mqtt.topic")); settings.setWildcard(getSettingValue("mqtt.wil...
[ "public", "MqttSettings", "getMqttSettings", "(", ")", "{", "MqttSettings", "settings", "=", "new", "MqttSettings", "(", ")", ";", "settings", ".", "setServerUrl", "(", "getSettingValue", "(", "\"mqtt.serverUrl\"", ")", ")", ";", "settings", ".", "setClientUrl", ...
Returns MQTT settings @return MQTT settings
[ "Returns", "MQTT", "settings" ]
d91a0b54f954b33b4ee674a1bdf03612d76c3305
https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/rest/src/main/java/fi/metatavu/edelphi/settings/SettingsController.java#L30-L37
train
Metatavu/edelphi
rest/src/main/java/fi/metatavu/edelphi/settings/SettingsController.java
SettingsController.getSettingValue
private String getSettingValue(String key) { SettingKey settingKey = settingKeyDAO.findByName(key); if (settingKey == null) { return null; } Setting setting = settingDAO.findByKey(settingKey); return setting != null ? setting.getValue() : null; }
java
private String getSettingValue(String key) { SettingKey settingKey = settingKeyDAO.findByName(key); if (settingKey == null) { return null; } Setting setting = settingDAO.findByKey(settingKey); return setting != null ? setting.getValue() : null; }
[ "private", "String", "getSettingValue", "(", "String", "key", ")", "{", "SettingKey", "settingKey", "=", "settingKeyDAO", ".", "findByName", "(", "key", ")", ";", "if", "(", "settingKey", "==", "null", ")", "{", "return", "null", ";", "}", "Setting", "sett...
Returns a setting value for given key @param key key @return setting value
[ "Returns", "a", "setting", "value", "for", "given", "key" ]
d91a0b54f954b33b4ee674a1bdf03612d76c3305
https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/rest/src/main/java/fi/metatavu/edelphi/settings/SettingsController.java#L45-L53
train
Metatavu/edelphi
edelphi-persistence/src/main/java/fi/metatavu/edelphi/dao/users/UserIdentificationDAO.java
UserIdentificationDAO.listByUserAndAuthSource
public List<UserIdentification> listByUserAndAuthSource(User user, AuthSource authSource) { EntityManager entityManager = getEntityManager(); CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder(); CriteriaQuery<UserIdentification> criteria = criteriaBuilder.createQuery(UserIdentificatio...
java
public List<UserIdentification> listByUserAndAuthSource(User user, AuthSource authSource) { EntityManager entityManager = getEntityManager(); CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder(); CriteriaQuery<UserIdentification> criteria = criteriaBuilder.createQuery(UserIdentificatio...
[ "public", "List", "<", "UserIdentification", ">", "listByUserAndAuthSource", "(", "User", "user", ",", "AuthSource", "authSource", ")", "{", "EntityManager", "entityManager", "=", "getEntityManager", "(", ")", ";", "CriteriaBuilder", "criteriaBuilder", "=", "entityMan...
Lists user identifications by user and auth source @param user user @param authSource auth source @return user identification
[ "Lists", "user", "identifications", "by", "user", "and", "auth", "source" ]
d91a0b54f954b33b4ee674a1bdf03612d76c3305
https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/edelphi-persistence/src/main/java/fi/metatavu/edelphi/dao/users/UserIdentificationDAO.java#L57-L72
train
Metatavu/edelphi
edelphi/src/main/java/fi/metatavu/edelphi/auth/AbstractAuthenticationStrategy.java
AbstractAuthenticationStrategy.initialize
public void initialize(AuthSource authSource) { this.authSource = authSource; AuthSourceSettingDAO authSourceSettingDAO = new AuthSourceSettingDAO(); List<AuthSourceSetting> authSourceSettings = authSourceSettingDAO.listByAuthSource(authSource); this.settings = new HashMap<>(); for (AuthSourceSettin...
java
public void initialize(AuthSource authSource) { this.authSource = authSource; AuthSourceSettingDAO authSourceSettingDAO = new AuthSourceSettingDAO(); List<AuthSourceSetting> authSourceSettings = authSourceSettingDAO.listByAuthSource(authSource); this.settings = new HashMap<>(); for (AuthSourceSettin...
[ "public", "void", "initialize", "(", "AuthSource", "authSource", ")", "{", "this", ".", "authSource", "=", "authSource", ";", "AuthSourceSettingDAO", "authSourceSettingDAO", "=", "new", "AuthSourceSettingDAO", "(", ")", ";", "List", "<", "AuthSourceSetting", ">", ...
Initializes this authentication strategy to work as per the given authentication source. @param authSource The authentication source
[ "Initializes", "this", "authentication", "strategy", "to", "work", "as", "per", "the", "given", "authentication", "source", "." ]
d91a0b54f954b33b4ee674a1bdf03612d76c3305
https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/edelphi/src/main/java/fi/metatavu/edelphi/auth/AbstractAuthenticationStrategy.java#L35-L43
train
Metatavu/edelphi
edelphi-persistence/src/main/java/fi/metatavu/edelphi/dao/base/AuthSourceDAO.java
AuthSourceDAO.findByStrategy
public AuthSource findByStrategy(String strategy) { EntityManager entityManager = getEntityManager(); CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder(); CriteriaQuery<AuthSource> criteria = criteriaBuilder.createQuery(AuthSource.class); Root<AuthSource> root = criteria.from(AuthS...
java
public AuthSource findByStrategy(String strategy) { EntityManager entityManager = getEntityManager(); CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder(); CriteriaQuery<AuthSource> criteria = criteriaBuilder.createQuery(AuthSource.class); Root<AuthSource> root = criteria.from(AuthS...
[ "public", "AuthSource", "findByStrategy", "(", "String", "strategy", ")", "{", "EntityManager", "entityManager", "=", "getEntityManager", "(", ")", ";", "CriteriaBuilder", "criteriaBuilder", "=", "entityManager", ".", "getCriteriaBuilder", "(", ")", ";", "CriteriaQuer...
Finds an auth source by strategy @param strategy strategy @return auth source or null if not found
[ "Finds", "an", "auth", "source", "by", "strategy" ]
d91a0b54f954b33b4ee674a1bdf03612d76c3305
https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/edelphi-persistence/src/main/java/fi/metatavu/edelphi/dao/base/AuthSourceDAO.java#L22-L34
train
Metatavu/edelphi
rest/src/main/java/fi/metatavu/edelphi/mqtt/MqttConnection.java
MqttConnection.publish
private static void publish(MqttSettings settings, String subtopic, byte[] payload, int qos, boolean retained) throws MqttException { getClient(settings).publish(String.format("%s/%s", settings.getTopic(), subtopic), payload, qos, retained); }
java
private static void publish(MqttSettings settings, String subtopic, byte[] payload, int qos, boolean retained) throws MqttException { getClient(settings).publish(String.format("%s/%s", settings.getTopic(), subtopic), payload, qos, retained); }
[ "private", "static", "void", "publish", "(", "MqttSettings", "settings", ",", "String", "subtopic", ",", "byte", "[", "]", "payload", ",", "int", "qos", ",", "boolean", "retained", ")", "throws", "MqttException", "{", "getClient", "(", "settings", ")", ".", ...
Publishes message into given MQTT topic @param settings MQTT settings @param subtopic subtopic to deliver the message to. @param payload the byte array to use as the payload @param qos the Quality of Service to deliver the message at. Valid values are 0, 1 or 2. @param retained whether or not this message should be re...
[ "Publishes", "message", "into", "given", "MQTT", "topic" ]
d91a0b54f954b33b4ee674a1bdf03612d76c3305
https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/rest/src/main/java/fi/metatavu/edelphi/mqtt/MqttConnection.java#L49-L51
train
Metatavu/edelphi
rest/src/main/java/fi/metatavu/edelphi/mqtt/MqttConnection.java
MqttConnection.getClient
private static synchronized IMqttClient getClient(MqttSettings settings) throws MqttException { if (CLIENT == null) { CLIENT = new MqttClient(settings.getServerUrl(), PUBLISHER_ID); MqttConnectOptions options = new MqttConnectOptions(); options.setAutomaticReconnect(true); options.setCleanSe...
java
private static synchronized IMqttClient getClient(MqttSettings settings) throws MqttException { if (CLIENT == null) { CLIENT = new MqttClient(settings.getServerUrl(), PUBLISHER_ID); MqttConnectOptions options = new MqttConnectOptions(); options.setAutomaticReconnect(true); options.setCleanSe...
[ "private", "static", "synchronized", "IMqttClient", "getClient", "(", "MqttSettings", "settings", ")", "throws", "MqttException", "{", "if", "(", "CLIENT", "==", "null", ")", "{", "CLIENT", "=", "new", "MqttClient", "(", "settings", ".", "getServerUrl", "(", "...
Returns client instance @param settings settings @return client instance @throws MqttException thrown when MQTT client construction fails
[ "Returns", "client", "instance" ]
d91a0b54f954b33b4ee674a1bdf03612d76c3305
https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/rest/src/main/java/fi/metatavu/edelphi/mqtt/MqttConnection.java#L60-L71
train
Metatavu/edelphi
edelphi/src/main/java/fi/metatavu/edelphi/jsons/panel/admin/CreateInvitationJSONRequestController.java
CreateInvitationJSONRequestController.getUserEmail
private String getUserEmail(Long userId) { UserDAO userDAO = new UserDAO(); User user = userDAO.findById(userId); return user.getDefaultEmailAsString(); }
java
private String getUserEmail(Long userId) { UserDAO userDAO = new UserDAO(); User user = userDAO.findById(userId); return user.getDefaultEmailAsString(); }
[ "private", "String", "getUserEmail", "(", "Long", "userId", ")", "{", "UserDAO", "userDAO", "=", "new", "UserDAO", "(", ")", ";", "User", "user", "=", "userDAO", ".", "findById", "(", "userId", ")", ";", "return", "user", ".", "getDefaultEmailAsString", "(...
Returns user's default email address by user id @param userId user id @return user's default email address
[ "Returns", "user", "s", "default", "email", "address", "by", "user", "id" ]
d91a0b54f954b33b4ee674a1bdf03612d76c3305
https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/edelphi/src/main/java/fi/metatavu/edelphi/jsons/panel/admin/CreateInvitationJSONRequestController.java#L97-L101
train
Metatavu/edelphi
rest/src/main/java/fi/metatavu/edelphi/comments/QueryQuestionCommentController.java
QueryQuestionCommentController.createQueryQuestionComment
public QueryQuestionComment createQueryQuestionComment(QueryReply queryReply, QueryPage queryPage, QueryQuestionComment parentComment, String comment, Boolean hidden, User creator, Date created) { return queryQuestionCommentDAO.create(queryReply, queryPage, parentComment, comment, hidden, creator, created, creator,...
java
public QueryQuestionComment createQueryQuestionComment(QueryReply queryReply, QueryPage queryPage, QueryQuestionComment parentComment, String comment, Boolean hidden, User creator, Date created) { return queryQuestionCommentDAO.create(queryReply, queryPage, parentComment, comment, hidden, creator, created, creator,...
[ "public", "QueryQuestionComment", "createQueryQuestionComment", "(", "QueryReply", "queryReply", ",", "QueryPage", "queryPage", ",", "QueryQuestionComment", "parentComment", ",", "String", "comment", ",", "Boolean", "hidden", ",", "User", "creator", ",", "Date", "create...
Creates new query question comment @param queryReply query reply @param queryPage query page @param parentComment parent comment @param comment comment contents @param hidden whether comment should be hidden @param creator creator @param created create time @return created comment
[ "Creates", "new", "query", "question", "comment" ]
d91a0b54f954b33b4ee674a1bdf03612d76c3305
https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/rest/src/main/java/fi/metatavu/edelphi/comments/QueryQuestionCommentController.java#L49-L51
train
Metatavu/edelphi
rest/src/main/java/fi/metatavu/edelphi/comments/QueryQuestionCommentController.java
QueryQuestionCommentController.listQueryQuestionComments
public List<QueryQuestionComment> listQueryQuestionComments(Panel panel, PanelStamp stamp, QueryPage queryPage, Query query, QueryQuestionComment parentComment, User user, boolean onlyRootComments) { if (stamp == null) { stamp = panel.getCurrentStamp(); } return queryQuestionCommentDAO.list(query...
java
public List<QueryQuestionComment> listQueryQuestionComments(Panel panel, PanelStamp stamp, QueryPage queryPage, Query query, QueryQuestionComment parentComment, User user, boolean onlyRootComments) { if (stamp == null) { stamp = panel.getCurrentStamp(); } return queryQuestionCommentDAO.list(query...
[ "public", "List", "<", "QueryQuestionComment", ">", "listQueryQuestionComments", "(", "Panel", "panel", ",", "PanelStamp", "stamp", ",", "QueryPage", "queryPage", ",", "Query", "query", ",", "QueryQuestionComment", "parentComment", ",", "User", "user", ",", "boolean...
Lists not archived comments by given parameters. @param panel panel. Required @param stamp filter by panel stamp. Defaults to panel's current stamp @param queryPage filter by comment's query page. Ignored if null @param query filter by query. Ignored if null @param parentComment filter by parent comment. Ignored if nu...
[ "Lists", "not", "archived", "comments", "by", "given", "parameters", "." ]
d91a0b54f954b33b4ee674a1bdf03612d76c3305
https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/rest/src/main/java/fi/metatavu/edelphi/comments/QueryQuestionCommentController.java#L75-L81
train
Metatavu/edelphi
rest/src/main/java/fi/metatavu/edelphi/comments/QueryQuestionCommentController.java
QueryQuestionCommentController.updateQueryQuestionComment
public QueryQuestionComment updateQueryQuestionComment(QueryQuestionComment queryQuestionComment, String comment, Boolean hidden, User modifier, Date modified) { queryQuestionCommentDAO.updateHidden(queryQuestionComment, hidden, modifier); return queryQuestionCommentDAO.updateComment(queryQuestionComment, comme...
java
public QueryQuestionComment updateQueryQuestionComment(QueryQuestionComment queryQuestionComment, String comment, Boolean hidden, User modifier, Date modified) { queryQuestionCommentDAO.updateHidden(queryQuestionComment, hidden, modifier); return queryQuestionCommentDAO.updateComment(queryQuestionComment, comme...
[ "public", "QueryQuestionComment", "updateQueryQuestionComment", "(", "QueryQuestionComment", "queryQuestionComment", ",", "String", "comment", ",", "Boolean", "hidden", ",", "User", "modifier", ",", "Date", "modified", ")", "{", "queryQuestionCommentDAO", ".", "updateHidd...
Updates query question comment @param queryQuestionComment comment to be updated @param comment comment contents @param hidden whether comment should be hidden @param modifier modifier @param modified modification time @return
[ "Updates", "query", "question", "comment" ]
d91a0b54f954b33b4ee674a1bdf03612d76c3305
https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/rest/src/main/java/fi/metatavu/edelphi/comments/QueryQuestionCommentController.java#L93-L96
train
Metatavu/edelphi
rest/src/main/java/fi/metatavu/edelphi/comments/QueryQuestionCommentController.java
QueryQuestionCommentController.isQueryQuestionCommentArchived
public boolean isQueryQuestionCommentArchived(QueryQuestionComment comment) { if (comment == null || comment.getArchived()) { return true; } if (comment.getParentComment() != null && isQueryQuestionCommentArchived(comment.getParentComment())) { return true; } if (comment.getQue...
java
public boolean isQueryQuestionCommentArchived(QueryQuestionComment comment) { if (comment == null || comment.getArchived()) { return true; } if (comment.getParentComment() != null && isQueryQuestionCommentArchived(comment.getParentComment())) { return true; } if (comment.getQue...
[ "public", "boolean", "isQueryQuestionCommentArchived", "(", "QueryQuestionComment", "comment", ")", "{", "if", "(", "comment", "==", "null", "||", "comment", ".", "getArchived", "(", ")", ")", "{", "return", "true", ";", "}", "if", "(", "comment", ".", "getP...
Returns whether query question comment is archived or not @param comment comment @return whether query question comment is archived or not
[ "Returns", "whether", "query", "question", "comment", "is", "archived", "or", "not" ]
d91a0b54f954b33b4ee674a1bdf03612d76c3305
https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/rest/src/main/java/fi/metatavu/edelphi/comments/QueryQuestionCommentController.java#L122-L136
train
Metatavu/edelphi
rest/src/main/java/fi/metatavu/edelphi/comments/QueryQuestionCommentController.java
QueryQuestionCommentController.isPanelsComment
public boolean isPanelsComment(QueryQuestionComment comment, Panel panel) { Panel queryPanel = resourceController.getResourcePanel(comment.getQueryPage().getQuerySection().getQuery()); if (queryPanel == null || panel == null) { return false; } return queryPanel.getId().equals(panel.getId()); ...
java
public boolean isPanelsComment(QueryQuestionComment comment, Panel panel) { Panel queryPanel = resourceController.getResourcePanel(comment.getQueryPage().getQuerySection().getQuery()); if (queryPanel == null || panel == null) { return false; } return queryPanel.getId().equals(panel.getId()); ...
[ "public", "boolean", "isPanelsComment", "(", "QueryQuestionComment", "comment", ",", "Panel", "panel", ")", "{", "Panel", "queryPanel", "=", "resourceController", ".", "getResourcePanel", "(", "comment", ".", "getQueryPage", "(", ")", ".", "getQuerySection", "(", ...
Returns whether comment belongs to given panel @param comment comment @param panel panel @return whether comment belongs to given panel
[ "Returns", "whether", "comment", "belongs", "to", "given", "panel" ]
d91a0b54f954b33b4ee674a1bdf03612d76c3305
https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/rest/src/main/java/fi/metatavu/edelphi/comments/QueryQuestionCommentController.java#L145-L152
train
Metatavu/edelphi
edelphi/src/main/java/fi/metatavu/edelphi/query/thesis/AbstractScaleThesisQueryPageHandler.java
AbstractScaleThesisQueryPageHandler.synchronizeFieldCaption
protected void synchronizeFieldCaption(QueryPage queryPage, String fieldName, String fieldCaption) { QueryFieldDAO queryFieldDAO = new QueryFieldDAO(); QueryOptionField queryField = (QueryOptionField) queryFieldDAO.findByQueryPageAndName(queryPage, fieldName); if (queryField != null) queryFieldDAO.up...
java
protected void synchronizeFieldCaption(QueryPage queryPage, String fieldName, String fieldCaption) { QueryFieldDAO queryFieldDAO = new QueryFieldDAO(); QueryOptionField queryField = (QueryOptionField) queryFieldDAO.findByQueryPageAndName(queryPage, fieldName); if (queryField != null) queryFieldDAO.up...
[ "protected", "void", "synchronizeFieldCaption", "(", "QueryPage", "queryPage", ",", "String", "fieldName", ",", "String", "fieldCaption", ")", "{", "QueryFieldDAO", "queryFieldDAO", "=", "new", "QueryFieldDAO", "(", ")", ";", "QueryOptionField", "queryField", "=", "...
Updates field caption if field can be found. Used only when query already contains replies. @param queryPage query page @param fieldName field name @param fieldCaption field caption
[ "Updates", "field", "caption", "if", "field", "can", "be", "found", ".", "Used", "only", "when", "query", "already", "contains", "replies", "." ]
d91a0b54f954b33b4ee674a1bdf03612d76c3305
https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/edelphi/src/main/java/fi/metatavu/edelphi/query/thesis/AbstractScaleThesisQueryPageHandler.java#L113-L119
train
Metatavu/edelphi
edelphi-persistence/src/main/java/fi/metatavu/edelphi/dao/querydata/QueryQuestionCommentDAO.java
QueryQuestionCommentDAO.listByQueryPageAndStamp
public List<QueryQuestionComment> listByQueryPageAndStamp(QueryPage queryPage, PanelStamp stamp) { EntityManager entityManager = getEntityManager(); CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder(); CriteriaQuery<QueryQuestionComment> criteria = criteriaBuilder.createQuery(QueryQuestion...
java
public List<QueryQuestionComment> listByQueryPageAndStamp(QueryPage queryPage, PanelStamp stamp) { EntityManager entityManager = getEntityManager(); CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder(); CriteriaQuery<QueryQuestionComment> criteria = criteriaBuilder.createQuery(QueryQuestion...
[ "public", "List", "<", "QueryQuestionComment", ">", "listByQueryPageAndStamp", "(", "QueryPage", "queryPage", ",", "PanelStamp", "stamp", ")", "{", "EntityManager", "entityManager", "=", "getEntityManager", "(", ")", ";", "CriteriaBuilder", "criteriaBuilder", "=", "en...
Lists all nonarchived comments left on the given query page in the given panel stamp. @param queryPage the comments' query page @param stamp the panel stamp @return a list of all nonarchived comments left on the given query page in the given panel stamp
[ "Lists", "all", "nonarchived", "comments", "left", "on", "the", "given", "query", "page", "in", "the", "given", "panel", "stamp", "." ]
d91a0b54f954b33b4ee674a1bdf03612d76c3305
https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/edelphi-persistence/src/main/java/fi/metatavu/edelphi/dao/querydata/QueryQuestionCommentDAO.java#L200-L217
train
Metatavu/edelphi
edelphi-persistence/src/main/java/fi/metatavu/edelphi/dao/querydata/QueryQuestionCommentDAO.java
QueryQuestionCommentDAO.listTreesByQueryPage
public Map<Long, List<QueryQuestionComment>> listTreesByQueryPage(QueryPage queryPage) { Map<Long, List<QueryQuestionComment>> result = new HashMap<>(); EntityManager entityManager = getEntityManager(); CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder(); CriteriaQuery<QueryQuestionCo...
java
public Map<Long, List<QueryQuestionComment>> listTreesByQueryPage(QueryPage queryPage) { Map<Long, List<QueryQuestionComment>> result = new HashMap<>(); EntityManager entityManager = getEntityManager(); CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder(); CriteriaQuery<QueryQuestionCo...
[ "public", "Map", "<", "Long", ",", "List", "<", "QueryQuestionComment", ">", ">", "listTreesByQueryPage", "(", "QueryPage", "queryPage", ")", "{", "Map", "<", "Long", ",", "List", "<", "QueryQuestionComment", ">", ">", "result", "=", "new", "HashMap", "<>", ...
Lists all non-root comments on page and orders them to map with parentComment.id as key and list of comments directly below parentComment as value. @param queryPage page where to list the comments from @return list of non-root comments on page and orders to mapped by parentComment.id
[ "Lists", "all", "non", "-", "root", "comments", "on", "page", "and", "orders", "them", "to", "map", "with", "parentComment", ".", "id", "as", "key", "and", "list", "of", "comments", "directly", "below", "parentComment", "as", "value", "." ]
d91a0b54f954b33b4ee674a1bdf03612d76c3305
https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/edelphi-persistence/src/main/java/fi/metatavu/edelphi/dao/querydata/QueryQuestionCommentDAO.java#L282-L314
train
Metatavu/edelphi
smvcj/src/main/java/fi/metatavu/edelphi/smvcj/dispatcher/Servlet.java
Servlet.service
@Override protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, java.io.IOException { if (sessionSynchronization) { String syncKey = getSyncKey(request); synchronized (getSyncObject(syncKey)) { try { doService(request, response); ...
java
@Override protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, java.io.IOException { if (sessionSynchronization) { String syncKey = getSyncKey(request); synchronized (getSyncObject(syncKey)) { try { doService(request, response); ...
[ "@", "Override", "protected", "void", "service", "(", "HttpServletRequest", "request", ",", "HttpServletResponse", "response", ")", "throws", "ServletException", ",", "java", ".", "io", ".", "IOException", "{", "if", "(", "sessionSynchronization", ")", "{", "Strin...
Processes all application requests, delegating them to their corresponding page, binary and JSON controllers.
[ "Processes", "all", "application", "requests", "delegating", "them", "to", "their", "corresponding", "page", "binary", "and", "JSON", "controllers", "." ]
d91a0b54f954b33b4ee674a1bdf03612d76c3305
https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/smvcj/src/main/java/fi/metatavu/edelphi/smvcj/dispatcher/Servlet.java#L81-L97
train
Metatavu/edelphi
rest/src/main/java/fi/metatavu/edelphi/queries/QueryController.java
QueryController.isQueryPageArchived
public boolean isQueryPageArchived(QueryPage queryPage) { if (queryPage.getArchived()) { return true; } QuerySection querySection = queryPage.getQuerySection(); if (querySection.getArchived()) { return true; } return isQueryArchived(querySection.getQuery()); }
java
public boolean isQueryPageArchived(QueryPage queryPage) { if (queryPage.getArchived()) { return true; } QuerySection querySection = queryPage.getQuerySection(); if (querySection.getArchived()) { return true; } return isQueryArchived(querySection.getQuery()); }
[ "public", "boolean", "isQueryPageArchived", "(", "QueryPage", "queryPage", ")", "{", "if", "(", "queryPage", ".", "getArchived", "(", ")", ")", "{", "return", "true", ";", "}", "QuerySection", "querySection", "=", "queryPage", ".", "getQuerySection", "(", ")",...
Returns whether query page is archived or not @param queryPage query page @return whether query page is archived or not
[ "Returns", "whether", "query", "page", "is", "archived", "or", "not" ]
d91a0b54f954b33b4ee674a1bdf03612d76c3305
https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/rest/src/main/java/fi/metatavu/edelphi/queries/QueryController.java#L72-L83
train
Metatavu/edelphi
rest/src/main/java/fi/metatavu/edelphi/queries/QueryController.java
QueryController.isQueryArchived
public boolean isQueryArchived(Query query) { if (query.getArchived()) { return true; } return resourceController.isFolderArchived(query.getParentFolder()); }
java
public boolean isQueryArchived(Query query) { if (query.getArchived()) { return true; } return resourceController.isFolderArchived(query.getParentFolder()); }
[ "public", "boolean", "isQueryArchived", "(", "Query", "query", ")", "{", "if", "(", "query", ".", "getArchived", "(", ")", ")", "{", "return", "true", ";", "}", "return", "resourceController", ".", "isFolderArchived", "(", "query", ".", "getParentFolder", "(...
Returns whether query is archived @param query query @return whether query is archived
[ "Returns", "whether", "query", "is", "archived" ]
d91a0b54f954b33b4ee674a1bdf03612d76c3305
https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/rest/src/main/java/fi/metatavu/edelphi/queries/QueryController.java#L91-L97
train
Metatavu/edelphi
rest/src/main/java/fi/metatavu/edelphi/queries/QueryController.java
QueryController.isPanelsQuery
public boolean isPanelsQuery(Query query, Panel panel) { Panel queryPanel = resourceController.getResourcePanel(query); if (queryPanel == null || panel == null) { return false; } return queryPanel.getId().equals(panel.getId()); }
java
public boolean isPanelsQuery(Query query, Panel panel) { Panel queryPanel = resourceController.getResourcePanel(query); if (queryPanel == null || panel == null) { return false; } return queryPanel.getId().equals(panel.getId()); }
[ "public", "boolean", "isPanelsQuery", "(", "Query", "query", ",", "Panel", "panel", ")", "{", "Panel", "queryPanel", "=", "resourceController", ".", "getResourcePanel", "(", "query", ")", ";", "if", "(", "queryPanel", "==", "null", "||", "panel", "==", "null...
Returns whether query belongs to given panel @param query query @param panel panel @return whether query belongs to given panel
[ "Returns", "whether", "query", "belongs", "to", "given", "panel" ]
d91a0b54f954b33b4ee674a1bdf03612d76c3305
https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/rest/src/main/java/fi/metatavu/edelphi/queries/QueryController.java#L106-L113
train
Metatavu/edelphi
edelphi-persistence/src/main/java/fi/metatavu/edelphi/dao/panels/PanelUserDAO.java
PanelUserDAO.create
public PanelUser create(Panel panel, User user, PanelUserRole role, PanelUserJoinType joinType, PanelStamp stamp, User creator) { Date now = new Date(); PanelUser panelUser = new PanelUser(); panelUser.setPanel(panel); panelUser.setUser(user); panelUser.setRole(role); panelUser.setJoinType(...
java
public PanelUser create(Panel panel, User user, PanelUserRole role, PanelUserJoinType joinType, PanelStamp stamp, User creator) { Date now = new Date(); PanelUser panelUser = new PanelUser(); panelUser.setPanel(panel); panelUser.setUser(user); panelUser.setRole(role); panelUser.setJoinType(...
[ "public", "PanelUser", "create", "(", "Panel", "panel", ",", "User", "user", ",", "PanelUserRole", "role", ",", "PanelUserJoinType", "joinType", ",", "PanelStamp", "stamp", ",", "User", "creator", ")", "{", "Date", "now", "=", "new", "Date", "(", ")", ";",...
Creates new panel user @param panel panel @param user user @param role user's role in panel @param joinType join type @param stamp panel stamp @param creator creator user @return new panelist
[ "Creates", "new", "panel", "user" ]
d91a0b54f954b33b4ee674a1bdf03612d76c3305
https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/edelphi-persistence/src/main/java/fi/metatavu/edelphi/dao/panels/PanelUserDAO.java#L41-L57
train
Metatavu/edelphi
edelphi-persistence/src/main/java/fi/metatavu/edelphi/dao/panels/PanelUserDAO.java
PanelUserDAO.updateJoinType
public PanelUser updateJoinType(PanelUser panelUser, PanelUserJoinType joinType, User modifier) { panelUser.setJoinType(joinType); panelUser.setLastModified(new Date()); panelUser.setLastModifier(modifier); return persist(panelUser); }
java
public PanelUser updateJoinType(PanelUser panelUser, PanelUserJoinType joinType, User modifier) { panelUser.setJoinType(joinType); panelUser.setLastModified(new Date()); panelUser.setLastModifier(modifier); return persist(panelUser); }
[ "public", "PanelUser", "updateJoinType", "(", "PanelUser", "panelUser", ",", "PanelUserJoinType", "joinType", ",", "User", "modifier", ")", "{", "panelUser", ".", "setJoinType", "(", "joinType", ")", ";", "panelUser", ".", "setLastModified", "(", "new", "Date", ...
Updates panel user's join type @param panelUser panel user @param joinType new join type @param modifier modifier @return updated user
[ "Updates", "panel", "user", "s", "join", "type" ]
d91a0b54f954b33b4ee674a1bdf03612d76c3305
https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/edelphi-persistence/src/main/java/fi/metatavu/edelphi/dao/panels/PanelUserDAO.java#L180-L186
train
Metatavu/edelphi
edelphi-persistence/src/main/java/fi/metatavu/edelphi/dao/panels/PanelUserDAO.java
PanelUserDAO.updateRole
public PanelUser updateRole(PanelUser panelUser, PanelUserRole panelUserRole, User modifier) { panelUser.setRole(panelUserRole); panelUser.setLastModified(new Date()); panelUser.setLastModifier(modifier); return persist(panelUser); }
java
public PanelUser updateRole(PanelUser panelUser, PanelUserRole panelUserRole, User modifier) { panelUser.setRole(panelUserRole); panelUser.setLastModified(new Date()); panelUser.setLastModifier(modifier); return persist(panelUser); }
[ "public", "PanelUser", "updateRole", "(", "PanelUser", "panelUser", ",", "PanelUserRole", "panelUserRole", ",", "User", "modifier", ")", "{", "panelUser", ".", "setRole", "(", "panelUserRole", ")", ";", "panelUser", ".", "setLastModified", "(", "new", "Date", "(...
Updates panel user's role @param panelUser panel user @param panelUserRole new role @param modifier modifier @return updated user
[ "Updates", "panel", "user", "s", "role" ]
d91a0b54f954b33b4ee674a1bdf03612d76c3305
https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/edelphi-persistence/src/main/java/fi/metatavu/edelphi/dao/panels/PanelUserDAO.java#L196-L202
train
Metatavu/edelphi
edelphi-persistence/src/main/java/fi/metatavu/edelphi/dao/panels/PanelUserDAO.java
PanelUserDAO.countByPanelStateUserAndRole
public Long countByPanelStateUserAndRole(User user, DelfoiAction action, PanelState state) { EntityManager entityManager = getEntityManager(); CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder(); CriteriaQuery<Long> criteria = criteriaBuilder.createQuery(Long.class); Root<PanelUse...
java
public Long countByPanelStateUserAndRole(User user, DelfoiAction action, PanelState state) { EntityManager entityManager = getEntityManager(); CriteriaBuilder criteriaBuilder = entityManager.getCriteriaBuilder(); CriteriaQuery<Long> criteria = criteriaBuilder.createQuery(Long.class); Root<PanelUse...
[ "public", "Long", "countByPanelStateUserAndRole", "(", "User", "user", ",", "DelfoiAction", "action", ",", "PanelState", "state", ")", "{", "EntityManager", "entityManager", "=", "getEntityManager", "(", ")", ";", "CriteriaBuilder", "criteriaBuilder", "=", "entityMana...
Returns count of panels in specific state where user has permission to perform specific action @param user user @param action action @param state panel state @return count of panels in specific state where user has permission to perform specific action
[ "Returns", "count", "of", "panels", "in", "specific", "state", "where", "user", "has", "permission", "to", "perform", "specific", "action" ]
d91a0b54f954b33b4ee674a1bdf03612d76c3305
https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/edelphi-persistence/src/main/java/fi/metatavu/edelphi/dao/panels/PanelUserDAO.java#L260-L284
train
Metatavu/edelphi
rest/src/main/java/fi/metatavu/edelphi/resources/ResourceController.java
ResourceController.getResourcePanel
public Panel getResourcePanel(Resource resource) { List<Folder> resourceFolders = new ArrayList<Folder>(); Resource current = resource; Folder folder = current instanceof Folder ? (Folder) current : current == null ? null : current.getParentFolder(); while (folder != null) { resourceFolders.add(fo...
java
public Panel getResourcePanel(Resource resource) { List<Folder> resourceFolders = new ArrayList<Folder>(); Resource current = resource; Folder folder = current instanceof Folder ? (Folder) current : current == null ? null : current.getParentFolder(); while (folder != null) { resourceFolders.add(fo...
[ "public", "Panel", "getResourcePanel", "(", "Resource", "resource", ")", "{", "List", "<", "Folder", ">", "resourceFolders", "=", "new", "ArrayList", "<", "Folder", ">", "(", ")", ";", "Resource", "current", "=", "resource", ";", "Folder", "folder", "=", "...
Returns a panel for given resource @param resource resource @return panel or null if not found
[ "Returns", "a", "panel", "for", "given", "resource" ]
d91a0b54f954b33b4ee674a1bdf03612d76c3305
https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/rest/src/main/java/fi/metatavu/edelphi/resources/ResourceController.java#L34-L56
train
Metatavu/edelphi
rest/src/main/java/fi/metatavu/edelphi/resources/ResourceController.java
ResourceController.isFolderArchived
public boolean isFolderArchived(Folder folder) { if (folder.getArchived()) { return true; } Folder parentFolder = folder.getParentFolder(); if (parentFolder != null) { return isFolderArchived(parentFolder); } else { Panel panel = panelDAO.findByRootFolder(parentFolder); ...
java
public boolean isFolderArchived(Folder folder) { if (folder.getArchived()) { return true; } Folder parentFolder = folder.getParentFolder(); if (parentFolder != null) { return isFolderArchived(parentFolder); } else { Panel panel = panelDAO.findByRootFolder(parentFolder); ...
[ "public", "boolean", "isFolderArchived", "(", "Folder", "folder", ")", "{", "if", "(", "folder", ".", "getArchived", "(", ")", ")", "{", "return", "true", ";", "}", "Folder", "parentFolder", "=", "folder", ".", "getParentFolder", "(", ")", ";", "if", "("...
Returns whether folder is archived @param folder folder @return whether folder is archived
[ "Returns", "whether", "folder", "is", "archived" ]
d91a0b54f954b33b4ee674a1bdf03612d76c3305
https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/rest/src/main/java/fi/metatavu/edelphi/resources/ResourceController.java#L64-L80
train
Metatavu/edelphi
edelphi/src/main/java/fi/metatavu/edelphi/auth/AuthenticationProviderFactory.java
AuthenticationProviderFactory.registerAuthenticationProvider
public void registerAuthenticationProvider(Class<? extends AuthenticationProvider> providerClass) { AuthenticationProvider provider = instantiateProvider(providerClass); authenticationProviders.put(provider.getName(), providerClass); credentialAuths.put(provider.getName(), provider.requiresCredentials());...
java
public void registerAuthenticationProvider(Class<? extends AuthenticationProvider> providerClass) { AuthenticationProvider provider = instantiateProvider(providerClass); authenticationProviders.put(provider.getName(), providerClass); credentialAuths.put(provider.getName(), provider.requiresCredentials());...
[ "public", "void", "registerAuthenticationProvider", "(", "Class", "<", "?", "extends", "AuthenticationProvider", ">", "providerClass", ")", "{", "AuthenticationProvider", "provider", "=", "instantiateProvider", "(", "providerClass", ")", ";", "authenticationProviders", "....
Registers an authentication provider to this class. @param providerClass The authentication provider to be registered
[ "Registers", "an", "authentication", "provider", "to", "this", "class", "." ]
d91a0b54f954b33b4ee674a1bdf03612d76c3305
https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/edelphi/src/main/java/fi/metatavu/edelphi/auth/AuthenticationProviderFactory.java#L44-L48
train
Metatavu/edelphi
edelphi/src/main/java/fi/metatavu/edelphi/taglib/chartutil/ChartWebHelper.java
ChartWebHelper.isChartInRuntime
public static boolean isChartInRuntime(Chart cm) { if (cm instanceof ChartWithAxes) { Axis bAxis = ((ChartWithAxes) cm).getAxes().get(0); EList<Axis> oAxes = bAxis.getAssociatedAxes(); for (int i = 0; i < oAxes.size(); i++) { Axis oAxis = oAxes.get(i); EList<SeriesDefinition> oSeri...
java
public static boolean isChartInRuntime(Chart cm) { if (cm instanceof ChartWithAxes) { Axis bAxis = ((ChartWithAxes) cm).getAxes().get(0); EList<Axis> oAxes = bAxis.getAssociatedAxes(); for (int i = 0; i < oAxes.size(); i++) { Axis oAxis = oAxes.get(i); EList<SeriesDefinition> oSeri...
[ "public", "static", "boolean", "isChartInRuntime", "(", "Chart", "cm", ")", "{", "if", "(", "cm", "instanceof", "ChartWithAxes", ")", "{", "Axis", "bAxis", "=", "(", "(", "ChartWithAxes", ")", "cm", ")", ".", "getAxes", "(", ")", ".", "get", "(", "0", ...
Checks if current chart has runtime data sets. @param cm chart model @return has runtime data or not
[ "Checks", "if", "current", "chart", "has", "runtime", "data", "sets", "." ]
d91a0b54f954b33b4ee674a1bdf03612d76c3305
https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/edelphi/src/main/java/fi/metatavu/edelphi/taglib/chartutil/ChartWebHelper.java#L51-L76
train
Metatavu/edelphi
edelphi/src/main/java/fi/metatavu/edelphi/utils/QueryDataUtils.java
QueryDataUtils.exportQueryCommentsAsCsv
public static byte[] exportQueryCommentsAsCsv(Locale locale, ReplierExportStrategy replierExportStrategy, List<QueryReply> replies, Query query, PanelStamp stamp) throws IOException { QueryPageDAO queryPageDAO = new QueryPageDAO(); List<QueryPage> queryPages = queryPageDAO.listByQuery(query); Collectio...
java
public static byte[] exportQueryCommentsAsCsv(Locale locale, ReplierExportStrategy replierExportStrategy, List<QueryReply> replies, Query query, PanelStamp stamp) throws IOException { QueryPageDAO queryPageDAO = new QueryPageDAO(); List<QueryPage> queryPages = queryPageDAO.listByQuery(query); Collectio...
[ "public", "static", "byte", "[", "]", "exportQueryCommentsAsCsv", "(", "Locale", "locale", ",", "ReplierExportStrategy", "replierExportStrategy", ",", "List", "<", "QueryReply", ">", "replies", ",", "Query", "query", ",", "PanelStamp", "stamp", ")", "throws", "IOE...
Export query comments into CSV byte array @param locale locale @param replierExportStrategy replies export strategy @param replies replies to be exported @param query query @param stamp stamp @return query comments in CSV byte array @throws IOException throws IOException when CSV writing fails
[ "Export", "query", "comments", "into", "CSV", "byte", "array" ]
d91a0b54f954b33b4ee674a1bdf03612d76c3305
https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/edelphi/src/main/java/fi/metatavu/edelphi/utils/QueryDataUtils.java#L121-L148
train
Metatavu/edelphi
edelphi/src/main/java/fi/metatavu/edelphi/utils/QueryDataUtils.java
QueryDataUtils.exportQueryPageCommentsAsCsv
private static List<String[]> exportQueryPageCommentsAsCsv(ReplierExportStrategy replierExportStrategy, List<QueryReply> replies, PanelStamp stamp, QueryPage queryPage) { QueryPageHandler queryPageHandler = QueryPageHandlerFactory.getInstance().buildPageHandler(queryPage.getPageType()); if (queryPageHandler != ...
java
private static List<String[]> exportQueryPageCommentsAsCsv(ReplierExportStrategy replierExportStrategy, List<QueryReply> replies, PanelStamp stamp, QueryPage queryPage) { QueryPageHandler queryPageHandler = QueryPageHandlerFactory.getInstance().buildPageHandler(queryPage.getPageType()); if (queryPageHandler != ...
[ "private", "static", "List", "<", "String", "[", "]", ">", "exportQueryPageCommentsAsCsv", "(", "ReplierExportStrategy", "replierExportStrategy", ",", "List", "<", "QueryReply", ">", "replies", ",", "PanelStamp", "stamp", ",", "QueryPage", "queryPage", ")", "{", "...
Exports single query page into CSV rows @param replierExportStrategy replier export strategy @param replies replies to be exported @param stamp stamp @param queryPage query page to be exported @return CSV rows
[ "Exports", "single", "query", "page", "into", "CSV", "rows" ]
d91a0b54f954b33b4ee674a1bdf03612d76c3305
https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/edelphi/src/main/java/fi/metatavu/edelphi/utils/QueryDataUtils.java#L189-L199
train
Metatavu/edelphi
edelphi/src/main/java/fi/metatavu/edelphi/utils/QueryDataUtils.java
QueryDataUtils.exportQueryPageCommentsAsCsv
private static List<String[]> exportQueryPageCommentsAsCsv(ReplierExportStrategy replierExportStrategy, QueryPage queryPage, ReportPageCommentProcessor processor) { QueryQuestionCommentDAO queryQuestionCommentDAO = new QueryQuestionCommentDAO(); List<String[]> rows = new ArrayList<>(); processor.processCom...
java
private static List<String[]> exportQueryPageCommentsAsCsv(ReplierExportStrategy replierExportStrategy, QueryPage queryPage, ReportPageCommentProcessor processor) { QueryQuestionCommentDAO queryQuestionCommentDAO = new QueryQuestionCommentDAO(); List<String[]> rows = new ArrayList<>(); processor.processCom...
[ "private", "static", "List", "<", "String", "[", "]", ">", "exportQueryPageCommentsAsCsv", "(", "ReplierExportStrategy", "replierExportStrategy", ",", "QueryPage", "queryPage", ",", "ReportPageCommentProcessor", "processor", ")", "{", "QueryQuestionCommentDAO", "queryQuesti...
Exports single query page into CSV rows using comment processor @param replierExportStrategy replier export strategy @param queryPage query page to be exported @param processor comment processor @return CSV rows
[ "Exports", "single", "query", "page", "into", "CSV", "rows", "using", "comment", "processor" ]
d91a0b54f954b33b4ee674a1bdf03612d76c3305
https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/edelphi/src/main/java/fi/metatavu/edelphi/utils/QueryDataUtils.java#L209-L234
train
Metatavu/edelphi
edelphi/src/main/java/fi/metatavu/edelphi/utils/QueryDataUtils.java
QueryDataUtils.getReplierExportStrategyLabel
private static String getReplierExportStrategyLabel(Locale locale, ReplierExportStrategy replierExportStrategy) { switch (replierExportStrategy) { case NONE: break; case HASH: return Messages.getInstance().getText(locale, "panelAdmin.query.export.csvReplierIdColumn"); case NAME: ...
java
private static String getReplierExportStrategyLabel(Locale locale, ReplierExportStrategy replierExportStrategy) { switch (replierExportStrategy) { case NONE: break; case HASH: return Messages.getInstance().getText(locale, "panelAdmin.query.export.csvReplierIdColumn"); case NAME: ...
[ "private", "static", "String", "getReplierExportStrategyLabel", "(", "Locale", "locale", ",", "ReplierExportStrategy", "replierExportStrategy", ")", "{", "switch", "(", "replierExportStrategy", ")", "{", "case", "NONE", ":", "break", ";", "case", "HASH", ":", "retur...
Returns label for given replier export strategy @param locale locale @param replierExportStrategy replier export strategy @return label
[ "Returns", "label", "for", "given", "replier", "export", "strategy" ]
d91a0b54f954b33b4ee674a1bdf03612d76c3305
https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/edelphi/src/main/java/fi/metatavu/edelphi/utils/QueryDataUtils.java#L279-L292
train
Metatavu/edelphi
edelphi/src/main/java/fi/metatavu/edelphi/utils/QueryDataUtils.java
QueryDataUtils.getReplierExportStrategyValue
private static String getReplierExportStrategyValue(ReplierExportStrategy replierExportStrategy, QueryReply queryReply) { if (queryReply != null) { User user = queryReply.getUser(); if (user != null) { switch (replierExportStrategy) { case NONE: break; case HASH: ...
java
private static String getReplierExportStrategyValue(ReplierExportStrategy replierExportStrategy, QueryReply queryReply) { if (queryReply != null) { User user = queryReply.getUser(); if (user != null) { switch (replierExportStrategy) { case NONE: break; case HASH: ...
[ "private", "static", "String", "getReplierExportStrategyValue", "(", "ReplierExportStrategy", "replierExportStrategy", ",", "QueryReply", "queryReply", ")", "{", "if", "(", "queryReply", "!=", "null", ")", "{", "User", "user", "=", "queryReply", ".", "getUser", "(",...
Returns user identifier for given replier export strategy @param replierExportStrategy replier export strategy @param queryReply reply @return user identifier
[ "Returns", "user", "identifier", "for", "given", "replier", "export", "strategy" ]
d91a0b54f954b33b4ee674a1bdf03612d76c3305
https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/edelphi/src/main/java/fi/metatavu/edelphi/utils/QueryDataUtils.java#L301-L319
train
Metatavu/edelphi
edelphi/src/main/java/fi/metatavu/edelphi/utils/QueryUtils.java
QueryUtils.appendQueryPageComments
public static void appendQueryPageComments(RequestContext requestContext, QueryPage queryPage) { QueryQuestionCommentDAO queryQuestionCommentDAO = new QueryQuestionCommentDAO(); PanelStamp activeStamp = RequestUtils.getActiveStamp(requestContext); List<QueryQuestionComment> rootComments = queryQuestionComme...
java
public static void appendQueryPageComments(RequestContext requestContext, QueryPage queryPage) { QueryQuestionCommentDAO queryQuestionCommentDAO = new QueryQuestionCommentDAO(); PanelStamp activeStamp = RequestUtils.getActiveStamp(requestContext); List<QueryQuestionComment> rootComments = queryQuestionComme...
[ "public", "static", "void", "appendQueryPageComments", "(", "RequestContext", "requestContext", ",", "QueryPage", "queryPage", ")", "{", "QueryQuestionCommentDAO", "queryQuestionCommentDAO", "=", "new", "QueryQuestionCommentDAO", "(", ")", ";", "PanelStamp", "activeStamp", ...
Loads the whole comment tree and appends it to requestContext for JSP to read. @param requestContext Smvcj request context @param queryPage query page
[ "Loads", "the", "whole", "comment", "tree", "and", "appends", "it", "to", "requestContext", "for", "JSP", "to", "read", "." ]
d91a0b54f954b33b4ee674a1bdf03612d76c3305
https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/edelphi/src/main/java/fi/metatavu/edelphi/utils/QueryUtils.java#L137-L155
train
Metatavu/edelphi
edelphi/src/main/java/fi/metatavu/edelphi/utils/MaterialUtils.java
MaterialUtils.findIndexPageDocument
public static LocalDocument findIndexPageDocument(Delfoi delfoi, Locale locale) { String urlName = String.format("%s-%s", INDEX_PAGE_URLNAME, locale.getLanguage()); return findLocalDocumentByParentAndUrlName(delfoi.getRootFolder(), urlName); }
java
public static LocalDocument findIndexPageDocument(Delfoi delfoi, Locale locale) { String urlName = String.format("%s-%s", INDEX_PAGE_URLNAME, locale.getLanguage()); return findLocalDocumentByParentAndUrlName(delfoi.getRootFolder(), urlName); }
[ "public", "static", "LocalDocument", "findIndexPageDocument", "(", "Delfoi", "delfoi", ",", "Locale", "locale", ")", "{", "String", "urlName", "=", "String", ".", "format", "(", "\"%s-%s\"", ",", "INDEX_PAGE_URLNAME", ",", "locale", ".", "getLanguage", "(", ")",...
Finds delfoi index page document @param delfoi delfoi @param locale document locale @return index page document or null if not defined
[ "Finds", "delfoi", "index", "page", "document" ]
d91a0b54f954b33b4ee674a1bdf03612d76c3305
https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/edelphi/src/main/java/fi/metatavu/edelphi/utils/MaterialUtils.java#L83-L86
train
Metatavu/edelphi
edelphi/src/main/java/fi/metatavu/edelphi/utils/MaterialUtils.java
MaterialUtils.createIndexPageDocument
public static LocalDocument createIndexPageDocument(Delfoi delfoi, Locale locale, User user) { LocalDocumentDAO localDocumentDAO = new LocalDocumentDAO(); String urlName = String.format("%s-%s", INDEX_PAGE_URLNAME, locale.getLanguage()); return localDocumentDAO.create(urlName, urlName, delfoi.getRootFolder(...
java
public static LocalDocument createIndexPageDocument(Delfoi delfoi, Locale locale, User user) { LocalDocumentDAO localDocumentDAO = new LocalDocumentDAO(); String urlName = String.format("%s-%s", INDEX_PAGE_URLNAME, locale.getLanguage()); return localDocumentDAO.create(urlName, urlName, delfoi.getRootFolder(...
[ "public", "static", "LocalDocument", "createIndexPageDocument", "(", "Delfoi", "delfoi", ",", "Locale", "locale", ",", "User", "user", ")", "{", "LocalDocumentDAO", "localDocumentDAO", "=", "new", "LocalDocumentDAO", "(", ")", ";", "String", "urlName", "=", "Strin...
Creates index page document @param delfoi delfoi @param locale locale @param user logged user @return created document
[ "Creates", "index", "page", "document" ]
d91a0b54f954b33b4ee674a1bdf03612d76c3305
https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/edelphi/src/main/java/fi/metatavu/edelphi/utils/MaterialUtils.java#L96-L100
train