├── .gitattributes ├── bonita-integration-tests-web ├── .gitignore └── src │ ├── test │ └── resources │ │ ├── page.zip │ │ └── newPage.zip │ └── main │ ├── resources │ ├── logback.xml │ └── org │ │ └── bonitasoft │ │ └── test │ │ └── toolkit │ │ └── connector │ │ ├── TestConnector.java │ │ └── TestConnector.impl │ └── java │ └── org │ └── bonitasoft │ └── test │ └── toolkit │ ├── bpm │ ├── TestActor.java │ ├── TestCaseFactory.java │ └── AbstractManualTask.java │ ├── organization │ ├── TestMembershipFactory.java │ └── AdminUser.java │ └── exception │ └── NoActivityLeftException.java ├── server ├── src │ ├── test │ │ ├── resources │ │ │ ├── bdmDependencies │ │ │ │ ├── bdm-dao.jar │ │ │ │ ├── bdm-client.jar │ │ │ │ └── javassist-3.18.1-GA.jar │ │ │ ├── ARootPageFolder │ │ │ │ ├── lib │ │ │ │ │ ├── bdm-dao.jar │ │ │ │ │ ├── util.jar │ │ │ │ │ ├── bdm-client.jar │ │ │ │ │ ├── javassist-3.18.1-GA.jar │ │ │ │ │ └── subdir │ │ │ │ │ │ └── resource.properties │ │ │ │ ├── org │ │ │ │ │ └── company │ │ │ │ │ │ └── test │ │ │ │ │ │ ├── config.properties │ │ │ │ │ │ └── Util.groovy │ │ │ │ ├── AbstractIndex.groovy │ │ │ │ └── Index.groovy │ │ │ ├── invalidCustomPage │ │ │ │ ├── resources │ │ │ │ │ └── style.css │ │ │ │ └── descriptor.properties │ │ │ ├── invalidFormPage │ │ │ │ ├── resources │ │ │ │ │ └── index.js │ │ │ │ └── page.properties │ │ │ ├── invalidThemePage │ │ │ │ ├── resources │ │ │ │ │ └── style.css │ │ │ │ └── page.properties │ │ │ ├── org │ │ │ │ └── bonitasoft │ │ │ │ │ ├── web │ │ │ │ │ └── rest │ │ │ │ │ │ └── server │ │ │ │ │ │ ├── api │ │ │ │ │ │ ├── bdm │ │ │ │ │ │ │ ├── bizdatamodel.zip │ │ │ │ │ │ │ ├── simpleRef.json │ │ │ │ │ │ │ ├── multiRef.json │ │ │ │ │ │ │ └── refs.json │ │ │ │ │ │ ├── bpm │ │ │ │ │ │ │ ├── flownode │ │ │ │ │ │ │ │ ├── timerEventTriggerInstance.json │ │ │ │ │ │ │ │ ├── timerEventTriggerInstances.json │ │ │ │ │ │ │ │ ├── longDataInstance.json │ │ │ │ │ │ │ │ ├── nullDataInstance.json │ │ │ │ │ │ │ │ ├── doubleDataInstance.json │ │ │ │ │ │ │ │ ├── stringDataInstance.json │ │ │ │ │ │ │ │ ├── floatDataInstance.json │ │ │ │ │ │ │ │ └── contract.json │ │ │ │ │ │ │ └── process │ │ │ │ │ │ │ │ └── contract.json │ │ │ │ │ │ └── extension │ │ │ │ │ │ │ └── page.properties │ │ │ │ │ │ └── datastore │ │ │ │ │ │ └── page │ │ │ │ │ │ ├── page.zip │ │ │ │ │ │ └── pageApiExtension.zip │ │ │ │ │ └── console │ │ │ │ │ └── common │ │ │ │ │ └── server │ │ │ │ │ └── page │ │ │ │ │ ├── file.css │ │ │ │ │ ├── page.zip │ │ │ │ │ ├── pageApiExtension.zip │ │ │ │ │ ├── page.properties │ │ │ │ │ ├── my_html_page_v_6 │ │ │ │ │ └── index.html │ │ │ │ │ └── my_html_page_v_7 │ │ │ │ │ └── resources │ │ │ │ │ └── index.html │ │ │ ├── i18n │ │ │ │ ├── test_fr.po │ │ │ │ ├── other_translations_fr.po │ │ │ │ └── portal_fr.po │ │ │ ├── custom_po_resource │ │ │ │ ├── test_fr.po │ │ │ │ ├── test_es.po │ │ │ │ └── added_custom_i18n_fr.po │ │ │ ├── doc.jpg │ │ │ ├── resources-permissions-mapping.properties │ │ │ ├── InvalidPage.zip │ │ │ ├── pageApiExtension.zip │ │ │ ├── pageWithPermissions.zip │ │ │ ├── custom-permissions-mapping.properties │ │ │ ├── pageWithIndexInResources.zip │ │ │ ├── myRestAPI-1.0.0-SNAPSHOT │ │ │ │ ├── lib │ │ │ │ │ └── myRestAPI-1.0.0-SNAPSHOT.jar │ │ │ │ └── page.properties │ │ │ ├── compound-permissions-mapping.properties │ │ │ ├── IndexRestApi.groovy │ │ │ ├── logback-test.xml │ │ │ └── test.po │ │ └── java │ │ │ └── org │ │ │ └── bonitasoft │ │ │ ├── web │ │ │ ├── rest │ │ │ │ ├── server │ │ │ │ │ ├── api │ │ │ │ │ │ ├── bpm │ │ │ │ │ │ │ └── flownode │ │ │ │ │ │ │ │ ├── Dummy.java │ │ │ │ │ │ │ │ ├── APIActivityTest.java │ │ │ │ │ │ │ │ ├── APIUserTaskTest.java │ │ │ │ │ │ │ │ ├── APITaskTest.java │ │ │ │ │ │ │ │ └── archive │ │ │ │ │ │ │ │ ├── APIArchivedFlowNodeTest.java │ │ │ │ │ │ │ │ ├── APIArchivedUserTaskTest.java │ │ │ │ │ │ │ │ ├── APIArchivedActivityTest.java │ │ │ │ │ │ │ │ └── APIArchivedHumanTaskTest.java │ │ │ │ │ │ ├── organization │ │ │ │ │ │ │ └── password │ │ │ │ │ │ │ │ └── validator │ │ │ │ │ │ │ │ ├── DefaultPasswordValidatorTest.java │ │ │ │ │ │ │ │ └── RobustnessPasswordValidatorTest.java │ │ │ │ │ │ ├── resource │ │ │ │ │ │ │ └── ErrorMessageTest.java │ │ │ │ │ │ └── tenant │ │ │ │ │ │ │ └── TenantResourceItemTest.java │ │ │ │ │ ├── datastore │ │ │ │ │ │ ├── utils │ │ │ │ │ │ │ └── NotSerializableObject.java │ │ │ │ │ │ ├── bpm │ │ │ │ │ │ │ └── cases │ │ │ │ │ │ │ │ └── CaseVariableDatastoreTest.java │ │ │ │ │ │ ├── filter │ │ │ │ │ │ │ └── StrValueTest.java │ │ │ │ │ │ └── converter │ │ │ │ │ │ │ └── StringValueConverterTest.java │ │ │ │ │ ├── framework │ │ │ │ │ │ └── json │ │ │ │ │ │ │ ├── JacksonSerializerTest.java │ │ │ │ │ │ │ └── model │ │ │ │ │ │ │ └── ProfileImportStatusMessageFake.java │ │ │ │ │ └── utils │ │ │ │ │ │ └── FakeResource.java │ │ │ │ └── model │ │ │ │ │ └── ModelFactoryExtTest.java │ │ │ └── toolkit │ │ │ │ └── client │ │ │ │ ├── common │ │ │ │ └── json │ │ │ │ │ ├── JSonUtilTest.java │ │ │ │ │ └── JSonSerializerTest.java │ │ │ │ └── data │ │ │ │ └── validator │ │ │ │ └── StringFormatURLValidatorTest.java │ │ │ ├── console │ │ │ ├── common │ │ │ │ └── server │ │ │ │ │ ├── login │ │ │ │ │ └── filter │ │ │ │ │ │ └── FakeAuthenticationManager.java │ │ │ │ │ ├── utils │ │ │ │ │ └── TenantCacheUtilTest.java │ │ │ │ │ └── page │ │ │ │ │ └── extension │ │ │ │ │ └── PageContextImplTest.java │ │ │ └── server │ │ │ │ └── service │ │ │ │ └── ProcessActorImportServiceTest.java │ │ │ └── livingapps │ │ │ └── menu │ │ │ ├── RootMenuCollectorTest.java │ │ │ └── ChildrenMenuCollectorTest.java │ └── main │ │ ├── resources │ │ ├── VERSION │ │ └── i18n │ │ │ └── resources_ja.po │ │ ├── webapp │ │ ├── images │ │ │ ├── error-red-circle.png │ │ │ └── error-lines-pattern.gif │ │ ├── index.html │ │ └── WEB-INF │ │ │ └── errors.html │ │ └── java │ │ └── org │ │ └── bonitasoft │ │ ├── livingapps │ │ ├── menu │ │ │ ├── Menu.java │ │ │ ├── RootMenuCollector.java │ │ │ ├── ChildrenMenuCollector.java │ │ │ ├── MenuLink.java │ │ │ └── MenuContainer.java │ │ └── exception │ │ │ └── CreationException.java │ │ ├── web │ │ ├── rest │ │ │ ├── server │ │ │ │ ├── datastore │ │ │ │ │ ├── organization │ │ │ │ │ │ ├── Avatars.java │ │ │ │ │ │ ├── GroupItemConverter.java │ │ │ │ │ │ └── UserFilterCreator.java │ │ │ │ │ ├── page │ │ │ │ │ │ ├── PageDatastoreFactory.java │ │ │ │ │ │ └── PageFilterCreator.java │ │ │ │ │ ├── converter │ │ │ │ │ │ ├── ValueConverter.java │ │ │ │ │ │ ├── LongValueConverter.java │ │ │ │ │ │ ├── StringValueConverter.java │ │ │ │ │ │ ├── BooleanValueConverter.java │ │ │ │ │ │ └── AttributeConverter.java │ │ │ │ │ ├── filter │ │ │ │ │ │ ├── FilterCreator.java │ │ │ │ │ │ ├── BooleanValue.java │ │ │ │ │ │ ├── LongValue.java │ │ │ │ │ │ └── StrValue.java │ │ │ │ │ ├── application │ │ │ │ │ │ └── ApplicationFilterCreator.java │ │ │ │ │ ├── applicationmenu │ │ │ │ │ │ └── ApplicationMenuFilterCreator.java │ │ │ │ │ ├── applicationpage │ │ │ │ │ │ └── ApplicationPageFilterCreator.java │ │ │ │ │ ├── bpm │ │ │ │ │ │ ├── cases │ │ │ │ │ │ │ ├── CaseDocumentFilterCreator.java │ │ │ │ │ │ │ ├── ArchivedCaseDocumentFilterCreator.java │ │ │ │ │ │ │ └── CaseDocumentItemConverter.java │ │ │ │ │ │ ├── process │ │ │ │ │ │ │ └── helper │ │ │ │ │ │ │ │ └── SearchProcessFilterCreator.java │ │ │ │ │ │ └── flownode │ │ │ │ │ │ │ ├── TaskDatastore.java │ │ │ │ │ │ │ ├── ActivityDatastore.java │ │ │ │ │ │ │ ├── UserTaskDatastore.java │ │ │ │ │ │ │ ├── HumanTaskDatastore.java │ │ │ │ │ │ │ └── FlowNodeDatastore.java │ │ │ │ │ └── profile │ │ │ │ │ │ └── member │ │ │ │ │ │ └── MemberTypeConverter.java │ │ │ │ ├── framework │ │ │ │ │ ├── search │ │ │ │ │ │ └── ISearchDirection.java │ │ │ │ │ ├── json │ │ │ │ │ │ └── JacksonSerializer.java │ │ │ │ │ ├── api │ │ │ │ │ │ ├── Datastore.java │ │ │ │ │ │ ├── APIHasAdd.java │ │ │ │ │ │ ├── DatastoreHasAdd.java │ │ │ │ │ │ ├── APIHasDelete.java │ │ │ │ │ │ ├── DatastoreHasDelete.java │ │ │ │ │ │ ├── APIHasGet.java │ │ │ │ │ │ ├── DatastoreHasGet.java │ │ │ │ │ │ ├── APIHasUpdate.java │ │ │ │ │ │ ├── DatastoreHasUpdate.java │ │ │ │ │ │ ├── DatastoreHasSearch.java │ │ │ │ │ │ ├── EnumConverter.java │ │ │ │ │ │ └── APIHasSearch.java │ │ │ │ │ ├── utils │ │ │ │ │ │ └── converter │ │ │ │ │ │ │ ├── Converter.java │ │ │ │ │ │ │ ├── ConversionException.java │ │ │ │ │ │ │ └── typed │ │ │ │ │ │ │ ├── StringConverter.java │ │ │ │ │ │ │ └── BooleanConverter.java │ │ │ │ │ ├── APIs.java │ │ │ │ │ └── exception │ │ │ │ │ │ └── APIFilterEmptyException.java │ │ │ │ ├── api │ │ │ │ │ ├── bpm │ │ │ │ │ │ ├── signal │ │ │ │ │ │ │ └── BPMSignal.java │ │ │ │ │ │ ├── flownode │ │ │ │ │ │ │ ├── archive │ │ │ │ │ │ │ │ └── ArchivedUserTaskContextResourceFinder.java │ │ │ │ │ │ │ ├── UserTaskContractResourceFinder.java │ │ │ │ │ │ │ ├── TimerEventTriggerResourceFinder.java │ │ │ │ │ │ │ ├── UserTaskContextResourceFinder.java │ │ │ │ │ │ │ ├── APIFlowNode.java │ │ │ │ │ │ │ ├── APIUserTask.java │ │ │ │ │ │ │ ├── APIHumanTask.java │ │ │ │ │ │ │ ├── UserTaskExecutionResourceFinder.java │ │ │ │ │ │ │ └── TimerEventTrigger.java │ │ │ │ │ │ └── process │ │ │ │ │ │ │ ├── ProcessContractResourceFinder.java │ │ │ │ │ │ │ ├── ProcessDefinitionDesignResourceFinder.java │ │ │ │ │ │ │ └── ProcessInstantiationResourceFinder.java │ │ │ │ │ ├── form │ │ │ │ │ │ └── FormMappingResourceFinder.java │ │ │ │ │ ├── bdm │ │ │ │ │ │ ├── BusinessDataFieldValue.java │ │ │ │ │ │ ├── BusinessDataQueryResourceFinder.java │ │ │ │ │ │ └── BusinessDataFindByIdsResourceFinder.java │ │ │ │ │ ├── system │ │ │ │ │ │ └── VersionFile.java │ │ │ │ │ └── organization │ │ │ │ │ │ └── password │ │ │ │ │ │ └── validator │ │ │ │ │ │ └── DefaultPasswordValidator.java │ │ │ │ └── engineclient │ │ │ │ │ └── CustomUserInfoEngineClientCreator.java │ │ │ └── model │ │ │ │ ├── bpm │ │ │ │ ├── flownode │ │ │ │ │ ├── ITaskItem.java │ │ │ │ │ └── IUserTaskItem.java │ │ │ │ └── AbstractDocumentDefinition.java │ │ │ │ ├── identity │ │ │ │ └── MemberType.java │ │ │ │ ├── tenant │ │ │ │ └── BusinessDataModelItem.java │ │ │ │ └── bdm │ │ │ │ └── BusinessDataModelItem.java │ │ └── toolkit │ │ │ ├── client │ │ │ ├── data │ │ │ │ └── item │ │ │ │ │ ├── attribute │ │ │ │ │ ├── modifier │ │ │ │ │ │ ├── Modifier.java │ │ │ │ │ │ ├── AbstractStringModifier.java │ │ │ │ │ │ └── DefaultValueModifier.java │ │ │ │ │ ├── validator │ │ │ │ │ │ ├── IsNumericValidator.java │ │ │ │ │ │ ├── FileIsNoScript.java │ │ │ │ │ │ ├── FileExtensionForbiddenValidator.java │ │ │ │ │ │ ├── FileIsImageValidator.java │ │ │ │ │ │ ├── StringSingleLineValidator.java │ │ │ │ │ │ └── AbstractCollectionValidator.java │ │ │ │ │ └── ModifiableInput.java │ │ │ │ │ ├── template │ │ │ │ │ ├── ItemHasIcon.java │ │ │ │ │ ├── ItemHasUniqueId.java │ │ │ │ │ ├── ItemHasLastUpdateDate.java │ │ │ │ │ ├── ItemHasDualDescription.java │ │ │ │ │ └── ItemHasDualName.java │ │ │ │ │ └── DummyItem.java │ │ │ └── common │ │ │ │ ├── json │ │ │ │ ├── JsonSerializable.java │ │ │ │ └── JSonUnserializer.java │ │ │ │ └── exception │ │ │ │ └── api │ │ │ │ ├── APIIncorrectIdException.java │ │ │ │ └── APISessionInvalidException.java │ │ │ └── server │ │ │ ├── ServiceFactory.java │ │ │ └── ServiceNotFoundException.java │ │ └── console │ │ ├── common │ │ └── server │ │ │ ├── servlet │ │ │ ├── IconContent.java │ │ │ └── ResourceLocationReader.java │ │ │ ├── utils │ │ │ ├── TenantCacheUtilFactory.java │ │ │ ├── UnauthorizedFolderException.java │ │ │ ├── DefaultTenantIdException.java │ │ │ └── DocumentUtil.java │ │ │ ├── page │ │ │ ├── VersionedClassloader.java │ │ │ └── PageContextHelper.java │ │ │ ├── login │ │ │ ├── credentials │ │ │ │ └── Credentials.java │ │ │ ├── filter │ │ │ │ ├── TenantIsPausedException.java │ │ │ │ └── EngineUserNotFoundOrInactive.java │ │ │ └── utils │ │ │ │ └── RedirectUrl.java │ │ │ ├── api │ │ │ └── token │ │ │ │ └── APIToken.java │ │ │ ├── auth │ │ │ └── AuthenticationManagerNotFoundException.java │ │ │ └── preferences │ │ │ └── properties │ │ │ └── PropertiesFactory.java │ │ └── server │ │ ├── ConsoleServiceFactory.java │ │ └── ConsoleServiceServlet.java └── README.md ├── .mvn └── wrapper │ ├── maven-wrapper.jar │ └── maven-wrapper.properties └── .gitignore /.gitattributes: -------------------------------------------------------------------------------- 1 | *.po merge=ours -------------------------------------------------------------------------------- /bonita-integration-tests-web/.gitignore: -------------------------------------------------------------------------------- 1 | /bin/ 2 | -------------------------------------------------------------------------------- /server/src/test/resources/bdmDependencies/bdm-dao.jar: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /server/src/test/resources/ARootPageFolder/lib/bdm-dao.jar: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /server/src/test/resources/ARootPageFolder/lib/util.jar: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /server/src/test/resources/bdmDependencies/bdm-client.jar: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /server/src/test/resources/ARootPageFolder/lib/bdm-client.jar: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /server/src/test/resources/invalidCustomPage/resources/style.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /server/src/test/resources/invalidFormPage/resources/index.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /server/src/test/resources/invalidThemePage/resources/style.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /server/src/test/resources/bdmDependencies/javassist-3.18.1-GA.jar: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /server/src/test/resources/ARootPageFolder/lib/javassist-3.18.1-GA.jar: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /server/src/test/resources/invalidFormPage/page.properties: -------------------------------------------------------------------------------- 1 | contentType=form -------------------------------------------------------------------------------- /server/src/test/resources/invalidThemePage/page.properties: -------------------------------------------------------------------------------- 1 | contentType=theme -------------------------------------------------------------------------------- /server/src/test/resources/ARootPageFolder/lib/subdir/resource.properties: -------------------------------------------------------------------------------- 1 | key=value -------------------------------------------------------------------------------- /server/src/test/resources/invalidCustomPage/descriptor.properties: -------------------------------------------------------------------------------- 1 | contentType=theme -------------------------------------------------------------------------------- /server/src/test/resources/org/bonitasoft/web/rest/server/api/bdm/bizdatamodel.zip: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /server/src/test/resources/ARootPageFolder/org/company/test/config.properties: -------------------------------------------------------------------------------- 1 | aProperty=Value -------------------------------------------------------------------------------- /server/src/test/resources/i18n/test_fr.po: -------------------------------------------------------------------------------- 1 | msgid "test key" 2 | msgstr "Valeur de test en français" 3 | -------------------------------------------------------------------------------- /server/src/test/resources/custom_po_resource/test_fr.po: -------------------------------------------------------------------------------- 1 | msgid "test key" 2 | msgstr "Valeur modifiée" 3 | -------------------------------------------------------------------------------- /server/src/main/resources/VERSION: -------------------------------------------------------------------------------- 1 | ${project.version} 2 | ${branding.version} 3 | Bonitasoft © ${build.year} 4 | -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bonitasoft/bonita-web/HEAD/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /server/src/test/resources/custom_po_resource/test_es.po: -------------------------------------------------------------------------------- 1 | msgid "test key" 2 | msgstr "valor de prueba en Espanol" 3 | -------------------------------------------------------------------------------- /server/src/test/resources/doc.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bonitasoft/bonita-web/HEAD/server/src/test/resources/doc.jpg -------------------------------------------------------------------------------- /server/src/test/resources/custom_po_resource/added_custom_i18n_fr.po: -------------------------------------------------------------------------------- 1 | msgid "about" 2 | msgstr "Copyright Bonitasoft 2016" 3 | -------------------------------------------------------------------------------- /server/src/test/resources/i18n/other_translations_fr.po: -------------------------------------------------------------------------------- 1 | msgid "web site title" 2 | msgstr "Bienvenue dans Bonita Portal 7+" 3 | -------------------------------------------------------------------------------- /server/src/test/resources/org/bonitasoft/console/common/server/page/file.css: -------------------------------------------------------------------------------- 1 | html, body { 2 | margin: 0; 3 | padding: 0; 4 | } -------------------------------------------------------------------------------- /server/src/test/resources/resources-permissions-mapping.properties: -------------------------------------------------------------------------------- 1 | GET|bpm/identity [UserVisualization, groupVisualization] 2 | -------------------------------------------------------------------------------- /server/src/test/resources/InvalidPage.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bonitasoft/bonita-web/HEAD/server/src/test/resources/InvalidPage.zip -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.8.5/apache-maven-3.8.5-bin.zip 2 | -------------------------------------------------------------------------------- /server/src/test/resources/pageApiExtension.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bonitasoft/bonita-web/HEAD/server/src/test/resources/pageApiExtension.zip -------------------------------------------------------------------------------- /server/src/main/webapp/images/error-red-circle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bonitasoft/bonita-web/HEAD/server/src/main/webapp/images/error-red-circle.png -------------------------------------------------------------------------------- /server/src/test/resources/org/bonitasoft/web/rest/server/api/bpm/flownode/timerEventTriggerInstance.json: -------------------------------------------------------------------------------- 1 | { 2 | "executionDate": 9223372036854775807 3 | } -------------------------------------------------------------------------------- /server/src/test/resources/pageWithPermissions.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bonitasoft/bonita-web/HEAD/server/src/test/resources/pageWithPermissions.zip -------------------------------------------------------------------------------- /server/src/main/webapp/images/error-lines-pattern.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bonitasoft/bonita-web/HEAD/server/src/main/webapp/images/error-lines-pattern.gif -------------------------------------------------------------------------------- /server/src/test/resources/custom-permissions-mapping.properties: -------------------------------------------------------------------------------- 1 | profile|User=[ManageLooknFeel, ManageProfiles] 2 | profile|HR\u0020manager=[ManageProfiles] 3 | -------------------------------------------------------------------------------- /server/src/test/resources/pageWithIndexInResources.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bonitasoft/bonita-web/HEAD/server/src/test/resources/pageWithIndexInResources.zip -------------------------------------------------------------------------------- /bonita-integration-tests-web/src/test/resources/page.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bonitasoft/bonita-web/HEAD/bonita-integration-tests-web/src/test/resources/page.zip -------------------------------------------------------------------------------- /bonita-integration-tests-web/src/test/resources/newPage.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bonitasoft/bonita-web/HEAD/bonita-integration-tests-web/src/test/resources/newPage.zip -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/livingapps/menu/Menu.java: -------------------------------------------------------------------------------- 1 | package org.bonitasoft.livingapps.menu; 2 | 3 | public interface Menu { 4 | 5 | String getHtml(); 6 | } 7 | -------------------------------------------------------------------------------- /server/src/test/resources/ARootPageFolder/AbstractIndex.groovy: -------------------------------------------------------------------------------- 1 | public class AbstractIndex { 2 | 3 | public String name(){ 4 | return "name"; 5 | } 6 | 7 | } 8 | -------------------------------------------------------------------------------- /server/src/test/resources/i18n/portal_fr.po: -------------------------------------------------------------------------------- 1 | # only here to make test org.bonitasoft.console.common.server.page.PageContextHelperTest work 2 | msgid "test key" 3 | msgstr "test value" 4 | -------------------------------------------------------------------------------- /server/src/test/resources/ARootPageFolder/Index.groovy: -------------------------------------------------------------------------------- 1 | 2 | public class Index extends AbstractIndex { 3 | 4 | public void doGet() { 5 | 6 | 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /server/src/test/resources/org/bonitasoft/console/common/server/page/page.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bonitasoft/bonita-web/HEAD/server/src/test/resources/org/bonitasoft/console/common/server/page/page.zip -------------------------------------------------------------------------------- /server/src/test/resources/org/bonitasoft/web/rest/server/datastore/page/page.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bonitasoft/bonita-web/HEAD/server/src/test/resources/org/bonitasoft/web/rest/server/datastore/page/page.zip -------------------------------------------------------------------------------- /server/src/test/resources/myRestAPI-1.0.0-SNAPSHOT/lib/myRestAPI-1.0.0-SNAPSHOT.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bonitasoft/bonita-web/HEAD/server/src/test/resources/myRestAPI-1.0.0-SNAPSHOT/lib/myRestAPI-1.0.0-SNAPSHOT.jar -------------------------------------------------------------------------------- /server/src/test/resources/ARootPageFolder/org/company/test/Util.groovy: -------------------------------------------------------------------------------- 1 | package org.company.test; 2 | 3 | public class Util { 4 | 5 | public static String name(){ 6 | return "My Name"; 7 | } 8 | 9 | } 10 | -------------------------------------------------------------------------------- /server/src/test/resources/compound-permissions-mapping.properties: -------------------------------------------------------------------------------- 1 | processListingPage processVisualization 2 | caseListingPage caseVisualizationWithTrailingSpace 3 | taskListingPage [TaskVisualization, CaseVisualization] 4 | 5 | -------------------------------------------------------------------------------- /server/src/test/resources/org/bonitasoft/console/common/server/page/pageApiExtension.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bonitasoft/bonita-web/HEAD/server/src/test/resources/org/bonitasoft/console/common/server/page/pageApiExtension.zip -------------------------------------------------------------------------------- /server/src/test/resources/org/bonitasoft/web/rest/server/datastore/page/pageApiExtension.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bonitasoft/bonita-web/HEAD/server/src/test/resources/org/bonitasoft/web/rest/server/datastore/page/pageApiExtension.zip -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/server/datastore/organization/Avatars.java: -------------------------------------------------------------------------------- 1 | package org.bonitasoft.web.rest.server.datastore.organization; 2 | 3 | 4 | public interface Avatars { 5 | 6 | String PATH = "../API/avatars/"; 7 | } 8 | -------------------------------------------------------------------------------- /server/src/main/webapp/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/server/framework/search/ISearchDirection.java: -------------------------------------------------------------------------------- 1 | package org.bonitasoft.web.rest.server.framework.search; 2 | 3 | public interface ISearchDirection { 4 | 5 | String SORT_ORDER_ASCENDING = " ASC"; 6 | String SORT_ORDER_DESCENDING = " DESC"; 7 | 8 | } 9 | -------------------------------------------------------------------------------- /server/src/test/resources/org/bonitasoft/web/rest/server/api/bdm/simpleRef.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "myEmployee", 3 | "type": "com.bonitasoft.pojo.Employee", 4 | "storageId": 487467354, 5 | "storageId_string": "487467354", 6 | "link": "API/bdm/businessData/com.bonitasoft.pojo.Employee/487467354" 7 | } -------------------------------------------------------------------------------- /server/src/test/resources/org/bonitasoft/web/rest/server/api/bpm/flownode/timerEventTriggerInstances.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "eventInstanceId": 2, 4 | "eventInstanceId_string": "2", 5 | "id": 1, 6 | "id_string": "1", 7 | "executionDate": 123, 8 | "eventInstanceName": "name" 9 | } 10 | ] 11 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # eclipse settings 2 | *.project 3 | *.settings 4 | *.classpath 5 | target/ 6 | 7 | # intellij settings 8 | *.iml 9 | **/.idea/** 10 | .idea 11 | 12 | btm1.tlog 13 | btm2.tlog 14 | 15 | *.class 16 | /en.po 17 | 18 | *.orig 19 | *.tmp 20 | node 21 | node_modules 22 | 23 | .java-version 24 | 25 | # h2 database 26 | *.h2.db 27 | *.lock.db 28 | *.mv.db 29 | *.trace.db -------------------------------------------------------------------------------- /server/src/test/java/org/bonitasoft/web/rest/server/api/bpm/flownode/Dummy.java: -------------------------------------------------------------------------------- 1 | package org.bonitasoft.web.rest.server.api.bpm.flownode; 2 | 3 | public class Dummy { 4 | 5 | private final String field; 6 | 7 | public Dummy(final String fieldValue) { 8 | field = fieldValue; 9 | } 10 | 11 | public String getField() { 12 | return field; 13 | } 14 | 15 | } -------------------------------------------------------------------------------- /server/src/test/resources/myRestAPI-1.0.0-SNAPSHOT/page.properties: -------------------------------------------------------------------------------- 1 | name=custompage_myRestAPI 2 | displayName=My REST API 3 | description=REST API to manage resourceName 4 | contentType=apiExtension 5 | 6 | apiExtensions=myRestAPI 7 | 8 | myRestAPI.method=GET 9 | myRestAPI.pathTemplate=myRestAPI 10 | myRestAPI.className=com.compagny.rest.api.MyController 11 | myRestAPI.permissions=myPermission 12 | -------------------------------------------------------------------------------- /server/src/test/resources/org/bonitasoft/web/rest/server/api/bdm/multiRef.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "myEmployee", 3 | "type": "com.bonitasoft.pojo.Employee", 4 | "storageIds": [ 5 | 487467354, 6 | 48674634 7 | ], 8 | "storageIds_string": [ 9 | "487467354", 10 | "48674634" 11 | ], 12 | "link": "API/bdm/businessData/com.bonitasoft.pojo.Employee/findByIds?ids=487467354,48674634" 13 | } -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/livingapps/exception/CreationException.java: -------------------------------------------------------------------------------- 1 | package org.bonitasoft.livingapps.exception; 2 | 3 | public class CreationException extends Exception { 4 | 5 | public CreationException(String message, Throwable throwable) { 6 | super(message, throwable); 7 | } 8 | 9 | public CreationException(String message) { 10 | super(message); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /server/src/test/java/org/bonitasoft/console/common/server/login/filter/FakeAuthenticationManager.java: -------------------------------------------------------------------------------- 1 | package org.bonitasoft.console.common.server.login.filter; 2 | 3 | import org.bonitasoft.console.common.server.auth.impl.standard.StandardAuthenticationManagerImpl; 4 | 5 | public class FakeAuthenticationManager extends StandardAuthenticationManagerImpl { 6 | 7 | public FakeAuthenticationManager() { 8 | } 9 | 10 | } 11 | -------------------------------------------------------------------------------- /server/src/test/resources/org/bonitasoft/web/rest/server/api/bpm/flownode/longDataInstance.json: -------------------------------------------------------------------------------- 1 | { 2 | "tenantId": 2, 3 | "tenantId_string": "2", 4 | "name": "dataInstanceName", 5 | "description": "description", 6 | "transientData": false, 7 | "className": "com.company.Model", 8 | "containerType": null, 9 | "id": 5, 10 | "id_string": "5", 11 | "containerId": 7, 12 | "containerId_string": "7", 13 | "value": 123, 14 | "value_string": "123" 15 | } -------------------------------------------------------------------------------- /server/src/test/resources/org/bonitasoft/web/rest/server/api/bpm/flownode/nullDataInstance.json: -------------------------------------------------------------------------------- 1 | { 2 | "tenantId": 2, 3 | "tenantId_string": "2", 4 | "name": "dataInstanceName", 5 | "description": "description", 6 | "transientData": false, 7 | "className": "com.company.Model", 8 | "containerType": null, 9 | "id": 5, 10 | "id_string": "5", 11 | "containerId": 7, 12 | "containerId_string": "7", 13 | "value": null, 14 | "value_string": "null" 15 | } -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/livingapps/menu/RootMenuCollector.java: -------------------------------------------------------------------------------- 1 | package org.bonitasoft.livingapps.menu; 2 | 3 | import org.bonitasoft.engine.business.application.ApplicationMenu; 4 | import org.bonitasoft.livingapps.menu.MenuFactory.Collector; 5 | 6 | 7 | class RootMenuCollector implements Collector { 8 | 9 | @Override 10 | public boolean isCollectible(final ApplicationMenu menu) { 11 | return menu.getParentId() == null; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /server/src/test/resources/org/bonitasoft/web/rest/server/api/bpm/flownode/doubleDataInstance.json: -------------------------------------------------------------------------------- 1 | { 2 | "tenantId": 2, 3 | "tenantId_string": "2", 4 | "name": "dataInstanceName", 5 | "description": "description", 6 | "transientData": false, 7 | "className": "com.company.Model", 8 | "containerType": null, 9 | "id": 5, 10 | "id_string": "5", 11 | "containerId": 7, 12 | "containerId_string": "7", 13 | "value": 123.5, 14 | "value_string": "123.5" 15 | } -------------------------------------------------------------------------------- /server/src/test/resources/org/bonitasoft/web/rest/server/api/bpm/flownode/stringDataInstance.json: -------------------------------------------------------------------------------- 1 | { 2 | "tenantId": 2, 3 | "tenantId_string": "2", 4 | "name": "dataInstanceName", 5 | "description": "description", 6 | "transientData": false, 7 | "className": "com.company.Model", 8 | "containerType": null, 9 | "id": 5, 10 | "id_string": "5", 11 | "containerId": 7, 12 | "containerId_string": "7", 13 | "value": "abc", 14 | "value_string": "abc" 15 | } -------------------------------------------------------------------------------- /server/src/test/resources/org/bonitasoft/web/rest/server/api/bpm/flownode/floatDataInstance.json: -------------------------------------------------------------------------------- 1 | { 2 | "tenantId": 2, 3 | "tenantId_string": "2", 4 | "name": "dataInstanceName", 5 | "description": "description", 6 | "transientData": false, 7 | "className": "com.company.Model", 8 | "containerType": null, 9 | "id": 5, 10 | "id_string": "5", 11 | "containerId": 7, 12 | "containerId_string": "7", 13 | "value": 123.456, 14 | "value_string": "123.456" 15 | } -------------------------------------------------------------------------------- /server/src/test/resources/org/bonitasoft/web/rest/server/api/bdm/refs.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "name": "john", 4 | "type": "com.bonitasoft.pojo.Employee", 5 | "storageId": 487467354, 6 | "storageId_string": "487467354" 7 | }, 8 | { 9 | "name": "Ateam", 10 | "type": "com.bonitasoft.pojo.Employee", 11 | "storageIds": [ 12 | 687646784, 13 | 2313213874354 14 | ], 15 | "storageIds_string": [ 16 | "687646784", 17 | "2313213874354" 18 | ] 19 | } 20 | ] -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/server/api/bpm/signal/BPMSignal.java: -------------------------------------------------------------------------------- 1 | package org.bonitasoft.web.rest.server.api.bpm.signal; 2 | 3 | public class BPMSignal { 4 | 5 | private String name; 6 | 7 | public String getName() { 8 | return name; 9 | } 10 | 11 | public void setName(String name) { 12 | this.name = name; 13 | } 14 | 15 | public static BPMSignal create(String signalName) { 16 | var bpmSignal = new BPMSignal(); 17 | bpmSignal.setName(signalName); 18 | return bpmSignal; 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /bonita-integration-tests-web/src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | %d{HH:mm:ss.SSS} [%thread] %-5level \(%file:%line\) %method - %msg%n 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /server/src/test/resources/org/bonitasoft/web/rest/server/api/bpm/flownode/contract.json: -------------------------------------------------------------------------------- 1 | { 2 | "constraints":[ 3 | {"name":"aRule","expression":"an expression","explanation":"an explanation","inputNames":[]} 4 | ], 5 | "inputs":[ 6 | {"description":"aDescription","name":"anInput","multiple":false,"type":"TEXT","inputs":[]}, 7 | {"description":"description","name":"complexInput","multiple":true,"type":null,"inputs":[ 8 | {"description":"aDescription","name":"anInput","multiple":false,"type":"TEXT","inputs":[]} 9 | ]} 10 | ] 11 | } -------------------------------------------------------------------------------- /server/src/test/resources/org/bonitasoft/web/rest/server/api/bpm/process/contract.json: -------------------------------------------------------------------------------- 1 | { 2 | "constraints":[ 3 | {"name":"aRule","expression":"an expression","explanation":"an explanation","inputNames":[]} 4 | ], 5 | "inputs":[ 6 | {"description":"aDescription","name":"anInput","multiple":false,"type":"TEXT","inputs":[]}, 7 | {"description":"description","name":"complexInput","multiple":true,"type":null,"inputs":[ 8 | {"description":"aDescription","name":"anInput","multiple":false,"type":"TEXT","inputs":[]} 9 | ]} 10 | ] 11 | } -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/console/common/server/servlet/IconContent.java: -------------------------------------------------------------------------------- 1 | package org.bonitasoft.console.common.server.servlet; 2 | 3 | class IconContent { 4 | private final byte[] content; 5 | private final String mimeType; 6 | 7 | public IconContent(byte[] content, String mimeType) { 8 | this.content = content; 9 | this.mimeType = mimeType; 10 | } 11 | 12 | public byte[] getContent() { 13 | return content; 14 | } 15 | 16 | public String getMimeType() { 17 | return mimeType; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /server/src/test/java/org/bonitasoft/web/toolkit/client/common/json/JSonUtilTest.java: -------------------------------------------------------------------------------- 1 | package org.bonitasoft.web.toolkit.client.common.json; 2 | 3 | import static org.assertj.core.api.Assertions.assertThat; 4 | import static org.bonitasoft.web.toolkit.client.common.json.JSonUtil.escape; 5 | 6 | import org.junit.Test; 7 | 8 | public class JSonUtilTest { 9 | 10 | @Test 11 | public void should_escape_unsafe_html_characters() { 12 | assertThat(escape("")) 13 | .isEqualTo("\\u003cscript\\u003ealert(\\u0027bad\\u0027)\\u003c\\/script\\u003e"); 14 | } 15 | } -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/console/common/server/utils/TenantCacheUtilFactory.java: -------------------------------------------------------------------------------- 1 | package org.bonitasoft.console.common.server.utils; 2 | 3 | /** 4 | * @author Julien Mege 5 | * 6 | */ 7 | public class TenantCacheUtilFactory { 8 | 9 | private static TenantCacheUtil tenantCacheUtil; 10 | 11 | /** 12 | * Get FormCacheUtil of different Domain 13 | * @return TenatCacheUtil 14 | */ 15 | public static TenantCacheUtil getTenantCacheUtil() { 16 | if (tenantCacheUtil == null) { 17 | tenantCacheUtil = new TenantCacheUtil(); 18 | } 19 | return tenantCacheUtil; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/livingapps/menu/ChildrenMenuCollector.java: -------------------------------------------------------------------------------- 1 | package org.bonitasoft.livingapps.menu; 2 | 3 | import org.bonitasoft.engine.business.application.ApplicationMenu; 4 | import org.bonitasoft.livingapps.menu.MenuFactory.Collector; 5 | 6 | 7 | class ChildrenMenuCollector implements Collector { 8 | 9 | private final Long parentId; 10 | 11 | public ChildrenMenuCollector(final Long parentId) { 12 | this.parentId = parentId; 13 | } 14 | 15 | @Override 16 | public boolean isCollectible(final ApplicationMenu menu) { 17 | return parentId.equals(menu.getParentId()); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/livingapps/menu/MenuLink.java: -------------------------------------------------------------------------------- 1 | package org.bonitasoft.livingapps.menu; 2 | 3 | import org.bonitasoft.engine.business.application.ApplicationMenu; 4 | 5 | 6 | public class MenuLink implements Menu { 7 | 8 | private final ApplicationMenu menu; 9 | private final String pageToken; 10 | 11 | public MenuLink(final ApplicationMenu menu, final String pageToken) { 12 | this.menu = menu; 13 | this.pageToken = pageToken; 14 | } 15 | 16 | @Override 17 | public String getHtml() { 18 | return "
  • " + menu.getDisplayName() + "
  • "; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /server/src/test/resources/org/bonitasoft/console/common/server/page/page.properties: -------------------------------------------------------------------------------- 1 | #The name must start with 'custompage_' 2 | name=custompage_restApi 3 | displayName=aDisplayName 4 | description=aDescription 5 | resources=[] 6 | 7 | contentType=apiExtension 8 | 9 | apiExtensions=restResource1,restResource2 10 | 11 | restResource1.method=GET 12 | restResource1.pathTemplate=restApiGet 13 | restResource1.classFileName=restResource1.groovy 14 | restResource1.permissions=permission1 15 | 16 | restResource2.method=POST 17 | restResource2.pathTemplate=restApiPost 18 | restResource2.classFileName=restResource1.groovy 19 | restResource2.permissions=permission2,permission3 20 | 21 | 22 | -------------------------------------------------------------------------------- /server/src/test/resources/IndexRestApi.groovy: -------------------------------------------------------------------------------- 1 | package org.bonitasoft.test.page 2 | 3 | import javax.servlet.http.HttpServletRequest 4 | 5 | import org.bonitasoft.web.extension.rest.RestAPIContext 6 | import org.bonitasoft.web.extension.rest.RestApiController 7 | import org.bonitasoft.web.extension.rest.RestApiResponse 8 | import org.bonitasoft.web.extension.rest.RestApiResponseBuilder 9 | 10 | class IndexRestApi implements RestApiController { 11 | 12 | @Override 13 | RestApiResponse doHandle(HttpServletRequest request, RestApiResponseBuilder responseBuilder, RestAPIContext context) { 14 | return responseBuilder.withResponse("result").build() 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/server/framework/json/JacksonSerializer.java: -------------------------------------------------------------------------------- 1 | package org.bonitasoft.web.rest.server.framework.json; 2 | 3 | import java.io.IOException; 4 | 5 | import com.fasterxml.jackson.databind.ObjectMapper; 6 | 7 | 8 | /** 9 | * @author Fabio Lombardi 10 | * 11 | */ 12 | public class JacksonSerializer { 13 | 14 | private final ObjectMapper mapper = new ObjectMapper(); 15 | 16 | public String serialize(Object obj) throws IOException { 17 | try{ 18 | return mapper.writeValueAsString(obj); 19 | }catch(Throwable e){ 20 | e.printStackTrace(); 21 | throw new RuntimeException(e); 22 | } 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /bonita-integration-tests-web/src/main/resources/org/bonitasoft/test/toolkit/connector/TestConnector.java: -------------------------------------------------------------------------------- 1 | package org.bonitasoft.test.toolkit.connector; 2 | 3 | import org.bonitasoft.engine.connector.AbstractConnector; 4 | import org.bonitasoft.engine.connector.ConnectorException; 5 | import org.bonitasoft.engine.connector.ConnectorValidationException; 6 | 7 | /** 8 | * @author Colin PUY 9 | */ 10 | public class TestConnector extends AbstractConnector { 11 | 12 | public void validateInputParameters() throws ConnectorValidationException { 13 | // Do Nothing 14 | } 15 | 16 | @Override 17 | protected void executeBusinessLogic() throws ConnectorException { 18 | // Do Nothing 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /bonita-integration-tests-web/src/main/resources/org/bonitasoft/test/toolkit/connector/TestConnector.impl: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.bonitasoft.test.toolkit.connector.TestConnector 4 | 1.0 5 | org.bonitasoft.test.toolkit.connector.TestConnector 6 | org.bonitasoft.test.toolkit.connector.testConnector 7 | 1.0 8 | 9 | 10 | aDependency.jar 11 | anOtherDependency.jar 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /server/src/test/java/org/bonitasoft/web/rest/server/api/bpm/flownode/APIActivityTest.java: -------------------------------------------------------------------------------- 1 | package org.bonitasoft.web.rest.server.api.bpm.flownode; 2 | 3 | import static org.assertj.core.api.Assertions.assertThat; 4 | 5 | import org.bonitasoft.web.rest.server.APITestWithMock; 6 | import org.junit.Test; 7 | 8 | public class APIActivityTest extends APITestWithMock { 9 | 10 | @Test 11 | public void should_have_default_search_order() throws Exception { 12 | final APIActivity apiActivity = new APIActivity(); 13 | 14 | final String defineDefaultSearchOrder = apiActivity.defineDefaultSearchOrder(); 15 | 16 | assertThat(defineDefaultSearchOrder).as("sould have a default search order").isEqualTo("state ASC"); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/console/common/server/utils/UnauthorizedFolderException.java: -------------------------------------------------------------------------------- 1 | package org.bonitasoft.console.common.server.utils; 2 | 3 | import java.io.IOException; 4 | 5 | /** 6 | * Technical exception thrown when we try to read/write a file out of the authorized file system path. 7 | * 8 | * @author Julien Mege 9 | */ 10 | public class UnauthorizedFolderException extends IOException { 11 | 12 | private static final long serialVersionUID = 1071342750973031637L; 13 | 14 | public UnauthorizedFolderException(final String message, final Throwable throwable) { 15 | super(message, throwable); 16 | } 17 | 18 | public UnauthorizedFolderException(final String message) { 19 | super(message); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /server/src/test/java/org/bonitasoft/web/rest/server/api/organization/password/validator/DefaultPasswordValidatorTest.java: -------------------------------------------------------------------------------- 1 | package org.bonitasoft.web.rest.server.api.organization.password.validator; 2 | 3 | import static org.junit.Assert.assertTrue; 4 | 5 | import org.bonitasoft.console.common.server.i18n.I18n; 6 | import org.junit.Test; 7 | 8 | 9 | 10 | public class DefaultPasswordValidatorTest { 11 | 12 | DefaultPasswordValidator defaultPasswordValidator = new DefaultPasswordValidator(); 13 | 14 | @Test 15 | public void testWithPassword() { 16 | I18n.getInstance(); 17 | defaultPasswordValidator.setLocale("en"); 18 | defaultPasswordValidator.check("password"); 19 | assertTrue(defaultPasswordValidator.getErrors().isEmpty()); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /server/src/test/java/org/bonitasoft/web/rest/server/api/bpm/flownode/APIUserTaskTest.java: -------------------------------------------------------------------------------- 1 | package org.bonitasoft.web.rest.server.api.bpm.flownode; 2 | 3 | import static org.assertj.core.api.Assertions.assertThat; 4 | 5 | import org.bonitasoft.web.rest.server.APITestWithMock; 6 | import org.junit.Test; 7 | 8 | 9 | public class APIUserTaskTest extends APITestWithMock { 10 | 11 | @Test 12 | public void should_have_default_search_order() throws Exception { 13 | //given 14 | final APIUserTask api = new APIUserTask(); 15 | 16 | //when 17 | final String defineDefaultSearchOrder = api.defineDefaultSearchOrder(); 18 | 19 | //then 20 | assertThat(defineDefaultSearchOrder).as("sould have a default search order").isEqualTo("priority DESC"); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /server/src/test/java/org/bonitasoft/web/rest/server/api/bpm/flownode/APITaskTest.java: -------------------------------------------------------------------------------- 1 | package org.bonitasoft.web.rest.server.api.bpm.flownode; 2 | 3 | import static org.assertj.core.api.Assertions.assertThat; 4 | 5 | import org.bonitasoft.web.rest.server.APITestWithMock; 6 | import org.junit.Test; 7 | 8 | public class APITaskTest extends APITestWithMock { 9 | 10 | @Test 11 | public void should_have_default_search_order() throws Exception { 12 | //given 13 | final APITask apiActivity = new APITask(); 14 | 15 | //when 16 | final String defineDefaultSearchOrder = apiActivity.defineDefaultSearchOrder(); 17 | 18 | //then 19 | assertThat(defineDefaultSearchOrder).as("sould have a default search order").isEqualTo("last_update_date DESC"); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /server/src/test/java/org/bonitasoft/web/rest/server/api/bpm/flownode/archive/APIArchivedFlowNodeTest.java: -------------------------------------------------------------------------------- 1 | package org.bonitasoft.web.rest.server.api.bpm.flownode.archive; 2 | 3 | import static org.assertj.core.api.Assertions.assertThat; 4 | 5 | import org.bonitasoft.web.rest.server.APITestWithMock; 6 | import org.junit.Test; 7 | 8 | 9 | public class APIArchivedFlowNodeTest extends APITestWithMock { 10 | 11 | @Test 12 | public void should_have_default_search_order() throws Exception { 13 | final APIArchivedFlowNode apiActivity = new APIArchivedFlowNode(); 14 | 15 | final String defineDefaultSearchOrder = apiActivity.defineDefaultSearchOrder(); 16 | 17 | assertThat(defineDefaultSearchOrder).as("sould have a default search order").isEqualTo("displayName ASC"); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /server/src/test/java/org/bonitasoft/web/rest/server/api/bpm/flownode/archive/APIArchivedUserTaskTest.java: -------------------------------------------------------------------------------- 1 | package org.bonitasoft.web.rest.server.api.bpm.flownode.archive; 2 | 3 | import static org.assertj.core.api.Assertions.assertThat; 4 | 5 | import org.bonitasoft.web.rest.server.APITestWithMock; 6 | import org.junit.Test; 7 | 8 | public class APIArchivedUserTaskTest extends APITestWithMock { 9 | 10 | @Test 11 | public void should_have_default_search_order() throws Exception { 12 | final APIArchivedUserTask apiActivity = new APIArchivedUserTask(); 13 | 14 | final String defineDefaultSearchOrder = apiActivity.defineDefaultSearchOrder(); 15 | 16 | assertThat(defineDefaultSearchOrder).as("sould have a default search order").isEqualTo("priority DESC"); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/server/api/bpm/flownode/archive/ArchivedUserTaskContextResourceFinder.java: -------------------------------------------------------------------------------- 1 | package org.bonitasoft.web.rest.server.api.bpm.flownode.archive; 2 | 3 | import org.bonitasoft.engine.api.ProcessAPI; 4 | import org.bonitasoft.web.rest.server.ResourceFinder; 5 | import org.restlet.Request; 6 | import org.restlet.Response; 7 | import org.restlet.resource.ServerResource; 8 | 9 | /** 10 | * Created by Fabio Lombardi 11 | */ 12 | public class ArchivedUserTaskContextResourceFinder extends ResourceFinder { 13 | @Override 14 | public ServerResource create(final Request request, final Response response) { 15 | final ProcessAPI processAPI = getProcessAPI(request); 16 | return new ArchivedUserTaskContextResource(processAPI, getFinderFactory()); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /server/src/test/java/org/bonitasoft/web/rest/server/api/bpm/flownode/archive/APIArchivedActivityTest.java: -------------------------------------------------------------------------------- 1 | package org.bonitasoft.web.rest.server.api.bpm.flownode.archive; 2 | 3 | import static org.assertj.core.api.Assertions.assertThat; 4 | 5 | import org.bonitasoft.web.rest.server.APITestWithMock; 6 | import org.junit.Test; 7 | 8 | public class APIArchivedActivityTest extends APITestWithMock { 9 | 10 | @Test 11 | public void should_have_default_search_order() throws Exception { 12 | final APIArchivedActivity apiActivity = new APIArchivedActivity(); 13 | 14 | final String defineDefaultSearchOrder = apiActivity.defineDefaultSearchOrder(); 15 | 16 | assertThat(defineDefaultSearchOrder).as("sould have a default search order").isEqualTo("reached_state_date ASC"); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /server/src/test/java/org/bonitasoft/web/rest/server/api/bpm/flownode/archive/APIArchivedHumanTaskTest.java: -------------------------------------------------------------------------------- 1 | package org.bonitasoft.web.rest.server.api.bpm.flownode.archive; 2 | 3 | import static org.assertj.core.api.Assertions.assertThat; 4 | 5 | import org.bonitasoft.web.rest.server.APITestWithMock; 6 | import org.junit.Test; 7 | 8 | 9 | public class APIArchivedHumanTaskTest extends APITestWithMock { 10 | 11 | @Test 12 | public void should_have_default_search_order() throws Exception { 13 | //given 14 | final APIArchivedHumanTask api = new APIArchivedHumanTask(); 15 | 16 | //when 17 | final String defineDefaultSearchOrder = api.defineDefaultSearchOrder(); 18 | 19 | //then 20 | assertThat(defineDefaultSearchOrder).as("sould have a default search order").isEqualTo("priority DESC"); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /server/src/test/java/org/bonitasoft/console/common/server/utils/TenantCacheUtilTest.java: -------------------------------------------------------------------------------- 1 | package org.bonitasoft.console.common.server.utils; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.assertEquals; 6 | import static org.junit.Assert.assertNotNull; 7 | 8 | public class TenantCacheUtilTest { 9 | 10 | @Test 11 | public void shouldStoreActorInitiator() { 12 | final TenantCacheUtil tenantCacheUtil = TenantCacheUtilFactory.getTenantCacheUtil(); 13 | tenantCacheUtil.storeProcessActorInitiatorId(2L, 3L); 14 | final Long actorInitiatorRetrievedFromCacheByParameters = TenantCacheUtilFactory.getTenantCacheUtil().getProcessActorInitiatorId(2L); 15 | assertNotNull(actorInitiatorRetrievedFromCacheByParameters); 16 | assertEquals(3L, actorInitiatorRetrievedFromCacheByParameters.longValue()); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /server/src/main/webapp/WEB-INF/errors.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Error %s 5 | 6 | 7 | 23 | 24 | 25 |
    26 | 27 |
    28 | 29 | -------------------------------------------------------------------------------- /server/src/test/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | |%d{HH:mm:ss.SSS}|%thread|%-5level|%logger{16}| %msg%n 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/server/datastore/page/PageDatastoreFactory.java: -------------------------------------------------------------------------------- 1 | package org.bonitasoft.web.rest.server.datastore.page; 2 | 3 | import org.bonitasoft.console.common.server.page.CustomPageService; 4 | import org.bonitasoft.console.common.server.preferences.constants.WebBonitaConstantsUtils; 5 | import org.bonitasoft.console.common.server.utils.BonitaHomeFolderAccessor; 6 | import org.bonitasoft.engine.api.PageAPI; 7 | import org.bonitasoft.engine.session.APISession; 8 | 9 | 10 | public class PageDatastoreFactory { 11 | 12 | public PageDatastore create(final APISession engineSession, final WebBonitaConstantsUtils constantsValue, final PageAPI pageAPI) { 13 | return new PageDatastore(engineSession, 14 | constantsValue, 15 | pageAPI, 16 | new CustomPageService(), 17 | new BonitaHomeFolderAccessor()); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /server/src/test/java/org/bonitasoft/livingapps/menu/RootMenuCollectorTest.java: -------------------------------------------------------------------------------- 1 | package org.bonitasoft.livingapps.menu; 2 | 3 | import static org.assertj.core.api.Assertions.assertThat; 4 | 5 | import org.bonitasoft.engine.business.application.impl.ApplicationMenuImpl; 6 | import org.junit.Test; 7 | 8 | public class RootMenuCollectorTest { 9 | 10 | RootMenuCollector collector = new RootMenuCollector(); 11 | 12 | ApplicationMenuImpl menu = new ApplicationMenuImpl("name", 1L, 2L, 1); 13 | 14 | @Test 15 | public void should_be_collectible_when_the_menu_has_no_parentId() { 16 | menu.setParentId(null); 17 | 18 | assertThat(collector.isCollectible(menu)).isTrue(); 19 | } 20 | 21 | @Test 22 | public void should_not_be_collectible_when_the_menu_has_a_parentId() { 23 | menu.setParentId(3L); 24 | 25 | assertThat(collector.isCollectible(menu)).isFalse(); 26 | } 27 | } -------------------------------------------------------------------------------- /server/README.md: -------------------------------------------------------------------------------- 1 | # Server 2 | 3 | Bonita server app. 4 | Enhance server with a REST API 5 | 6 | ## Launch dev mode 7 | The module need to first be built using 8 | 9 | mvn clean install 10 | 11 | Then we can build and launch a tomcat to host the app using 12 | 13 | mvn clean verify org.codehaus.cargo:cargo-maven2-plugin:run -DskipTests 14 | 15 | H2 database is created (if it does not already exist) in ${user.home}/.bonita/community/database 16 | When you checkout a different branch you need to clean this directory because the database schema may have changed. 17 | 18 | Hot reload is not supported, but hen you update a class in portal/, server/ or common/ in your IDE all you need to do is to restart the tomcat with the previous command (classes will be retrieved from the projects target/classes directory) 19 | 20 | You can debug the server code using the Remote Debug configuration of your ide on the port 5005. -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/console/common/server/servlet/ResourceLocationReader.java: -------------------------------------------------------------------------------- 1 | package org.bonitasoft.console.common.server.servlet; 2 | 3 | import javax.servlet.http.HttpServletRequest; 4 | 5 | 6 | public class ResourceLocationReader { 7 | 8 | /** 9 | * file location 10 | */ 11 | public final static String LOCATION_PARAM = "location"; 12 | 13 | public String getResourceLocationFromRequest(final HttpServletRequest request) { 14 | String fileName = request.getParameter(LOCATION_PARAM); 15 | if (fileName == null) { 16 | final String pathInfo = request.getPathInfo(); 17 | if (pathInfo != null && pathInfo.startsWith("/") && pathInfo.length() > 1) { 18 | //Support relative calls to the THEME from the homepage using ../theme 19 | fileName = pathInfo.substring(1); 20 | } 21 | } 22 | return fileName; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /server/src/test/java/org/bonitasoft/web/rest/server/datastore/utils/NotSerializableObject.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2012 BonitaSoft S.A. 3 | * 4 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 2.0 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | package org.bonitasoft.web.rest.server.datastore.utils; 19 | 20 | public class NotSerializableObject { 21 | } -------------------------------------------------------------------------------- /server/src/test/java/org/bonitasoft/web/rest/server/api/resource/ErrorMessageTest.java: -------------------------------------------------------------------------------- 1 | package org.bonitasoft.web.rest.server.api.resource; 2 | 3 | import static org.assertj.core.api.Assertions.assertThat; 4 | 5 | import org.junit.Test; 6 | 7 | public class ErrorMessageTest { 8 | 9 | @Test 10 | public void should_encode_message_when_using_constructor() throws Exception { 11 | ErrorMessage errorMessage = new ErrorMessage(new RuntimeException("")); 12 | 13 | assertThat(errorMessage.getMessage()).isEqualTo("\\u003cscript\\u003ealert(\\u0027bad\\u0027)\\u003c\\/script\\u003e"); 14 | } 15 | 16 | @Test 17 | public void should_encode_message_when_using_setter() throws Exception { 18 | ErrorMessage errorMessage = new ErrorMessage(); 19 | errorMessage.setMessage(""); 20 | 21 | assertThat(errorMessage.getMessage()).isEqualTo("\\u003cscript\\u003ealert(\\u0027bad\\u0027)\\u003c\\/script\\u003e"); 22 | } 23 | } -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/server/framework/api/Datastore.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2012 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.web.rest.server.framework.api; 18 | 19 | /** 20 | * @author Julien Mege 21 | * 22 | */ 23 | public class Datastore { 24 | 25 | } 26 | -------------------------------------------------------------------------------- /server/src/test/java/org/bonitasoft/web/rest/server/framework/json/JacksonSerializerTest.java: -------------------------------------------------------------------------------- 1 | package org.bonitasoft.web.rest.server.framework.json; 2 | 3 | import static org.assertj.core.api.Assertions.assertThat; 4 | 5 | import org.bonitasoft.web.rest.server.framework.json.model.ProfileImportStatusMessageFake; 6 | import org.junit.Test; 7 | 8 | public class JacksonSerializerTest { 9 | 10 | @Test 11 | public void testSerialize() throws Exception { 12 | // Given 13 | JacksonSerializer serializer = new JacksonSerializer(); 14 | ProfileImportStatusMessageFake message = new ProfileImportStatusMessageFake("profile1", "will be replaced"); 15 | message.addError("Organization: skks"); 16 | message.addError("Page: page1"); 17 | 18 | // When 19 | String serialize = serializer.serialize(message); 20 | 21 | // Then 22 | assertThat(serialize).isEqualTo("{\"errors\":[\"Organization: skks\",\"Page: page1\"],\"profileName\":\"profile1\"}"); 23 | 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/model/bpm/flownode/ITaskItem.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2013 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.web.rest.model.bpm.flownode; 18 | 19 | /** 20 | * @author Séverin Moussel 21 | * 22 | */ 23 | public interface ITaskItem extends IActivityItem { 24 | 25 | } 26 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/toolkit/client/data/item/attribute/modifier/Modifier.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.web.toolkit.client.data.item.attribute.modifier; 18 | 19 | /** 20 | * @author Séverin Moussel 21 | * 22 | */ 23 | public class Modifier { 24 | } 25 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/model/bpm/flownode/IUserTaskItem.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2013 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.web.rest.model.bpm.flownode; 18 | 19 | 20 | /** 21 | * @author Séverin Moussel 22 | * 23 | */ 24 | public interface IUserTaskItem extends IHumanTaskItem { 25 | 26 | } 27 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/toolkit/client/common/json/JsonSerializable.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * You should have received a copy of the GNU General Public License 13 | * along with this program. If not, see . 14 | */ 15 | package org.bonitasoft.web.toolkit.client.common.json; 16 | 17 | /** 18 | * 19 | * @author Séverin Moussel 20 | * 21 | */ 22 | public interface JsonSerializable { 23 | 24 | String toJson(); 25 | } 26 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/console/common/server/page/VersionedClassloader.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2015 Bonitasoft S.A. 3 | * Bonitasoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.console.common.server.page; 18 | 19 | 20 | public interface VersionedClassloader { 21 | 22 | String getVersion(); 23 | 24 | boolean hasVersion(String version); 25 | } 26 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/console/common/server/login/credentials/Credentials.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2012 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.console.common.server.login.credentials; 18 | 19 | /** 20 | * @author Vincent Elcrin 21 | * 22 | */ 23 | public interface Credentials { 24 | 25 | String getName(); 26 | 27 | String getPassword(); 28 | } 29 | -------------------------------------------------------------------------------- /server/src/test/resources/test.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Project-Id-Version: bonita-bpm-60\n" 4 | "POT-Creation-Date: 2013-06-07 14:58+0100\n" 5 | "PO-Revision-Date: 2013-06-07 14:58+0100\n" 6 | "Last-Translator: \n" 7 | "Language-Team: English\n" 8 | "Language: en_US\n" 9 | "MIME-Version: 1.0\n" 10 | "Content-Type: text/plain; charset=UTF-8\n" 11 | "Content-Transfer-Encoding: 8bit\n" 12 | "X-Generator: Poedit 1.5.5\n" 13 | "X-Poedit-KeywordsList: _;gettext;gettext_noop\n" 14 | "X-Poedit-Basepath: .\n" 15 | "X-Poedit-SourceCharset: UTF-8\n" 16 | "Plural-Forms: nplurals=2; plural=(n != 1);\n" 17 | "X-Poedit-SearchPath-0: common\n" 18 | "X-Poedit-SearchPath-1: console\n" 19 | "X-Poedit-SearchPath-2: platform\n" 20 | "X-Poedit-SearchPath-3: toolkit\n" 21 | 22 | #: toolkit/toolkit-view/src/main/java/org/bonitasoft/web/toolkit/client/ui/page/SupportCodePage.java:42 23 | msgid "" 24 | "Multiline\n" 25 | "Message\n" 26 | "Id" 27 | msgstr "" 28 | "This is a multilines\n" 29 | "Message" 30 | 31 | #: toolkit/toolkit-view/src/main/java/org/bonitasoft/web/toolkit/client/ui/page/SupportCodePage.java:43 32 | msgid "theId" 33 | msgstr "theMsg" 34 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/server/api/bpm/process/ProcessContractResourceFinder.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2015 BonitaSoft S.A. 3 | * BonitaSoft is a trademark of BonitaSoft SA. 4 | * This software file is BONITASOFT CONFIDENTIAL. Not For Distribution. 5 | * For commercial licensing information, contact: 6 | * BonitaSoft, 32 rue Gustave Eiffel – 38000 Grenoble 7 | * or BonitaSoft US, 51 Federal Street, Suite 305, San Francisco, CA 94107 8 | **/ 9 | 10 | package org.bonitasoft.web.rest.server.api.bpm.process; 11 | 12 | import org.bonitasoft.engine.api.ProcessAPI; 13 | import org.bonitasoft.web.rest.server.ResourceFinder; 14 | import org.restlet.Request; 15 | import org.restlet.Response; 16 | import org.restlet.resource.ServerResource; 17 | 18 | /** 19 | * @author Baptiste Mesta 20 | */ 21 | public class ProcessContractResourceFinder extends ResourceFinder { 22 | 23 | @Override 24 | public ServerResource create(final Request request, final Response response) { 25 | final ProcessAPI processAPI = getProcessAPI(request); 26 | return new ProcessContractResource(processAPI); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/server/api/form/FormMappingResourceFinder.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2015 BonitaSoft S.A. 3 | * BonitaSoft is a trademark of BonitaSoft SA. 4 | * This software file is BONITASOFT CONFIDENTIAL. Not For Distribution. 5 | * For commercial licensing information, contact: 6 | * BonitaSoft, 32 rue Gustave Eiffel – 38000 Grenoble 7 | * or BonitaSoft US, 51 Federal Street, Suite 305, San Francisco, CA 94107 8 | **/ 9 | 10 | package org.bonitasoft.web.rest.server.api.form; 11 | 12 | import org.bonitasoft.engine.api.ProcessAPI; 13 | import org.bonitasoft.web.rest.server.ResourceFinder; 14 | import org.restlet.Request; 15 | import org.restlet.Response; 16 | import org.restlet.resource.ServerResource; 17 | 18 | /** 19 | * @author Baptiste Mesta 20 | */ 21 | public class FormMappingResourceFinder extends ResourceFinder { 22 | 23 | @Override 24 | public ServerResource create(final Request request, final Response response) { 25 | final ProcessAPI processConfigurationAPI = getProcessAPI(request); 26 | return new FormMappingResource(processConfigurationAPI); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/server/api/bpm/flownode/UserTaskContractResourceFinder.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2015 BonitaSoft S.A. 3 | * BonitaSoft is a trademark of BonitaSoft SA. 4 | * This software file is BONITASOFT CONFIDENTIAL. Not For Distribution. 5 | * For commercial licensing information, contact: 6 | * BonitaSoft, 32 rue Gustave Eiffel – 38000 Grenoble 7 | * or BonitaSoft US, 51 Federal Street, Suite 305, San Francisco, CA 94107 8 | **/ 9 | 10 | package org.bonitasoft.web.rest.server.api.bpm.flownode; 11 | 12 | import org.bonitasoft.engine.api.ProcessAPI; 13 | import org.bonitasoft.web.rest.server.ResourceFinder; 14 | import org.restlet.Request; 15 | import org.restlet.Response; 16 | import org.restlet.resource.ServerResource; 17 | 18 | /** 19 | * @author Baptiste Mesta 20 | */ 21 | public class UserTaskContractResourceFinder extends ResourceFinder { 22 | 23 | @Override 24 | public ServerResource create(final Request request, final Response response) { 25 | final ProcessAPI processAPI = getProcessAPI(request); 26 | return new UserTaskContractResource(processAPI); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /bonita-integration-tests-web/src/main/java/org/bonitasoft/test/toolkit/bpm/TestActor.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2012 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.test.toolkit.bpm; 18 | 19 | /** 20 | * @author Vincent Elcrin 21 | * 22 | */ 23 | public interface TestActor { 24 | 25 | /** 26 | * Id used by the process to define the actor 27 | */ 28 | long getId(); 29 | } 30 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/server/api/bpm/flownode/TimerEventTriggerResourceFinder.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2015 BonitaSoft S.A. 3 | * BonitaSoft is a trademark of BonitaSoft SA. 4 | * This software file is BONITASOFT CONFIDENTIAL. Not For Distribution. 5 | * For commercial licensing information, contact: 6 | * BonitaSoft, 32 rue Gustave Eiffel – 38000 Grenoble 7 | * or BonitaSoft US, 51 Federal Street, Suite 305, San Francisco, CA 94107 8 | **/ 9 | 10 | package org.bonitasoft.web.rest.server.api.bpm.flownode; 11 | 12 | import org.bonitasoft.engine.api.ProcessAPI; 13 | import org.bonitasoft.web.rest.server.ResourceFinder; 14 | import org.restlet.Request; 15 | import org.restlet.Response; 16 | import org.restlet.resource.ServerResource; 17 | 18 | /** 19 | * @author Baptiste Mesta 20 | */ 21 | public class TimerEventTriggerResourceFinder extends ResourceFinder { 22 | 23 | @Override 24 | public ServerResource create(final Request request, final Response response) { 25 | final ProcessAPI processAPI = getProcessAPI(request); 26 | return new TimerEventTriggerResource(processAPI); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/server/api/bpm/flownode/UserTaskContextResourceFinder.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2015 BonitaSoft S.A. 3 | * BonitaSoft is a trademark of BonitaSoft SA. 4 | * This software file is BONITASOFT CONFIDENTIAL. Not For Distribution. 5 | * For commercial licensing information, contact: 6 | * BonitaSoft, 32 rue Gustave Eiffel – 38000 Grenoble 7 | * or BonitaSoft US, 51 Federal Street, Suite 305, San Francisco, CA 94107 8 | **/ 9 | 10 | package org.bonitasoft.web.rest.server.api.bpm.flownode; 11 | 12 | import org.bonitasoft.engine.api.ProcessAPI; 13 | import org.bonitasoft.web.rest.server.ResourceFinder; 14 | import org.restlet.Request; 15 | import org.restlet.Response; 16 | import org.restlet.resource.ServerResource; 17 | 18 | /** 19 | * @author Baptiste Mesta 20 | */ 21 | public class UserTaskContextResourceFinder extends ResourceFinder { 22 | 23 | @Override 24 | public ServerResource create(final Request request, final Response response) { 25 | final ProcessAPI processAPI = getProcessAPI(request); 26 | return new UserTaskContextResource(processAPI, getFinderFactory()); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/server/api/bpm/process/ProcessDefinitionDesignResourceFinder.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2015 BonitaSoft S.A. 3 | * BonitaSoft is a trademark of BonitaSoft SA. 4 | * This software file is BONITASOFT CONFIDENTIAL. Not For Distribution. 5 | * For commercial licensing information, contact: 6 | * BonitaSoft, 32 rue Gustave Eiffel – 38000 Grenoble 7 | * or BonitaSoft US, 51 Federal Street, Suite 305, San Francisco, CA 94107 8 | **/ 9 | 10 | package org.bonitasoft.web.rest.server.api.bpm.process; 11 | 12 | import org.bonitasoft.engine.api.ProcessAPI; 13 | import org.bonitasoft.web.rest.server.ResourceFinder; 14 | import org.restlet.Request; 15 | import org.restlet.Response; 16 | import org.restlet.resource.ServerResource; 17 | 18 | /** 19 | * @author Baptiste Mesta 20 | */ 21 | public class ProcessDefinitionDesignResourceFinder extends ResourceFinder { 22 | 23 | @Override 24 | public ServerResource create(final Request request, final Response response) { 25 | final ProcessAPI processAPI = getProcessAPI(request); 26 | return new ProcessDefinitionDesignResource(processAPI); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/server/framework/api/APIHasAdd.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2012 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.web.rest.server.framework.api; 18 | 19 | import org.bonitasoft.web.toolkit.client.data.item.IItem; 20 | 21 | /** 22 | * @author Séverin Moussel 23 | * 24 | */ 25 | public interface APIHasAdd { 26 | 27 | T add(final T item); 28 | } 29 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/toolkit/client/data/item/template/ItemHasIcon.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2012 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * You should have received a copy of the GNU General Public License 13 | * along with this program. If not, see . 14 | */ 15 | package org.bonitasoft.web.toolkit.client.data.item.template; 16 | 17 | /** 18 | * @author Séverin Moussel 19 | */ 20 | public interface ItemHasIcon { 21 | 22 | String ATTRIBUTE_ICON = "icon"; 23 | 24 | String getIcon(); 25 | 26 | void setIcon(String icon); 27 | 28 | } 29 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/server/api/bpm/flownode/APIFlowNode.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2013 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.web.rest.server.api.bpm.flownode; 18 | 19 | import org.bonitasoft.web.rest.model.bpm.flownode.FlowNodeItem; 20 | 21 | /** 22 | * @author Séverin Moussel 23 | * 24 | */ 25 | public class APIFlowNode extends AbstractAPIFlowNode { 26 | 27 | } 28 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/server/api/bpm/flownode/APIUserTask.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2013 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.web.rest.server.api.bpm.flownode; 18 | 19 | import org.bonitasoft.web.rest.model.bpm.flownode.UserTaskItem; 20 | 21 | /** 22 | * @author Séverin Moussel 23 | * 24 | */ 25 | public class APIUserTask extends AbstractAPIUserTask { 26 | 27 | } 28 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/server/datastore/converter/ValueConverter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2012 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.web.rest.server.datastore.converter; 18 | 19 | import java.io.Serializable; 20 | 21 | /** 22 | * @author Vincent Elcrin 23 | * 24 | */ 25 | public interface ValueConverter { 26 | 27 | V convert(String value); 28 | } 29 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/livingapps/menu/MenuContainer.java: -------------------------------------------------------------------------------- 1 | package org.bonitasoft.livingapps.menu; 2 | 3 | import java.util.List; 4 | 5 | import org.bonitasoft.engine.business.application.ApplicationMenu; 6 | 7 | 8 | public class MenuContainer implements Menu { 9 | 10 | private final ApplicationMenu menu; 11 | 12 | private final List children; 13 | 14 | public MenuContainer(final ApplicationMenu menu, final List children) { 15 | this.menu = menu; 16 | this.children = children; 17 | } 18 | 19 | @Override 20 | public String getHtml() { 21 | final StringBuilder builder = new StringBuilder() 22 | .append("
  • ") 23 | .append("") 24 | .append(menu.getDisplayName()).append(" ") 25 | .append("
      "); 26 | for (final Menu child : children) { 27 | builder.append(child.getHtml()); 28 | } 29 | return builder.append("
  • ").toString(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/server/api/bpm/flownode/APIHumanTask.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2013 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.web.rest.server.api.bpm.flownode; 18 | 19 | import org.bonitasoft.web.rest.model.bpm.flownode.HumanTaskItem; 20 | 21 | /** 22 | * @author Séverin Moussel 23 | * 24 | */ 25 | public class APIHumanTask extends AbstractAPIHumanTask { 26 | 27 | } 28 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/server/framework/api/DatastoreHasAdd.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2012 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.web.rest.server.framework.api; 18 | 19 | import org.bonitasoft.web.toolkit.client.data.item.IItem; 20 | 21 | /** 22 | * @author Séverin Moussel 23 | * 24 | */ 25 | public interface DatastoreHasAdd { 26 | 27 | T add(final T item); 28 | } 29 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/server/datastore/filter/FilterCreator.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2012 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.web.rest.server.datastore.filter; 18 | 19 | import java.io.Serializable; 20 | 21 | /** 22 | * @author Vincent Elcrin 23 | * 24 | */ 25 | public interface FilterCreator { 26 | 27 | Filter create(String attribute, String value); 28 | } 29 | -------------------------------------------------------------------------------- /server/src/test/java/org/bonitasoft/livingapps/menu/ChildrenMenuCollectorTest.java: -------------------------------------------------------------------------------- 1 | package org.bonitasoft.livingapps.menu; 2 | 3 | import static org.assertj.core.api.Assertions.assertThat; 4 | 5 | import org.bonitasoft.engine.business.application.impl.ApplicationMenuImpl; 6 | import org.junit.Test; 7 | 8 | public class ChildrenMenuCollectorTest { 9 | 10 | ChildrenMenuCollector collector = new ChildrenMenuCollector(1L); 11 | 12 | ApplicationMenuImpl menu = new ApplicationMenuImpl("name", 1L, 2L, 1); 13 | 14 | @Test 15 | public void should_be_collectible_when_menu_parentId_is_the_given_parentId() { 16 | menu.setParentId(1L); 17 | 18 | assertThat(collector.isCollectible(menu)).isTrue(); 19 | } 20 | 21 | @Test 22 | public void should_not_be_collectible_when_menu_parentId_is_not_the_given_parentId() { 23 | menu.setParentId(2L); 24 | 25 | assertThat(collector.isCollectible(menu)).isFalse(); 26 | } 27 | 28 | @Test 29 | public void should_not_be_collectible_when_menu_parentId_is_null() { 30 | menu.setParentId(null); 31 | 32 | assertThat(collector.isCollectible(menu)).isFalse(); 33 | } 34 | } -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/server/api/bdm/BusinessDataFieldValue.java: -------------------------------------------------------------------------------- 1 | /** Copyright (C) 2015 Bonitasoft S.A. 2 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 3 | * This program is free software: you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation, either version 2.0 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program. If not, see . 15 | */ 16 | package org.bonitasoft.web.rest.server.api.bdm; 17 | 18 | /** 19 | * @author Laurent Leseigneur 20 | */ 21 | public interface BusinessDataFieldValue { 22 | // used by command. parameter names must not be changed 23 | String URI_PATTERN = "/API/bdm/businessData/{className}/{id}/{field}"; 24 | } 25 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/model/identity/MemberType.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.web.rest.model.identity; 18 | 19 | /** 20 | * @author Yongtao Guo 21 | * 22 | */ 23 | public enum MemberType { 24 | 25 | USER, GROUP, ROLE, MEMBERSHIP; 26 | 27 | @Override 28 | public String toString() { 29 | return super.toString().toLowerCase(); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/server/api/system/VersionFile.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2014 BonitaSoft S.A. 3 | * BonitaSoft, 31 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * You should have received a copy of the GNU General Public License 13 | * along with this program. If not, see . 14 | */ 15 | package org.bonitasoft.web.rest.server.api.system; 16 | 17 | import java.io.InputStream; 18 | 19 | /** 20 | * @author Vincent Elcrin 21 | */ 22 | public class VersionFile { 23 | 24 | public InputStream getStream() { 25 | return VersionFile.class.getClassLoader().getResourceAsStream("VERSION"); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/server/framework/utils/converter/Converter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2012 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.web.rest.server.framework.utils.converter; 18 | 19 | import java.io.Serializable; 20 | 21 | /** 22 | * @author Colin PUY 23 | * 24 | */ 25 | public interface Converter { 26 | 27 | E convert(String convert) throws ConversionException; 28 | } 29 | -------------------------------------------------------------------------------- /server/src/test/java/org/bonitasoft/web/rest/server/framework/json/model/ProfileImportStatusMessageFake.java: -------------------------------------------------------------------------------- 1 | package org.bonitasoft.web.rest.server.framework.json.model; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | /** 7 | * @author Fabio Lombardi 8 | * 9 | */ 10 | public class ProfileImportStatusMessageFake { 11 | 12 | private List errors; 13 | 14 | private String profileName; 15 | 16 | private String status; 17 | 18 | public ProfileImportStatusMessageFake(String profileName, String status) { 19 | errors = new ArrayList<>(); 20 | this.profileName = profileName; 21 | this.status = status; 22 | } 23 | 24 | public void addError(String errorMessage) { 25 | errors.add(errorMessage); 26 | } 27 | 28 | public void addErrors(List errorMessages) { 29 | errors.addAll(errorMessages); 30 | } 31 | 32 | public void setProfileName(String name) { 33 | this.profileName = name; 34 | } 35 | 36 | public List getErrors() { 37 | return errors; 38 | } 39 | 40 | public String getProfileName() { 41 | return profileName; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/console/common/server/page/PageContextHelper.java: -------------------------------------------------------------------------------- 1 | package org.bonitasoft.console.common.server.page; 2 | 3 | import java.util.Locale; 4 | 5 | import javax.servlet.http.HttpServletRequest; 6 | import javax.servlet.http.HttpSession; 7 | 8 | import org.bonitasoft.console.common.server.utils.LocaleUtils; 9 | import org.bonitasoft.engine.session.APISession; 10 | 11 | public class PageContextHelper { 12 | 13 | public static final String PROFILE_PARAM = "profile"; 14 | 15 | public static final String ATTRIBUTE_API_SESSION = "apiSession"; 16 | 17 | private final HttpServletRequest request; 18 | 19 | public PageContextHelper(HttpServletRequest request) { 20 | this.request = request; 21 | } 22 | 23 | public String getCurrentProfile() { 24 | return request.getParameter(PROFILE_PARAM); 25 | } 26 | 27 | public Locale getCurrentLocale() { 28 | return LocaleUtils.getUserLocale(request); 29 | } 30 | 31 | public APISession getApiSession() { 32 | final HttpSession httpSession = request.getSession(); 33 | return (APISession) httpSession.getAttribute(ATTRIBUTE_API_SESSION); 34 | 35 | } 36 | } -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/console/server/ConsoleServiceFactory.java: -------------------------------------------------------------------------------- 1 | package org.bonitasoft.console.server; 2 | 3 | import org.bonitasoft.console.server.service.ApplicationsImportService; 4 | import org.bonitasoft.console.server.service.OrganizationImportService; 5 | import org.bonitasoft.console.server.service.ProcessActorImportService; 6 | import org.bonitasoft.web.toolkit.server.Service; 7 | import org.bonitasoft.web.toolkit.server.ServiceFactory; 8 | import org.bonitasoft.web.toolkit.server.ServiceNotFoundException; 9 | 10 | public class ConsoleServiceFactory implements ServiceFactory { 11 | 12 | @Override 13 | public Service getService(final String calledToolToken) { 14 | if (OrganizationImportService.TOKEN.equals(calledToolToken)) { 15 | return new OrganizationImportService(); 16 | } else if (ProcessActorImportService.TOKEN.equals(calledToolToken)) { 17 | return new ProcessActorImportService(); 18 | } else if (ApplicationsImportService.TOKEN.equals(calledToolToken)) { 19 | return new ApplicationsImportService(); 20 | } 21 | throw new ServiceNotFoundException(calledToolToken); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/server/framework/api/APIHasDelete.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2012 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.web.rest.server.framework.api; 18 | 19 | import java.util.List; 20 | 21 | import org.bonitasoft.web.toolkit.client.data.APIID; 22 | 23 | /** 24 | * @author Séverin Moussel 25 | * 26 | */ 27 | public interface APIHasDelete { 28 | 29 | void delete(final List ids); 30 | } 31 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/server/framework/api/DatastoreHasDelete.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2012 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.web.rest.server.framework.api; 18 | 19 | import java.util.List; 20 | 21 | import org.bonitasoft.web.toolkit.client.data.APIID; 22 | 23 | /** 24 | * @author Séverin Moussel 25 | * 26 | */ 27 | public interface DatastoreHasDelete { 28 | 29 | void delete(final List ids); 30 | } 31 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/server/datastore/organization/GroupItemConverter.java: -------------------------------------------------------------------------------- 1 | package org.bonitasoft.web.rest.server.datastore.organization; 2 | 3 | import org.bonitasoft.engine.identity.Group; 4 | import org.bonitasoft.web.rest.model.identity.GroupItem; 5 | import org.bonitasoft.web.rest.server.datastore.converter.ItemConverter; 6 | 7 | public class GroupItemConverter extends ItemConverter { 8 | 9 | @Override 10 | public GroupItem convert(Group group) { 11 | GroupItem groupItem = new GroupItem(); 12 | groupItem.setCreatedByUserId(group.getCreatedBy()); 13 | groupItem.setCreationDate(group.getCreationDate()); 14 | groupItem.setDescription(group.getDescription()); 15 | groupItem.setDisplayName(group.getDisplayName()); 16 | groupItem.setIcon(group.getIconId() == null ? "" : Avatars.PATH + group.getIconId()); 17 | groupItem.setId(group.getId()); 18 | groupItem.setLastUpdateDate(group.getLastUpdate()); 19 | groupItem.setName(group.getName()); 20 | groupItem.setParentPath(group.getParentPath()); 21 | groupItem.setPath(group.getPath()); 22 | return groupItem; 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/toolkit/client/common/json/JSonUnserializer.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.web.toolkit.client.common.json; 18 | 19 | import org.bonitasoft.web.toolkit.client.common.AbstractTreeNode; 20 | 21 | /** 22 | * @author Séverin Moussel 23 | * 24 | */ 25 | public interface JSonUnserializer { 26 | 27 | AbstractTreeNode _unserializeTree(final String json); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /server/src/test/java/org/bonitasoft/console/common/server/page/extension/PageContextImplTest.java: -------------------------------------------------------------------------------- 1 | package org.bonitasoft.console.common.server.page.extension; 2 | 3 | import java.util.Locale; 4 | 5 | import org.bonitasoft.console.common.server.page.PageContextAssert; 6 | import org.bonitasoft.console.common.server.page.extension.PageContextImpl; 7 | import org.bonitasoft.engine.session.APISession; 8 | import org.junit.Test; 9 | import org.junit.runner.RunWith; 10 | import org.mockito.Mock; 11 | import org.mockito.runners.MockitoJUnitRunner; 12 | 13 | /** 14 | * @author Laurent Leseigneur 15 | */ 16 | @RunWith(MockitoJUnitRunner.class) 17 | public class PageContextImplTest { 18 | 19 | public static final Locale LOCALE = Locale.FRANCE; 20 | public static final String PROFILE_ID = "profileId"; 21 | @Mock 22 | private APISession apiSession; 23 | 24 | @Test 25 | public void testPageContext() throws Exception { 26 | PageContextImpl pageContext = new PageContextImpl(apiSession, LOCALE, PROFILE_ID); 27 | 28 | PageContextAssert.assertThat(pageContext).hasApiSession(apiSession) 29 | .hasLocale(LOCALE) 30 | .hasProfileID(PROFILE_ID); 31 | 32 | } 33 | } -------------------------------------------------------------------------------- /server/src/test/resources/org/bonitasoft/web/rest/server/api/extension/page.properties: -------------------------------------------------------------------------------- 1 | # api extensions list 2 | apiExtensions=myGetResource,myPostResource,MyPutResource,myDeleteResource,myPostResourceB,myCompiledRestApi,myCompiledRestApi2 3 | 4 | #http method 5 | myGetResource.method=GET 6 | 7 | # resulting url wille be ../API/extension/helloWorld 8 | myGetResource.pathTemplate=helloWorld 9 | 10 | # implementation file that will serve this resource 11 | myGetResource.classFileName=Index.groovy 12 | 13 | myPostResource.method=POST 14 | myPostResource.pathTemplate=myPostResource 15 | # Empty className -> classFileName should be used 16 | myPostResource.className= 17 | myPostResource.classFileName=PostResource.groovy 18 | 19 | myPostResourceB.method=POST 20 | myPostResourceB.pathTemplate=myPostResourceB 21 | myPostResourceB.classFileName=PostResourceB.groovy 22 | 23 | myCompiledRestApi.method=GET 24 | myCompiledRestApi.pathTemplate=myCompiledRestApi 25 | myCompiledRestApi.className=com.company.MyController 26 | 27 | myCompiledRestApi2.method=GET 28 | myCompiledRestApi2.pathTemplate=myCompiledRestApi2 29 | myCompiledRestApi2.className=com.company.MyController 30 | myCompiledRestApi2.classFileName=MyController.groovy 31 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/server/datastore/page/PageFilterCreator.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2014-2018 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * You should have received a copy of the GNU General Public License 13 | * along with this program. If not, see . 14 | */ 15 | package org.bonitasoft.web.rest.server.datastore.page; 16 | 17 | import org.bonitasoft.web.rest.server.datastore.filter.GenericFilterCreator; 18 | 19 | class PageFilterCreator extends GenericFilterCreator { 20 | 21 | PageFilterCreator(final PageSearchDescriptorConverter converter) { 22 | super(converter); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/server/framework/api/APIHasGet.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2012 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.web.rest.server.framework.api; 18 | 19 | import org.bonitasoft.web.toolkit.client.data.APIID; 20 | import org.bonitasoft.web.toolkit.client.data.item.IItem; 21 | 22 | /** 23 | * @author Séverin Moussel 24 | * 25 | */ 26 | public interface APIHasGet { 27 | 28 | T get(final APIID id); 29 | } 30 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/console/common/server/login/filter/TenantIsPausedException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011-2020 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * You should have received a copy of the GNU General Public License 13 | * along with this program. If not, see . 14 | */ 15 | package org.bonitasoft.console.common.server.login.filter; 16 | 17 | public class TenantIsPausedException extends RuntimeException { 18 | 19 | private static final long serialVersionUID = 4836182063504328577L; 20 | 21 | public TenantIsPausedException(final String message) { 22 | super(message); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/server/datastore/converter/LongValueConverter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2012 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.web.rest.server.datastore.converter; 18 | 19 | /** 20 | * @author Vincent Elcrin 21 | * 22 | */ 23 | public class LongValueConverter implements ValueConverter { 24 | 25 | @Override 26 | public Long convert(String value) { 27 | return Long.valueOf(value); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/server/datastore/converter/StringValueConverter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2012 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.web.rest.server.datastore.converter; 18 | 19 | 20 | 21 | /** 22 | * @author Vincent Elcrin 23 | * 24 | */ 25 | public class StringValueConverter implements ValueConverter { 26 | 27 | @Override 28 | public String convert(String value) { 29 | return value; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/server/framework/api/DatastoreHasGet.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2012 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.web.rest.server.framework.api; 18 | 19 | import org.bonitasoft.web.toolkit.client.data.APIID; 20 | import org.bonitasoft.web.toolkit.client.data.item.IItem; 21 | 22 | /** 23 | * @author Séverin Moussel 24 | * 25 | */ 26 | public interface DatastoreHasGet { 27 | 28 | T get(final APIID id); 29 | } 30 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/server/datastore/filter/BooleanValue.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2012 BonitaSoft S.A. 3 | * 4 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 2.0 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | package org.bonitasoft.web.rest.server.datastore.filter; 19 | 20 | import org.bonitasoft.web.rest.server.datastore.converter.BooleanValueConverter; 21 | 22 | public class BooleanValue extends Value { 23 | 24 | public BooleanValue(String value) { 25 | super(value, new BooleanValueConverter()); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /server/src/test/resources/org/bonitasoft/console/common/server/page/my_html_page_v_6/index.html: -------------------------------------------------------------------------------- 1 | 2 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/console/common/server/login/filter/EngineUserNotFoundOrInactive.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011-2020 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * You should have received a copy of the GNU General Public License 13 | * along with this program. If not, see . 14 | */ 15 | package org.bonitasoft.console.common.server.login.filter; 16 | 17 | public class EngineUserNotFoundOrInactive extends RuntimeException { 18 | 19 | private static final long serialVersionUID = 4735182063504328575L; 20 | 21 | public EngineUserNotFoundOrInactive(final String message) { 22 | super(message); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/model/tenant/BusinessDataModelItem.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2014 BonitaSoft S.A. 3 | * BonitaSoft is a trademark of BonitaSoft SA. 4 | * This software file is BONITASOFT CONFIDENTIAL. Not For Distribution. 5 | * For commercial licensing information, contact: 6 | * BonitaSoft, 32 rue Gustave Eiffel – 38000 Grenoble 7 | * or BonitaSoft US, 51 Federal Street, Suite 305, San Francisco, CA 94107 8 | *******************************************************************************/ 9 | package org.bonitasoft.web.rest.model.tenant; 10 | 11 | import org.bonitasoft.web.toolkit.client.data.item.Item; 12 | import org.bonitasoft.web.toolkit.client.data.item.ItemDefinition; 13 | 14 | 15 | public class BusinessDataModelItem extends Item { 16 | 17 | public static final String ATTRIBUTE_FILE_UPLOAD_PATH = "fileUpload"; 18 | 19 | @Override 20 | public ItemDefinition getItemDefinition() { 21 | return new BusinessDataModelDefinition(); 22 | } 23 | 24 | public String getFileUploadPath() { 25 | return getAttributeValue(ATTRIBUTE_FILE_UPLOAD_PATH); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/server/datastore/converter/BooleanValueConverter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2012 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.web.rest.server.datastore.converter; 18 | 19 | /** 20 | * @author Vincent Elcrin 21 | * 22 | */ 23 | public class BooleanValueConverter implements ValueConverter { 24 | 25 | @Override 26 | public Boolean convert(String value) { 27 | return Boolean.valueOf(value); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/server/framework/utils/converter/ConversionException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2012 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.web.rest.server.framework.utils.converter; 18 | 19 | /** 20 | * @author Colin PUY 21 | * 22 | */ 23 | @SuppressWarnings("serial") 24 | public class ConversionException extends Exception { 25 | 26 | public ConversionException(String message, Throwable cause) { 27 | super(message, cause); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /server/src/test/resources/org/bonitasoft/console/common/server/page/my_html_page_v_7/resources/index.html: -------------------------------------------------------------------------------- 1 | 2 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/server/datastore/organization/UserFilterCreator.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2012 BonitaSoft S.A. 3 | * 4 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 2.0 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | package org.bonitasoft.web.rest.server.datastore.organization; 19 | 20 | import org.bonitasoft.web.rest.server.datastore.filter.GenericFilterCreator; 21 | 22 | class UserFilterCreator extends GenericFilterCreator { 23 | 24 | UserFilterCreator(UserSearchAttributeConverter converter) { 25 | super(converter); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /server/src/test/java/org/bonitasoft/web/rest/server/utils/FakeResource.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Copyright (C) 2009, 2013 BonitaSoft S.A. 3 | * BonitaSoft is a trademark of BonitaSoft SA. 4 | * This software file is BONITASOFT CONFIDENTIAL. Not For Distribution. 5 | * For commercial licensing information, contact: 6 | * BonitaSoft, 32 rue Gustave Eiffel – 38000 Grenoble 7 | * or BonitaSoft US, 51 Federal Street, Suite 305, San Francisco, CA 94107 8 | *******************************************************************************/ 9 | package org.bonitasoft.web.rest.server.utils; 10 | 11 | import org.bonitasoft.web.rest.server.api.resource.CommonResource; 12 | import org.restlet.resource.Get; 13 | 14 | public class FakeResource extends CommonResource { 15 | 16 | private final FakeService fakeService; 17 | 18 | public FakeResource(final FakeService fakeService) { 19 | this.fakeService = fakeService; 20 | } 21 | 22 | @Get 23 | public String doSomething() throws Exception { 24 | return fakeService.saySomething(); 25 | } 26 | 27 | public interface FakeService { 28 | 29 | String saySomething() throws Exception; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/console/common/server/login/utils/RedirectUrl.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2012 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.console.common.server.login.utils; 18 | 19 | /** 20 | * @author Vincent Elcrin 21 | * 22 | */ 23 | public class RedirectUrl { 24 | 25 | private final String url; 26 | 27 | protected RedirectUrl(String url) { 28 | this.url = url; 29 | } 30 | 31 | public String getUrl() { 32 | return url; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/console/server/ConsoleServiceServlet.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.console.server; 18 | 19 | import org.bonitasoft.web.toolkit.server.servlet.ServiceServlet; 20 | 21 | /** 22 | * @author Séverin Moussel 23 | * 24 | */ 25 | @SuppressWarnings("serial") 26 | public class ConsoleServiceServlet extends ServiceServlet { 27 | 28 | public ConsoleServiceServlet() { 29 | super(new ConsoleServiceFactory()); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/server/datastore/filter/LongValue.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2012 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.web.rest.server.datastore.filter; 18 | 19 | import org.bonitasoft.web.rest.server.datastore.converter.LongValueConverter; 20 | 21 | /** 22 | * @author Vincent Elcrin 23 | * 24 | */ 25 | public class LongValue extends Value { 26 | 27 | public LongValue(String value) { 28 | super(value, new LongValueConverter()); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/server/datastore/filter/StrValue.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2012 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.web.rest.server.datastore.filter; 18 | 19 | import org.bonitasoft.web.rest.server.datastore.converter.StringValueConverter; 20 | 21 | /** 22 | * @author Vincent Elcrin 23 | * 24 | */ 25 | public class StrValue extends Value { 26 | 27 | public StrValue(String value) { 28 | super(value, new StringValueConverter()); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/toolkit/client/data/item/DummyItem.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2012 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.web.toolkit.client.data.item; 18 | 19 | /** 20 | * @author Séverin Moussel 21 | * 22 | */ 23 | public class DummyItem extends Item { 24 | 25 | public DummyItem() { 26 | super(); 27 | } 28 | 29 | @Override 30 | public ItemDefinition getItemDefinition() { 31 | return DummyItemDefinition.get(); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /bonita-integration-tests-web/src/main/java/org/bonitasoft/test/toolkit/organization/TestMembershipFactory.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2012 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.test.toolkit.organization; 18 | 19 | /** 20 | * @author Séverin Moussel 21 | */ 22 | public class TestMembershipFactory { 23 | 24 | public static void assignMembership(final TestUser user, final TestGroup group, final TestRole role) { 25 | new TestMembership(user.getId(), group.getId(), role.getId()); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/server/api/bpm/process/ProcessInstantiationResourceFinder.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2015 BonitaSoft S.A. 3 | * BonitaSoft is a trademark of BonitaSoft SA. 4 | * This software file is BONITASOFT CONFIDENTIAL. Not For Distribution. 5 | * For commercial licensing information, contact: 6 | * BonitaSoft, 32 rue Gustave Eiffel – 38000 Grenoble 7 | * or BonitaSoft US, 51 Federal Street, Suite 305, San Francisco, CA 94107 8 | **/ 9 | 10 | package org.bonitasoft.web.rest.server.api.bpm.process; 11 | 12 | import org.bonitasoft.engine.api.ProcessAPI; 13 | import org.bonitasoft.engine.session.APISession; 14 | import org.bonitasoft.web.rest.server.ResourceFinder; 15 | import org.restlet.Request; 16 | import org.restlet.Response; 17 | import org.restlet.resource.ServerResource; 18 | 19 | /** 20 | * @author Baptiste Mesta 21 | */ 22 | public class ProcessInstantiationResourceFinder extends ResourceFinder { 23 | 24 | @Override 25 | public ServerResource create(final Request request, final Response response) { 26 | final ProcessAPI processAPI = getProcessAPI(request); 27 | final APISession apiSession = getAPISession(request); 28 | return new ProcessInstantiationResource(processAPI); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /server/src/test/java/org/bonitasoft/console/server/service/ProcessActorImportServiceTest.java: -------------------------------------------------------------------------------- 1 | package org.bonitasoft.console.server.service; 2 | 3 | import static org.junit.Assert.assertTrue; 4 | import static org.mockito.Mockito.doReturn; 5 | import static org.mockito.Mockito.spy; 6 | 7 | import java.io.File; 8 | 9 | import org.bonitasoft.web.toolkit.server.ServiceException; 10 | import org.junit.Test; 11 | import org.junit.runner.RunWith; 12 | import org.mockito.runners.MockitoJUnitRunner; 13 | 14 | /** 15 | * @author Julien Mege 16 | */ 17 | @RunWith(MockitoJUnitRunner.class) 18 | public class ProcessActorImportServiceTest { 19 | 20 | @Test 21 | public void should_verify_authorisation_for_the_given_location_param() throws Exception { 22 | 23 | final ProcessActorImportService processActorImportService = spy(new ProcessActorImportService()); 24 | doReturn(".." + File.separator + ".." + File.separator + ".." + File.separator + "file.txt").when(processActorImportService).getFileUploadParameter(); 25 | 26 | try { 27 | processActorImportService.run(); 28 | } catch (final ServiceException e) { 29 | assertTrue(e.getMessage().startsWith("Unauthorized access to the file")); 30 | } 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/server/api/bpm/flownode/UserTaskExecutionResourceFinder.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2015 BonitaSoft S.A. 3 | * BonitaSoft is a trademark of BonitaSoft SA. 4 | * This software file is BONITASOFT CONFIDENTIAL. Not For Distribution. 5 | * For commercial licensing information, contact: 6 | * BonitaSoft, 32 rue Gustave Eiffel – 38000 Grenoble 7 | * or BonitaSoft US, 51 Federal Street, Suite 305, San Francisco, CA 94107 8 | **/ 9 | 10 | package org.bonitasoft.web.rest.server.api.bpm.flownode; 11 | 12 | import org.bonitasoft.engine.api.ProcessAPI; 13 | import org.bonitasoft.engine.session.APISession; 14 | import org.bonitasoft.web.rest.server.ResourceFinder; 15 | import org.restlet.Request; 16 | import org.restlet.Response; 17 | import org.restlet.resource.ServerResource; 18 | 19 | /** 20 | * @author Baptiste Mesta 21 | */ 22 | public class UserTaskExecutionResourceFinder extends ResourceFinder { 23 | 24 | @Override 25 | public ServerResource create(final Request request, final Response response) { 26 | final ProcessAPI processAPI = getProcessAPI(request); 27 | final APISession apiSession = getAPISession(request); 28 | return new UserTaskExecutionResource(processAPI, apiSession); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/server/datastore/application/ApplicationFilterCreator.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2014 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.web.rest.server.datastore.application; 18 | 19 | import org.bonitasoft.web.rest.server.datastore.filter.GenericFilterCreator; 20 | 21 | class ApplicationFilterCreator extends GenericFilterCreator { 22 | 23 | ApplicationFilterCreator(final ApplicationSearchDescriptorConverter converter) { 24 | super(converter); 25 | } 26 | 27 | 28 | } 29 | -------------------------------------------------------------------------------- /bonita-integration-tests-web/src/main/java/org/bonitasoft/test/toolkit/bpm/TestCaseFactory.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2012 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.test.toolkit.bpm; 18 | 19 | import org.bonitasoft.test.toolkit.organization.TestUser; 20 | 21 | /** 22 | * @author Colin PUY 23 | * 24 | */ 25 | public class TestCaseFactory { 26 | 27 | public static TestCase createRandomCase(TestUser initiator) { 28 | return TestProcessFactory.createRandomResolvedProcess(initiator).startCase(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/toolkit/client/common/exception/api/APIIncorrectIdException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2022 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.web.toolkit.client.common.exception.api; 18 | 19 | /** 20 | * @author Dumitru Corini 21 | */ 22 | public class APIIncorrectIdException extends APIException { 23 | 24 | private static final long serialVersionUID = 1054890811602278747L; 25 | 26 | public APIIncorrectIdException(final String message) { 27 | super(message); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /server/src/test/java/org/bonitasoft/web/rest/server/api/tenant/TenantResourceItemTest.java: -------------------------------------------------------------------------------- 1 | package org.bonitasoft.web.rest.server.api.tenant; 2 | 3 | import org.bonitasoft.engine.tenant.TenantResource; 4 | import org.junit.Test; 5 | import org.junit.runner.RunWith; 6 | import org.mockito.Mock; 7 | import org.mockito.runners.MockitoJUnitRunner; 8 | 9 | import java.time.Instant; 10 | import java.time.OffsetDateTime; 11 | import java.time.ZoneOffset; 12 | 13 | import static org.assertj.core.api.Assertions.assertThat; 14 | import static org.mockito.Mockito.when; 15 | 16 | @RunWith(MockitoJUnitRunner.class) 17 | public class TenantResourceItemTest { 18 | 19 | @Mock 20 | private TenantResource tenantResource; 21 | 22 | @Test 23 | public void should_format_lastUpdateDate_as_ISO8601_string_when_tenantResourceItem_is_created(){ 24 | String dateAsString = "2018-01-05T09:04:19Z"; 25 | Instant instant = Instant.ofEpochSecond(1515143059); 26 | when(tenantResource.getLastUpdateDate()).thenReturn(OffsetDateTime.ofInstant(instant, ZoneOffset.UTC)); 27 | 28 | TenantResourceItem tenantResourceItem = new TenantResourceItem(tenantResource); 29 | 30 | assertThat(tenantResourceItem.getLastUpdateDate()).isEqualTo(dateAsString); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/toolkit/client/data/item/attribute/validator/IsNumericValidator.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.web.toolkit.client.data.item.attribute.validator; 18 | 19 | /** 20 | * @author Séverin Moussel 21 | * 22 | */ 23 | public class IsNumericValidator extends AbstractNumericValidator { 24 | 25 | @Override 26 | protected void _check(final Double attributeValue) { 27 | // Do nothing. The parent class check is enough 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/server/datastore/applicationmenu/ApplicationMenuFilterCreator.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2014 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.web.rest.server.datastore.applicationmenu; 18 | 19 | import org.bonitasoft.web.rest.server.datastore.filter.GenericFilterCreator; 20 | 21 | class ApplicationMenuFilterCreator extends GenericFilterCreator { 22 | 23 | ApplicationMenuFilterCreator(final ApplicationMenuSearchDescriptorConverter converter) { 24 | super(converter); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/server/datastore/applicationpage/ApplicationPageFilterCreator.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2014 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.web.rest.server.datastore.applicationpage; 18 | 19 | import org.bonitasoft.web.rest.server.datastore.filter.GenericFilterCreator; 20 | 21 | class ApplicationPageFilterCreator extends GenericFilterCreator { 22 | 23 | ApplicationPageFilterCreator(final ApplicationPageSearchDescriptorConverter converter) { 24 | super(converter); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/toolkit/server/ServiceFactory.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.web.toolkit.server; 18 | 19 | 20 | /** 21 | * @author Colin PUY 22 | */ 23 | public interface ServiceFactory { 24 | 25 | /** 26 | * 27 | * @param calledToolToken 28 | * The token as a path. For example if the tool url is ".../TOOLS/actors/import", the token will be "actors/import". 29 | */ 30 | Service getService(String calledToolToken); 31 | 32 | } 33 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/model/bpm/AbstractDocumentDefinition.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2012 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.web.rest.model.bpm; 18 | 19 | import org.bonitasoft.web.toolkit.client.data.item.ItemDefinition; 20 | 21 | /** 22 | * @author Paul AMAR 23 | * 24 | */ 25 | public abstract class AbstractDocumentDefinition extends ItemDefinition { 26 | 27 | /** 28 | * Default Constructor. 29 | */ 30 | public AbstractDocumentDefinition() { 31 | super(); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/server/framework/APIs.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.web.rest.server.framework; 18 | 19 | import org.bonitasoft.web.toolkit.client.data.item.IItem; 20 | 21 | /** 22 | * @author Séverin Moussel 23 | * 24 | */ 25 | public class APIs { 26 | 27 | public static API get(final String apiToken, final String resourceToken) { 28 | return RestAPIFactory.getDefaultFactory().defineApis(apiToken, resourceToken); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/console/common/server/utils/DefaultTenantIdException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2012 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.console.common.server.utils; 18 | 19 | /** 20 | * @author Vincent Elcrin 21 | * 22 | */ 23 | public class DefaultTenantIdException extends RuntimeException { 24 | 25 | private static final long serialVersionUID = -6433100847740743825L; 26 | 27 | public DefaultTenantIdException(Exception e) { 28 | super("Can't retrieve default tenant id", e); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/server/framework/api/APIHasUpdate.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2012 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.web.rest.server.framework.api; 18 | 19 | import java.util.Map; 20 | 21 | import org.bonitasoft.web.toolkit.client.data.APIID; 22 | import org.bonitasoft.web.toolkit.client.data.item.IItem; 23 | 24 | /** 25 | * @author Séverin Moussel 26 | * 27 | */ 28 | public interface APIHasUpdate { 29 | 30 | T update(final APIID id, final Map attributes); 31 | 32 | } 33 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/toolkit/client/data/item/attribute/validator/FileIsNoScript.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2012 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.web.toolkit.client.data.item.attribute.validator; 18 | 19 | /** 20 | * @author Paul AMAR 21 | * 22 | */ 23 | public class FileIsNoScript extends FileExtensionForbiddenValidator { 24 | 25 | /** 26 | * Default Constructor. 27 | */ 28 | public FileIsNoScript() { 29 | super("exe", "bat", "cmd", "sh", "com", "jsp", "js", "jar"); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/server/framework/utils/converter/typed/StringConverter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2012 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.web.rest.server.framework.utils.converter.typed; 18 | 19 | import org.bonitasoft.web.rest.server.framework.utils.converter.Converter; 20 | 21 | /** 22 | * @author Colin PUY 23 | * 24 | */ 25 | public class StringConverter implements Converter { 26 | 27 | @Override 28 | public String convert(String convert) { 29 | return convert; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/toolkit/client/data/item/attribute/validator/FileExtensionForbiddenValidator.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.web.toolkit.client.data.item.attribute.validator; 18 | 19 | /** 20 | * @author Paul AMAR 21 | * 22 | */ 23 | public class FileExtensionForbiddenValidator extends FileExtensionAllowedValidator { 24 | 25 | public FileExtensionForbiddenValidator(final String... extensions) { 26 | super(extensions); 27 | setExclude(true); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/toolkit/client/data/item/template/ItemHasUniqueId.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2012 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.web.toolkit.client.data.item.template; 18 | 19 | import org.bonitasoft.web.toolkit.client.data.APIID; 20 | 21 | /** 22 | * @author Julien Mege 23 | * 24 | */ 25 | public interface ItemHasUniqueId { 26 | 27 | String ATTRIBUTE_ID = "id"; 28 | 29 | void setId(String id); 30 | 31 | void setId(APIID id); 32 | 33 | void setId(Long id); 34 | 35 | APIID getId(); 36 | } 37 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/toolkit/client/data/item/attribute/ModifiableInput.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.web.toolkit.client.data.item.attribute; 18 | 19 | import java.util.List; 20 | 21 | import org.bonitasoft.web.toolkit.client.data.item.attribute.modifier.Modifier; 22 | 23 | /** 24 | * @author Séverin Moussel 25 | * 26 | */ 27 | public interface ModifiableInput { 28 | 29 | List getInputModifiers(); 30 | 31 | void addInputModifier(final Modifier modifier); 32 | 33 | } 34 | -------------------------------------------------------------------------------- /server/src/test/java/org/bonitasoft/web/toolkit/client/data/validator/StringFormatURLValidatorTest.java: -------------------------------------------------------------------------------- 1 | package org.bonitasoft.web.toolkit.client.data.item.attribute.validator; 2 | 3 | import static org.assertj.core.api.Assertions.assertThat; 4 | 5 | import org.bonitasoft.console.common.server.i18n.I18n; 6 | import org.junit.Before; 7 | import org.junit.Test; 8 | 9 | public class StringFormatURLValidatorTest { 10 | 11 | private StringFormatURLValidator stringFormatURLValidator = new StringFormatURLValidator(); 12 | 13 | @Before 14 | public void before() { 15 | // to initialize the system: 16 | I18n.getInstance(); 17 | } 18 | 19 | 20 | @Test 21 | public void should_verify_urls() { 22 | checkUrl("toto", true); 23 | checkUrl("www.toto", false); 24 | checkUrl("https://toto", false); 25 | checkUrl("ftp://toto", false); 26 | checkUrl("http://toto", false); 27 | checkUrl("http://toto?tata.titi=tutu", false); 28 | } 29 | 30 | private void checkUrl(String url, boolean shouldHaveErrors) throws AssertionError { 31 | stringFormatURLValidator.reset(); 32 | stringFormatURLValidator._check(url); 33 | assertThat(stringFormatURLValidator.getErrors().isEmpty()).isEqualTo(!shouldHaveErrors); 34 | } 35 | 36 | } -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/console/common/server/api/token/APIToken.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2013 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.console.common.server.api.token; 18 | 19 | import java.util.UUID; 20 | 21 | /** 22 | * @author Paul AMAR 23 | * 24 | */ 25 | public class APIToken { 26 | 27 | private final String APIToken; 28 | 29 | public APIToken() { 30 | this.APIToken = UUID.randomUUID().toString(); 31 | } 32 | 33 | public String getToken() { 34 | return this.APIToken; 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/server/framework/api/DatastoreHasUpdate.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2012 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.web.rest.server.framework.api; 18 | 19 | import java.util.Map; 20 | 21 | import org.bonitasoft.web.toolkit.client.data.APIID; 22 | import org.bonitasoft.web.toolkit.client.data.item.IItem; 23 | 24 | /** 25 | * @author Séverin Moussel 26 | * 27 | */ 28 | public interface DatastoreHasUpdate { 29 | 30 | T update(final APIID id, final Map attributes); 31 | 32 | } 33 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/toolkit/client/data/item/attribute/validator/FileIsImageValidator.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.web.toolkit.client.data.item.attribute.validator; 18 | 19 | /** 20 | * @author Séverin Moussel 21 | * 22 | */ 23 | public class FileIsImageValidator extends FileExtensionAllowedValidator { 24 | 25 | public FileIsImageValidator() { 26 | super("png", "jpg", "jpeg", "bmp", "wbmp", "tga", "gif", "PNG", "JPG", "JPEG", "BMP", "WBMP", "TGA", "GIF"); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/server/engineclient/CustomUserInfoEngineClientCreator.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2014 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.web.rest.server.engineclient; 18 | 19 | import org.bonitasoft.engine.session.APISession; 20 | 21 | /** 22 | * @author Vincent Elcrin 23 | */ 24 | public class CustomUserInfoEngineClientCreator { 25 | 26 | public CustomUserInfoEngineClient create(APISession session) { 27 | return new CustomUserInfoEngineClient(new EngineAPIAccessor(session).getIdentityAPI()); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /server/src/main/resources/i18n/resources_ja.po: -------------------------------------------------------------------------------- 1 | msgid "" 2 | msgstr "" 3 | "Content-Type: text/plain; charset=UTF-8\n" 4 | "Content-Transfer-Encoding: 8bit\n" 5 | "Project-Id-Version: bonita\n" 6 | "Plural-Forms: nplurals=1; plural=0;\n" 7 | "X-Crowdin-Project: bonita\n" 8 | "X-Crowdin-Project-ID: 13316\n" 9 | "X-Crowdin-Language: ja\n" 10 | "X-Crowdin-File: /dev/bonita-web/distrib/resources.pot\n" 11 | "X-Crowdin-File-ID: 61547\n" 12 | "Language-Team: Japanese\n" 13 | "Language: ja_JP\n" 14 | "PO-Revision-Date: 2022-10-06 01:30\n" 15 | 16 | msgid "Add" 17 | msgstr "追加" 18 | 19 | msgid "Attention" 20 | msgstr "注意" 21 | 22 | msgid "Example:" 23 | msgstr "例:" 24 | 25 | msgid "Execute" 26 | msgstr "実行" 27 | 28 | msgid "Expecting a {} value." 29 | msgstr "{} の値を期待しています。" 30 | 31 | msgid "no description defined in contract for this input" 32 | msgstr "この入力項目のコントラクトには、説明が定義されていません" 33 | 34 | msgid "Not a valid number!" 35 | msgstr "有効な数値ではないです" 36 | 37 | msgid "remove" 38 | msgstr "削除" 39 | 40 | msgid "Select a file" 41 | msgstr "ファイルを選択します。" 42 | 43 | msgid "Start" 44 | msgstr "開始" 45 | 46 | msgid "this is a temporary form generated automatically for testing. Before you put your process into production, create and map the necessary forms." 47 | msgstr "これはテスト用に自動生成された一時的なフォームです。本番環境にプロセスを移行する前に必要なフォームを作成し、マップしてください。" 48 | 49 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/server/datastore/bpm/cases/CaseDocumentFilterCreator.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2013 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.web.rest.server.datastore.bpm.cases; 18 | 19 | import org.bonitasoft.web.rest.server.datastore.filter.GenericFilterCreator; 20 | 21 | /** 22 | * @author Fabio Lombardi 23 | * 24 | */ 25 | 26 | class CaseDocumentFilterCreator extends GenericFilterCreator { 27 | 28 | CaseDocumentFilterCreator(final CaseDocumentSearchAttributeConverter converter) { 29 | super(converter); 30 | } 31 | 32 | } -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/toolkit/client/data/item/template/ItemHasLastUpdateDate.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2012 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.web.toolkit.client.data.item.template; 18 | 19 | import java.util.Date; 20 | 21 | /** 22 | * @author Julien Mege 23 | * 24 | */ 25 | public interface ItemHasLastUpdateDate { 26 | 27 | String ATTRIBUTE_LAST_UPDATE_DATE = "last_update_date"; 28 | 29 | void setLastUpdateDate(String date); 30 | 31 | void setLastUpdateDate(Date date); 32 | 33 | Date getLastUpdateDate(); 34 | 35 | } 36 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/server/datastore/profile/member/MemberTypeConverter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2012 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.web.rest.server.datastore.profile.member; 18 | 19 | import org.bonitasoft.web.rest.server.datastore.converter.ValueConverter; 20 | 21 | /** 22 | * @author Vincent Elcrin 23 | * 24 | */ 25 | public class MemberTypeConverter implements ValueConverter { 26 | 27 | @Override 28 | public MemberType convert(String value) { 29 | return MemberType.from(value); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/server/datastore/bpm/cases/ArchivedCaseDocumentFilterCreator.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2013 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.web.rest.server.datastore.bpm.cases; 18 | 19 | import org.bonitasoft.web.rest.server.datastore.filter.GenericFilterCreator; 20 | 21 | /** 22 | * @author Fabio Lombardi 23 | */ 24 | class ArchivedCaseDocumentFilterCreator extends GenericFilterCreator { 25 | 26 | ArchivedCaseDocumentFilterCreator(final ArchivedCaseDocumentSearchAttributeConverter converter) { 27 | super(converter); 28 | } 29 | 30 | } -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/server/datastore/bpm/process/helper/SearchProcessFilterCreator.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2012 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.web.rest.server.datastore.bpm.process.helper; 18 | 19 | import org.bonitasoft.web.rest.server.datastore.filter.GenericFilterCreator; 20 | 21 | /** 22 | * @author Vincent Elcrin 23 | * 24 | */ 25 | class SearchProcessFilterCreator extends GenericFilterCreator { 26 | 27 | SearchProcessFilterCreator(ProcessSearchDescriptorConverter converter) { 28 | super(converter); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /server/src/test/java/org/bonitasoft/web/rest/server/datastore/bpm/cases/CaseVariableDatastoreTest.java: -------------------------------------------------------------------------------- 1 | package org.bonitasoft.web.rest.server.datastore.bpm.cases; 2 | 3 | import static org.mockito.Mockito.*; 4 | import static org.mockito.MockitoAnnotations.initMocks; 5 | 6 | import org.bonitasoft.engine.api.ProcessAPI; 7 | import org.bonitasoft.web.rest.server.APITestWithMock; 8 | import org.junit.Before; 9 | import org.junit.Test; 10 | import org.mockito.Mock; 11 | 12 | /** 13 | * @author Colin PUY 14 | * 15 | */ 16 | public class CaseVariableDatastoreTest extends APITestWithMock { 17 | 18 | private CaseVariableDatastore datastore; 19 | 20 | @Mock 21 | private ProcessAPI processAPI; 22 | 23 | @Before 24 | public void initializeMocks() { 25 | initMocks(this); 26 | 27 | datastore = spy(new CaseVariableDatastore(null)); 28 | doReturn(processAPI).when(datastore).getEngineProcessAPI(); 29 | } 30 | 31 | @Test 32 | public void testUpdateVariableValue() throws Exception { 33 | long caseId = 1L; 34 | String name = "aName"; 35 | String newValue = "newValue"; 36 | 37 | datastore.updateVariableValue(caseId, name, String.class.getName(), newValue); 38 | 39 | verify(processAPI).updateProcessDataInstance(name, caseId, newValue); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /bonita-integration-tests-web/src/main/java/org/bonitasoft/test/toolkit/exception/NoActivityLeftException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2012 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.test.toolkit.exception; 18 | 19 | /** 20 | * @author Vincent Elcrin 21 | * 22 | */ 23 | public class NoActivityLeftException extends TestToolkitException { 24 | 25 | /** 26 | * 27 | */ 28 | private static final long serialVersionUID = 5201304240169814990L; 29 | 30 | /** 31 | * Default Constructor. 32 | */ 33 | public NoActivityLeftException() { 34 | super("The case is archived"); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /bonita-integration-tests-web/src/main/java/org/bonitasoft/test/toolkit/organization/AdminUser.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2012 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.test.toolkit.organization; 18 | 19 | /** 20 | * @author Vincent Elcrin 21 | * 22 | */ 23 | public final class AdminUser extends TestUser { 24 | 25 | private static final String USERNAME = "install"; 26 | 27 | private static final String PASSWORD = "install"; 28 | 29 | /** 30 | * Default Constructor. 31 | * 32 | * @throws Exception 33 | */ 34 | protected AdminUser() { 35 | super(USERNAME, PASSWORD); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /server/src/test/java/org/bonitasoft/web/rest/server/datastore/filter/StrValueTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2012 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.web.rest.server.datastore.filter; 18 | 19 | import static org.junit.Assert.assertEquals; 20 | 21 | import org.bonitasoft.web.rest.server.datastore.filter.StrValue; 22 | import org.junit.Test; 23 | 24 | /** 25 | * @author Vincent Elcrin 26 | * 27 | */ 28 | public class StrValueTest { 29 | 30 | @Test 31 | public void testStringValue() throws Exception { 32 | StrValue value = new StrValue("abc"); 33 | 34 | assertEquals("abc", value.cast()); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /server/src/test/java/org/bonitasoft/web/toolkit/client/common/json/JSonSerializerTest.java: -------------------------------------------------------------------------------- 1 | package org.bonitasoft.web.toolkit.client.common.json; 2 | 3 | import static org.assertj.core.api.Assertions.assertThat; 4 | 5 | import org.junit.Test; 6 | 7 | public class JSonSerializerTest { 8 | 9 | @Test 10 | public void should_serialize_an_exception() throws Exception { 11 | Exception exception = new Exception("an exception"); 12 | 13 | String serialize = JSonSerializer.serialize(exception); 14 | 15 | assertThat(serialize).isEqualTo("{\"exception\":\"class java.lang.Exception\",\"message\":\"an exception\"}"); 16 | } 17 | 18 | @Test 19 | public void should_serialize_only_first_cause_of_an_exception() throws Exception { 20 | Exception exception = new Exception("first one", new Exception("second one", new Exception("third one"))); 21 | 22 | String serialize = JSonSerializer.serialize(exception); 23 | 24 | assertThat(serialize).isEqualTo( 25 | "{\"exception\":\"class java.lang.Exception\"," 26 | + "\"message\":\"first one\"," 27 | + "\"cause\":{" 28 | + "\"exception\":\"class java.lang.Exception\"," 29 | + "\"message\":\"second one\"" 30 | + "}" 31 | + "}"); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/server/datastore/bpm/flownode/TaskDatastore.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2013 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.web.rest.server.datastore.bpm.flownode; 18 | 19 | import org.bonitasoft.engine.bpm.flownode.TaskInstance; 20 | import org.bonitasoft.engine.session.APISession; 21 | import org.bonitasoft.web.rest.model.bpm.flownode.TaskItem; 22 | 23 | /** 24 | * @author Séverin Moussel 25 | */ 26 | public class TaskDatastore extends AbstractTaskDatastore { 27 | 28 | public TaskDatastore(final APISession engineSession) { 29 | super(engineSession); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/console/common/server/auth/AuthenticationManagerNotFoundException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011 BonitaSoft S.A. 3 | * BonitaSoft, 31 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * You should have received a copy of the GNU General Public License 13 | * along with this program. If not, see . 14 | */ 15 | package org.bonitasoft.console.common.server.auth; 16 | 17 | /** 18 | * @author Ruiheng Fan 19 | */ 20 | public class AuthenticationManagerNotFoundException extends Exception { 21 | 22 | /** 23 | * 24 | */ 25 | private static final long serialVersionUID = 1L; 26 | 27 | /** 28 | * @param message 29 | * message associated with the exception 30 | */ 31 | public AuthenticationManagerNotFoundException(final String message) { 32 | super(message); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/toolkit/client/data/item/attribute/modifier/AbstractStringModifier.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.web.toolkit.client.data.item.attribute.modifier; 18 | 19 | /** 20 | * 21 | * @author Séverin Moussel 22 | * 23 | */ 24 | public abstract class AbstractStringModifier extends Modifier { 25 | 26 | public String[] clean(final String[] values) { 27 | for (int i = 0; i < values.length; i++) { 28 | values[i] = this.clean(values[i]); 29 | } 30 | return values; 31 | } 32 | 33 | public abstract String clean(String value); 34 | } 35 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/toolkit/client/common/exception/api/APISessionInvalidException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.web.toolkit.client.common.exception.api; 18 | 19 | /** 20 | * @author Séverin Moussel 21 | * 22 | */ 23 | public class APISessionInvalidException extends APIException { 24 | 25 | private static final long serialVersionUID = -88365018117861938L; 26 | 27 | public APISessionInvalidException(final Throwable cause) { 28 | super(cause); 29 | } 30 | 31 | @Override 32 | protected String defaultMessage() { 33 | return "Invalid session"; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /bonita-integration-tests-web/src/main/java/org/bonitasoft/test/toolkit/bpm/AbstractManualTask.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2012 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.test.toolkit.bpm; 18 | 19 | /** 20 | * @author Vincent Elcrin 21 | * 22 | */ 23 | public abstract class AbstractManualTask { 24 | 25 | public abstract long getId(); 26 | 27 | public abstract String getName(); 28 | 29 | public abstract String getDescription(); 30 | 31 | // ///////////////////////////////////////////////////////////////////////////// 32 | // / Test state 33 | // ///////////////////////////////////////////////////////////////////////////// 34 | 35 | } 36 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/toolkit/server/ServiceNotFoundException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2012 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.web.toolkit.server; 18 | 19 | /** 20 | * @author Séverin Moussel 21 | * 22 | */ 23 | public class ServiceNotFoundException extends ServiceException { 24 | 25 | private static final long serialVersionUID = -6084401627376022011L; 26 | 27 | public ServiceNotFoundException(final String path) { 28 | super(path); 29 | } 30 | 31 | @Override 32 | protected String defaultMessage() { 33 | return "The service \"" + getPath() + "\" doesn't exist or is not declared"; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/server/datastore/converter/AttributeConverter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2012-2018 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * You should have received a copy of the GNU General Public License 13 | * along with this program. If not, see . 14 | */ 15 | package org.bonitasoft.web.rest.server.datastore.converter; 16 | 17 | 18 | import java.util.Map; 19 | 20 | import org.bonitasoft.web.toolkit.client.data.item.attribute.ItemAttribute.TYPE; 21 | 22 | /** 23 | * @author Colin PUY 24 | * @author Emmanuel Duchastenier 25 | */ 26 | public interface AttributeConverter { 27 | 28 | String convert(String attribute); 29 | 30 | /** 31 | * return a map of attribute name to the type to convert the value into. 32 | */ 33 | Map getValueTypeMapping(); 34 | 35 | } 36 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/server/framework/api/DatastoreHasSearch.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2012 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.web.rest.server.framework.api; 18 | 19 | import java.util.Map; 20 | 21 | import org.bonitasoft.web.rest.server.framework.search.ItemSearchResult; 22 | import org.bonitasoft.web.toolkit.client.data.item.IItem; 23 | 24 | /** 25 | * @author Séverin Moussel 26 | * 27 | */ 28 | public interface DatastoreHasSearch { 29 | 30 | ItemSearchResult search(final int page, final int resultsByPage, final String search, final String orders, 31 | final Map filters); 32 | 33 | } 34 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/server/datastore/bpm/flownode/ActivityDatastore.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2013 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.web.rest.server.datastore.bpm.flownode; 18 | 19 | import org.bonitasoft.engine.bpm.flownode.ActivityInstance; 20 | import org.bonitasoft.engine.session.APISession; 21 | import org.bonitasoft.web.rest.model.bpm.flownode.ActivityItem; 22 | 23 | /** 24 | * @author Séverin Moussel 25 | */ 26 | public class ActivityDatastore extends AbstractActivityDatastore { 27 | 28 | public ActivityDatastore(final APISession engineSession) { 29 | super(engineSession); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/server/datastore/bpm/flownode/UserTaskDatastore.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2013 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.web.rest.server.datastore.bpm.flownode; 18 | 19 | import org.bonitasoft.engine.bpm.flownode.UserTaskInstance; 20 | import org.bonitasoft.engine.session.APISession; 21 | import org.bonitasoft.web.rest.model.bpm.flownode.UserTaskItem; 22 | 23 | /** 24 | * @author Séverin Moussel 25 | */ 26 | public class UserTaskDatastore extends AbstractUserTaskDatastore { 27 | 28 | public UserTaskDatastore(final APISession engineSession) { 29 | super(engineSession); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/toolkit/client/data/item/template/ItemHasDualDescription.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2012 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.web.toolkit.client.data.item.template; 18 | 19 | /** 20 | * @author Séverin Moussel 21 | * 22 | */ 23 | public interface ItemHasDualDescription { 24 | 25 | String ATTRIBUTE_DESCRIPTION = "description"; 26 | 27 | String ATTRIBUTE_DISPLAY_DESCRIPTION = "displayDescription"; 28 | 29 | void setDescription(final String description); 30 | 31 | void setDisplayDescription(final String displayDescription); 32 | 33 | String getDescription(); 34 | 35 | String getDisplayDescription(); 36 | } 37 | -------------------------------------------------------------------------------- /server/src/test/java/org/bonitasoft/web/rest/server/api/organization/password/validator/RobustnessPasswordValidatorTest.java: -------------------------------------------------------------------------------- 1 | package org.bonitasoft.web.rest.server.api.organization.password.validator; 2 | 3 | import static org.junit.Assert.*; 4 | 5 | import org.bonitasoft.console.common.server.i18n.I18n; 6 | import org.junit.Test; 7 | 8 | 9 | 10 | public class RobustnessPasswordValidatorTest { 11 | 12 | RobustnessPasswordValidator robustnessPasswordValidator = new RobustnessPasswordValidator(); 13 | 14 | @Test 15 | public void testWithWrongPassword() { 16 | I18n.getInstance(); 17 | robustnessPasswordValidator.setLocale("en"); 18 | robustnessPasswordValidator.check("password"); 19 | assertFalse(robustnessPasswordValidator.getErrors().isEmpty()); 20 | } 21 | 22 | @Test 23 | public void testwithLongPassword() { 24 | I18n.getInstance(); 25 | robustnessPasswordValidator.setLocale("en"); 26 | robustnessPasswordValidator.check("myreallylongpassword"); 27 | assertFalse(robustnessPasswordValidator.getErrors().isEmpty()); 28 | } 29 | 30 | @Test 31 | public void testwithGoodPassword() { 32 | I18n.getInstance(); 33 | robustnessPasswordValidator.setLocale("en"); 34 | robustnessPasswordValidator.check("MyPasswOrd!?321D*"); 35 | assertTrue(robustnessPasswordValidator.getErrors().isEmpty()); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/server/datastore/bpm/flownode/HumanTaskDatastore.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2013 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.web.rest.server.datastore.bpm.flownode; 18 | 19 | import org.bonitasoft.engine.bpm.flownode.HumanTaskInstance; 20 | import org.bonitasoft.engine.session.APISession; 21 | import org.bonitasoft.web.rest.model.bpm.flownode.HumanTaskItem; 22 | 23 | /** 24 | * @author Séverin Moussel 25 | */ 26 | public class HumanTaskDatastore extends AbstractHumanTaskDatastore { 27 | 28 | public HumanTaskDatastore(final APISession engineSession) { 29 | super(engineSession); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/server/framework/api/EnumConverter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2012 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.web.rest.server.framework.api; 18 | 19 | /** 20 | * @author Vincent Elcrin 21 | * 22 | * Converter doing bridge between engine's enum and web's item 23 | * 24 | */ 25 | public interface EnumConverter> { 26 | 27 | /** 28 | * Convert attribute value stored in items into engine's enum. 29 | */ 30 | E convert(final String attributeValue); 31 | 32 | /** 33 | * Convert engine's enum into an item's attribute. 34 | */ 35 | String convert(final E enumValue); 36 | 37 | } 38 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/server/api/bdm/BusinessDataQueryResourceFinder.java: -------------------------------------------------------------------------------- 1 | /** Copyright (C) 2015 Bonitasoft S.A. 2 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 3 | * This program is free software: you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation, either version 2.0 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program. If not, see . 15 | */ 16 | package org.bonitasoft.web.rest.server.api.bdm; 17 | 18 | import org.bonitasoft.web.rest.server.ResourceFinder; 19 | import org.restlet.Request; 20 | import org.restlet.Response; 21 | import org.restlet.resource.ServerResource; 22 | 23 | /** 24 | * @author Baptiste Mesta 25 | */ 26 | public class BusinessDataQueryResourceFinder extends ResourceFinder { 27 | 28 | @Override 29 | public ServerResource create(final Request request, final Response response) { 30 | return new BusinessDataQueryResource(getCommandAPI(request)); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/server/api/organization/password/validator/DefaultPasswordValidator.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2013 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * You should have received a copy of the GNU General Public License 13 | * along with this program. If not, see . 14 | */ 15 | package org.bonitasoft.web.rest.server.api.organization.password.validator; 16 | 17 | import org.bonitasoft.web.toolkit.client.data.item.attribute.validator.AbstractStringValidator; 18 | 19 | /** 20 | * Do not delete: this class is used by reflection ! 21 | * See 'security.password.validator' in file 'security-config.properties' 22 | * 23 | * @author Paul AMAR 24 | */ 25 | public class DefaultPasswordValidator extends AbstractStringValidator { 26 | 27 | @Override 28 | protected void _check(String password) { 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/server/datastore/bpm/cases/CaseDocumentItemConverter.java: -------------------------------------------------------------------------------- 1 | package org.bonitasoft.web.rest.server.datastore.bpm.cases; 2 | 3 | import org.bonitasoft.engine.bpm.document.Document; 4 | import org.bonitasoft.web.rest.model.bpm.cases.CaseDocumentItem; 5 | import org.bonitasoft.web.rest.server.datastore.converter.ItemConverter; 6 | 7 | public class CaseDocumentItemConverter extends ItemConverter { 8 | 9 | @Override 10 | public CaseDocumentItem convert(final Document engineItem) { 11 | final CaseDocumentItem item = new CaseDocumentItem(); 12 | item.setId(String.valueOf(engineItem.getId())); 13 | item.setCaseId(String.valueOf(engineItem.getProcessInstanceId())); 14 | item.setName(engineItem.getName()); 15 | item.setVersion(engineItem.getVersion()); 16 | item.setDescription(engineItem.getDescription()); 17 | item.setSubmittedBy(engineItem.getAuthor()); 18 | item.setFileName(engineItem.getContentFileName()); 19 | item.setCreationDate(engineItem.getCreationDate()); 20 | item.setMIMEType(engineItem.getContentMimeType()); 21 | item.setHasContent(String.valueOf(engineItem.hasContent())); 22 | item.setStorageId(engineItem.getContentStorageId()); 23 | item.setURL(engineItem.getUrl()); 24 | item.setIndex(engineItem.getIndex()); 25 | return item; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/server/datastore/bpm/flownode/FlowNodeDatastore.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2013 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.web.rest.server.datastore.bpm.flownode; 18 | 19 | import org.bonitasoft.engine.bpm.flownode.FlowNodeInstance; 20 | import org.bonitasoft.engine.session.APISession; 21 | import org.bonitasoft.web.rest.model.bpm.flownode.FlowNodeItem; 22 | 23 | /** 24 | * @author Séverin Moussel 25 | * 26 | */ 27 | public class FlowNodeDatastore extends AbstractFlowNodeDatastore { 28 | 29 | public FlowNodeDatastore(final APISession engineSession) { 30 | super(engineSession); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/toolkit/client/data/item/template/ItemHasDualName.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2012 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.web.toolkit.client.data.item.template; 18 | 19 | /** 20 | * Insert name and display_name in the allowed attributes. 21 | * 22 | * @author Julien Mege, Séverin Moussel 23 | * 24 | */ 25 | public interface ItemHasDualName { 26 | 27 | String ATTRIBUTE_NAME = "name"; 28 | 29 | String ATTRIBUTE_DISPLAY_NAME = "displayName"; 30 | 31 | void setName(final String name); 32 | 33 | void setDisplayName(final String displayName); 34 | 35 | String getName(); 36 | 37 | String getDisplayName(); 38 | 39 | } 40 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/console/common/server/utils/DocumentUtil.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2012 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | */ 5 | package org.bonitasoft.console.common.server.utils; 6 | 7 | import java.io.ByteArrayOutputStream; 8 | import java.io.File; 9 | import java.io.FileInputStream; 10 | import java.io.IOException; 11 | import java.io.InputStream; 12 | 13 | /** 14 | * @author Yongtao Guo 15 | * 16 | */ 17 | public class DocumentUtil { 18 | 19 | public static byte[] getArrayByte(final InputStream input, final int estimatedSize) throws IOException { 20 | final ByteArrayOutputStream output = new ByteArrayOutputStream(estimatedSize); 21 | try (output) { 22 | final byte[] buf = new byte[8192]; 23 | int len; 24 | 25 | while ((len = input.read(buf)) >= 0) { 26 | output.write(buf, 0, len); 27 | } 28 | } 29 | return output.toByteArray(); 30 | } 31 | 32 | public static byte[] getArrayByteFromFile(final File f) throws IOException { 33 | final long length = f.length(); 34 | if (length > Integer.MAX_VALUE) { // more than 2 GB 35 | throw new IOException("File too big"); 36 | } 37 | 38 | try (FileInputStream input = new FileInputStream(f)) { 39 | return getArrayByte(input, (int) length); 40 | } 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/model/bdm/BusinessDataModelItem.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2018 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.web.rest.model.bdm; 18 | 19 | import java.io.Serializable; 20 | 21 | 22 | public class BusinessDataModelItem implements Serializable { 23 | 24 | /** 25 | * UID 26 | */ 27 | private static final long serialVersionUID = -6119736077951213751L; 28 | 29 | private String fileUpload; 30 | 31 | 32 | public String getFileUpload() { 33 | return fileUpload; 34 | } 35 | 36 | 37 | public void setFileUpload(String fileUpload) { 38 | this.fileUpload = fileUpload; 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/server/framework/exception/APIFilterEmptyException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2013 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.web.rest.server.framework.exception; 18 | 19 | /** 20 | * @author Séverin Moussel 21 | * 22 | */ 23 | public class APIFilterEmptyException extends APIFilterException { 24 | 25 | private static final long serialVersionUID = -3372478894238466120L; 26 | 27 | public APIFilterEmptyException(final String filterName) { 28 | super(filterName); 29 | } 30 | 31 | @Override 32 | protected String defaultMessage() { 33 | return "Filter " + getFilterName() + " mustn't be empty"; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/server/framework/utils/converter/typed/BooleanConverter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2012 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.web.rest.server.framework.utils.converter.typed; 18 | 19 | import org.bonitasoft.web.rest.server.framework.utils.converter.Converter; 20 | 21 | 22 | /** 23 | * @author Colin PUY 24 | * 25 | */ 26 | public class BooleanConverter implements Converter { 27 | 28 | @Override 29 | public Boolean convert(String toBeConverted) { 30 | if (toBeConverted == null || toBeConverted.isEmpty()) { 31 | return null; 32 | } 33 | return Boolean.valueOf(toBeConverted); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /server/src/test/java/org/bonitasoft/web/rest/server/datastore/converter/StringValueConverterTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2012 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.web.rest.server.datastore.converter; 18 | 19 | import static org.junit.Assert.assertEquals; 20 | 21 | import org.bonitasoft.web.rest.server.datastore.converter.StringValueConverter; 22 | import org.junit.Test; 23 | 24 | /** 25 | * @author Vincent Elcrin 26 | * 27 | */ 28 | public class StringValueConverterTest { 29 | 30 | @Test 31 | public void testStringConvertion() throws Exception { 32 | String value = new StringValueConverter().convert("cba"); 33 | 34 | assertEquals("cba", value); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/server/api/bdm/BusinessDataFindByIdsResourceFinder.java: -------------------------------------------------------------------------------- 1 | /** Copyright (C) 2015 Bonitasoft S.A. 2 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 3 | * This program is free software: you can redistribute it and/or modify 4 | * it under the terms of the GNU General Public License as published by 5 | * the Free Software Foundation, either version 2.0 of the License, or 6 | * (at your option) any later version. 7 | * 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * 13 | * You should have received a copy of the GNU General Public License 14 | * along with this program. If not, see . 15 | */ 16 | package org.bonitasoft.web.rest.server.api.bdm; 17 | 18 | import org.bonitasoft.web.rest.server.ResourceFinder; 19 | import org.restlet.Request; 20 | import org.restlet.Response; 21 | import org.restlet.resource.ServerResource; 22 | 23 | /** 24 | * @author Matthieu Chaffotte 25 | */ 26 | public class BusinessDataFindByIdsResourceFinder extends ResourceFinder { 27 | 28 | @Override 29 | public ServerResource create(final Request request, final Response response) { 30 | return new BusinessDataFindByIdsResource(getCommandAPI(request)); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/server/framework/api/APIHasSearch.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2012 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.web.rest.server.framework.api; 18 | 19 | import java.util.Map; 20 | 21 | import org.bonitasoft.web.rest.server.framework.search.ItemSearchResult; 22 | import org.bonitasoft.web.toolkit.client.data.item.IItem; 23 | 24 | /** 25 | * @author Séverin Moussel 26 | * 27 | */ 28 | public interface APIHasSearch { 29 | 30 | ItemSearchResult search(final int page, final int resultsByPage, final String search, final String orders, 31 | final Map filters); 32 | 33 | String defineDefaultSearchOrder(); 34 | } 35 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/toolkit/client/data/item/attribute/validator/StringSingleLineValidator.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.web.toolkit.client.data.item.attribute.validator; 18 | 19 | import org.bonitasoft.web.toolkit.client.common.i18n.AbstractI18n; 20 | 21 | /** 22 | * @author Séverin Moussel 23 | * 24 | */ 25 | public class StringSingleLineValidator extends AbstractStringValidator { 26 | 27 | @Override 28 | protected void _check(final String attributeValue) { 29 | 30 | if (attributeValue.indexOf('\n') >= 0) { 31 | addError(AbstractI18n.t_("%attribute% must be on a single line")); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /server/src/test/java/org/bonitasoft/web/rest/model/ModelFactoryExtTest.java: -------------------------------------------------------------------------------- 1 | package org.bonitasoft.web.rest.model; 2 | 3 | import static org.assertj.core.api.Assertions.assertThat; 4 | 5 | import org.bonitasoft.web.rest.model.application.ApplicationDefinition; 6 | import org.bonitasoft.web.rest.model.applicationpage.ApplicationPageDefinition; 7 | import org.bonitasoft.web.toolkit.client.data.item.ItemDefinition; 8 | import org.junit.Test; 9 | 10 | 11 | public class ModelFactoryExtTest { 12 | 13 | private final ModelFactory factory = new ModelFactory(); 14 | 15 | @Test 16 | public void defineItemDefinitions_should_return_instanceOf_ApplicationDefinition_for_application_token() throws Exception { 17 | //when 18 | final ItemDefinition definition = factory.defineItemDefinitions(ApplicationDefinition.TOKEN); 19 | 20 | //then 21 | assertThat(definition).isNotNull(); 22 | assertThat(definition).isInstanceOf(ApplicationDefinition.class); 23 | } 24 | 25 | @Test 26 | public void defineItemDefinitions_should_return_instanceOf_ApplicationPageDefinition_for_applicationPage_token() throws Exception { 27 | //when 28 | final ItemDefinition definition = factory.defineItemDefinitions(ApplicationPageDefinition.TOKEN); 29 | 30 | //then 31 | assertThat(definition).isNotNull(); 32 | assertThat(definition).isInstanceOf(ApplicationPageDefinition.class); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/rest/server/api/bpm/flownode/TimerEventTrigger.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2014 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This library is free software; you can redistribute it and/or modify it under the terms 5 | * of the GNU Lesser General Public License as published by the Free Software Foundation 6 | * version 2.1 of the License. 7 | * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 8 | * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 9 | * See the GNU Lesser General Public License for more details. 10 | * You should have received a copy of the GNU Lesser General Public License along with this 11 | * program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth 12 | * Floor, Boston, MA 02110-1301, USA. 13 | **/ 14 | package org.bonitasoft.web.rest.server.api.bpm.flownode; 15 | 16 | public class TimerEventTrigger { 17 | 18 | private Long executionDate = null; 19 | 20 | public TimerEventTrigger() { 21 | } 22 | 23 | public TimerEventTrigger(final long executionDate) { 24 | this.executionDate = executionDate; 25 | } 26 | 27 | public void setExecutionDate(final Long executionDate) { 28 | this.executionDate = executionDate; 29 | } 30 | 31 | public Long getExecutionDate() { 32 | return executionDate; 33 | } 34 | 35 | } -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/toolkit/client/data/item/attribute/modifier/DefaultValueModifier.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.web.toolkit.client.data.item.attribute.modifier; 18 | 19 | /** 20 | * @author Séverin Moussel 21 | * 22 | */ 23 | public class DefaultValueModifier extends AbstractStringModifier { 24 | 25 | private final String defaultValue; 26 | 27 | public DefaultValueModifier(final String defaultValue) { 28 | super(); 29 | this.defaultValue = defaultValue; 30 | } 31 | 32 | @Override 33 | public String clean(final String value) { 34 | return value != null ? value : this.defaultValue; 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/web/toolkit/client/data/item/attribute/validator/AbstractCollectionValidator.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011 BonitaSoft S.A. 3 | * BonitaSoft, 32 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * 9 | * This program is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | * GNU General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU General Public License 15 | * along with this program. If not, see . 16 | */ 17 | package org.bonitasoft.web.toolkit.client.data.item.attribute.validator; 18 | 19 | /** 20 | * @author Séverin Moussel 21 | * 22 | */ 23 | public abstract class AbstractCollectionValidator extends Validator { 24 | 25 | public final void check(final String[] attributeValue) { 26 | reset(); 27 | _check(attributeValue); 28 | } 29 | 30 | protected abstract void _check(String[] attributeValue); 31 | 32 | @Override 33 | protected final void addError(final String error) { 34 | super.addError(error); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /server/src/main/java/org/bonitasoft/console/common/server/preferences/properties/PropertiesFactory.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (C) 2011 BonitaSoft S.A. 3 | * BonitaSoft, 31 rue Gustave Eiffel - 38000 Grenoble 4 | * This program is free software: you can redistribute it and/or modify 5 | * it under the terms of the GNU General Public License as published by 6 | * the Free Software Foundation, either version 2.0 of the License, or 7 | * (at your option) any later version. 8 | * This program is distributed in the hope that it will be useful, 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | * GNU General Public License for more details. 12 | * You should have received a copy of the GNU General Public License 13 | * along with this program. If not, see . 14 | */ 15 | package org.bonitasoft.console.common.server.preferences.properties; 16 | 17 | /** 18 | * @author Anthony Birembaut 19 | */ 20 | public class PropertiesFactory { 21 | 22 | public static SecurityProperties getSecurityProperties() { 23 | return new SecurityProperties(); 24 | } 25 | 26 | public static ConsoleProperties getConsoleProperties() { 27 | return new ConsoleProperties(); 28 | } 29 | 30 | public static PlatformTenantConfigProperties getPlatformTenantConfigProperties() { 31 | return new PlatformTenantConfigProperties(); 32 | } 33 | 34 | } 35 | --------------------------------------------------------------------------------