diff --git a/dbs/social_ests.mv.db b/dbs/social_ests.mv.db index 1a36ac1..b1f9f90 100644 Binary files a/dbs/social_ests.mv.db and b/dbs/social_ests.mv.db differ diff --git a/dbs/social_ests.trace.db b/dbs/social_ests.trace.db index 82b6ec5..e1f73fb 100644 --- a/dbs/social_ests.trace.db +++ b/dbs/social_ests.trace.db @@ -529,3 +529,442 @@ org.h2.jdbc.JdbcSQLSyntaxErrorException: Syntax error in SQL statement " GROUP BY SUBSTRING(publicacao.momento FROM 1 FOR 10), comunidade.nome ORDER BY SUBSTRING(publicacao.momento FROM 1 FOR 10), comunidade.nome [42000-198] +2021-04-23 14:45:32 jdbc[3]: exception +org.h2.jdbc.JdbcSQLDataException: Parameter "#1" is not set; SQL statement: + + SELECT + comunidade.uid, + comunidade.nome, + comunidade.descricao, + comunidade.imagem, + ( + SELECT comunidade_id + FROM pessoa_comunidade + WHERE pessoa_id = ? + AND comunidade_id = comunidade.id + ) + FROM comunidade + WHERE comunidade.active = true + ORDER BY comunidade.nome + [90012-198] + at org.h2.message.DbException.getJdbcSQLException(DbException.java:587) + at org.h2.message.DbException.getJdbcSQLException(DbException.java:427) + at org.h2.message.DbException.get(DbException.java:205) + at org.h2.message.DbException.get(DbException.java:181) + at org.h2.expression.Parameter.checkSet(Parameter.java:94) + at org.h2.command.Prepared.checkParameters(Prepared.java:180) + at org.h2.command.CommandContainer.query(CommandContainer.java:144) + at org.h2.command.Command.executeQuery(Command.java:202) + at org.h2.jdbc.JdbcPreparedStatement.executeQuery(JdbcPreparedStatement.java:115) + at org.netuno.psamata.DB.executeQuery(SourceFile:460) + at org.netuno.psamata.DB.executeQuery(SourceFile:411) + at org.netuno.psamata.DB.query(SourceFile:381) + at org.netuno.tritao.resource.DB.query(SourceFile:761) + at org.graalvm.truffle/com.oracle.truffle.polyglot.HostMethodDesc$SingleMethod$MHBase.invokeHandle(HostMethodDesc.java:292) + at org.graalvm.truffle/com.oracle.truffle.polyglot.HostToGuestCodeCache$1.executeImpl(HostToGuestCodeCache.java:86) + at org.graalvm.truffle/com.oracle.truffle.polyglot.GuestToHostRootNode.execute(GuestToHostRootNode.java:82) + at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:591) + at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callInlined(OptimizedCallTarget.java:485) + at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.GraalRuntimeSupport.callInlined(GraalRuntimeSupport.java:120) + at org.graalvm.truffle/com.oracle.truffle.polyglot.GuestToHostRootNode.guestToHostCall(GuestToHostRootNode.java:108) + at org.graalvm.truffle/com.oracle.truffle.polyglot.HostMethodDesc$SingleMethod$MHBase.invokeGuestToHost(HostMethodDesc.java:319) + at org.graalvm.truffle/com.oracle.truffle.polyglot.HostExecuteNode.doInvoke(HostExecuteNode.java:809) + at org.graalvm.truffle/com.oracle.truffle.polyglot.HostExecuteNode.doOverloadedCached(HostExecuteNode.java:241) + at org.graalvm.truffle/com.oracle.truffle.polyglot.HostExecuteNodeGen.executeAndSpecialize(HostExecuteNodeGen.java:241) + at org.graalvm.truffle/com.oracle.truffle.polyglot.HostExecuteNodeGen.execute(HostExecuteNodeGen.java:94) + at org.graalvm.truffle/com.oracle.truffle.polyglot.HostObject.invokeMember(HostObject.java:412) + at org.graalvm.truffle/com.oracle.truffle.polyglot.HostObjectGen$InteropLibraryExports$Cached.invokeMemberNode_AndSpecialize(HostObjectGen.java:1393) + at org.graalvm.truffle/com.oracle.truffle.polyglot.HostObjectGen$InteropLibraryExports$Cached.invokeMember(HostObjectGen.java:1365) + at org.graalvm.truffle/com.oracle.truffle.api.interop.InteropLibraryGen$CachedDispatch.invokeMember(InteropLibraryGen.java:6078) + at com.oracle.truffle.js.nodes.function.JSFunctionCallNode$ForeignInvokeNode.executeCall(JSFunctionCallNode.java:1482) + at com.oracle.truffle.js.nodes.function.JSFunctionCallNode.executeAndSpecialize(JSFunctionCallNode.java:294) + at com.oracle.truffle.js.nodes.function.JSFunctionCallNode.executeCall(JSFunctionCallNode.java:240) + at com.oracle.truffle.js.nodes.function.JSFunctionCallNode$InvokeNode.execute(JSFunctionCallNode.java:711) + at com.oracle.truffle.js.nodes.access.WritePropertyNode.executeAndSpecialize(WritePropertyNode.java:263) + at com.oracle.truffle.js.nodes.access.WritePropertyNode.executeVoid(WritePropertyNode.java:235) + at com.oracle.truffle.js.nodes.control.AbstractBlockNode.executeVoid(AbstractBlockNode.java:80) + at com.oracle.truffle.js.nodes.control.AbstractBlockNode.executeVoid(AbstractBlockNode.java:55) + at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedBlockNode.executeVoid(OptimizedBlockNode.java:120) + at com.oracle.truffle.js.nodes.control.AbstractBlockNode.executeVoid(AbstractBlockNode.java:70) + at com.oracle.truffle.js.nodes.control.AbstractBlockNode.executeVoid(AbstractBlockNode.java:80) + at com.oracle.truffle.js.nodes.control.AbstractBlockNode.executeVoid(AbstractBlockNode.java:55) + at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedBlockNode.executeGeneric(OptimizedBlockNode.java:79) + at com.oracle.truffle.js.nodes.control.AbstractBlockNode.execute(AbstractBlockNode.java:75) + at com.oracle.truffle.js.nodes.function.FunctionBodyNode.execute(FunctionBodyNode.java:73) + at com.oracle.truffle.js.nodes.function.FunctionRootNode.executeInRealm(FunctionRootNode.java:147) + at com.oracle.truffle.js.runtime.JavaScriptRealmBoundaryRootNode.execute(JavaScriptRealmBoundaryRootNode.java:93) + at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:591) + at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:562) + at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:512) + at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:496) + at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:459) + at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:71) + at com.oracle.truffle.js.lang.JavaScriptLanguage$1.execute(JavaScriptLanguage.java:214) + at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:591) + at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:562) + at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:512) + at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:496) + at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callIndirect(OptimizedCallTarget.java:446) + at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.call(OptimizedCallTarget.java:434) + at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotContextImpl.eval(PolyglotContextImpl.java:941) + at org.graalvm.sdk/org.graalvm.polyglot.Context.eval(Context.java:347) + at org.graalvm.sdk/org.graalvm.polyglot.Context.eval(Context.java:373) + at org.netuno.psamata.script.GraalRunner.eval(SourceFile:179) + at org.netuno.tritao.config.Hili.runGraalScript(SourceFile:561) + at org.netuno.tritao.config.Hili.runScriptSandbox(SourceFile:401) + at org.netuno.tritao.config.Hili.runScriptSandbox(SourceFile:317) + at org.netuno.tritao.Service.execute(SourceFile:631) + at org.netuno.tritao.Service._main(SourceFile:572) + at jdk.internal.reflect.GeneratedMethodAccessor78.invoke(Unknown Source) + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.base/java.lang.reflect.Method.invoke(Method.java:566) + at org.netuno.proteu.Run.run(SourceFile:103) + at org.netuno.proteu.Run.(SourceFile:33) + at org.netuno.proteu.DynamicURL.build(SourceFile:153) + at org.netuno.proteu.Enterprise.processRequest(SourceFile:452) + at org.netuno.proteu.Enterprise.service(SourceFile:525) + at javax.servlet.http.HttpServlet.service(SourceFile:791) + at org.eclipse.jetty.servlet.ServletHolder$NotAsyncServlet.service(SourceFile:1402) + at org.eclipse.jetty.servlet.ServletHolder.handle(SourceFile:763) + at org.eclipse.jetty.servlet.ServletHandler.doHandle(SourceFile:551) + at org.eclipse.jetty.server.handler.ScopedHandler.handle(SourceFile:143) + at org.eclipse.jetty.security.SecurityHandler.handle(SourceFile:602) + at org.eclipse.jetty.server.handler.HandlerWrapper.handle(SourceFile:127) + at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(SourceFile:235) + at org.eclipse.jetty.server.session.SessionHandler.doHandle(SourceFile:1610) + at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(SourceFile:233) + at org.eclipse.jetty.server.handler.ContextHandler.doHandle(SourceFile:1369) + at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(SourceFile:188) + at org.eclipse.jetty.servlet.ServletHandler.doScope(SourceFile:489) + at org.eclipse.jetty.server.session.SessionHandler.doScope(SourceFile:1580) + at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(SourceFile:186) + at org.eclipse.jetty.server.handler.ContextHandler.doScope(SourceFile:1284) + at org.eclipse.jetty.server.handler.ScopedHandler.handle(SourceFile:141) + at org.eclipse.jetty.server.handler.HandlerList.handle(SourceFile:59) + at org.eclipse.jetty.server.handler.HandlerWrapper.handle(SourceFile:127) + at org.eclipse.jetty.server.Server.handle(SourceFile:501) + at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(SourceFile:383) + at org.eclipse.jetty.server.HttpChannel.dispatch(SourceFile:556) + at org.eclipse.jetty.server.HttpChannel.handle(SourceFile:375) + at org.eclipse.jetty.server.HttpConnection.onFillable(SourceFile:272) + at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(SourceFile:311) + at org.eclipse.jetty.io.FillInterest.fillable(SourceFile:103) + at org.eclipse.jetty.io.ChannelEndPoint$1.run(SourceFile:104) + at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(SourceFile:806) + at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(SourceFile:938) + at java.base/java.lang.Thread.run(Thread.java:834) +2021-04-23 14:46:53 jdbc[3]: exception +org.h2.jdbc.JdbcSQLDataException: Invalid value "1" for parameter "parameterIndex" [90008-198] + at org.h2.message.DbException.getJdbcSQLException(DbException.java:587) + at org.h2.message.DbException.getJdbcSQLException(DbException.java:427) + at org.h2.message.DbException.get(DbException.java:205) + at org.h2.message.DbException.getInvalidValueException(DbException.java:280) + at org.h2.jdbc.JdbcPreparedStatement.setParameter(JdbcPreparedStatement.java:1573) + at org.h2.jdbc.JdbcPreparedStatement.setInt(JdbcPreparedStatement.java:407) + at org.netuno.psamata.DB.b(SourceFile:695) + at org.netuno.psamata.DB.executeQuery(SourceFile:458) + at org.netuno.psamata.DB.query(SourceFile:421) + at org.netuno.tritao.resource.DB.query(SourceFile:822) + at org.graalvm.truffle/com.oracle.truffle.polyglot.HostMethodDesc$SingleMethod$MHBase.invokeHandle(HostMethodDesc.java:292) + at org.graalvm.truffle/com.oracle.truffle.polyglot.HostToGuestCodeCache$1.executeImpl(HostToGuestCodeCache.java:86) + at org.graalvm.truffle/com.oracle.truffle.polyglot.GuestToHostRootNode.execute(GuestToHostRootNode.java:82) + at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:591) + at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callInlined(OptimizedCallTarget.java:485) + at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.GraalRuntimeSupport.callInlined(GraalRuntimeSupport.java:120) + at org.graalvm.truffle/com.oracle.truffle.polyglot.GuestToHostRootNode.guestToHostCall(GuestToHostRootNode.java:108) + at org.graalvm.truffle/com.oracle.truffle.polyglot.HostMethodDesc$SingleMethod$MHBase.invokeGuestToHost(HostMethodDesc.java:319) + at org.graalvm.truffle/com.oracle.truffle.polyglot.HostExecuteNode.doInvoke(HostExecuteNode.java:809) + at org.graalvm.truffle/com.oracle.truffle.polyglot.HostExecuteNode.doOverloadedCached(HostExecuteNode.java:241) + at org.graalvm.truffle/com.oracle.truffle.polyglot.HostExecuteNodeGen.executeAndSpecialize(HostExecuteNodeGen.java:241) + at org.graalvm.truffle/com.oracle.truffle.polyglot.HostExecuteNodeGen.execute(HostExecuteNodeGen.java:94) + at org.graalvm.truffle/com.oracle.truffle.polyglot.HostObject.invokeMember(HostObject.java:412) + at org.graalvm.truffle/com.oracle.truffle.polyglot.HostObjectGen$InteropLibraryExports$Cached.invokeMemberNode_AndSpecialize(HostObjectGen.java:1393) + at org.graalvm.truffle/com.oracle.truffle.polyglot.HostObjectGen$InteropLibraryExports$Cached.invokeMember(HostObjectGen.java:1365) + at org.graalvm.truffle/com.oracle.truffle.api.interop.InteropLibraryGen$CachedDispatch.invokeMember(InteropLibraryGen.java:6078) + at com.oracle.truffle.js.nodes.function.JSFunctionCallNode$ForeignInvokeNode.executeCall(JSFunctionCallNode.java:1482) + at com.oracle.truffle.js.nodes.function.JSFunctionCallNode.executeAndSpecialize(JSFunctionCallNode.java:294) + at com.oracle.truffle.js.nodes.function.JSFunctionCallNode.executeCall(JSFunctionCallNode.java:240) + at com.oracle.truffle.js.nodes.function.JSFunctionCallNode$InvokeNode.execute(JSFunctionCallNode.java:711) + at com.oracle.truffle.js.nodes.access.WritePropertyNode.executeAndSpecialize(WritePropertyNode.java:263) + at com.oracle.truffle.js.nodes.access.WritePropertyNode.executeVoid(WritePropertyNode.java:235) + at com.oracle.truffle.js.nodes.control.AbstractBlockNode.executeVoid(AbstractBlockNode.java:80) + at com.oracle.truffle.js.nodes.control.AbstractBlockNode.executeVoid(AbstractBlockNode.java:55) + at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedBlockNode.executeVoid(OptimizedBlockNode.java:120) + at com.oracle.truffle.js.nodes.control.AbstractBlockNode.executeVoid(AbstractBlockNode.java:70) + at com.oracle.truffle.js.nodes.control.AbstractBlockNode.executeVoid(AbstractBlockNode.java:80) + at com.oracle.truffle.js.nodes.control.AbstractBlockNode.executeVoid(AbstractBlockNode.java:55) + at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedBlockNode.executeGeneric(OptimizedBlockNode.java:79) + at com.oracle.truffle.js.nodes.control.AbstractBlockNode.execute(AbstractBlockNode.java:75) + at com.oracle.truffle.js.nodes.function.FunctionBodyNode.execute(FunctionBodyNode.java:73) + at com.oracle.truffle.js.nodes.function.FunctionRootNode.executeInRealm(FunctionRootNode.java:147) + at com.oracle.truffle.js.runtime.JavaScriptRealmBoundaryRootNode.execute(JavaScriptRealmBoundaryRootNode.java:93) + at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:591) + at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:562) + at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:512) + at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:496) + at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:459) + at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:71) + at com.oracle.truffle.js.lang.JavaScriptLanguage$1.execute(JavaScriptLanguage.java:214) + at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:591) + at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:562) + at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:512) + at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:496) + at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callIndirect(OptimizedCallTarget.java:446) + at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.call(OptimizedCallTarget.java:434) + at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotContextImpl.eval(PolyglotContextImpl.java:941) + at org.graalvm.sdk/org.graalvm.polyglot.Context.eval(Context.java:347) + at org.graalvm.sdk/org.graalvm.polyglot.Context.eval(Context.java:373) + at org.netuno.psamata.script.GraalRunner.eval(SourceFile:179) + at org.netuno.tritao.config.Hili.runGraalScript(SourceFile:561) + at org.netuno.tritao.config.Hili.runScriptSandbox(SourceFile:401) + at org.netuno.tritao.config.Hili.runScriptSandbox(SourceFile:317) + at org.netuno.tritao.Service.execute(SourceFile:631) + at org.netuno.tritao.Service._main(SourceFile:572) + at jdk.internal.reflect.GeneratedMethodAccessor78.invoke(Unknown Source) + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.base/java.lang.reflect.Method.invoke(Method.java:566) + at org.netuno.proteu.Run.run(SourceFile:103) + at org.netuno.proteu.Run.(SourceFile:33) + at org.netuno.proteu.DynamicURL.build(SourceFile:153) + at org.netuno.proteu.Enterprise.processRequest(SourceFile:452) + at org.netuno.proteu.Enterprise.service(SourceFile:525) + at javax.servlet.http.HttpServlet.service(SourceFile:791) + at org.eclipse.jetty.servlet.ServletHolder$NotAsyncServlet.service(SourceFile:1402) + at org.eclipse.jetty.servlet.ServletHolder.handle(SourceFile:763) + at org.eclipse.jetty.servlet.ServletHandler.doHandle(SourceFile:551) + at org.eclipse.jetty.server.handler.ScopedHandler.handle(SourceFile:143) + at org.eclipse.jetty.security.SecurityHandler.handle(SourceFile:602) + at org.eclipse.jetty.server.handler.HandlerWrapper.handle(SourceFile:127) + at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(SourceFile:235) + at org.eclipse.jetty.server.session.SessionHandler.doHandle(SourceFile:1610) + at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(SourceFile:233) + at org.eclipse.jetty.server.handler.ContextHandler.doHandle(SourceFile:1369) + at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(SourceFile:188) + at org.eclipse.jetty.servlet.ServletHandler.doScope(SourceFile:489) + at org.eclipse.jetty.server.session.SessionHandler.doScope(SourceFile:1580) + at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(SourceFile:186) + at org.eclipse.jetty.server.handler.ContextHandler.doScope(SourceFile:1284) + at org.eclipse.jetty.server.handler.ScopedHandler.handle(SourceFile:141) + at org.eclipse.jetty.server.handler.HandlerList.handle(SourceFile:59) + at org.eclipse.jetty.server.handler.HandlerWrapper.handle(SourceFile:127) + at org.eclipse.jetty.server.Server.handle(SourceFile:501) + at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(SourceFile:383) + at org.eclipse.jetty.server.HttpChannel.dispatch(SourceFile:556) + at org.eclipse.jetty.server.HttpChannel.handle(SourceFile:375) + at org.eclipse.jetty.server.HttpConnection.onFillable(SourceFile:272) + at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(SourceFile:311) + at org.eclipse.jetty.io.FillInterest.fillable(SourceFile:103) + at org.eclipse.jetty.io.ChannelEndPoint$1.run(SourceFile:104) + at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(SourceFile:336) + at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(SourceFile:313) + at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(SourceFile:171) + at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(SourceFile:129) + at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(SourceFile:375) + at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(SourceFile:806) + at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(SourceFile:938) + at java.base/java.lang.Thread.run(Thread.java:834) +2021-04-23 14:47:12 jdbc[3]: exception +org.h2.jdbc.JdbcSQLDataException: Scalar subquery contains more than one row; SQL statement: + + SELECT + comunidade.uid, + comunidade.nome, + comunidade.descricao, + comunidade.imagem, + ( + SELECT comunidade_id + FROM pessoa_comunidade + --WHERE pessoa_id = ? + --AND comunidade_id = comunidade.id + ) AS seguindo + FROM comunidade + WHERE comunidade.active = true + ORDER BY comunidade.nome + [90053-198] + at org.h2.message.DbException.getJdbcSQLException(DbException.java:587) + at org.h2.message.DbException.getJdbcSQLException(DbException.java:427) + at org.h2.message.DbException.get(DbException.java:205) + at org.h2.message.DbException.get(DbException.java:181) + at org.h2.message.DbException.get(DbException.java:170) + at org.h2.expression.Subquery.getValue(Subquery.java:49) + at org.h2.expression.Alias.getValue(Alias.java:37) + at org.h2.command.dml.Select$LazyResultQueryFlat.fetchNextRow(Select.java:1886) + at org.h2.result.LazyResult.hasNext(LazyResult.java:80) + at org.h2.result.LazyResult.next(LazyResult.java:60) + at org.h2.command.dml.Select.queryFlat(Select.java:719) + at org.h2.command.dml.Select.queryWithoutCache(Select.java:895) + at org.h2.command.dml.Query.queryWithoutCacheLazyCheck(Query.java:151) + at org.h2.command.dml.Query.query(Query.java:435) + at org.h2.command.dml.Query.query(Query.java:397) + at org.h2.command.CommandContainer.query(CommandContainer.java:145) + at org.h2.command.Command.executeQuery(Command.java:202) + at org.h2.jdbc.JdbcPreparedStatement.executeQuery(JdbcPreparedStatement.java:115) + at org.netuno.psamata.DB.executeQuery(SourceFile:460) + at org.netuno.psamata.DB.executeQuery(SourceFile:411) + at org.netuno.psamata.DB.query(SourceFile:381) + at org.netuno.tritao.resource.DB.query(SourceFile:761) + at org.graalvm.truffle/com.oracle.truffle.polyglot.HostMethodDesc$SingleMethod$MHBase.invokeHandle(HostMethodDesc.java:292) + at org.graalvm.truffle/com.oracle.truffle.polyglot.HostToGuestCodeCache$1.executeImpl(HostToGuestCodeCache.java:86) + at org.graalvm.truffle/com.oracle.truffle.polyglot.GuestToHostRootNode.execute(GuestToHostRootNode.java:82) + at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:591) + at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callInlined(OptimizedCallTarget.java:485) + at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.GraalRuntimeSupport.callInlined(GraalRuntimeSupport.java:120) + at org.graalvm.truffle/com.oracle.truffle.polyglot.GuestToHostRootNode.guestToHostCall(GuestToHostRootNode.java:108) + at org.graalvm.truffle/com.oracle.truffle.polyglot.HostMethodDesc$SingleMethod$MHBase.invokeGuestToHost(HostMethodDesc.java:319) + at org.graalvm.truffle/com.oracle.truffle.polyglot.HostExecuteNode.doInvoke(HostExecuteNode.java:809) + at org.graalvm.truffle/com.oracle.truffle.polyglot.HostExecuteNode.doOverloadedCached(HostExecuteNode.java:241) + at org.graalvm.truffle/com.oracle.truffle.polyglot.HostExecuteNodeGen.executeAndSpecialize(HostExecuteNodeGen.java:241) + at org.graalvm.truffle/com.oracle.truffle.polyglot.HostExecuteNodeGen.execute(HostExecuteNodeGen.java:94) + at org.graalvm.truffle/com.oracle.truffle.polyglot.HostObject.invokeMember(HostObject.java:412) + at org.graalvm.truffle/com.oracle.truffle.polyglot.HostObjectGen$InteropLibraryExports$Cached.invokeMemberNode_AndSpecialize(HostObjectGen.java:1393) + at org.graalvm.truffle/com.oracle.truffle.polyglot.HostObjectGen$InteropLibraryExports$Cached.invokeMember(HostObjectGen.java:1365) + at org.graalvm.truffle/com.oracle.truffle.api.interop.InteropLibraryGen$CachedDispatch.invokeMember(InteropLibraryGen.java:6078) + at com.oracle.truffle.js.nodes.function.JSFunctionCallNode$ForeignInvokeNode.executeCall(JSFunctionCallNode.java:1482) + at com.oracle.truffle.js.nodes.function.JSFunctionCallNode.executeAndSpecialize(JSFunctionCallNode.java:294) + at com.oracle.truffle.js.nodes.function.JSFunctionCallNode.executeCall(JSFunctionCallNode.java:240) + at com.oracle.truffle.js.nodes.function.JSFunctionCallNode$InvokeNode.execute(JSFunctionCallNode.java:711) + at com.oracle.truffle.js.nodes.access.WritePropertyNode.executeAndSpecialize(WritePropertyNode.java:263) + at com.oracle.truffle.js.nodes.access.WritePropertyNode.executeVoid(WritePropertyNode.java:235) + at com.oracle.truffle.js.nodes.control.AbstractBlockNode.executeVoid(AbstractBlockNode.java:80) + at com.oracle.truffle.js.nodes.control.AbstractBlockNode.executeVoid(AbstractBlockNode.java:55) + at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedBlockNode.executeVoid(OptimizedBlockNode.java:120) + at com.oracle.truffle.js.nodes.control.AbstractBlockNode.executeVoid(AbstractBlockNode.java:70) + at com.oracle.truffle.js.nodes.control.AbstractBlockNode.executeVoid(AbstractBlockNode.java:80) + at com.oracle.truffle.js.nodes.control.AbstractBlockNode.executeVoid(AbstractBlockNode.java:55) + at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedBlockNode.executeGeneric(OptimizedBlockNode.java:79) + at com.oracle.truffle.js.nodes.control.AbstractBlockNode.execute(AbstractBlockNode.java:75) + at com.oracle.truffle.js.nodes.function.FunctionBodyNode.execute(FunctionBodyNode.java:73) + at com.oracle.truffle.js.nodes.function.FunctionRootNode.executeInRealm(FunctionRootNode.java:147) + at com.oracle.truffle.js.runtime.JavaScriptRealmBoundaryRootNode.execute(JavaScriptRealmBoundaryRootNode.java:93) + at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:591) + at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:562) + at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:512) + at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:496) + at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:459) + at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:71) + at com.oracle.truffle.js.lang.JavaScriptLanguage$1.execute(JavaScriptLanguage.java:214) + at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:591) + at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:562) + at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:512) + at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:496) + at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callIndirect(OptimizedCallTarget.java:446) + at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.call(OptimizedCallTarget.java:434) + at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotContextImpl.eval(PolyglotContextImpl.java:941) + at org.graalvm.sdk/org.graalvm.polyglot.Context.eval(Context.java:347) + at org.graalvm.sdk/org.graalvm.polyglot.Context.eval(Context.java:373) + at org.netuno.psamata.script.GraalRunner.eval(SourceFile:179) + at org.netuno.tritao.config.Hili.runGraalScript(SourceFile:561) + at org.netuno.tritao.config.Hili.runScriptSandbox(SourceFile:401) + at org.netuno.tritao.config.Hili.runScriptSandbox(SourceFile:317) + at org.netuno.tritao.Service.execute(SourceFile:631) + at org.netuno.tritao.Service._main(SourceFile:572) + at jdk.internal.reflect.GeneratedMethodAccessor78.invoke(Unknown Source) + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.base/java.lang.reflect.Method.invoke(Method.java:566) + at org.netuno.proteu.Run.run(SourceFile:103) + at org.netuno.proteu.Run.(SourceFile:33) + at org.netuno.proteu.DynamicURL.build(SourceFile:153) + at org.netuno.proteu.Enterprise.processRequest(SourceFile:452) + at org.netuno.proteu.Enterprise.service(SourceFile:525) + at javax.servlet.http.HttpServlet.service(SourceFile:791) + at org.eclipse.jetty.servlet.ServletHolder$NotAsyncServlet.service(SourceFile:1402) + at org.eclipse.jetty.servlet.ServletHolder.handle(SourceFile:763) + at org.eclipse.jetty.servlet.ServletHandler.doHandle(SourceFile:551) + at org.eclipse.jetty.server.handler.ScopedHandler.handle(SourceFile:143) + at org.eclipse.jetty.security.SecurityHandler.handle(SourceFile:602) + at org.eclipse.jetty.server.handler.HandlerWrapper.handle(SourceFile:127) + at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(SourceFile:235) + at org.eclipse.jetty.server.session.SessionHandler.doHandle(SourceFile:1610) + at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(SourceFile:233) + at org.eclipse.jetty.server.handler.ContextHandler.doHandle(SourceFile:1369) + at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(SourceFile:188) + at org.eclipse.jetty.servlet.ServletHandler.doScope(SourceFile:489) + at org.eclipse.jetty.server.session.SessionHandler.doScope(SourceFile:1580) + at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(SourceFile:186) + at org.eclipse.jetty.server.handler.ContextHandler.doScope(SourceFile:1284) + at org.eclipse.jetty.server.handler.ScopedHandler.handle(SourceFile:141) + at org.eclipse.jetty.server.handler.HandlerList.handle(SourceFile:59) + at org.eclipse.jetty.server.handler.HandlerWrapper.handle(SourceFile:127) + at org.eclipse.jetty.server.Server.handle(SourceFile:501) + at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(SourceFile:383) + at org.eclipse.jetty.server.HttpChannel.dispatch(SourceFile:556) + at org.eclipse.jetty.server.HttpChannel.handle(SourceFile:375) + at org.eclipse.jetty.server.HttpConnection.onFillable(SourceFile:272) + at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(SourceFile:311) + at org.eclipse.jetty.io.FillInterest.fillable(SourceFile:103) + at org.eclipse.jetty.io.ChannelEndPoint$1.run(SourceFile:104) + at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(SourceFile:336) + at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(SourceFile:313) + at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(SourceFile:171) + at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(SourceFile:129) + at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(SourceFile:375) + at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(SourceFile:806) + at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(SourceFile:938) + at java.base/java.lang.Thread.run(Thread.java:834) +2021-04-23 14:57:14 jdbc[3]: exception +org.h2.jdbc.JdbcSQLSyntaxErrorException: Column "comunidade.id" not found; SQL statement: +SELECT count(comunidade_id) + FROM pessoa_comunidade + WHERE pessoa_id = 2 + AND comunidade_id = comunidade.id + + [42122-198] + at org.h2.message.DbException.getJdbcSQLException(DbException.java:451) + at org.h2.message.DbException.getJdbcSQLException(DbException.java:427) + at org.h2.message.DbException.get(DbException.java:205) + at org.h2.message.DbException.get(DbException.java:181) + at org.h2.expression.ExpressionColumn.getColumnException(ExpressionColumn.java:176) + at org.h2.expression.ExpressionColumn.optimize(ExpressionColumn.java:158) + at org.h2.expression.condition.Comparison.optimize(Comparison.java:207) + at org.h2.expression.condition.ConditionAndOr.optimize(ConditionAndOr.java:134) + at org.h2.command.dml.Select.prepare(Select.java:1259) + at org.h2.command.Parser.prepareCommand(Parser.java:690) + at org.h2.engine.Session.prepareLocal(Session.java:629) + at org.h2.engine.Session.prepareCommand(Session.java:567) + at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1247) + at org.h2.jdbc.JdbcStatement.executeQuery(JdbcStatement.java:78) + at org.netuno.tritao.dev.Query._main(SourceFile:37) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) + at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) + at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) + at java.base/java.lang.reflect.Method.invoke(Method.java:566) + at org.netuno.proteu.Run.run(SourceFile:103) + at org.netuno.proteu.Run.(SourceFile:33) + at org.netuno.proteu.DynamicURL.build(SourceFile:153) + at org.netuno.proteu.Enterprise.processRequest(SourceFile:452) + at org.netuno.proteu.Enterprise.service(SourceFile:525) + at javax.servlet.http.HttpServlet.service(SourceFile:791) + at org.eclipse.jetty.servlet.ServletHolder$NotAsyncServlet.service(SourceFile:1402) + at org.eclipse.jetty.servlet.ServletHolder.handle(SourceFile:763) + at org.eclipse.jetty.servlet.ServletHandler.doHandle(SourceFile:551) + at org.eclipse.jetty.server.handler.ScopedHandler.handle(SourceFile:143) + at org.eclipse.jetty.security.SecurityHandler.handle(SourceFile:602) + at org.eclipse.jetty.server.handler.HandlerWrapper.handle(SourceFile:127) + at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(SourceFile:235) + at org.eclipse.jetty.server.session.SessionHandler.doHandle(SourceFile:1610) + at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(SourceFile:233) + at org.eclipse.jetty.server.handler.ContextHandler.doHandle(SourceFile:1369) + at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(SourceFile:188) + at org.eclipse.jetty.servlet.ServletHandler.doScope(SourceFile:489) + at org.eclipse.jetty.server.session.SessionHandler.doScope(SourceFile:1580) + at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(SourceFile:186) + at org.eclipse.jetty.server.handler.ContextHandler.doScope(SourceFile:1284) + at org.eclipse.jetty.server.handler.ScopedHandler.handle(SourceFile:141) + at org.eclipse.jetty.server.handler.HandlerList.handle(SourceFile:59) + at org.eclipse.jetty.server.handler.HandlerWrapper.handle(SourceFile:127) + at org.eclipse.jetty.server.Server.handle(SourceFile:501) + at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(SourceFile:383) + at org.eclipse.jetty.server.HttpChannel.dispatch(SourceFile:556) + at org.eclipse.jetty.server.HttpChannel.handle(SourceFile:375) + at org.eclipse.jetty.server.HttpConnection.onFillable(SourceFile:272) + at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(SourceFile:311) + at org.eclipse.jetty.io.FillInterest.fillable(SourceFile:103) + at org.eclipse.jetty.io.ChannelEndPoint$1.run(SourceFile:104) + at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(SourceFile:336) + at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(SourceFile:313) + at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(SourceFile:171) + at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(SourceFile:129) + at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(SourceFile:375) + at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(SourceFile:806) + at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(SourceFile:938) + at java.base/java.lang.Thread.run(Thread.java:834) diff --git a/server/core/social/userPessoa.js b/server/core/social/userPessoa.js new file mode 100644 index 0000000..91b0565 --- /dev/null +++ b/server/core/social/userPessoa.js @@ -0,0 +1,9 @@ + +const userPessoa = ()=> { + const dbPessoa = _db.queryFirst(` + SELECT pessoa.* + FROM pessoa + WHERE utilizador_id = ? + `, _user.id()) + return dbPessoa +} diff --git a/server/services/api/communities/get.js b/server/services/api/communities/get.js new file mode 100644 index 0000000..87fb03f --- /dev/null +++ b/server/services/api/communities/get.js @@ -0,0 +1,31 @@ +// _core : social/userPessoa + +const dbComunidades = _db.query(` + SELECT + comunidade.uid, + comunidade.nome, + comunidade.descricao, + ( + SELECT count(comunidade_id) + FROM pessoa_comunidade + WHERE pessoa_id = ? + AND comunidade_id = comunidade.id + ) AS seguindo + FROM comunidade + WHERE comunidade.active = true + ORDER BY comunidade.nome +`, userPessoa().getInt("id")) + +const data = _val.list() + +for (const dbComunidade of dbComunidades) { + data.add( + _val.map() + .set("uid", dbComunidade.getString("uid")) + .set("name", dbComunidade.getString("nome")) + .set("description", dbComunidade.getString("descricao")) + .set("following", dbComunidade.getInt("seguindo") > 0) + ) +} + +_out.json(data) diff --git a/server/services/api/communities/image.get.js b/server/services/api/communities/image.get.js new file mode 100644 index 0000000..3123f47 --- /dev/null +++ b/server/services/api/communities/image.get.js @@ -0,0 +1,19 @@ + +const dbComunidade = _db.queryFirst(` + SELECT imagem + FROM comunidade + WHERE uid = ? +`, _req.getString("uid")) + +_header + .contentTypeJPG() + .noCache() + +if (dbComunidade && dbComunidade.getString("imagem") != '') { + const storageImage = _storage.database( + "comunidade", + "imagem", + dbComunidade.getString("imagem") + ) + _out.copy(storageImage.inputStream()) +} diff --git a/server/services/api/communities/options.js b/server/services/api/communities/options.js new file mode 100644 index 0000000..f731105 --- /dev/null +++ b/server/services/api/communities/options.js @@ -0,0 +1 @@ +_out.json(_val.map().set("result", true)) \ No newline at end of file diff --git a/server/services/api/info.get.js b/server/services/api/info.get.js new file mode 100644 index 0000000..8d48146 --- /dev/null +++ b/server/services/api/info.get.js @@ -0,0 +1,14 @@ + +const dbPessoa = _db.queryFirst(` + SELECT pessoa.*, cidade.nome cidade + FROM pessoa INNER JOIN cidade ON pessoa.cidade_id = cidade.id + WHERE utilizador_id = ? +`, _user.id()) + +const data = _val.map() + .set("name", dbPessoa.getString("nome")) + .set("surname", dbPessoa.getString("apelido")) + .set("email", dbPessoa.getString("email")) + .set("city", dbPessoa.getString("cidade")) + +_out.json(data) \ No newline at end of file diff --git a/server/services/api/info.options.js b/server/services/api/info.options.js new file mode 100644 index 0000000..f731105 --- /dev/null +++ b/server/services/api/info.options.js @@ -0,0 +1 @@ +_out.json(_val.map().set("result", true)) \ No newline at end of file diff --git a/server/setup/_schema-form-2-comunidade.js b/server/setup/_schema-form-2-comunidade.js index ac73806..4a9aab1 100644 --- a/server/setup/_schema-form-2-comunidade.js +++ b/server/setup/_schema-form-2-comunidade.js @@ -85,6 +85,36 @@ _form.createComponentIfNotExists( .set("x", 1) .set("y", 2) ) +_form.createComponentIfNotExists( + "e96b426b-6f34-4dcc-8ac7-a8d22dd78b5e", + _val.init() + .set("colspan", 0) + .set("displayname", "Imagem") + .set("firebase", "") + .set("group_id", 0) + .set("height", 0) + .set("max", 0) + .set("min", 0) + .set("name", "imagem") + .set("notnull", false) + .set("primarykey", false) + .set("properties", "{}") + .set("rowspan", 0) + .set("tdheight", 0) + .set("tdwidth", 0) + .set("type", "image") + .set("uid", "374c3765-da8a-49be-bd9c-bcef985c9600") + .set("user_id", 0) + .set("whenedit", true) + .set("whenexport", true) + .set("whenfilter", true) + .set("whennew", true) + .set("whenresult", true) + .set("whenview", true) + .set("width", 0) + .set("x", 1) + .set("y", 4) +) _form.createComponentIfNotExists( "e96b426b-6f34-4dcc-8ac7-a8d22dd78b5e", _val.init() diff --git a/storage/database/comunidade/imagem/Download.netuno-s3zKBo98.jpg b/storage/database/comunidade/imagem/Download.netuno-s3zKBo98.jpg new file mode 100644 index 0000000..6f34889 Binary files /dev/null and b/storage/database/comunidade/imagem/Download.netuno-s3zKBo98.jpg differ diff --git a/storage/database/comunidade/imagem/Download.netuno-s3zKBo98___form.jpg b/storage/database/comunidade/imagem/Download.netuno-s3zKBo98___form.jpg new file mode 100644 index 0000000..1ec3151 Binary files /dev/null and b/storage/database/comunidade/imagem/Download.netuno-s3zKBo98___form.jpg differ diff --git a/storage/database/comunidade/imagem/Download.netuno-s3zKBo98___search.jpg b/storage/database/comunidade/imagem/Download.netuno-s3zKBo98___search.jpg new file mode 100644 index 0000000..3c11613 Binary files /dev/null and b/storage/database/comunidade/imagem/Download.netuno-s3zKBo98___search.jpg differ diff --git a/storage/database/comunidade/imagem/Download.netuno2-lTFqwKLG.jpg b/storage/database/comunidade/imagem/Download.netuno2-lTFqwKLG.jpg new file mode 100644 index 0000000..70ec10a Binary files /dev/null and b/storage/database/comunidade/imagem/Download.netuno2-lTFqwKLG.jpg differ diff --git a/storage/database/comunidade/imagem/Download.netuno2-lTFqwKLG___form.jpg b/storage/database/comunidade/imagem/Download.netuno2-lTFqwKLG___form.jpg new file mode 100644 index 0000000..f4147bd Binary files /dev/null and b/storage/database/comunidade/imagem/Download.netuno2-lTFqwKLG___form.jpg differ diff --git a/storage/database/comunidade/imagem/Download.netuno2-lTFqwKLG___search.jpg b/storage/database/comunidade/imagem/Download.netuno2-lTFqwKLG___search.jpg new file mode 100644 index 0000000..f944953 Binary files /dev/null and b/storage/database/comunidade/imagem/Download.netuno2-lTFqwKLG___search.jpg differ diff --git a/storage/database/comunidade/imagem/Download.netuno3-ButCwJhz.jpg b/storage/database/comunidade/imagem/Download.netuno3-ButCwJhz.jpg new file mode 100644 index 0000000..759a122 Binary files /dev/null and b/storage/database/comunidade/imagem/Download.netuno3-ButCwJhz.jpg differ diff --git a/storage/database/comunidade/imagem/Download.netuno3-ButCwJhz___form.jpg b/storage/database/comunidade/imagem/Download.netuno3-ButCwJhz___form.jpg new file mode 100644 index 0000000..2d4666d Binary files /dev/null and b/storage/database/comunidade/imagem/Download.netuno3-ButCwJhz___form.jpg differ diff --git a/storage/database/comunidade/imagem/Download.netuno3-ButCwJhz___search.jpg b/storage/database/comunidade/imagem/Download.netuno3-ButCwJhz___search.jpg new file mode 100644 index 0000000..1776916 Binary files /dev/null and b/storage/database/comunidade/imagem/Download.netuno3-ButCwJhz___search.jpg differ diff --git a/website/package.json b/website/package.json index 7570f87..391f889 100644 --- a/website/package.json +++ b/website/package.json @@ -3,6 +3,7 @@ "version": "0.1.0", "private": true, "dependencies": { + "@ant-design/icons": "^4.6.2", "@netuno/auth-client": "^1.0.3", "@netuno/service-client": "^1.0.7", "@testing-library/jest-dom": "^5.11.10", diff --git a/website/src/App.js b/website/src/App.js index e095aeb..acd9b7e 100644 --- a/website/src/App.js +++ b/website/src/App.js @@ -1,5 +1,6 @@ import React, { useState, useEffect } from "react"; -import _service from '@netuno/service-client'; + +import _auth from '@netuno/auth-client'; import { Layout, Menu } from 'antd'; @@ -14,6 +15,7 @@ import Home from './pages/Home'; import Login from './pages/Login'; import Register from './pages/Register'; import Main from './pages/Main'; +import Communities from './pages/Communities'; import logo from './logo.svg'; import './App.less'; @@ -21,27 +23,25 @@ import './App.less'; const { Header, Footer, Content } = Layout; export default () => { - const [ data, setData ] = useState([]); - useEffect(()=> { - _service({ - url: "pessoas", - success: (response) => { - setData(response.json); - }, - fail: (e) => { - console.log("Service Error", e); - } - }); - }, []); - + let menuItems = null; + if (_auth.isLogged()) { + menuItems = <> + Principal + Comunidades + ; + } else { + menuItems = <> + Home + Login + Register + ; + } return (
- Home - Login - Register + {menuItems}
@@ -55,6 +55,9 @@ export default () => {
+ + + diff --git a/website/src/pages/Communities/Item/index.js b/website/src/pages/Communities/Item/index.js new file mode 100644 index 0000000..8cf68af --- /dev/null +++ b/website/src/pages/Communities/Item/index.js @@ -0,0 +1,23 @@ +import React, { useState, useEffect } from "react"; + +import { Redirect } from "react-router-dom"; + +import { Button, Spin } from 'antd'; +import { CheckCircleOutlined } from '@ant-design/icons'; + +import _auth from '@netuno/auth-client'; + +import _service from '@netuno/service-client'; + +export default ({ data }) => { + const servicesPrefix = _service.config().prefix; + return ( +
  • +

    + { data.name } +   + { data.following ? : null } +

    +
  • + ); +}; diff --git a/website/src/pages/Communities/Item/index.less b/website/src/pages/Communities/Item/index.less new file mode 100644 index 0000000..e69de29 diff --git a/website/src/pages/Communities/index.js b/website/src/pages/Communities/index.js new file mode 100644 index 0000000..061673f --- /dev/null +++ b/website/src/pages/Communities/index.js @@ -0,0 +1,58 @@ +import React, { useState, useEffect } from "react"; + +import { Redirect } from "react-router-dom"; + +import { Button, Spin } from 'antd'; +import { CheckCircleOutlined } from '@ant-design/icons'; + +import _auth from '@netuno/auth-client'; + +import _service from '@netuno/service-client'; + +import Item from './Item'; + +import './index.less'; + +export default () => { + if (!_auth.isLogged()) { + return ; + } + const [ loading, setLoading ] = useState(true); + const [ communities, setCommunities ] = useState([]); + useEffect(()=> { + _service({ + method: 'GET', + url: "api/communities", + success: (response) => { + setLoading(false); + setCommunities(response.json); + }, + fail: (e) => { + setLoading(false); + console.log("Service User Info Error", e); + } + }); + }, []); + const onLogout = ()=> { + _auth.logout(); + setLoading(true); + } + if (loading) { + return ; + } + return ( +
    +
      + { + communities.map( + (community) => { + return ( + + ); + } + ) + } +
    +
    + ); +}; diff --git a/website/src/pages/Communities/index.less b/website/src/pages/Communities/index.less new file mode 100644 index 0000000..e807d4b --- /dev/null +++ b/website/src/pages/Communities/index.less @@ -0,0 +1,19 @@ + +.communities { + &__list { + list-style: none; + padding: 0; + margin: 0; + > li { + height: 200px; + background-size: cover; + background-repeat: no-repeat; + background-position: 50% 50%; + > h1 { + background-color: rgba(0, 0, 0, 0.75); + color: #ffffff; + padding: 10px; + } + } + } +} diff --git a/website/src/pages/Login/index.js b/website/src/pages/Login/index.js index 15258df..0bcec80 100644 --- a/website/src/pages/Login/index.js +++ b/website/src/pages/Login/index.js @@ -37,7 +37,8 @@ export default () => { }; if (_auth.isLogged()) { - return ; + window.location = '/main'; + //return ; } return (
    diff --git a/website/src/pages/Main/index.js b/website/src/pages/Main/index.js index d6e5d03..7daca12 100644 --- a/website/src/pages/Main/index.js +++ b/website/src/pages/Main/index.js @@ -6,18 +6,34 @@ import { Button } from 'antd'; import _auth from '@netuno/auth-client'; +import _service from '@netuno/service-client'; + export default () => { - const [ loading, setLoading ] = useState(false); if (!_auth.isLogged()) { return ; } + const [ loading, setLoading ] = useState(false); + const [ userInfo, setUserInfo ] = useState(null); + useEffect(()=> { + _service({ + method: 'GET', + url: "api/info", + success: (response) => { + setUserInfo(response.json); + }, + fail: (e) => { + console.log("Service User Info Error", e); + } + }); + }, []); const onLogout = ()=> { _auth.logout(); setLoading(true); + window.location = '/'; } return (
    -

    Olá...

    +

    Olá { userInfo && userInfo.name }...

    );