"El primer paso para llegar a cualquier parte es decidir que no te vas a quedar donde estás.... da tu primer paso hoy no importa que no veas el camino......"
lunes, 16 de diciembre de 2013
Web Script Response Codes
##
## Web Script Response Codes
##
webscript.code.100.name=Continue
webscript.code.100.description=Client can continue.
webscript.code.101.name=Switching Protocols
webscript.code.101.description=The server is switching protocols according to Upgrade header.
webscript.code.200.name=OK
webscript.code.200.description=The request succeeded normally.
webscript.code.201.name=Created
webscript.code.201.description=Request succeeded and created a new resource on the server.
webscript.code.202.name=Accepted
webscript.code.202.description=Request was accepted for processing, but was not completed.
webscript.code.203.name=Non authoritative information
webscript.code.203.description=The meta information presented by the client did not originate from the server.
webscript.code.204.name=No Content
webscript.code.204.description=The request succeeded but that there was no new information to return.
webscript.code.205.name=Reset Content
webscript.code.205.description=The agent SHOULD reset the document view which caused the request to be sent.
webscript.code.206.name=Partial Content
webscript.code.206.description=The server has fulfilled the partial GET request for the resource.
webscript.code.300.name=Multiple Choices
webscript.code.300.description=The requested resource corresponds to any one of a set of representations, each with its own specific location.
webscript.code.301.name=Moved Permanently
webscript.code.301.description=The resource has permanently moved to a new location, and that future references should use a new URI with their requests.
webscript.code.302.name=Moved Temporarily
webscript.code.302.description=The resource has temporarily moved to another location, but that future references should still use the original URI to access the resource.
webscript.code.303.name=See Other
webscript.code.303.description=The response to the request can be found under a different URI.
webscript.code.304.name=Not Modified
webscript.code.304.description=A conditional GET operation found that the resource was available and not modified.
webscript.code.305.name=Use Proxy
webscript.code.305.description=The requested resource MUST be accessed through the proxy given by the Location field.
webscript.code.400.name=Bad Request
webscript.code.400.description=Request sent by the client was syntactically incorrect.
webscript.code.401.name=Unauthorized
webscript.code.401.description=The request requires HTTP authentication.
webscript.code.402.name=Payment Required
webscript.code.402.description=Reserved for future use.
webscript.code.403.name=Forbidden
webscript.code.403.description=Server understood the request but refused to fulfill it.
webscript.code.404.name=Not Found
webscript.code.404.description=Requested resource is not available.
webscript.code.405.name=Method Not Allowed
webscript.code.405.description=The method specified in the Request-Line is not allowed for the resource identified by the Request-URI.
webscript.code.406.name=Not Acceptable
webscript.code.406.description=The resource identified by the request is only capable of generating response entities which have content characteristics not acceptable according to the accept headers sent in the request.
webscript.code.407.name=Proxy Authentication Required
webscript.code.407.description=The client MUST first authenticate itself with the proxy.
webscript.code.408.name=Request Timeout
webscript.code.408.description=The client did not produce a request within the time that the server was prepared to wait.
webscript.code.409.name=Conflict
webscript.code.409.description=Request could not be completed due to a conflict with the current state of the resource.
webscript.code.410.name=Gone
webscript.code.410.description=Resource is no longer available at the server and no forwarding address is known.
webscript.code.411.name=Length required
webscript.code.411.description=Request cannot be handled without a defined Content-Length.
webscript.code.412.name=Precondition Failed
webscript.code.412.description=The precondition given in one or more of the request-header fields evaluated to false when it was tested on the server.
webscript.code.413.name=Request Entity Too Large
webscript.code.413.description=The server is refusing to process the request because the request entity is larger than the server is willing or able to process.
webscript.code.414.name=Request URI Too Long
webscript.code.414.description=The server is refusing to service the request because the Request-URI is longer than the server is willing to interpret.
webscript.code.415.name=Unsupported Media Type
webscript.code.415.description=The server is refusing to service the request because the entity of the request is in a format not supported by the requested resource for the requested method.
webscript.code.416.name=Requested Range Not Satisfiable
webscript.code.416.description=The server cannot serve the requested byte range.
webscript.code.417.name=Expectation Failed
webscript.code.417.description=Server could not meet the expectation given in the Expect request header.
webscript.code.500.name=Internal Error
webscript.code.500.description=An error inside the HTTP server which prevented it from fulfilling the request.
webscript.code.501.name=Not Implemented
webscript.code.501.description=The HTTP server does not support the functionality needed to fulfill the request.
webscript.code.502.name=Bad Gateway
webscript.code.502.description=HTTP server received an invalid response from a server it consulted when acting as a proxy or gateway.
webscript.code.503.name=Service Unavailable
webscript.code.503.description=The HTTP server is temporarily overloaded, and unable to handle the request.
webscript.code.504.name=Gateway Timeout
webscript.code.504.description=Server did not receive a timely response from the upstream server while acting as a gateway or proxy.
webscript.code.505.name=HTTP version not supported
webscript.code.505.description=Server does not support or refuses to support the HTTP protocol version that was used in the request message.
##
## Test Web Script Server Help
##
testserver.help=alfresco/messages/webscripts-test-help.txt
## Web Script Response Codes
##
webscript.code.100.name=Continue
webscript.code.100.description=Client can continue.
webscript.code.101.name=Switching Protocols
webscript.code.101.description=The server is switching protocols according to Upgrade header.
webscript.code.200.name=OK
webscript.code.200.description=The request succeeded normally.
webscript.code.201.name=Created
webscript.code.201.description=Request succeeded and created a new resource on the server.
webscript.code.202.name=Accepted
webscript.code.202.description=Request was accepted for processing, but was not completed.
webscript.code.203.name=Non authoritative information
webscript.code.203.description=The meta information presented by the client did not originate from the server.
webscript.code.204.name=No Content
webscript.code.204.description=The request succeeded but that there was no new information to return.
webscript.code.205.name=Reset Content
webscript.code.205.description=The agent SHOULD reset the document view which caused the request to be sent.
webscript.code.206.name=Partial Content
webscript.code.206.description=The server has fulfilled the partial GET request for the resource.
webscript.code.300.name=Multiple Choices
webscript.code.300.description=The requested resource corresponds to any one of a set of representations, each with its own specific location.
webscript.code.301.name=Moved Permanently
webscript.code.301.description=The resource has permanently moved to a new location, and that future references should use a new URI with their requests.
webscript.code.302.name=Moved Temporarily
webscript.code.302.description=The resource has temporarily moved to another location, but that future references should still use the original URI to access the resource.
webscript.code.303.name=See Other
webscript.code.303.description=The response to the request can be found under a different URI.
webscript.code.304.name=Not Modified
webscript.code.304.description=A conditional GET operation found that the resource was available and not modified.
webscript.code.305.name=Use Proxy
webscript.code.305.description=The requested resource MUST be accessed through the proxy given by the Location field.
webscript.code.400.name=Bad Request
webscript.code.400.description=Request sent by the client was syntactically incorrect.
webscript.code.401.name=Unauthorized
webscript.code.401.description=The request requires HTTP authentication.
webscript.code.402.name=Payment Required
webscript.code.402.description=Reserved for future use.
webscript.code.403.name=Forbidden
webscript.code.403.description=Server understood the request but refused to fulfill it.
webscript.code.404.name=Not Found
webscript.code.404.description=Requested resource is not available.
webscript.code.405.name=Method Not Allowed
webscript.code.405.description=The method specified in the Request-Line is not allowed for the resource identified by the Request-URI.
webscript.code.406.name=Not Acceptable
webscript.code.406.description=The resource identified by the request is only capable of generating response entities which have content characteristics not acceptable according to the accept headers sent in the request.
webscript.code.407.name=Proxy Authentication Required
webscript.code.407.description=The client MUST first authenticate itself with the proxy.
webscript.code.408.name=Request Timeout
webscript.code.408.description=The client did not produce a request within the time that the server was prepared to wait.
webscript.code.409.name=Conflict
webscript.code.409.description=Request could not be completed due to a conflict with the current state of the resource.
webscript.code.410.name=Gone
webscript.code.410.description=Resource is no longer available at the server and no forwarding address is known.
webscript.code.411.name=Length required
webscript.code.411.description=Request cannot be handled without a defined Content-Length.
webscript.code.412.name=Precondition Failed
webscript.code.412.description=The precondition given in one or more of the request-header fields evaluated to false when it was tested on the server.
webscript.code.413.name=Request Entity Too Large
webscript.code.413.description=The server is refusing to process the request because the request entity is larger than the server is willing or able to process.
webscript.code.414.name=Request URI Too Long
webscript.code.414.description=The server is refusing to service the request because the Request-URI is longer than the server is willing to interpret.
webscript.code.415.name=Unsupported Media Type
webscript.code.415.description=The server is refusing to service the request because the entity of the request is in a format not supported by the requested resource for the requested method.
webscript.code.416.name=Requested Range Not Satisfiable
webscript.code.416.description=The server cannot serve the requested byte range.
webscript.code.417.name=Expectation Failed
webscript.code.417.description=Server could not meet the expectation given in the Expect request header.
webscript.code.500.name=Internal Error
webscript.code.500.description=An error inside the HTTP server which prevented it from fulfilling the request.
webscript.code.501.name=Not Implemented
webscript.code.501.description=The HTTP server does not support the functionality needed to fulfill the request.
webscript.code.502.name=Bad Gateway
webscript.code.502.description=HTTP server received an invalid response from a server it consulted when acting as a proxy or gateway.
webscript.code.503.name=Service Unavailable
webscript.code.503.description=The HTTP server is temporarily overloaded, and unable to handle the request.
webscript.code.504.name=Gateway Timeout
webscript.code.504.description=Server did not receive a timely response from the upstream server while acting as a gateway or proxy.
webscript.code.505.name=HTTP version not supported
webscript.code.505.description=Server does not support or refuses to support the HTTP protocol version that was used in the request message.
##
## Test Web Script Server Help
##
testserver.help=alfresco/messages/webscripts-test-help.txt
viernes, 1 de noviembre de 2013
ALFRESCO + CMIS + .NET
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using DotCMIS; using DotCMIS.Client.Impl; using DotCMIS.Client; using DotCMIS.Data.Impl; using DotCMIS.Data.Extensions; using System.Web; namespace IntegracionCMIS { class Program { static void Main(string[] args) { Program program = new Program(); program.ConnectingUsingAtomPub_CreateFolder(); } private void ConnectingUsingAtomPub_CreateFolder() { // define dictonary with key value pair Dictionaryparameters = new Dictionary (); // define binding type, in our example we are using ATOMPUB as stated above parameters[DotCMIS.SessionParameter.BindingType] = BindingType.AtomPub; // define CMIS available path which is already available under alfresco parameters[DotCMIS.SessionParameter.AtomPubUrl] = "http://192.168.100.44:8080/alfresco/service/cmis"; // alfresco portal admin user name parameters[DotCMIS.SessionParameter.User] = "edmon"; // alfresco portal admin password parameters[DotCMIS.SessionParameter.Password] = "edmon"; // define session factory SessionFactory factory = SessionFactory.NewInstance(); // using session factory get the default repository, on this repository we would be performing actions & create session on this repository ISession session = factory.GetRepositories(parameters)[0].CreateSession(); // get the root folder in which we would be creating a new folder IFolder root = session.GetRootFolder(); // print statement before creating a folder Console.Write("Creating 'NewFolder: Surya' in the root folder"); // define dictory with key value pair for new folder that we are going to create IDictionary properties = new Dictionary (); // below property define name properties.Add(PropertyIds.Name, "Surya"); // below propert define object type & object types can be folder, document etc.., in our case it is folder properties.Add(PropertyIds.ObjectTypeId, "cmis:folder"); // create a folder in root folder which we defined above @ session.GetRootFolder() IFolder newFolder = root.CreateFolder(properties); // check to see did it work? IItemEnumerable childrens = root.GetChildren(); // writing all folders Console.Write("Now finding the following objects in the root folder:-"); foreach (ICmisObject item in childrens) { Console.Write("
Name: " + item.Name); } } // Navegación de la carpeta private void ConnectingUsingAtomPub_FolderNavigation() { Dictionaryparameters = new Dictionary (); parameters[DotCMIS.SessionParameter.BindingType] = BindingType.AtomPub; parameters[DotCMIS.SessionParameter.AtomPubUrl] = "https://localhost:8080/alfresco/service/cmis"; parameters[DotCMIS.SessionParameter.User] = "edmon"; parameters[DotCMIS.SessionParameter.Password] = "edmon"; SessionFactory factory = SessionFactory.NewInstance(); // create a session object for default repository ISession session = factory.GetRepositories(parameters)[0].CreateSession(); // get all folders IFolder root = session.GetRootFolder(); // print each object foreach (ITree t in root.GetDescendants(-1)) { Console.Write(t); } } //Crear un documento private void ConnectingUsingAtomPub_CreateDocument() { Dictionary parameters = new Dictionary (); parameters[DotCMIS.SessionParameter.BindingType] = BindingType.AtomPub; parameters[DotCMIS.SessionParameter.AtomPubUrl] = "https://localhost:8080/alfresco/service/cmis"; parameters[DotCMIS.SessionParameter.User] = "edmon"; parameters[DotCMIS.SessionParameter.Password] = "edmon"; SessionFactory factory = SessionFactory.NewInstance(); ISession session = factory.GetRepositories(parameters)[0].CreateSession(); IOperationContext oc = session.CreateOperationContext(); oc.IncludeAcls = true; IFolder folder = session.GetRootFolder(); // document name string formattedName = "SuryaPrakashTesting.doc"; // define dictionary IDictionary properties = new Dictionary (); properties.Add(PropertyIds.Name, formattedName); // define object type as document, as we wanted to create document properties.Add(PropertyIds.ObjectTypeId, "cmis:document"); // read a empty document with empty bytes // fileUpload1: is a .net file upload control ContentStream contentStream = new ContentStream { FileName = formattedName, MimeType = "application/msword", Length = fileUpload1.FileBytes.Length, Stream = new MemoryStream(fileUpload1.FileBytes) }; // this statment would create document in default repository folder.CreateDocument(properties, contentStream, null); } // Crear una version del documento private void ConnectingUsingAtomPub_CreateDocument_Version() { Dictionary parameters = new Dictionary (); parameters[DotCMIS.SessionParameter.BindingType] = BindingType.AtomPub; parameters[DotCMIS.SessionParameter.AtomPubUrl] = "https://localhost:8080/alfresco/service/cmis"; parameters[DotCMIS.SessionParameter.User] = "edmon"; parameters[DotCMIS.SessionParameter.Password] = "edmon"; SessionFactory factory = SessionFactory.NewInstance(); ISession session = factory.GetRepositories(parameters)[0].CreateSession(); // get / define the document, which you would want to update with versioning Document doc = ((Document)session.GetObject("workspace://SpacesStore/c38e8efa-04dd-46e1-938c-a20884dff5ee")); string objId = string.Empty; try { // checkout the doc IObjectId Iobj = doc.CheckOut(); objId = Iobj.Id; Console.Write("Checked out doc ID: " + objId); } catch (Exception cbe) { // cancel the checkout incase of exception doc.CancelCheckOut(); Console.Write("Exception checking out; must be checked out already: " + cbe.Message); } // define dictionary for document IDictionary properties = new Dictionary (); properties.Add(PropertyIds.Name, "test.doc"); properties.Add(PropertyIds.ObjectTypeId, "cmis:document"); properties.Add(PropertyIds.ObjectId, objId); IFolder folder = session.GetRootFolder(); // define new document stream object ContentStream contentStream = new ContentStream { FileName = "test.doc", MimeType = "application/msword", Length = fileUpload1.FileBytes.Length, Stream = new MemoryStream(fileUpload1.FileBytes) }; // create/update the document with new stream & version folder.CreateDocument(properties, contentStream, DotCMIS.Enums.VersioningState.CheckedOut); // finally check in the document IObjectId ob = doc.CheckIn(true, properties, null, "testing prakash checking"); } } }
jueves, 24 de octubre de 2013
CONFIGURAR BASE DE DATOS ORACLE ANTES DE INSTALAR ALFRESCO 4.X
Esta configuración la realize antes de intalar Alfresco en una base de datos Oracle, espero les sirva si alguien tiene sugerencias para mejorar bienvenidas
Saludos
--Crear un tablespace para los datos
CREATE TABLESPACE "TS_ALFRESCO" LOGGING DATAFILE 'C:\app\Oracle\product\11.1.0\db_1\oradata\alfresco\ALFRESCODAT.dbf' SIZE 200M EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO--Crear un tablespace para los indices
CREATE TABLESPACE "TS_ALFRESCO_IDX" LOGGING DATAFILE 'C:\app\Oracle\product\11.1.0\db_1\oradata\alfresco\ALFRESCOIDX.dbf' SIZE 200M EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO--Crear el usuario que va a trabajar sobre estos tablespace
CREATE USER "ALFRESCOUSER" PROFILE "DEFAULT" IDENTIFIED BY "ALFRESCOPWD" DEFAULT TABLESPACE "TS_ALFRESCO" TEMPORARY TABLESPACE "TEMP" ACCOUNT UNLOCK;--Asignacion de permisos para el usuario ALFRESCOUSER
GRANT "CONNECT" TO "ALFRESCOUSER" GRANT "RESOURCE" TO "ALFRESCOUSER"--permisos complementarios
GRANT ALTER ANY INDEX TO "ALFRESCOUSER"; GRANT ALTER ANY SEQUENCE TO "ALFRESCOUSER"; GRANT ALTER ANY TABLE TO "ALFRESCOUSER"; GRANT ALTER ANY TRIGGER TO "ALFRESCOUSER"; GRANT CREATE ANY INDEX TO "ALFRESCOUSER"; GRANT CREATE ANY SEQUENCE TO "ALFRESCOUSER"; GRANT CREATE ANY SYNONYM TO "ALFRESCOUSER"; GRANT CREATE ANY TABLE TO "ALFRESCOUSER"; GRANT CREATE ANY TRIGGER TO "ALFRESCOUSER"; GRANT CREATE ANY VIEW TO "ALFRESCOUSER"; GRANT CREATE PROCEDURE TO "ALFRESCOUSER"; GRANT CREATE PUBLIC SYNONYM TO "ALFRESCOUSER"; GRANT CREATE TRIGGER TO "ALFRESCOUSER"; GRANT CREATE VIEW TO "ALFRESCOUSER"; GRANT DELETE ANY TABLE TO "ALFRESCOUSER"; GRANT DROP ANY INDEX TO "ALFRESCOUSER"; GRANT DROP ANY SEQUENCE TO "ALFRESCOUSER"; GRANT DROP ANY TABLE TO "ALFRESCOUSER"; GRANT DROP ANY TRIGGER TO "ALFRESCOUSER"; GRANT DROP ANY VIEW TO "ALFRESCOUSER"; GRANT INSERT ANY TABLE TO "ALFRESCOUSER"; GRANT QUERY REWRITE TO "ALFRESCOUSER"; GRANT SELECT ANY TABLE TO "ALFRESCOUSER"; GRANT UNLIMITED TABLESPACE TO "ALFRESCOUSER";-- crear un esquema de la base de datos
CREATE SCHEMA AUTHORIZATION ALFRESCOUSER;Si es el caso que instalamos algo mal y necesitamos borrar las tablas que creamos ejecutamos el siguiente script o los drop directamente --borrar las tablas de un esquema
SELECT 'DROP TABLE '||table_name||' CASCADE CONSTRAINTS;' FROM ALL_TABLES WHERE owner='ALFRESCOUSER'; SELECT 'DROP TABLE '||table_name||' CASCADE CONSTRAINTS;' FROM user_tables SELECT 'DROP VIEW '||VIEW_NAME||';' FROM user_views SELECT 'DROP SEQUENCE '|| SEQUENCE_NAME||';' FROM user_sequences DROP TABLE ALF_NAMESPACE CASCADE CONSTRAINTS; DROP TABLE ALF_APPLIED_PATCH CASCADE CONSTRAINTS; DROP TABLE ALF_BOOTSTRAP_LOCK CASCADE CONSTRAINTS; DROP TABLE ACT_ID_INFO CASCADE CONSTRAINTS; DROP TABLE ACT_ID_USER CASCADE CONSTRAINTS; DROP TABLE ACT_ID_MEMBERSHIP CASCADE CONSTRAINTS; DROP TABLE ACT_ID_GROUP CASCADE CONSTRAINTS; DROP TABLE ACT_HI_ATTACHMENT CASCADE CONSTRAINTS; DROP TABLE ACT_HI_COMMENT CASCADE CONSTRAINTS; DROP TABLE ACT_HI_DETAIL CASCADE CONSTRAINTS; DROP TABLE ACT_HI_TASKINST CASCADE CONSTRAINTS; DROP TABLE ACT_HI_ACTINST CASCADE CONSTRAINTS; DROP TABLE ACT_HI_PROCINST CASCADE CONSTRAINTS; DROP TABLE ACT_RU_EVENT_SUBSCR CASCADE CONSTRAINTS; DROP TABLE ACT_RU_VARIABLE CASCADE CONSTRAINTS; DROP TABLE ACT_RU_IDENTITYLINK CASCADE CONSTRAINTS; DROP TABLE ACT_RU_TASK CASCADE CONSTRAINTS; DROP TABLE ACT_RE_PROCDEF CASCADE CONSTRAINTS; DROP TABLE ACT_RU_JOB CASCADE CONSTRAINTS; DROP TABLE ACT_RU_EXECUTION CASCADE CONSTRAINTS; DROP TABLE ACT_RE_DEPLOYMENT CASCADE CONSTRAINTS; DROP TABLE ACT_GE_BYTEARRAY CASCADE CONSTRAINTS; DROP TABLE ACT_GE_PROPERTY CASCADE CONSTRAINTS;
martes, 22 de octubre de 2013
Instalar Gnome Desktop en Oracle Linux 6.4 con Windows Azure
El problema ocurre desde que Windows Azure Agente Linux no es compatible con NetworkManager incluido en los paquetes de GNOME.
/ Se intalo ejecutando los siguientes pasos
* Eliminar Windows Azure Linux Agente
/ Se intalo ejecutando los siguientes pasos
* Eliminar Windows Azure Linux Agente
# yum remove WALinuxAgent* Instalación de X Window and GNOME
# yum groupinstall "X Window System" "Desktop" "Fonts" "General Purpose Desktop"* Eliminar NetworkManager e instalar Windows Azure Linux Agent
# yum remove NetworkManagerhttp://social.msdn.microsoft.com/Forums/en-US/WAVirtualMachinesforLinux/thread/e836aa6a-65cb-47dd-81d5-363ffc013c75
# yum install WALinuxAgent
domingo, 20 de octubre de 2013
Después de actualizar a ubuntu 13.10
Luego del lanzamiento de Ubuntu 13.10, siempre ejecutamos la típica actualización en mi caso actualice de Ubuntu 13.04 a 13.10 y nos encontramos con algunas cosillas que nunca faltan aquí una lista de los temas que me sucedieron.
1. Desconfiguración de Unity.
Toco reinstalar completamente unity
Probar esta solucion
1. Desconfiguración de Unity.
Toco reinstalar completamente unity
$ sudo dpkg --configure -a2. No funciona el wireless
$ sudo apt-get install linux-headers-generic $ sudo apt-get install --reinstall bcmwl-kernel-source3. Instalar vmware workstation
Probar esta solucion
$sudo apt-get install open-vm-tools open-vm-tools-dev open-vm-dkms open-vm-toolbox open-vm-tools-dev $sudo apt-get install gcc $sudo vmware-modconfig --console --install-all --appname="VMware Player" --icon="vmware-player"Si no Funciona remover y volver a instalar con los paquetes instalados no vuelve a dar el problema.
$vmware-installer --uninstall-product vmware-workstation $vmware-installer -l4. Instalar flash player
$ sudo apt-get update $ sudo apt-get install flashplugin-installercontinua....
sábado, 5 de octubre de 2013
Problemas con la licencia de Producción de Bonita
Esta información fue de utilidad cuando trabajaba con la version 5.X de bonita SP.
Hello,
I'm using the bundled Tomcat from Bonita download page : BOS-5.6.1-Tomcat-6.0.33.zip I succesfully call the REST API from another webapp, but now I want to supervise my changes from the User XP. I configured the server and its config files as explained in this article http://www.bonitasoft.org/blog/tutorial … -http-api/.
Then I deployed the bonita USER XP webapp but when I'm trying to log in, I run into this error :
18 janv. 2012 16:11:21 org.ow2.bonita.services.impl.DefaultCommandService execute GRAVE: exception while executing command org.ow2.bonita.facade.rest.RESTServerAPIInterceptorCommand@49dd63c9: Unexpected Exception arrived in Bonita: License Error 27 18 janv. 2012 16:11:21 org.bonitasoft.console.server.login.ConsoleLoginServletExt consoleLoginOnDomain GRAVE: Auto authentication failed on domain: null java.lang.RuntimeException at org.bonitasoft.console.server.login.ConsoleLoginServlet.consoleLogin(ConsoleLoginServlet.java:216) ...
As it says it is a license problem, I put my license file into the folder "BOS-5.6.1-Tomcat-6.0.33\bonita\server\licenses\", but now I get this slightly different error :
18 janv. 2012 16:40:02 org.ow2.bonita.services.impl.DefaultCommandService execute GRAVE: exception while executing command org.ow2.bonita.facade.rest.RESTServerAPIInterceptorCommand@4ea14b94: Unexpected Exception arrived in Bonita: License Error 42,27 18 janv. 2012 16:40:02 org.bonitasoft.console.server.login.ConsoleLoginServletExt consoleLoginOnDomain GRAVE: Auto authentication failed on domain: null java.lang.RuntimeException at org.bonitasoft.console.server.login.ConsoleLoginServlet.consoleLogin(ConsoleLoginServlet.java:216) ...
My license is a standard SP license.
Do you have any insights about this issue ? I couldn't find anything in the forum or in the internet...
Thank you in advance.
Fred.
Hi,
Thank you for your reply.
I reinstalled the wole thing on a fresh new install on Tomcat 7, and I still had the same error license. I figured out that in fact the problem came from the number of CPUs my machine has (4). It seems that my license have been generated for a 2 CPUs machine, so by forcing my Tomcat to use only 2 cores, everything works fine now.
For information, here is the command I use (Found in the BOS-5.5.1-installation-guide-tomcat-rev1.pdf):
Hello,
I'm using the bundled Tomcat from Bonita download page : BOS-5.6.1-Tomcat-6.0.33.zip I succesfully call the REST API from another webapp, but now I want to supervise my changes from the User XP. I configured the server and its config files as explained in this article http://www.bonitasoft.org/blog/tutorial … -http-api/.
Then I deployed the bonita USER XP webapp but when I'm trying to log in, I run into this error :
18 janv. 2012 16:11:21 org.ow2.bonita.services.impl.DefaultCommandService execute GRAVE: exception while executing command org.ow2.bonita.facade.rest.RESTServerAPIInterceptorCommand@49dd63c9: Unexpected Exception arrived in Bonita: License Error 27 18 janv. 2012 16:11:21 org.bonitasoft.console.server.login.ConsoleLoginServletExt consoleLoginOnDomain GRAVE: Auto authentication failed on domain: null java.lang.RuntimeException at org.bonitasoft.console.server.login.ConsoleLoginServlet.consoleLogin(ConsoleLoginServlet.java:216) ...
As it says it is a license problem, I put my license file into the folder "BOS-5.6.1-Tomcat-6.0.33\bonita\server\licenses\", but now I get this slightly different error :
18 janv. 2012 16:40:02 org.ow2.bonita.services.impl.DefaultCommandService execute GRAVE: exception while executing command org.ow2.bonita.facade.rest.RESTServerAPIInterceptorCommand@4ea14b94: Unexpected Exception arrived in Bonita: License Error 42,27 18 janv. 2012 16:40:02 org.bonitasoft.console.server.login.ConsoleLoginServletExt consoleLoginOnDomain GRAVE: Auto authentication failed on domain: null java.lang.RuntimeException at org.bonitasoft.console.server.login.ConsoleLoginServlet.consoleLogin(ConsoleLoginServlet.java:216) ...
My license is a standard SP license.
Do you have any insights about this issue ? I couldn't find anything in the forum or in the internet...
Thank you in advance.
Fred.
Hi,
Thank you for your reply.
I reinstalled the wole thing on a fresh new install on Tomcat 7, and I still had the same error license. I figured out that in fact the problem came from the number of CPUs my machine has (4). It seems that my license have been generated for a 2 CPUs machine, so by forcing my Tomcat to use only 2 cores, everything works fine now.
For information, here is the command I use (Found in the BOS-5.5.1-installation-guide-tomcat-rev1.pdf):
cmd /C start /AFFINITY 3 catalina.bat start
How to configure JAAS to use CASClient authentification
Esta información la recupere de un foro me ayudo cuando se me presento el mismo problema.
The order of my filters was exactly what was wrong. I now have this working!
For future reference for anyone else who needs to do this - here's the basic code you should need to get it working. I had success with this on Ubuntu 10.04.1 (64-bit), Tomcat 6, Oracle JDK 1.6.0_20, Bonita 5.3, Cas server 3.4.3 and Cas client 3.1.12
The order of my filters was exactly what was wrong. I now have this working!
For future reference for anyone else who needs to do this - here's the basic code you should need to get it working. I had success with this on Ubuntu 10.04.1 (64-bit), Tomcat 6, Oracle JDK 1.6.0_20, Bonita 5.3, Cas server 3.4.3 and Cas client 3.1.12
web.xmljaas-standard.cfgCAS Authentication Filter org.jasig.cas.client.authentication.AuthenticationFilter casServerLoginUrl http://cashost:8080/cas/login service http://bonitahost:8080/bonita/ serverName http://bonitahost:8080 CAS Validation Filter org.jasig.cas.client.validation.Cas10TicketValidationFilter casServerUrlPrefix http://cashost:8080/cas serverName http://bonitahost:8080 CAS HttpServletRequest Wrapper Filter org.jasig.cas.client.util.HttpServletRequestWrapperFilter CAS Web Authentication Filter org.jasig.cas.client.tomcat.authentication.WebAuthenticationFilter service http://bonitahost:8080/bonita/ serverName http://bonitahost:8080 CAS Authentication Filter /* CAS Validation Filter /* CAS HttpServletRequest Wrapper Filter /* CAS Web Authentication Filter /*
BonitaAuth { org.jasig.cas.client.jaas.CasLoginModule required ticketValidatorClass="org.jasig.cas.client.validation.Cas10TicketValidator" casServerUrlPrefix="http://cashost:8080/cas" service="http://bonitahost:8080/bonita" };WebAuthenticationFilter.java (Requires cas-client-core-3.1.12.jar, commons-logging-1.1.jar, security-server-5.3.jar, servlet-api-6.0.29.jar)
public class WebAuthenticationFilter extends AbstractCasFilter { @Override public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain chain) throws IOException, ServletException { HttpServletRequest request = (HttpServletRequest)servletRequset; HttpSession session = request.getSession(); CredentialsEncryptionAPIImpl credEncAPI = CredentialsEncryptionAPIImpl.getInstance(); String username = request.getRemoteUser(); String encryptedCredentials = credEncAPI.encryptCredential(username); session.setAttribtue(LoginServlet.USER_CREDENTIALS_SESSION_PARAM_KEY, encryptedCredentials); chain.doFilter(servletRequset, servletResponse); } }
Validaciones con expresiones Regulares
A string with at least one character but not only white spaces
(.{1,})(\S+)(\s*)Only the characters of the alphabet:
^[a-zA-Z]+Everything instead of digits:
^[\D]+Everything except the given string "mystring":
^((?!mystring).)*$http://www.cis.upenn.edu/~matuszek/General/RegexTester/regex-tester.html
Deploy Bonita User Experience
1. Requiere tener habilitado el cache de firefox o chrome.
Expected Results
->Copy Bonita Execution Engine libraries\bin\run.conf.bat add code after :JAVA_OPTS_SET
\server\default\conf\login-config.xml inside :
Expected Results
->Copy Bonita Execution Engine libraries
Copy all *.jar files from->Deploy User Experience web application\bonita_execution_engine\bonita_client\libs and \bonita_execution_engine\engine\libs to \server\default\lib.
Copy\bonita_user_experience\ BOS-5.5- DEPLOYwithout_execution_engine_without_client\bonita.war to \server\default\deploy.
remove xml-apis-*.jar from WEB-INF/lib in the war
Copy\bonita_execution_engine\interfaces\EJB\EJB3\bonita.ear to \server\default\deploy
Deploy xCMIS web application Copy\xcmis\xcmis.war to \server\default\deploy.
Copy Bonita configuration files to web container Go toDefine variables edit the file\conf and copy the bonita folder and external folder to .
set "JAVA_OPTS=%JAVA_OPTS% -Dorg.jboss.resolver.warning=true -Dorg.ow2.bonita.api-type=EJB3 -DBONITA_HOME=Configure JAAS authentication and communication Add to\bonita -Djava.naming.factory.initial=org.jnp.interfaces.NamingContextFactory -Djava.security.auth.login.config= \external\security\jaas-standard.cfg -Djava.naming.provider.url=jnp://localhost:1099 [^] -Dexo.data.dir= \external\xcmis\ext-exo-data -Dorg.exoplatform.container.standalone.config= \external\xcmis\ext-exo-conf\exo-configuration-hsql.xml" set "MEMORY_OPTS=-Xshare:auto -Xms512m -Xmx1024m -XX:+HeapDumpOnOutOfMemoryError" set "JAVA_OPTS=%JAVA_OPTS% %BONITA_OPTS% %MEMORY_OPTS%"
Add toConfigure JAAS for xCMIS If your xCMIS server is also located here, you must also add the following to login-config.xml:\server\default\conf\login-config.xml inside :
Add license file
copy the valid license file to\bonita\server\licenses
Error al deployar aplicacion JEE en jbos-eap-5.1 con BOS 5.7.1
caused by: java.lang.SecurityException: class
"org.hibernate.cfg.AnnotationConfiguration"'s signer information does
not match signer information of other classes in the same package
------------------------------------------------------------------------------------------------------------------------------------
Error ocasionado por duplicado de librerías hibernate,con las de hibernate de bonita
hibernate-core-3.5.6-Final.jar
hibernate-jpa-2.0-api-1.0.0.Final.jar
------------------------------------------------------------------------------------------------------------------------------------
Error ocasionado por duplicado de librerías hibernate,con las de hibernate de bonita
hibernate-core-3.5.6-Final.jar
hibernate-jpa-2.0-api-1.0.0.Final.jar
viernes, 27 de septiembre de 2013
Cómo borrar el DNS en Ubuntu
Instrucciones
- Inicia sesión en Ubuntu y abre una ventana de Terminal desde el acceso directo en tu escritorio.
- Escribe "sudo aptitude install nscd" y presiona "Entrar".
- Ingresa tu contraseña de raíz y presiona "Entrar".
- Escribe "sudo /etc/init.d/nscd restart" y presiona "Entrar" para borrar el caché DNS.
jueves, 26 de septiembre de 2013
RESTRINGIR A LOS USUARIOS SFTP ACCESO A UNA CARPETA PRINCIPAL DE UN SITIO WEB
La siguiente es una guía para la creación de usuarios SFTP y la restricción de acceso hacia el directorio
home del usuario.
La confirmación la realizara agregando lo siguiente al final del archivo /etc/ssh/sshd_config
Subsystema sftp internal-sftp
#configuracion de sftp
Match Group sftpgroup
ChrootDirectory %h
ForceCommand internal-sftp
X11Forwarding no
AllowTcpForwarding no
Esto significa que todos los usuarios en el grupo de "sftpgroup “ se restringe a su directorio principal,
en el que sólo podrán ejecutar procesos internos SFTP.
Ahora usted puede crear el grupo sftpgroup ejecutando el siguiente comando:
$ groupadd sftpgroup
Crear los usuarios requeridos y configurarles la clave respectiva
$ useradd usuario1
$ passwd usuario1
$ useradd usuario2
$ passwd usuario2
Establecer un grupo de usuarios:
$ usermod –g sftpgroup usuario1
$ usermod –g sftpgroup usuario2
Para denegar el acceso shell SeSH, ejecute el siguiente comando:
$ usermod usuario1 –s /bin/false
$ usermod usuario2 –s /bin/false
Y configurar el directorio de inicio del usuario:
$ usermod usuario1 –d /var/www/
$ usermod usuario2 –d /var/www/
Establecer el propietario de la carpeta
$ chown root:sftpgroup /var/www/
Establecer los permisos para las carpetas
$ chmod 755 –R /var/www/web.com
Establecer el permiso de escritura al grupo sftpgroup
$ chmod g+w /var/www/web.com
Por último, reiniciar SSH
$ service sshd restart
La parte SSH ahora debe estar en orden, pero usted debe asegurarse de que los permisos de los
archivos también son correctas. Si el entorno chroot está en el directorio principal de un usuario a la
vez / debe ser propiedad de root y debe tener permisos en la línea de 755 o 750.
En otras palabras, todas las carpetas que lleva hasta e incluyendo la carpeta de inicio debe ser
propiedad de root, de lo contrario, aparecerá el siguiente error después de iniciar sesión:
Error en la escritura: Tubería rota
No se pudo leer paquete: Connection reset by peer
En el caso de ser necesario verificar que se tengan permisos necesarios para acceder
$ getenforce
$ setenforce 0
home del usuario.
La confirmación la realizara agregando lo siguiente al final del archivo /etc/ssh/sshd_config
Subsystema sftp internal-sftp
#configuracion de sftp
Match Group sftpgroup
ChrootDirectory %h
ForceCommand internal-sftp
X11Forwarding no
AllowTcpForwarding no
Esto significa que todos los usuarios en el grupo de "sftpgroup “ se restringe a su directorio principal,
en el que sólo podrán ejecutar procesos internos SFTP.
Ahora usted puede crear el grupo sftpgroup ejecutando el siguiente comando:
$ groupadd sftpgroup
Crear los usuarios requeridos y configurarles la clave respectiva
$ useradd usuario1
$ passwd usuario1
$ useradd usuario2
$ passwd usuario2
Establecer un grupo de usuarios:
$ usermod –g sftpgroup usuario1
$ usermod –g sftpgroup usuario2
Para denegar el acceso shell SeSH, ejecute el siguiente comando:
$ usermod usuario1 –s /bin/false
$ usermod usuario2 –s /bin/false
Y configurar el directorio de inicio del usuario:
$ usermod usuario1 –d /var/www/
$ usermod usuario2 –d /var/www/
Establecer el propietario de la carpeta
$ chown root:sftpgroup /var/www/
Establecer los permisos para las carpetas
$ chmod 755 –R /var/www/web.com
Establecer el permiso de escritura al grupo sftpgroup
$ chmod g+w /var/www/web.com
Por último, reiniciar SSH
$ service sshd restart
La parte SSH ahora debe estar en orden, pero usted debe asegurarse de que los permisos de los
archivos también son correctas. Si el entorno chroot está en el directorio principal de un usuario a la
vez / debe ser propiedad de root y debe tener permisos en la línea de 755 o 750.
En otras palabras, todas las carpetas que lleva hasta e incluyendo la carpeta de inicio debe ser
propiedad de root, de lo contrario, aparecerá el siguiente error después de iniciar sesión:
Error en la escritura: Tubería rota
No se pudo leer paquete: Connection reset by peer
En el caso de ser necesario verificar que se tengan permisos necesarios para acceder
$ getenforce
$ setenforce 0
lunes, 16 de septiembre de 2013
Instalar .net Framework en Win Server 2012 - PowerShell
dism /online /enable-feature /featurename:NetFX3 /all /Source:d:\sources\sxs /LimitAccess
domingo, 28 de julio de 2013
Groovy SQL
import groovy.sql.Sql;
import java.sql.RowId;
import java.text.SimpleDateFormat;
//def list=[];
sql = providedscripts.BonitaSql.newInstance("jdbc:mysql://localhost:3306/exampleBonita","root", "root",new com.mysql.jdbc.Driver());
//sql.eachRow("SELECT * FROM `personen`",{row-> list.add(row.idNachname)});
row = sql.firstRow("select id, nombre from datos where id =" + cedulaIdentidad);
//println "Columna personid = ${row.id} y la columna nombre = ${row.nombre}"
if (row == null){
print "No existe registros" + cedulaIdentidad;
estudiante = false;
}
else{
cedulaIdentidad = row.id;
nombre = row.nombre;
estudiante = true;
}
Selects dinamicos
${import groovy.sql.Sql;
def list=[];
sql = providedscripts.BonitaSql.newInstance("jdbc:mysql://localhost:3306/exampleBonita","root", "root",new com.mysql.jdbc.Driver());
sql.eachRow("SELECT * FROM datos",{row-> list.add(row.nombre)});
list}
def list=[];
sql = providedscripts.BonitaSql.newInstance("jdbc:mysql://localhost:3306/exampleBonita","root", "root",new com.mysql.jdbc.Driver());
sql.eachRow("SELECT * FROM datos",{row-> list.add(row.nombre)});
list}
Script Groovy para manejo de Fechas en Bonita
Creamos una variable local tipo date, y utilizamos un conector de tipo asignacion de variable donde incluimos este script groovy
String dia = fechaPrestamoLocal.getDate();
String mes = (fechaPrestamoLocal.getMonth() + 1 );
String anio = (fechaPrestamoLocal.getYear() + 1900 );
if(java.lang.Integer.parseInt(dia) < 10 ){
dia = "0" + dia;
}
if(java.lang.Integer.parseInt(mes) < 10 ){
mes = "0" + mes;
}
return dia + "/" + mes + "/" + anio;
String dia = fechaPrestamoLocal.getDate();
String mes = (fechaPrestamoLocal.getMonth() + 1 );
String anio = (fechaPrestamoLocal.getYear() + 1900 );
if(java.lang.Integer.parseInt(dia) < 10 ){
dia = "0" + dia;
}
if(java.lang.Integer.parseInt(mes) < 10 ){
mes = "0" + mes;
}
return dia + "/" + mes + "/" + anio;
Configurar JVM en BOS-5.6.2-Tomcat
Incluir esta line en el archivo startup.sh de tomcat
#!/bin/sh
export JAVA_HOME=/opt/instadores/jdk1.6.0_31
#!/bin/sh
export JAVA_HOME=/opt/instadores/jdk1.6.0_31
Connecting to PostgreSQL Database Using Groovy
package
com.binarynovae.gsql;
import
groovy.sql.Sql;
"5432/binarynovae"
,
"postgres"
,
"admin"
,
"org.postgresql.Driver"
)
/*
* Display All the records in table Person
*/
println
"All Records:"
def
query =
"select * from person"
sql.eachRow query, {person->
println
person.name +
" "
+ person.person_id +
" "
+person.age
}
/*
* Insert a record into Person table
*/
query =
"insert into person (name, person_id, age) values (?,?,?)"
def
name =
"Ryan"
def
age =
23
def
id =
1289367
sql.executeInsert query, [name, id, age];
/*
* Display the inserted value
*/
println
"Inserted Record:"
query =
"select * from person where name = ?"
sql.eachRow(query,[name], {person->
println
person.name +
" "
+ person.person_id +
" "
+person.age
})
/*
* Update the inserted record values
*/
query =
"update person set age=? where name=?"
name =
"Ryan"
age =
30
sql.executeUpdate query, [age,name]
/*
* Display the updated value
*/
println
"Updated Record:"
query =
"select * from person where name = ?"
sql.eachRow(query,[name], {person->
println
person.name +
" "
+ person.person_id +
" "
+person.age
})
/*
* Delete the inserted value
*/
query =
"delete from person where name=?"
name =
"Ryan"
sql.execute query, [name]
/*
* Checking whether the deletion is successful
*/
println
"After deletion:"
query =
"select count(1) from person where name = ?"
sql.eachRow(query,[name], {row->
println
row[
0
]
})
Integracion BonitaOpenSolution in Jboss
I follow the steps described in the document:
Includes BOS 5.5.1 and a JBoss 5.1.0 server
http://www.bonitasoft.com/products/BPM_downloads#tabs-9
1. Copy all *.jar files from <BOS-5.5-DEPLOY>\bonita_execution_engine\bonita_client\libs and <BOS-5.5-DEPLOY>\bonita_execution_engine\engine\libs to <JBOSS_HOME>\server\default\lib
2. Copy <BOS-5.5-DEPLOY>\bonita_user_experience\without_execution_engine_without_client\bonita.war to <JBOSS_HOME>\server\default\deploy.
3. Edit the files
<JBOSS_HOME>\bonita\server\default\conf\bonita-journal.properties
<JBOSS_HOME>\bonita\server\default\conf\bonita-history.properties
I commented the Default database configuration section in both files and uncomment all POSTGRESQL section, for example:
##################################
# Default database configuration #
##################################
# IMPORTANT: do not use those settings for production!
# By default Bonita use a H2 database that will store all data in one file.
# Access to the database is done throught a datasource configured in Tomcat configuration file: conf/context.xml
# H2 Hibernate dialect
# hibernate.dialect org.hibernate.dialect.H2Dialect
# Using an interceptor can change the database behaviour. By default, an interceptor is defined to order the result of queries by adding null values at the end.
# bonita.hibernate.interceptor org.ow2.bonita.env.interceptor.H2DescNullFirstInterceptor
# Table are automatically create in database
# hibernate.hbm2ddl.auto update
# Location of the datasource (define in Tomcat configuration file: conf/context.xml)
# hibernate.connection.datasource java:/comp/env/bonita/default/history
# Default database connection over H2 (not using datasources)
# hibernate.connection.driver_class org.h2.Driver
# hibernate.connection.url jdbc:h2:file:${BONITA_HOME}/server/default/work/databases/bonita_history.db;FILE_LOCK=NO;MVCC=TRUE;DB_CLOSE_ON_EXIT=TRUE
# hibernate.connection.username bonita
# hibernate.connection.password bpm
hibernate.dialect org.hibernate.dialect.PostgreSQLDialect
hibernate.connection.driver_class org.postgresql.Driver
hibernate.connection.url jdbc:postgresql://localhost:5432/bonita_history
hibernate.connection.username my_user
hibernate.connection.password my_passwd
databases were previously created y my postgres server and also the username and password
4. In <JBOSS_HOME>\external\xcmis\ext-exo-conf folder I have used exo-configuration-mysql.xml and cmis-jcr-configuration-mysql.xml in order to created two files: exo-configuration-mysql.xml
cmis-jcr-configuration-postgresql.xml and exo-configuration-postgres.xml
In exo-configuration-postgres.xml change the following:
<component>
<key>org.exoplatform.services.jcr.config.RepositoryServiceConfiguration</key>
<type>org.exoplatform.services.jcr.impl.config.RepositoryServiceConfigurationImpl</type>
<init-params>
<value-param>
<name>conf-path</name>
<description>JCR configuration file</description>
<value>/cmis-jcr-configuration-postgresql.xml</value>
</value-param>
</init-params>
</component>
<properties-param>
<name>ref-addresses</name>
<description>ref-addresses</description>
<property name="driverClassName" value="org.postgresql.Driver"/>
<property name="url" value="jdbc:postgresql://localhost:5432/xcmis"/>
<property name="username" value="postgres"/>
<property name="password" value="debian"/>
</properties-param>
In cmis-jcr-configuration-postgresql.xml change the following:
<workspace name="system">
<container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
<properties>
<property name="source-name" value="jdbcxcmis" />
<property name="dialect" value="pgsql" />
<property name="multi-db" value="false" />
<property name="max-buffer-size" value="200k" />
<property name="swap-directory" value="${exo.data.dir}/swap/system" />
</properties>
</container>
<workspace name="cmis1">
<container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
<properties>
<property name="source-name" value="jdbcxcmis" />
<property name="dialect" value="pgsql" />
<property name="multi-db" value="false" />
<property name="max-buffer-size" value="200k" />
<property name="swap-directory" value="${exo.data.dir}/swap/cmis1" />
</properties>
</container>
5. Copy the JDBC driver to <JBOSS_HOME>\server\default\lib.
postgresql-9.1-901.jdbc4.jar
6. In the step 2.5.3 Configure logging, I did not find <JBOSS_HOME>\conf\logging.properties , I found
/etc/java6-open-jdk/logging.properties and edit it and added the lines
org.ow2.bonita.level = INFO
org.ow2.bonita.example.level = FINE
org.ow2.bonita.runtime.event.EventDispatcherThread.level = WARNING
org.hibernate.level = WARNING
net.sf.ehcache.level = SEVERE
7. IN <JBOSS_HOME>\bin\run.conf i added the lines
BONITA_OPTS="-DBONITA_HOME=/usr/share/jbossas5/bonita -Dorg.ow2.bonita.api-type=Standard" LOG_OPTS="-Djava.util.logging.config.file=../external/logging/logging.properties" mycwd=`pwd` CMIS_CONFIG="-Dexo.data.dir=/usr/share/jbossas5/external/xcmis/ext-exo-data -Dorg.exoplatform.container.standalone.config=/usr/share/jbossas5/external/xcmis/ext-exo-conf/exo-configuration-postgres.xml" JAVA_OPTS="$JAVA_OPTS $BONITA_OPTS $LOG_OPTS $CMIS_CONFIG -Dfile.encoding=UTF-8 -Xshare:auto -Xms512m -Xmx1024m -XX:MaxPermSize=256m -XX:+HeapDumpOnOutOfMemoryError" export JAVA_OPTS
8. In the step 2.6 Configure JAAS authentication and communication, I did not find <JBOSS_HOME>\conf\logging.properties, I found the following files:
/etc/jbossas5/profiles/all/login-config.xml
/etc/jbossas5/profiles/default/login-config.xml
/etc/jbossas5/profiles/standard/login-config.xml
/etc/jbossas5/profiles/web/login-config.xml
In all files I added the following lines:
<application-policy name="BonitaAuth">
<authentication>
<login-module code="org.ow2.bonita.identity.auth.BonitaIdentityLoginModule"
flag="required"/>
</authentication>
</application-policy>
<application-policy name="BonitaStore">
<authentication>
<login-module code="org.ow2.bonita.identity.auth.LocalStorageLoginModule"
flag="required"/>
</authentication>
</application-policy>
<application-policy name="exo-domain">
<authentication>
<login-module code="org.exoplatform.services.security.j2ee.JbossLoginModule"
flag="required"/>
</authentication>
</application-policy>
9. My jboss server is running and I try to open the bonita software with http://127.0.0.1:8080/bonita/, in the form I placed the credentials
username: admin
passwd: bpm
And then the error occurs:
org.ow2.bonita.util.BonitaRuntimeException: The system property 'BONITA_HOME' is not set
org.ow2.bonita.util.BonitaConstants.getBonitaHomeFolder(BonitaConstants.java:75)
org.ow2.bonita.facade.APIInterceptor.invoke(APIInterceptor.java:117)
$Proxy350.generateTemporaryToken(Unknown Source)
org.bonitasoft.console.security.server.api.impl.CredentialsEncryptionAPIImpl.generateTemporaryToken(CredentialsEncryptionAPIImpl.java:157)
org.bonitasoft.console.security.server.CredentialsEncryptionServlet.doPost(CredentialsEncryptionServlet.java:107)
javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
I do not know how to solve this I am new using open source technologies
please if anyone can help I'd appreciate it greatly
Includes BOS 5.5.1 and a JBoss 5.1.0 server
http://www.bonitasoft.com/products/BPM_downloads#tabs-9
1. Copy all *.jar files from <BOS-5.5-DEPLOY>\bonita_execution_engine\bonita_client\libs and <BOS-5.5-DEPLOY>\bonita_execution_engine\engine\libs to <JBOSS_HOME>\server\default\lib
2. Copy <BOS-5.5-DEPLOY>\bonita_user_experience\without_execution_engine_without_client\bonita.war to <JBOSS_HOME>\server\default\deploy.
3. Edit the files
<JBOSS_HOME>\bonita\server\default\conf\bonita-journal.properties
<JBOSS_HOME>\bonita\server\default\conf\bonita-history.properties
I commented the Default database configuration section in both files and uncomment all POSTGRESQL section, for example:
##################################
# Default database configuration #
##################################
# IMPORTANT: do not use those settings for production!
# By default Bonita use a H2 database that will store all data in one file.
# Access to the database is done throught a datasource configured in Tomcat configuration file: conf/context.xml
# H2 Hibernate dialect
# hibernate.dialect org.hibernate.dialect.H2Dialect
# Using an interceptor can change the database behaviour. By default, an interceptor is defined to order the result of queries by adding null values at the end.
# bonita.hibernate.interceptor org.ow2.bonita.env.interceptor.H2DescNullFirstInterceptor
# Table are automatically create in database
# hibernate.hbm2ddl.auto update
# Location of the datasource (define in Tomcat configuration file: conf/context.xml)
# hibernate.connection.datasource java:/comp/env/bonita/default/history
# Default database connection over H2 (not using datasources)
# hibernate.connection.driver_class org.h2.Driver
# hibernate.connection.url jdbc:h2:file:${BONITA_HOME}/server/default/work/databases/bonita_history.db;FILE_LOCK=NO;MVCC=TRUE;DB_CLOSE_ON_EXIT=TRUE
# hibernate.connection.username bonita
# hibernate.connection.password bpm
hibernate.dialect org.hibernate.dialect.PostgreSQLDialect
hibernate.connection.driver_class org.postgresql.Driver
hibernate.connection.url jdbc:postgresql://localhost:5432/bonita_history
hibernate.connection.username my_user
hibernate.connection.password my_passwd
databases were previously created y my postgres server and also the username and password
4. In <JBOSS_HOME>\external\xcmis\ext-exo-conf folder I have used exo-configuration-mysql.xml and cmis-jcr-configuration-mysql.xml in order to created two files: exo-configuration-mysql.xml
cmis-jcr-configuration-postgresql.xml and exo-configuration-postgres.xml
In exo-configuration-postgres.xml change the following:
<component>
<key>org.exoplatform.services.jcr.config.RepositoryServiceConfiguration</key>
<type>org.exoplatform.services.jcr.impl.config.RepositoryServiceConfigurationImpl</type>
<init-params>
<value-param>
<name>conf-path</name>
<description>JCR configuration file</description>
<value>/cmis-jcr-configuration-postgresql.xml</value>
</value-param>
</init-params>
</component>
<properties-param>
<name>ref-addresses</name>
<description>ref-addresses</description>
<property name="driverClassName" value="org.postgresql.Driver"/>
<property name="url" value="jdbc:postgresql://localhost:5432/xcmis"/>
<property name="username" value="postgres"/>
<property name="password" value="debian"/>
</properties-param>
In cmis-jcr-configuration-postgresql.xml change the following:
<workspace name="system">
<container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
<properties>
<property name="source-name" value="jdbcxcmis" />
<property name="dialect" value="pgsql" />
<property name="multi-db" value="false" />
<property name="max-buffer-size" value="200k" />
<property name="swap-directory" value="${exo.data.dir}/swap/system" />
</properties>
</container>
<workspace name="cmis1">
<container class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
<properties>
<property name="source-name" value="jdbcxcmis" />
<property name="dialect" value="pgsql" />
<property name="multi-db" value="false" />
<property name="max-buffer-size" value="200k" />
<property name="swap-directory" value="${exo.data.dir}/swap/cmis1" />
</properties>
</container>
5. Copy the JDBC driver to <JBOSS_HOME>\server\default\lib.
postgresql-9.1-901.jdbc4.jar
6. In the step 2.5.3 Configure logging, I did not find <JBOSS_HOME>\conf\logging.properties , I found
/etc/java6-open-jdk/logging.properties and edit it and added the lines
org.ow2.bonita.level = INFO
org.ow2.bonita.example.level = FINE
org.ow2.bonita.runtime.event.EventDispatcherThread.level = WARNING
org.hibernate.level = WARNING
net.sf.ehcache.level = SEVERE
7. IN <JBOSS_HOME>\bin\run.conf i added the lines
BONITA_OPTS="-DBONITA_HOME=/usr/share/jbossas5/bonita -Dorg.ow2.bonita.api-type=Standard" LOG_OPTS="-Djava.util.logging.config.file=../external/logging/logging.properties" mycwd=`pwd` CMIS_CONFIG="-Dexo.data.dir=/usr/share/jbossas5/external/xcmis/ext-exo-data -Dorg.exoplatform.container.standalone.config=/usr/share/jbossas5/external/xcmis/ext-exo-conf/exo-configuration-postgres.xml" JAVA_OPTS="$JAVA_OPTS $BONITA_OPTS $LOG_OPTS $CMIS_CONFIG -Dfile.encoding=UTF-8 -Xshare:auto -Xms512m -Xmx1024m -XX:MaxPermSize=256m -XX:+HeapDumpOnOutOfMemoryError" export JAVA_OPTS
8. In the step 2.6 Configure JAAS authentication and communication, I did not find <JBOSS_HOME>\conf\logging.properties, I found the following files:
/etc/jbossas5/profiles/all/login-config.xml
/etc/jbossas5/profiles/default/login-config.xml
/etc/jbossas5/profiles/standard/login-config.xml
/etc/jbossas5/profiles/web/login-config.xml
In all files I added the following lines:
<application-policy name="BonitaAuth">
<authentication>
<login-module code="org.ow2.bonita.identity.auth.BonitaIdentityLoginModule"
flag="required"/>
</authentication>
</application-policy>
<application-policy name="BonitaStore">
<authentication>
<login-module code="org.ow2.bonita.identity.auth.LocalStorageLoginModule"
flag="required"/>
</authentication>
</application-policy>
<application-policy name="exo-domain">
<authentication>
<login-module code="org.exoplatform.services.security.j2ee.JbossLoginModule"
flag="required"/>
</authentication>
</application-policy>
9. My jboss server is running and I try to open the bonita software with http://127.0.0.1:8080/bonita/, in the form I placed the credentials
username: admin
passwd: bpm
And then the error occurs:
org.ow2.bonita.util.BonitaRuntimeException: The system property 'BONITA_HOME' is not set
org.ow2.bonita.util.BonitaConstants.getBonitaHomeFolder(BonitaConstants.java:75)
org.ow2.bonita.facade.APIInterceptor.invoke(APIInterceptor.java:117)
$Proxy350.generateTemporaryToken(Unknown Source)
org.bonitasoft.console.security.server.api.impl.CredentialsEncryptionAPIImpl.generateTemporaryToken(CredentialsEncryptionAPIImpl.java:157)
org.bonitasoft.console.security.server.CredentialsEncryptionServlet.doPost(CredentialsEncryptionServlet.java:107)
javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
I do not know how to solve this I am new using open source technologies
please if anyone can help I'd appreciate it greatly
BOS + EJB on JBoss
Optionally, if you want to use the EJB3 API and access the engine remotely in EJB mode, use the EAR available in Bonita Open Solution.
Copy the EAR available in <BOS-5.6-DEPLOY>\bonita_execution_engine\interfaces\EJB\EJB3\bonita.ear to <JBOSS_HOME>\server\default\deploy.
Update JAAS configuration
If your client is Bonita User Experience or any Java client, configure the loginContext BonitaStore in <JBOSS_HOME>\conf\login-config.xml:
You will also have to update your server variable BONITA_OPTS to use the EJB3 API:
set "BONITA_OPTS=-DBONITA_HOME=<JBOSS_HOME>\bonita -Dorg.ow2.bonita.api-type=EJB3 -Djava.naming.factory.initial=org.jnp.interfaces.NamingContextFactory -Djava.naming.provider.url=jnp://localhost:1099"
How to install BOS with EJB on JBoss
Deploy Bonita EARCopy the EAR available in <BOS-5.6-DEPLOY>\bonita_execution_engine\interfaces\EJB\EJB3\bonita.ear to <JBOSS_HOME>\server\default\deploy.
Update JAAS configuration
If your client is Bonita User Experience or any Java client, configure the loginContext BonitaStore in <JBOSS_HOME>\conf\login-config.xml:
<application-policy name="BonitaStore"> <authentication> <login-module code="org.ow2.bonita.identity.auth.BonitaRemoteLoginModule" flag="required"/> <login-module code="org.jboss.security.ClientLoginModule" flag="required"> <module-option name="password-stacking">useFirstPass</module-option> </login-module> </authentication> </application-policy> |
set "BONITA_OPTS=-DBONITA_HOME=<JBOSS_HOME>\bonita -Dorg.ow2.bonita.api-type=EJB3 -Djava.naming.factory.initial=org.jnp.interfaces.NamingContextFactory -Djava.naming.provider.url=jnp://localhost:1099"
Bonita Open Solution 5.7 Now Available
The following bugs have also been fixed in this new version:
- 9567 Error while uploading an attachment oh 17MB
- 8881 XCMIS : some empty directories remains after ProcessDefinition removal.
- 9806 Studio Robustness : a corrupted .proc file prevent the Studio to work
- 9659 Jasper/Create report wizard accepts parameters of any type but connector has a limitation at runtime : String parameters only
- 8425 Exceptions with SVN repository that lead to inconsistency
- 9845 Case can't be archived.
- 9924 Validator dialog issue
- 8492 Add a tooltip to provide the name of the submitURL parameter
- 9799 Wrong HTML generated for (tabled) widgets in group
- 9471 look_n_feel.zip/css/BonitaConsoleExt.css changes are ignored
- 6377 User with no "process visibility" right on any processes can't access worklist
- 8182 User XP look and feel with multi-line description crashes the look and feel listing
- 9668 Missing logo after go to default theme
- 9793 Avaliable value after update of contingencies widget displays error
- 9823 Database connector error at at updata value
- 9277 Step Form editor : Contingencies / Update value does not display field_Group1
- 7092 Salesforce-Update a Salesforce object,button 'Next' is grey when all the Items are filled
- 7469 list widget contingencies problem
- 7382 Rule status does not change after remove the related process
- 9526 Attachment file can not upload to user xp
- 8449 Cannot retrieve document error when use attachment variable on process
- 8451 Number of variable display does not consistent between BOS version and BOS-SP version
- 8450 Attachment variable name and value displays error if they display in two pages
- 9477 attachment file name does not match with attachment file content in overview
- 8140 Validator still display in dropdown list after remove.
- 9533 modify a process's Diagram name and pool's name,delete all the processes,it will has NullPointerException
- 8349 Start a process can be clicked many times.
- 5852 Deletion of a hierachy of group failed
- 5853 Get an exception when trying to run an older version of the process from the Studio
- 9788 Sometimes, studio can't find step's actor.
- 9773 display incorrect version.
- 9528 process can't run when using Redirect to URL on a step which is in subprocess
- 9925 two textfield in group don't display in application page
- 9713 Null pointer on Process version edition.
- 9674 Multiple Injection of Bonita's CSS pages
- 7380 Not able to use step data in a multi-instantiated step actor selector
- 8439 New Process vs SVN is faulty
- 9709 Run process show"The version of the forms you are trying to display is not supported...."
- 9086 Preferences-->language-->restore default can't restore the language to English
- 8115 UserXP / Case Start Privilege interface : Upgrading a process definition mess up the interface for privileges definition.
- 9740 Studio installer: import workspace feature is faulty : default.properties file
- 9766 Gate View Pageflow : Only the auto-generated form is displayed.
- 9927 Studio crash if the admin user is changed from the user XP
- 9842 Aften run a process,the process will be locked
- 10024 warning when run a process after clicking "Menu bau->Process->Validate"
- 8692 Change the data type, data on the form are not synchronized
- 10030 Always show error"No actor selector defined"
- 10028 Add a form to a pool-->overview pageflow,archive this process,in administration-->overview show error
- 9484 Move a boundary error could produce error
- 8417 Contingency vs is Mandatory checkbox : Group or widget in a group behavior is faulty
- 8469 The Groovy manager distorts the accents
- 9808 the warning tip is still exist after adding actor for a line in studio
- 8130 Exception when deleting a process with an attachment var
- 9792 in studio preferences->eclipse->team->svn , can't enter svn connect
- 9733 step detail privilege can't work well
- 9827 in administration view , add a report ,then remove it , but it can't add same name again
- 6508 change Actors--Filters' name it can not display the new name at once
- 9479 add a Category which name end with a space
- 9660 Not significant message for POJO unserializable data
- 9476 The "User metadata"field should be cleared out when you try to use it for another user
- 10025 Remove process but do not check "Delete attachments",the attachment were deleted
- 8717 Unable to update an name of a diagram or a process with special characters
- 8855 email connector : Cyrillic file names of emails's attached file is changed.
- 9923 The function of Run simulation can't be used
- 9804 use attachment variable in email connector,when add other email connector,it will has value in attachment part
- 8863 Russian localization issue
- 10033 in studio set generate a war , run process , it throw error
- 9562 in subprocess event add a form , it can' t display well
- 9667 Contingencies of Text field which in one group has been contingencies on a select will error
- 9795 new a process to edit diagram version , it can't work well
- 8420 Role deletion : it removes other roles association to users
- 9465 Throw event error message : Catch event is not unique in repository
- 9921 The process have several cases and document can't be removed when select "delete the attachment"
- 9543 Email connector:use "existing configuration",the attachment can't be saved
- 9655 Contingency : Select widget "Show when a contingent field has changed" has no effect
- 9820 In the userXP of admin view,click cancel when change the privilege from no one to everyone,both two won't be selected
- 9852 The error tips is wrong when the name of the report template is long special character
- 9844 template error: After running the HR On-boarding process , forms were disappear
- 9530 Up and down more than one form error
- 8080 The tooltip is wrong when add a big attachment for a step in User-XP.
- 9922 install one process twice,it will generate the previous attachments
- 8501 Issue when using multiple schema with PostgreSQL
- 9616 the application url is wrong when finish a process,login in again
- 9818 for bonita--Add documents connector,add a row,after select create data and then cancel it,there is Create data... in the row
- 8194 The exception occurse when use Secure WS connector
- 7858 Studio engine log include some error about HTML parsing (Jericho)
- 8193 NullPointerException:when use WebService - Secure WS connector
Recuperar Registros de la Base de Datos
import GeneracionError;
sql = providedscripts.BonitaSql.newInstance("jdbc:mysql://localhost:3306/baseEjemplo","root", "root",new com.mysql.jdbc.Driver());
try{
row = sql.firstRow("select dsd_name from TIPO_SIGNO );
if(row == null){
}else{
notDireccion = row.dsd_name;
}
}catch(Exception e){
e.printStackTrace();
GeneracionError.error(e.getMessage());
}
sql = providedscripts.BonitaSql.newInstance("jdbc:mysql://localhost:3306/baseEjemplo","root", "root",new com.mysql.jdbc.Driver());
try{
row = sql.firstRow("select dsd_name from TIPO_SIGNO );
if(row == null){
}else{
notDireccion = row.dsd_name;
}
}catch(Exception e){
e.printStackTrace();
GeneracionError.error(e.getMessage());
}
Map your Active Directory or LDAP groups in Bonita Open Solution 5
Issue:
You have your users and groups defined in an Active Directory or a LDAP server and you want to use them in Bonita Open Solution in order to assign tasks.
Solution:
To do that, you have to use the LDAP group resolver or the Active Directory group resolver to do a one-to-one group mapping in Bonita Open Solution.
This article explains how to do that step by step.
For this article I suggest the next structure (adapt this guide with your own structure):
Your comments are welcome in order to improve this article.
You have your users and groups defined in an Active Directory or a LDAP server and you want to use them in Bonita Open Solution in order to assign tasks.
Solution:
To do that, you have to use the LDAP group resolver or the Active Directory group resolver to do a one-to-one group mapping in Bonita Open Solution.
This article explains how to do that step by step.
Prerequisite
You need to know how your directory is structured. Generally, when you create users and groups in a directory, you are invited to create one container for users and another one for groups. So the first thing you need to know is the paths to these 2 containers.For this article I suggest the next structure (adapt this guide with your own structure):
DC=ad,DC=bonitasoft,DC=comrodrigue, miguel are in bos5test1 and rodrigue is in bos5test2.
|
+– OU=BOSGroups,DC=ad,DC=bonitasoft,DC=com
| |
| +– CN=bos5test1,OU=BOSGroups,DC=ad,DC=bonitasoft,DC=com
| +– CN=bos5test2,OU=BOSGroups,DC=ad,DC=bonitasoft,DC=com
|
+– OU=BOSUsers,DC=ad,DC=bonitasoft,DC=com
|
+– CN=rodrigue,OU=BOSUsers,DC=ad,DC=bonitasoft,DC=com
+– CN=miguel,OU=BOSUsers,DC=ad,DC=bonitasoft,DC=com
What are we going to do?
The goal here is to create 2 groups in Bonita Open Solution according to this mapping:BOS Group | LDAP/AD Group |
---|---|
Group Test 1 | CN=bos5test1 |
Group Test 2 | CN=bos5test1 |
How to do that?
You have to use a group resolver which is a specific connector to create a group. In Bonita Open Solution, a group is a way to represent a list of candidates. You have to translate the group in a list of users with a group resolver. In our case, you will use either the LDAP group resolver (if you reach a LDAP server) or the ADGroupResolver group resolver (if you reach an AD server - note that you need to install this connector from the community contributions). These 2 connectors work in the same way. So you need to configure:- the server access
- the query to find your list of usersT
- To write your query you need to provide:
- the path to where your groups are stored. In the given example: OU=BOSGroups,DC=ad,DC=bonitasoft,DC=com
- the path to where your users are stored. In the given example: OU=BOSUsers,DC=ad,DC=bonitasoft,DC=com
- the filter to find the group: example: CN=bos5test1
Warning, the filter is applied on the groups not on the users.
Configuration and test of a group mapped with Active Directory: step by step
- Open menu Connectors > Test a Connector
- Select Group and click on Next
- Select the ADGroupResolver connector and click on Next
- Select configure from blank and click on Next
- Fill the form to connect to the Active Directory server (note the port is 389) and click on Next
- Fill the request with the group base path, the user base path and the filter (here CN=bos5test1)
- Click on Evaluate and check that your configuration is ok
- Save your configuration: click on save connector configuration, enter the name of your configuration and click on Finish
- Click on Close
- Create a new process, select Step1 and select Actors tab
- Click on Create
- Select the ADGroupResolver connector and click on Next
- Enter the name of the group in Bonita Open Solution: Group Test 1, and click on Next
- Select Configure connector starting from an existing configuration and select the saved configuration: Configuration for Group Test 1 and click on Next
- Click on Finish
- Select your process and select the Dependencies tab
- Add the ldap connector in the dependencies
What have you learned?
You’ve learned how to map a Bonita Group with an AD or LDAP groupWhat haven’t you learned?
You haven’t learned to do an authentication against LDAP or AD server. This is not done with Bonita Open Solution but it will depend on your deployment server (Tomcat, JBoss, JOnAS, Glassfish, …). You can configure the authentication with LDAP or AD server by configuring the JAAS layer of your server. Please refer to your Application Server Documentation to know how to do that.Your comments are welcome in order to improve this article.
Recuperar Usuarios de Bonita
package ec.users;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import javax.security.auth.login.LoginContext;
import org.ow2.bonita.facade.IdentityAPI;
import org.ow2.bonita.facade.ManagementAPI;
import org.ow2.bonita.facade.QueryRuntimeAPI;
import org.ow2.bonita.facade.RuntimeAPI;
import org.ow2.bonita.facade.identity.Group;
import org.ow2.bonita.facade.identity.Role;
import org.ow2.bonita.facade.identity.User;
import org.ow2.bonita.facade.runtime.ActivityState;
import org.ow2.bonita.facade.uuid.ActivityInstanceUUID;
import org.ow2.bonita.facade.uuid.ProcessDefinitionUUID;
import org.ow2.bonita.facade.uuid.ProcessInstanceUUID;
import org.ow2.bonita.util.AccessorUtil;
import org.ow2.bonita.util.BonitaConstants;
import org.ow2.bonita.util.SimpleCallbackHandler;
/**
* Method that get a simple list for users
*
* @author netdaemon
*
*/
public class ObtenerUsuario {
private static final String LOGIN = "admin";
private static final String PSSWD = "bpm";
private static final String jaasFile = "/home/netdaemon/BOS-SP-5.6.1-Tomcat-6.0.33/external/security/jaas-tomcat.cfg";
public static void main(String[] args) throws Exception {
// set system properties
System.setProperty(BonitaConstants.API_TYPE_PROPERTY, "REST");
System.setProperty(BonitaConstants.REST_SERVER_ADDRESS_PROPERTY,"http://localhost:9080/bonita-server-rest/");
System.setProperty(BonitaConstants.JAAS_PROPERTY, jaasFile);
// login
LoginContext loginContext = new LoginContext("BonitaAuth",new SimpleCallbackHandler(LOGIN, PSSWD));
loginContext.login();
loginContext.logout();
// propagate the user credentials
loginContext = new LoginContext("BonitaStore",new SimpleCallbackHandler(LOGIN, PSSWD));
loginContext.login();
// get he APIs
final IdentityAPI identityAPI = AccessorUtil.getIdentityAPI();
try {
//Recuperar usuarios por role
Role role = identityAPI.findRoleByName("secretario");
List<User> users = identityAPI.getAllUsersInRole(role.getUUID());
for (User usr : users) {
System.out.println("" + usr.getFirstName() + " " + usr.getLastName());
System.out.println("" + usr.getTitle());
}
//Recuperar usuarios por Grupo
Group group = identityAPI.getGroupByUUID("e8194c31-42d6-4a3b-83b2-b1456b63d74a");
List <User> usuarios = identityAPI.getAllUsersInGroup(group.getUUID());
for (User usr : usuarios) {
System.out.println("" + usr.getFirstName() + " " + usr.getLastName());
System.out.println("" + usr.getJobTitle());
}
List <String> firmantes1 = new ArrayList<String>();
//Recuperar lista de delegados y directores
Role role1 = identityAPI.findRoleByName("delegadoDN");
List<User> users1 = identityAPI.getAllUsersInRole(role1.getUUID());
for (User usr : users1) {
// System.out.println("" + usr.getFirstName() + " " + usr.getLastName());
// System.out.println("" + usr.getJobTitle());
firmantes1.add(usr.getLastName() + " " + usr.getFirstName());
}
Role role2 = identityAPI.findRoleByName("directorNacional");
List<User> users2 = identityAPI.getAllUsersInRole(role2.getUUID());
for (User usr : users2) {
// System.out.println("" + usr.getFirstName() + " " + usr.getLastName());
// System.out.println("" + usr.getJobTitle());
firmantes1.add(usr.getLastName() + " " + usr.getFirstName());
}
for ( String nombre : firmantes1 ){
System.out.println(nombre);
}
} catch (Exception e) {
e.printStackTrace();
}finally {
loginContext.logout();
}
}
}
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import javax.security.auth.login.LoginContext;
import org.ow2.bonita.facade.IdentityAPI;
import org.ow2.bonita.facade.ManagementAPI;
import org.ow2.bonita.facade.QueryRuntimeAPI;
import org.ow2.bonita.facade.RuntimeAPI;
import org.ow2.bonita.facade.identity.Group;
import org.ow2.bonita.facade.identity.Role;
import org.ow2.bonita.facade.identity.User;
import org.ow2.bonita.facade.runtime.ActivityState;
import org.ow2.bonita.facade.uuid.ActivityInstanceUUID;
import org.ow2.bonita.facade.uuid.ProcessDefinitionUUID;
import org.ow2.bonita.facade.uuid.ProcessInstanceUUID;
import org.ow2.bonita.util.AccessorUtil;
import org.ow2.bonita.util.BonitaConstants;
import org.ow2.bonita.util.SimpleCallbackHandler;
/**
* Method that get a simple list for users
*
* @author netdaemon
*
*/
public class ObtenerUsuario {
private static final String LOGIN = "admin";
private static final String PSSWD = "bpm";
private static final String jaasFile = "/home/netdaemon/BOS-SP-5.6.1-Tomcat-6.0.33/external/security/jaas-tomcat.cfg";
public static void main(String[] args) throws Exception {
// set system properties
System.setProperty(BonitaConstants.API_TYPE_PROPERTY, "REST");
System.setProperty(BonitaConstants.REST_SERVER_ADDRESS_PROPERTY,"http://localhost:9080/bonita-server-rest/");
System.setProperty(BonitaConstants.JAAS_PROPERTY, jaasFile);
// login
LoginContext loginContext = new LoginContext("BonitaAuth",new SimpleCallbackHandler(LOGIN, PSSWD));
loginContext.login();
loginContext.logout();
// propagate the user credentials
loginContext = new LoginContext("BonitaStore",new SimpleCallbackHandler(LOGIN, PSSWD));
loginContext.login();
// get he APIs
final IdentityAPI identityAPI = AccessorUtil.getIdentityAPI();
try {
//Recuperar usuarios por role
Role role = identityAPI.findRoleByName("secretario");
List<User> users = identityAPI.getAllUsersInRole(role.getUUID());
for (User usr : users) {
System.out.println("" + usr.getFirstName() + " " + usr.getLastName());
System.out.println("" + usr.getTitle());
}
//Recuperar usuarios por Grupo
Group group = identityAPI.getGroupByUUID("e8194c31-42d6-4a3b-83b2-b1456b63d74a");
List <User> usuarios = identityAPI.getAllUsersInGroup(group.getUUID());
for (User usr : usuarios) {
System.out.println("" + usr.getFirstName() + " " + usr.getLastName());
System.out.println("" + usr.getJobTitle());
}
List <String> firmantes1 = new ArrayList<String>();
//Recuperar lista de delegados y directores
Role role1 = identityAPI.findRoleByName("delegadoDN");
List<User> users1 = identityAPI.getAllUsersInRole(role1.getUUID());
for (User usr : users1) {
// System.out.println("" + usr.getFirstName() + " " + usr.getLastName());
// System.out.println("" + usr.getJobTitle());
firmantes1.add(usr.getLastName() + " " + usr.getFirstName());
}
Role role2 = identityAPI.findRoleByName("directorNacional");
List<User> users2 = identityAPI.getAllUsersInRole(role2.getUUID());
for (User usr : users2) {
// System.out.println("" + usr.getFirstName() + " " + usr.getLastName());
// System.out.println("" + usr.getJobTitle());
firmantes1.add(usr.getLastName() + " " + usr.getFirstName());
}
for ( String nombre : firmantes1 ){
System.out.println(nombre);
}
} catch (Exception e) {
e.printStackTrace();
}finally {
loginContext.logout();
}
}
}
Select Validator
public boolean validate(Map<String, FormFieldValue> campos, Locale locale) {
boolean resultado = true;
FormFieldValue campo1 = campos.get("select1");
String campoSelect = (String) campo1.getValue();
FormFieldValue campo2 = campos.get("textBox1");
String textBox1 = (String) campo1.getValue();
if (campoSelect =="Término indefinido"){
resultado = true }
if (campoSelect != "Término indefinido"){
if (textBox1 == null || textBox1=="")
{
resultado = false;
}
else
{
resultado = true;
}
}
return resultado
}
boolean resultado = true;
FormFieldValue campo1 = campos.get("select1");
String campoSelect = (String) campo1.getValue();
FormFieldValue campo2 = campos.get("textBox1");
String textBox1 = (String) campo1.getValue();
if (campoSelect =="Término indefinido"){
resultado = true }
if (campoSelect != "Término indefinido"){
if (textBox1 == null || textBox1=="")
{
resultado = false;
}
else
{
resultado = true;
}
}
return resultado
}
Suscribirse a:
Entradas (Atom)