From 4f843c6aff0aab72ce198c57d1e0ad52c199348a Mon Sep 17 00:00:00 2001 From: Victor Date: Thu, 12 Nov 2020 12:13:04 +0200 Subject: [PATCH] Issue IMCMS-554: Model for copying document - Prepare to stable version --- build.gradle | 2 +- docs/API-documentation/core/documentCache.rst | 39 ++++ .../API-documentation/core/imcmsLanguages.rst | 17 ++ .../core/imcmsUserLanguage.rst | 23 ++ docs/API-documentation/core/index.rst | 11 + docs/API-documentation/core/managerBean.rst | 36 +++ docs/API-documentation/index.rst | 16 ++ .../service-beans/MailService.rst | 19 ++ .../service-beans/accessService.rst | 41 ++++ .../service-beans/categoryMapper.rst | 8 + .../service-beans/categoryService.rst | 45 ++++ .../service-beans/categoryTypeService.rst | 28 +++ .../service-beans/commonContentService.rst | 92 ++++++++ .../delegatingByTypeDocumentService.rst | 115 ++++++++++ .../service-beans/documentMenuService.rst | 24 ++ .../service-beans/documentUrlService.rst | 45 ++++ .../documentValidatingService.rst | 12 + .../service-beans/fileService.rst | 57 +++++ .../service-beans/imageFileService.rst | 50 ++++ .../service-beans/imageFolderService.rst | 40 ++++ .../service-beans/imageHistoryService.rst | 24 ++ .../service-beans/imageService.rst | 66 ++++++ .../API-documentation/service-beans/index.rst | 51 +++++ .../service-beans/ipAccessRuleService.rst | 47 ++++ .../service-beans/languageService.rst | 39 ++++ .../service-beans/linkValidationService.rst | 35 +++ .../service-beans/loopService.rst | 54 +++++ .../service-beans/menuService.rst | 66 ++++++ .../service-beans/phoneService.rst | 34 +++ .../service-beans/propertyService.rst | 19 ++ .../service-beans/roleService.rst | 27 +++ .../service-beans/searchDocumentService.rst | 26 +++ .../service-beans/systemPropertyService.rst | 35 +++ .../service-beans/templateGroupService.rst | 27 +++ .../service-beans/templateService.rst | 33 +++ .../service-beans/temporalDataService.rst | 37 +++ .../textDocumentTemplateService.rst | 35 +++ .../service-beans/textHistoryService.rst | 18 ++ .../service-beans/textService.rst | 23 ++ .../service-beans/userAdminRolesService.rst | 29 +++ .../service-beans/userCreationService.rst | 21 ++ .../service-beans/userEditorService.rst | 24 ++ .../service-beans/userRolesService.rst | 25 ++ .../service-beans/userService.rst | 35 +++ .../service-beans/versionService.rst | 35 +++ docs/common/authors.txt | 1 + docs/index.rst | 1 + .../com/imcode/imcms/api/DocumentService.java | 6 +- .../com/imcode/imcms/api/TextDocument.java | 17 +- .../impl/ImcmsMenuHtmlConverter.java | 1 - .../com/imcode/imcms/config/DBConfig.java | 16 +- .../com/imcode/imcms/config/MainConfig.java | 33 ++- .../imcode/imcms/config/MappingConfig.java | 112 +++------ .../imcode/imcms/domain/dto/MenuItemDTO.java | 2 +- .../domain/service/DocumentMenuService.java | 4 +- .../imcms/domain/service/ImageService.java | 2 + .../imcms/domain/service/MenuService.java | 2 + .../imcms/domain/service/TextService.java | 2 + .../service/api/CachingMenuService.java | 6 + ...efaultDelegatingByTypeDocumentService.java | 29 ++- .../api/DefaultDocumentMenuService.java | 11 +- .../service/api/DefaultDocumentService.java | 87 ++++++- .../service/api/DefaultImageService.java | 12 + .../service/api/DefaultMenuService.java | 182 +++++++++------ .../service/api/DefaultTextService.java | 17 +- .../imcms/mapping/DefaultDocumentMapper.java | 5 +- .../imcms/mapping/DocumentCommonContent.java | 4 +- .../mapping/DocumentLoaderCachingProxy.java | 24 +- .../java/com/imcode/imcms/model/Text.java | 2 +- .../imcms/persistence/entity/MenuItem.java | 27 +-- .../imcms/persistence/entity/TextJPA.java | 9 + .../imcode/server/DefaultImcmsServices.java | 76 ++++--- .../java/imcode/server/ImcmsServices.java | 27 ++- src/main/resources-conf/server.properties | 7 + src/main/resources/ehcache.xml | 14 +- src/main/resources/schema.xml | 5 +- .../sql/diff/diff-6.86-6.87-mysql.sql | 23 ++ .../imcms-document-editor-head.css | 8 + src/main/webapp/imcms/css/grid/imcms-grid.css | 7 +- .../css/image_editor/imcms-image_editor.css | 4 + src/main/webapp/imcms/css/imcms-flex.css | 13 ++ .../css/menu_editor/imcms-menu_editor.css | 9 +- .../imcms/css/menu_editor/imcms-menu_item.css | 4 + .../imcms-image-editor-body-head-builder.js | 2 +- .../imcms-image-editor-builder.js | 5 + .../editors/imcms-document-editor-builder.js | 28 ++- .../editors/imcms-menu-editor-builder.js | 166 ++++++++++---- .../webapp/imcms/js/i18n/imcms-i18n-texts.js | 11 +- src/main/webapp/webpack.config.js | 4 +- .../LanguageDataInitializer.java | 5 +- .../datainitializer/MenuDataInitializer.java | 67 ++---- .../datainitializer/TextDataInitializer.java | 45 ++++ .../api/LinksValidationControllerTest.java | 60 ++--- .../domain/factory/ImcmsServiceTest.java | 115 ++++++++-- .../service/api/DocumentServiceTest.java | 13 +- .../service/api/ImageFolderServiceTest.java | 2 +- .../domain/service/api/ImageServiceTest.java | 65 ++++++ .../api/LinkValidationServiceTest.java | 62 ++--- .../domain/service/api/MenuServiceTest.java | 215 ++++++------------ .../service/api/TextDocumentServiceTest.java | 144 +++++++++++- .../domain/service/api/TextServiceTest.java | 69 +++++- .../service/core/DocumentMenuServiceTest.java | 18 +- .../repository/LanguageRepositoryTest.java | 9 +- .../repository/MenuRepositoryTest.java | 15 +- .../java/imcode/server/MockImcmsServices.java | 52 ++++- src/test/resources/test.server.properties | 9 +- 106 files changed, 2904 insertions(+), 673 deletions(-) create mode 100644 docs/API-documentation/core/documentCache.rst create mode 100644 docs/API-documentation/core/imcmsLanguages.rst create mode 100644 docs/API-documentation/core/imcmsUserLanguage.rst create mode 100644 docs/API-documentation/core/index.rst create mode 100644 docs/API-documentation/core/managerBean.rst create mode 100644 docs/API-documentation/index.rst create mode 100644 docs/API-documentation/service-beans/MailService.rst create mode 100644 docs/API-documentation/service-beans/accessService.rst create mode 100644 docs/API-documentation/service-beans/categoryMapper.rst create mode 100644 docs/API-documentation/service-beans/categoryService.rst create mode 100644 docs/API-documentation/service-beans/categoryTypeService.rst create mode 100644 docs/API-documentation/service-beans/commonContentService.rst create mode 100644 docs/API-documentation/service-beans/delegatingByTypeDocumentService.rst create mode 100644 docs/API-documentation/service-beans/documentMenuService.rst create mode 100644 docs/API-documentation/service-beans/documentUrlService.rst create mode 100644 docs/API-documentation/service-beans/documentValidatingService.rst create mode 100644 docs/API-documentation/service-beans/fileService.rst create mode 100644 docs/API-documentation/service-beans/imageFileService.rst create mode 100644 docs/API-documentation/service-beans/imageFolderService.rst create mode 100644 docs/API-documentation/service-beans/imageHistoryService.rst create mode 100644 docs/API-documentation/service-beans/imageService.rst create mode 100644 docs/API-documentation/service-beans/index.rst create mode 100644 docs/API-documentation/service-beans/ipAccessRuleService.rst create mode 100644 docs/API-documentation/service-beans/languageService.rst create mode 100644 docs/API-documentation/service-beans/linkValidationService.rst create mode 100644 docs/API-documentation/service-beans/loopService.rst create mode 100644 docs/API-documentation/service-beans/menuService.rst create mode 100644 docs/API-documentation/service-beans/phoneService.rst create mode 100644 docs/API-documentation/service-beans/propertyService.rst create mode 100644 docs/API-documentation/service-beans/roleService.rst create mode 100644 docs/API-documentation/service-beans/searchDocumentService.rst create mode 100644 docs/API-documentation/service-beans/systemPropertyService.rst create mode 100644 docs/API-documentation/service-beans/templateGroupService.rst create mode 100644 docs/API-documentation/service-beans/templateService.rst create mode 100644 docs/API-documentation/service-beans/temporalDataService.rst create mode 100644 docs/API-documentation/service-beans/textDocumentTemplateService.rst create mode 100644 docs/API-documentation/service-beans/textHistoryService.rst create mode 100644 docs/API-documentation/service-beans/textService.rst create mode 100644 docs/API-documentation/service-beans/userAdminRolesService.rst create mode 100644 docs/API-documentation/service-beans/userCreationService.rst create mode 100644 docs/API-documentation/service-beans/userEditorService.rst create mode 100644 docs/API-documentation/service-beans/userRolesService.rst create mode 100644 docs/API-documentation/service-beans/userService.rst create mode 100644 docs/API-documentation/service-beans/versionService.rst create mode 100644 src/main/resources/sql/diff/diff-6.86-6.87-mysql.sql create mode 100644 src/test/java/com/imcode/imcms/components/datainitializer/TextDataInitializer.java diff --git a/build.gradle b/build.gradle index 08de558e0b..ec5cc28179 100644 --- a/build.gradle +++ b/build.gradle @@ -12,7 +12,7 @@ plugins { } group = "com.imcode.imcms" -version = "6.0.0-beta9" +version = "6.0.0-beta10" description = "imCMS" diff --git a/docs/API-documentation/core/documentCache.rst b/docs/API-documentation/core/documentCache.rst new file mode 100644 index 0000000000..5899a34f1f --- /dev/null +++ b/docs/API-documentation/core/documentCache.rst @@ -0,0 +1,39 @@ +DocumentCache +============= + + +Description +""""""""""" +DocumentCache bean allow easy manipulation caches for the document/page and also global cache. + +Use API +------- +Init DocumentCache - ``Imcms.getServices().getManagedBean(DocumentCache.class)`` + +.. code-block:: jsp + + String calculateKey(HttpServletRequest request); + + String calculateKey(final String documentIdString, final String langCode); + + void setCache(Ehcache cache); + + PageInfo getPageInfoFromCache(String key); + + void invalidateDoc(Integer id, String alias); + + void invalidateItem(String key); + + void invalidateCache(); + + void invalidateDoc(HttpServletRequest request); + + boolean isDocumentAlreadyCached(String cacheKey); + + void setDisableCachesByProperty(); + + long getAmountOfCachedDocuments(); + + void setAmountOfCachedDocuments(Integer number); // using only in scope imcms + + String getDisabledCacheValue(); \ No newline at end of file diff --git a/docs/API-documentation/core/imcmsLanguages.rst b/docs/API-documentation/core/imcmsLanguages.rst new file mode 100644 index 0000000000..c9040593b3 --- /dev/null +++ b/docs/API-documentation/core/imcmsLanguages.rst @@ -0,0 +1,17 @@ +ImcmsLanguages +============== + + +In order to get the current ``IMCMS`` language need to use code like below + +Example usages current lang imcms +""""""""""""""""""""""""""""""""" + +.. code-block:: jsp + + Language language = Imcms.getLanguage(); + + String codeLanguage = language.getCode(); + + String nativeLanguage = language.getNativeName(); + diff --git a/docs/API-documentation/core/imcmsUserLanguage.rst b/docs/API-documentation/core/imcmsUserLanguage.rst new file mode 100644 index 0000000000..26806ef3c9 --- /dev/null +++ b/docs/API-documentation/core/imcmsUserLanguage.rst @@ -0,0 +1,23 @@ +ImcmsUserLanguage +================= + +In this scope we have possibles make different manipulation with current user imcms. You have to +get instance ``UserDomainObject`` from global Imcms class, and then we can check everything. + +.. warning:: +Use global Imcms.getUser() only for work with current user! Otherwise, use :doc:`UserService` + +Example usages imcms user +""""""""""""""""""""""""" + +.. code-block:: jsp + + UserDomainObject user = Imcms.getUser(); + + +Example usages get current lang user +"""""""""""""""""""""""""""""""""""" + +.. code-block:: jsp + + String language = Imcms.getUser().getLanguage(); \ No newline at end of file diff --git a/docs/API-documentation/core/index.rst b/docs/API-documentation/core/index.rst new file mode 100644 index 0000000000..33eaef4119 --- /dev/null +++ b/docs/API-documentation/core/index.rst @@ -0,0 +1,11 @@ +Core +==== + + +.. toctree:: +:titlesonly: + + managerBean + documentCache + imcmsLanguages + imcmsUserLanguage \ No newline at end of file diff --git a/docs/API-documentation/core/managerBean.rst b/docs/API-documentation/core/managerBean.rst new file mode 100644 index 0000000000..3bff9fc89b --- /dev/null +++ b/docs/API-documentation/core/managerBean.rst @@ -0,0 +1,36 @@ +ManagerBean +=========== + + +In this article: + - `Introduction`_ + - `Init ManagerBean`_ + + +Introduction +------------ +Imcms has support any service beans in different files over - ManagerBean. +With the help of ManagerBean we can easy call different implementation current service bean, which will be inject +to this the ManagerBean. + + +.. note:: +In the first step must be check exits getters current bean in `Imcms.getService()` if don't - + we can use ManagerBean with inject need type service bean! + + +Init ManagerBean +---------------- +.. code-block:: jsp + + T currentServiceBean = Imcms.getServices().getManagedBean(Class requiredType); + + +Block parameters: +""""""""""""""""" + ++---------------------+--------------+--------------------------------------------------+ +| Parameter | Type | Description | ++=====================+==============+==================================================+ +| requiredType | Class | Service bean which was injected | ++---------------------+--------------+--------------------------------------------------+ diff --git a/docs/API-documentation/index.rst b/docs/API-documentation/index.rst new file mode 100644 index 0000000000..278587c5c6 --- /dev/null +++ b/docs/API-documentation/index.rst @@ -0,0 +1,16 @@ +API-Documentation +================= + +Imcms has the main interface for call API is - ImcmsService; +Init ImcmsService - Imcms.getServices(); + +.. toctree:: +:titlesonly: + + service-beans/index + core/index + + + + + diff --git a/docs/API-documentation/service-beans/MailService.rst b/docs/API-documentation/service-beans/MailService.rst new file mode 100644 index 0000000000..d8139b004c --- /dev/null +++ b/docs/API-documentation/service-beans/MailService.rst @@ -0,0 +1,19 @@ +MailService +=========== + +In this article: + - `Use API`_ + +Use API +------- + +Init or get instance MailService over global Imcms.getServices ``Imcms.getServices().getMailService();`` + +.. code-block:: jsp + + Imcms.getServices().getMailService().sendMail(Mail mail); + + + + + diff --git a/docs/API-documentation/service-beans/accessService.rst b/docs/API-documentation/service-beans/accessService.rst new file mode 100644 index 0000000000..44395f4916 --- /dev/null +++ b/docs/API-documentation/service-beans/accessService.rst @@ -0,0 +1,41 @@ +AccessService +============= + +In this article: + - `Introduction`_ + - `Use API`_ + - `Description AccessType`_ + + +Introduction +------------ +To know do the user have access to do something with some document or not. +Imcms provides feature check permission and access for anybody user. Need to use just AccessService, which easy initialize. +Init AccessService - ``Imcms.getServices().getAccessService()``; + + +Use API +------- + +.. code-block:: jsp + + AccessService accessService = Imcms.getServices().getAccessService(); + + boolean hasUserEditAccess = accessService.hasUserEditAccess(UserDomainObject user, Integer documentId, AccessType accessType); + //Check, does the user have for access for edit document - ``documentId`` + + RestrictedPermission getEditPermission = accessService.getEditPermission(UserDomainObject user, int documentId); + //Get all permission for user on the current document ``documentId`` + + + +Description AccessType +---------------------- + +``AccessType`` has values like: + * IMAGE - access only for images + * TEXT - access only for texts + * MENU - access only for menu + * LOOP - access only for loop + * DOC_INFO - access only for doc_info + * ALL - access only for all content \ No newline at end of file diff --git a/docs/API-documentation/service-beans/categoryMapper.rst b/docs/API-documentation/service-beans/categoryMapper.rst new file mode 100644 index 0000000000..620c8f97e5 --- /dev/null +++ b/docs/API-documentation/service-beans/categoryMapper.rst @@ -0,0 +1,8 @@ +CategoryMapper +============== + + +CategoryMapper serves to maintain old code RB-4 in the project RB-6 with using new API. +Therefore we can easy this somewhere. However, recommendation use only new API, because of all stuff +covered tests and have better structure for productivity. + diff --git a/docs/API-documentation/service-beans/categoryService.rst b/docs/API-documentation/service-beans/categoryService.rst new file mode 100644 index 0000000000..29f28e9312 --- /dev/null +++ b/docs/API-documentation/service-beans/categoryService.rst @@ -0,0 +1,45 @@ +CategoryService +=============== + +In this article: + - `Introduction`_ + - `Use API`_ + - `Description about Category`_ + + +Introduction +------------ + +Imcms has single interface support and different manipulation with categories for documents. +We can easy, create/update/delete/get all categories over this bean CategoryService. +Of course you can use old version category service with oldest API objects - you have to use CategoryMapper, +more information about it :doc:`CategoryMapper` +That be init new bean CategoryService and work with methods need to look at the code below: + +Use API +------- + +.. code-block:: jsp + + CategoryService categoryService = Imcms.getServices().getManagedBean(CategoryService.class); + + List getAll(); + + Optional getById(int id); + + Category save(Category saveMe); //create new Category + + Category update(Category updateMe); + + void delete(int id); + + List getCategoriesByCategoryType(Integer id); + +Description about Category +-------------------------- +Category object has any fields: + +#. Integer ``id`` - identifier category object +#. String ``name`` - name category object +#. String ``description`` - something description about category +#. CategoryTypeDTO ``type`` - type category which relation current the category diff --git a/docs/API-documentation/service-beans/categoryTypeService.rst b/docs/API-documentation/service-beans/categoryTypeService.rst new file mode 100644 index 0000000000..e1524e8ad4 --- /dev/null +++ b/docs/API-documentation/service-beans/categoryTypeService.rst @@ -0,0 +1,28 @@ +CategoryTypeService +=================== + + + +Use API +------- + +.. code-block:: jsp + + CategoryTypeService categoryTypeService = Imcms.getServices().getManagedBean(CategoryTypeService.class); + + Optional get(int id); + + List getAll(); + + CategoryType create(CategoryType saveMe); + + CategoryType update(CategoryType updateMe); + + void delete(int id); + +.. note:: +About type Optional can read `here `_. + + + + diff --git a/docs/API-documentation/service-beans/commonContentService.rst b/docs/API-documentation/service-beans/commonContentService.rst new file mode 100644 index 0000000000..4e503615a9 --- /dev/null +++ b/docs/API-documentation/service-beans/commonContentService.rst @@ -0,0 +1,92 @@ +CommonContentService +==================== + +In this article: + - `Introduction`_ + - `Use API`_ + +.. warning:: This init instance over Imcms.getServices().getCommonContentService() working from 10 version + +Introduction +------------ + +Each documents page have common content with enable/disable languages, which store itself data about document. +We can easy get all info about it , just use ``CommonContentService``. +Init CommonContentService bean service - Imcms.getServices().getCommonContentService(); +Look at the code below how use API. + +Use API +------- + .. code-block:: jsp + + List getOrCreateCommonContents(int docId, int versionNo); + //Get document's common contents for all languages + //If common content of non working version is null it creates new common content based on working. + + CommonContent getOrCreate(int docId, int versionNo, Language language); + //Gets common content for working or published versions. + //If common content of non working version is null it creates new common content based on working. + + void save(int docId, Collection saveUs); + + Set getByVersion(Version version); + + deleteByDocId(Integer docId); + +Block parameters: +""""""""""""""""" ++----------------------+--------------+--------------------------------------------------+ +| Parameters | Type | Description | ++======================+==============+==================================================+ +| versionNo | Integer | number version document | ++----------------------+--------------+--------------------------------------------------+ +| docId | Integer | Identify the linked document | +| | | | ++----------------------+--------------+--------------------------------------------------+ +| saveUs | Collection| List common contents which need to save | ++----------------------+--------------+--------------------------------------------------+ + + + + + +How to use ``getOrCreate`` method simple example: +""""""""""""""""""""""""""""""""""""""""""""""""" +How to init languageService see to languageService-documentation + .. code-block:: jsp + + Language language = languageService.findByCode(String code); + int versionNo = 0; //working version + int docId = 1001; + + CommonContentService commonContentService = Imcms.getServices().getCommonContentService(); + + commonContentService.getOrCreate(int docId, int versionNo, Language language); + +Checking what languages the document is active in, example: +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +Using lambda and stream API java8+ + +.. code-block:: jsp + + List listEnableLang = Imcms.getServices().getCommonContentService().getOrCreateCommonContents(int docId, int versionNo) + .stream() + .filter(CommonContent::isEnabled) + .map(CommonContent::getLanguage) + .collect(Collectors.toList()); + + +Using simple code without stream API: + +.. code-block:: jsp + + List contents = Imcms.getServices().getCommonContentService().getOrCreateCommonContents(int docId, int versionNo); + List languages = new ArrayList<>(); + for (CommonContent commonContent: contents) { + if (commonContent.isEnabled()) { + languages.add(commonContent.getLanguage()); + } + } + + + diff --git a/docs/API-documentation/service-beans/delegatingByTypeDocumentService.rst b/docs/API-documentation/service-beans/delegatingByTypeDocumentService.rst new file mode 100644 index 0000000000..f3cb4e4076 --- /dev/null +++ b/docs/API-documentation/service-beans/delegatingByTypeDocumentService.rst @@ -0,0 +1,115 @@ +DelegatingByTypeDocumentService +=============================== + +In this article: + - `Introduction`_ + - `Use API`_ + - `Description parameters`_ + - `Description about Document`_ + - `The most important setters/getters for Document`_ + + +.. warning:: This init instance over Imcms.getServices().getDocumentService() working from 10 version + +Introduction +------------ +Imcms works smartly. Now we don't have to worry and create unnecessary pieces of code for editing documents, because the system took care of us +We can easy to make manipulation any type documents with using this API. +Imcms provides list API which wrote below. + +Use API +------- + +For what in order to get instance ``DelegatingByTypeDocumentService`` need to use Imcms.getServices().getDocumentService(); + +.. code-block:: jsp + + Imcms.getServices().getDocumentService().countDocuments(); //get counts documents from db; + + Imcms.getServices().getDocumentService().get(int docId); + + Imcms.getServices().getDocumentService().createNewDocument(DocumentType type, Integer parentDocId); + + Imcms.getServices().getDocumentService().save(Document saveMe); + + Imcms.getServices().getDocumentService().publishDocument(int docId, int userId); + + Imcms.getServices().getDocumentService().index(int docId); + + Imcms.getServices().getDocumentService().copy(int docId); + + Imcms.getServices().getDocumentService().deleteByDocId(Integer docIdToDelete); + + Imcms.getServices().getDocumentService().getUniqueAlias(String alias); + +Description parameters +---------------------- + ++---------------------------+----------------------------------------------------------------+ +| Type | Description | ++===========================+================================================================+ +| DocumentType | Imcms support any types (FILE, HTML,TEXT,URL) | ++---------------------------+----------------------------------------------------------------+ +| PublicationStatus | Imcms has aby publication status of document | +| | (NEW,DISAPPROVED,APPROVED) | ++---------------------------+----------------------------------------------------------------+ +| AuditDTO | AuditDTO - this custom formatted date time. | +| | | ++---------------------------+----------------------------------------------------------------+ +| DisabledLanguageShowMode | ``SHOW_IN_DEFAULT_LANGUAGE`` - show document in the | +| | default language if current language disabled for this document| +| | ``DO_NOT_SHOW`` - doesn't show document | ++---------------------------+----------------------------------------------------------------+ +| Set | | +| | | ++---------------------------+----------------------------------------------------------------+ +| Set | Each documents have restricted permission for edit | +| | contents | ++---------------------------+----------------------------------------------------------------+ +| Map | Info about permission read in the document java code | +| | by path ``com/imcode/imcms/persistence/entity/Meta`` | ++---------------------------+----------------------------------------------------------------+ + + +Description about Document +-------------------------- + +Document it is super class for ``TextDocumentDTO``, ``DocumentDTO``, ``UrlDocumentDTO``, ``FileDocumentDTO``. +Therefore, we can easily return any type of data that need - just inject call methods to above documents constructor; + +Example +""""""" +.. code-block:: jsp + + DocumentService docService = Imcms.getServices().getDocumentService(); + TextDocumentDTO documentDTO = new TextDocumentDTO(docService.createNewDocument(Meta.DocumentType.TEXT, 1001)); + +The most important setters/getters for Document +----------------------------------------------- + +Document has different fields for getter/setter for value + +#. setType(DocumentType type); +#. setTarget(String target); +#. setAlias(String alias); +#. setName(String name); +#. setCommonContents(List contents); +#. setPublicationStatus(PublicationStatus publicationStatus); +#. setPublished(AuditDTO audit); +#. setArchived(AuditDTO audit); +#. setPublicationEnd(AuditDTO audit); +#. setModified(AuditDTO audit); +#. setCreated(AuditDTO audit); +#. setDisabledLanguageShowMode(DisabledLanguageShowMode disabledLanguageShowMode); +#. setCurrentVersion(AuditDTO audit); +#. setLatestVersion(AuditDTO audit); +#. setKeywords(Set keywords); +#. setSearchDisabled(boolean isSearchDisabled); +#. setCategories(Set categories); +#. setRestrictedPermissions(Set restrictedPermissions); +#. setRoleIdToPermission(Map roleIdToPermission); +#. setLinkableByOtherUsers(boolean isLinkableByOtherUsers); +#. setLinkableForUnauthorizedUsers(boolean isLinkableForUnauthorizedUsers); + + + diff --git a/docs/API-documentation/service-beans/documentMenuService.rst b/docs/API-documentation/service-beans/documentMenuService.rst new file mode 100644 index 0000000000..ada92fdf25 --- /dev/null +++ b/docs/API-documentation/service-beans/documentMenuService.rst @@ -0,0 +1,24 @@ +DocumentMenuService +=================== + + +Description +""""""""""" +DocumentMenuService uses for different manipulation with menu items for current text document. +In order to init bean for DocumentMenuService need to use - ``Imcms.getService().getManagedBean(DocumentMenuService.class)`` + + +Use API +------- + +.. code-block:: jsp + + DocumentMenuService docMenuService = Imcms.getService().getManagedBean(DocumentMenuService.class); + + boolean hasUserAccessToDoc(int docId, UserDomainObject user); + + boolean isPublicMenuItem(int docId); + + Meta.DisabledLanguageShowMode getDisabledLanguageShowMode(int documentId); + + MenuItemDTO getMenuItemDTO(int docId, Language language); \ No newline at end of file diff --git a/docs/API-documentation/service-beans/documentUrlService.rst b/docs/API-documentation/service-beans/documentUrlService.rst new file mode 100644 index 0000000000..26b192ff18 --- /dev/null +++ b/docs/API-documentation/service-beans/documentUrlService.rst @@ -0,0 +1,45 @@ +DocumentUrlService +================== + + +.. warning:: This init instance over Imcms.getServices().getDocumentUrlService() working from 10 version + +Init or get instance DocumentUrlService over global Imcms.getServices ``Imcms.getServices().getDocumentUrlService();`` + +.. code-block:: jsp + + Imcms.getServices().getDocumentUrlService().getByDocId(int docId); + + Imcms.getServices().getDocumentUrlService().save(DocumentURL documentURL); + + Imcms.getServices().getDocumentUrlService().copy(int fromDocId, int toDocId); + + Imcms.getServices().getDocumentUrlService().removeId(DocumentUrlJPA documentURL, Version version); + + +Description about DocumentUrl +----------------------------- + +How to create DocumentUrl - + +.. code-block:: jsp + + DocumentUrlDTO.createDefault(); //will create default document url with empty fields. + + DocumentUrlDTO documentUrlDTO = new DocumentUrlDTO(); + + documentUrlDTO.setUrlFrameName(""); + documentUrlDTO.setUrlTarget(""); + documentUrlDTO.setUrl(""); + documentUrlDTO.setUrlText(""); + documentUrlDTO.setUrlLanguagePrefix(""); + +If need to create ``DocumentUrlJPA`` , so need to inject data to constructor current type - new DocumentUrlJPA(DocumentUrlDTO); + + + + + + + + diff --git a/docs/API-documentation/service-beans/documentValidatingService.rst b/docs/API-documentation/service-beans/documentValidatingService.rst new file mode 100644 index 0000000000..de9674d5aa --- /dev/null +++ b/docs/API-documentation/service-beans/documentValidatingService.rst @@ -0,0 +1,12 @@ +DocumentValidatingService +========================= + + +In order to init DocumentValidatingService bean - ``Imcms.getServices().getManagerBean(DocumentValidatingService.class)`` + +Usages Example +"""""""""""""" + +.. code-block:: jsp + + boolean isTextDocument(String documentIdentifier); \ No newline at end of file diff --git a/docs/API-documentation/service-beans/fileService.rst b/docs/API-documentation/service-beans/fileService.rst new file mode 100644 index 0000000000..70c2359556 --- /dev/null +++ b/docs/API-documentation/service-beans/fileService.rst @@ -0,0 +1,57 @@ +FileService +=========== + +In this article: + - `Introduction`_ + - `Use API`_ + - `Fields in SourceFile`_ + +Introduction +------------ +This file service works in scope a certain path like property ``FileAdminRootPaths`` which was set in `properties.file`. +So, we can control different files in this scope. +In order to init FileService need to use - ``Imcms.getServices().getManagedBean(FileService.class)`` + + +Use API +------- + +.. code-block:: jsp + + List getRootFiles(); + + List getFiles(Path file) throws IOException; + + SourceFile getFile(Path file) throws IOException; + + List getDocumentsByTemplatePath(Path template) throws IOException; + + void deleteFile(Path file) throws IOException; + + List moveFile(List src, Path target) throws IOException; + + SourceFile moveFile(Path src, Path target) throws IOException; + + List copyFile(List src, Path target) throws IOException; + + SourceFile saveFile(Path location, byte[] contents, OpenOption writeMode) throws IOException; + + Template saveTemplateInGroup(Path template, String templateGroupName) throws IOException; + + SourceFile createFile(SourceFile file, boolean isDirectory) throws IOException; + + void replaceDocsOnNewTemplate(Path oldTemplate, Path newTemplate); + + +About parameter Path need to read documentation about nio2 `here `_. + +Fields in SourceFile +-------------------- + +#. String fileName; +#. String physicalPath; +#. String fullPath; +#. FileType fileType; - DIRECTORY, FILE +#. byte[] contents; +#. String size; + diff --git a/docs/API-documentation/service-beans/imageFileService.rst b/docs/API-documentation/service-beans/imageFileService.rst new file mode 100644 index 0000000000..8d7d1026e1 --- /dev/null +++ b/docs/API-documentation/service-beans/imageFileService.rst @@ -0,0 +1,50 @@ +ImageFileService +================ + + +In order to init ImageFileService need to use - ``Imcms.getServices().getManagedBean(ImageFileService.class)`` + +Use API +------- +.. code-block:: jsp + + List saveNewImageFiles(String folder, List files) throws IOException; + + List deleteImage(ImageFileDTO imageFileDTO) throws IOException; + + List getImageFileUsages(String imageFileDTOPath); + + +Description how convert file to MockMultipartFile +""""""""""""""""""""""""""""""""""""""""""""""""" + +.. code-block:: jsp + + String name = "testFile"; + String originalName = "img-test.jpg"; + String contentType = null; + byte[] content = Files.readAllBytes(new File(pathName..).toPath()); + + MockMultipartFile file = new MockMultipartFile("file", "img1-test.jpg", null, content); + +Description fields in ImageFileDTO +"""""""""""""""""""""""""""""""""" + +#. String name; +#. String path; +#. Format format; +#. String uploaded; - lastModifiedDate +#. String resolution; +#. String size; +#. Integer width; +#. Integer height + +Description fields ImageFileUsageDTO +"""""""""""""""""""""""""""""""""""" + +#. Integer docId; +#. Integer version; +#. Integer elementIndex; +#. String comment; + + diff --git a/docs/API-documentation/service-beans/imageFolderService.rst b/docs/API-documentation/service-beans/imageFolderService.rst new file mode 100644 index 0000000000..02339ada1d --- /dev/null +++ b/docs/API-documentation/service-beans/imageFolderService.rst @@ -0,0 +1,40 @@ +ImageFolderService +================== + +In order to init ImageFolderService need to use - ``Imcms.getServices().getManagedBean(ImageFolderService.class)`` + +Use API +------- +.. code-block:: java + + ImageFolderDTO getImageFolder(); + + boolean createImageFolder(ImageFolderDTO folderToCreate); + + boolean renameFolder(ImageFolderDTO renameMe); + + boolean canBeDeleted(ImageFolderDTO folderToCheck) throws IOException; + + boolean deleteFolder(ImageFolderDTO deleteMe) throws IOException; + + ImageFolderDTO getImagesFrom(ImageFolderDTO folderToGetImages); + + List checkFolder(ImageFolderDTO folderToCheck); + +Description about fields ImageFolderDTO +""""""""""""""""""""""""""""""""""""""" + +#. String name; +#. String path; +#. List files; +#. List folders; + + see also :doc:`ImageFileService` + +Description about fields ImageFolderItemUsageDTO +"""""""""""""""""""""""""""""""""""""""""""""""" + +#. String filePath; +#. String imageName; +#. List usages; + diff --git a/docs/API-documentation/service-beans/imageHistoryService.rst b/docs/API-documentation/service-beans/imageHistoryService.rst new file mode 100644 index 0000000000..f126574267 --- /dev/null +++ b/docs/API-documentation/service-beans/imageHistoryService.rst @@ -0,0 +1,24 @@ +ImageHistoryService +=================== + + +In order to init ImageHistoryService need to use - Imcms.getServices().getManagedBean(ImageHistoryService.class) + +Use API +------- + +.. code-block:: jsp + + void save(ImageJPA image); + + void save(ImageDTO image, LanguageJPA language, Version version); + + List getAll(ImageDTO image); + +Description about fields ImageHistoryDTO +"""""""""""""""""""""""""""""""""""""""" + + - **User modifiedBy** + - **LocalDateTime modifiedAt** - created date + +And ImageHistoryDTO has parent ImageDTO read about image :doc:`ImageService` \ No newline at end of file diff --git a/docs/API-documentation/service-beans/imageService.rst b/docs/API-documentation/service-beans/imageService.rst new file mode 100644 index 0000000000..751bcdbca0 --- /dev/null +++ b/docs/API-documentation/service-beans/imageService.rst @@ -0,0 +1,66 @@ +ImageService +============ + + +In this article: + - `Use API`_ + - `Description ImageDTO`_ + - `Description fields imageDTO`_ + + +.. warning:: This init instance over Imcms.getServices().getImageService() working from 10 version + +Use API +------- + +Init or get instance ImageService over global Imcms.getServices ``Imcms.getServices().getImageService();`` + +.. code-block:: jsp + + Imcms.getServices().getImageService().getImage(ImageDTO dataHolder); + + Imcms.getServices().getImageService().getImage(int docId, int index, String langCode, LoopEntryRef loopEntryRef); + + Imcms.getServices().getImageService().getPublicImage(int docId, int index, String langCode, LoopEntryRef loopEntryRef); + + Imcms.getServices().getImageService().getUsedImagesInWorkingAndLatestVersions(String imageURL); + + Imcms.getServices().getImageService().getImagesAllVersionAndLanguages(int docId, Language language); + + Imcms.getServices().getImageService().saveImage(ImageDTO imageDTO); + + Imcms.getServices().getImageService().deleteByDocId(Integer docIdToDelete); + + Imcms.getServices().getImageService().getPublicImageLinks(int docId, Language language); + + Imcms.getServices().getImageService().deleteImage(ImageDTO imageDTO); + + +Description ImageDTO +-------------------- + +Imcms support a few variables to create imageDTO - + +ImageDTO image = new ImageDTO(Integer index, Integer docId, LoopEntryRef loopEntryRef, String langCode); + +ImageDTO image = new ImageDTO(Integer index, Integer docId); + +Description fields imageDTO +--------------------------- + +#. ``setIndex(Integer)`` - ``no`` index image +#. ``setDocId(Integer)`` - identified document where location image +#. ``setInText(boolean)`` - location image into text-aria. +#. ``setAllLanguage(boolean)`` - support all language image; +#. ``setAlternateText(String)`` - alternative text for image; +#. ``setSizeFormatted(String)`` - current size image (GB, Mb and etc) +#. ``setLoopEntryRef(LoopEntryRefDTO)`` - location into loop-area. (Check about loopEntryRef in :doc:`LoopService`.) +#. ``setFormat(Format)`` - set current format image; +#. ``setCropRegion(ImageCropRegionDTO)`` - x1,x2,y1,y2 crop region for image; +#. ``setSource(ImageSource)`` +#. ``setSpaceAround(SpaceAroundDTO)`` +#. ``setResize(Resize)`` +#. ``setRotateDirection(RotateDirection)`` + + + diff --git a/docs/API-documentation/service-beans/index.rst b/docs/API-documentation/service-beans/index.rst new file mode 100644 index 0000000000..be888d3e22 --- /dev/null +++ b/docs/API-documentation/service-beans/index.rst @@ -0,0 +1,51 @@ +Service-beans +============= + +.. toctree:: +:titlesonly: + + accessService + categoryMapper + categoryService + categoryTypeService + commonContentService + delegatingByTypeDocumentService + documentMenuService + documentRolesService + documentUrlService + documentValidatingService + fileService + imageFileService + imageFolderService + imageHistoryService + imageService + ipAccessRuleService + languageService + linkValidationService + loopService + MailService + menuService + phoneService + propertyService + roleService + searchDocumentService + systemPropertyService + templateGroupService + templateService + temporalDataService + textDocumentTemplateService + textHistoryService + textService + userAdminRolesService + userCreationService + userEditorService + userRolesService + userService + versionService + + + + + + + diff --git a/docs/API-documentation/service-beans/ipAccessRuleService.rst b/docs/API-documentation/service-beans/ipAccessRuleService.rst new file mode 100644 index 0000000000..0ffea1ba4d --- /dev/null +++ b/docs/API-documentation/service-beans/ipAccessRuleService.rst @@ -0,0 +1,47 @@ +IP_AccessRuleService +==================== + + +In this article: + - `Introduction`_ + - `Use API`_ + +Introduction +------------ +Through the use of IpAccessRuleService bean, we can easily control and put some kind of restriction on Ip address, +for user in the system. + +Use API +------- +In order to init IpAccessRuleService need to use - ``Imcms.getServices().getManagedBean(IpAccessRuleService)`` + +.. code-block:: jsp + + IpAccessRule getById(int id); + + List getAll(); + + IpAccessRule create(IpAccessRule rule); + + IpAccessRule update(IpAccessRule rule); + + void delete(int ruleId); + + boolean isAllowedToAccess(InetAddress accessIp, UserDomainObject user); + + +.. note:: +See also how to use InetAddress `here `_. + +Description about fields IpAccessRule +""""""""""""""""""""""""""""""""""""" + +#. Integer id; +#. boolean isEnabled; +#. boolean isRestricted; +#. String ipRange; +#. Integer roleId; +#. Integer userId; + + + diff --git a/docs/API-documentation/service-beans/languageService.rst b/docs/API-documentation/service-beans/languageService.rst new file mode 100644 index 0000000000..feceae1367 --- /dev/null +++ b/docs/API-documentation/service-beans/languageService.rst @@ -0,0 +1,39 @@ +LanguageService +=============== + +In this article: + - `Use API`_ + +Use API +------- + +For what in order to use LanguageService API need to init this the service. +How to init LanguageService and uses API look at the code below. + +.. code-block:: jsp + + LanguageService languageService = Imcms.getServices().getLanguageService(); + + Language language = languageService.findByCode(String code); //find language by code language from db + + List langs = languageService.getAll(); //get all languages + + List langs = languageService.getAvailableLanguages(); // get all available which set into server.properties + + Language langDefault = languageService.getDefaultLanguage(); // get default language imcms + + +Block parameters: +"""""""""""""""" + ++---------------------+--------------+--------------------------------------------------+ +| Parameter | Type | Description | ++=====================+==============+==================================================+ +| code | String | Language code | ++---------------------+--------------+--------------------------------------------------+ + + + + + + diff --git a/docs/API-documentation/service-beans/linkValidationService.rst b/docs/API-documentation/service-beans/linkValidationService.rst new file mode 100644 index 0000000000..99f0d87640 --- /dev/null +++ b/docs/API-documentation/service-beans/linkValidationService.rst @@ -0,0 +1,35 @@ +LinkValidationService +===================== + + +Introduction +------------ +Imcms allows easy a certain validate all links on text documents. You can also find list links which broken on text +documents. +Init LinkValidationService service bean - ``Imcms.getServices().getManagedBean(LinkValidationService.class);`` + +.. code-block:: java + + List validateDocumentsLinks(int startDocumentId, int endDocumentId, boolean onlyBrokenLinks); + + +Description about fields ValidationLink +""""""""""""""""""""""""""""""""""""""" +#. boolean pageFound; +#. boolean hostFound; +#. boolean hostReachable; +#. String url; +#. EditLink editLink; +#. DocumentStoredFieldsDTO documentData; +#. LinkType linkType; - TEXT,IMAGE,URL + + +Description about fields EditLink +""""""""""""""""""""""""""""""""" +#. Integer metaId; +#. String title; +#. Integer index; +#. LoopEntryRef loopEntryRef; + +.. note:: +See also description DocumentStoredFieldsDTO :doc:`SearchDocumentService` diff --git a/docs/API-documentation/service-beans/loopService.rst b/docs/API-documentation/service-beans/loopService.rst new file mode 100644 index 0000000000..94597f49ea --- /dev/null +++ b/docs/API-documentation/service-beans/loopService.rst @@ -0,0 +1,54 @@ +LoopService +=========== + +In this article: + - `Use API`_ + - `Example usages loopService API`_ + + +.. warning:: This init instance over Imcms.getServices().getLoopService() working from 10 version + +Use API +------- + +Init or get instance LoopService over global Imcms.getServices ``Imcms.getServices().getLoopService();`` + +.. code-block:: jsp + + Imcms.getServices().getLoopService().getLoop(int loopIndex, int docId); + + Imcms.getServices().getLoopService().getLoopPublic(int loopIndex, int docId); + + Imcms.getServices().getLoopService().getLoop(int loopIndex, int docId, Function versionGetter); + + Imcms.getServices().getLoopService().saveLoop(Loop loopDTO); + + Imcms.getServices().getLoopService().buildLoopEntryRef(int loopIndex, int entryIndex); + + Imcms.getServices().getLoopService().deleteByDocId(Integer docIdToDelete); + + Imcms.getServices().getLoopService().removeId(LoopJPA dto, Version version); + + Imcms.getServices().getLoopService().createVersionedContent(Version workingVersion, Version newVersion); + +Example usages loopService API +------------------------------ + +.. code-block:: jsp + + LoopService loopService = Imcms.getServices().getLoopService(); + int loopIndex = 1; + int docId = 1001; + + Loop loop = loopService.getLoop(loopIndex, docId); + +Example map JPA to DTO and versa +"""""""""""""""""""""""""""""""" + +In order to map JPA to DTO and versa classes, you have to use super constructor - +.. code-block:: jsp + + - new LoopJPA(loop); + - new LoopDTO(loop); + + diff --git a/docs/API-documentation/service-beans/menuService.rst b/docs/API-documentation/service-beans/menuService.rst new file mode 100644 index 0000000000..dec6eacbcf --- /dev/null +++ b/docs/API-documentation/service-beans/menuService.rst @@ -0,0 +1,66 @@ +MenuService +=========== + +Init or get instance MenuService over global Imcms.getServices ``Imcms.getServices().getMenuService();`` + +.. code-block:: jsp + + List getMenuItems(int docId, int menuIndex, String language, boolean nested, String typeSort) + + List getSortedMenuItems(MenuDTO menuDTO, String langCode) + + List getVisibleMenuItems(int docId, int menuIndex, String language, boolean nested) + + List getPublicMenuItems(int docId, int menuIndex, String language, boolean nested) + + String getVisibleMenuAsHtml(int docId, int menuIndex, String language, + boolean nested, String attributes, String treeKey, String wrap) + + String getPublicMenuAsHtml(int docId, int menuIndex, String language, + boolean nested, String attributes, String treeKey, String wrap) + + String getVisibleMenuAsHtml(int docId, int menuIndex) + + String getPublicMenuAsHtml(int docId, int menuIndex) + + MenuDTO saveFrom(MenuDTO menuDTO) + + void deleteByVersion(Version version) + + void deleteByDocId(Integer docIdToDelete) + + Menu removeId(Menu jpa, Version newVersion) + + List getAll(); + +Block parameters: +""""""""""""""""" ++----------------------+--------------+--------------------------------------------------+ +| Parameters | Type | Description | ++======================+==============+==================================================+ +| menuIndex | int | index ``no`` | ++----------------------+--------------+--------------------------------------------------+ +| docId | int | Identify the linked document | +| | | | ++----------------------+--------------+--------------------------------------------------+ +| nested | boolean | show nested in menu area | ++----------------------+--------------+--------------------------------------------------+ +| attributes | String | | ++----------------------+--------------+--------------------------------------------------+ +| treeKey | String | number key for start menu item | ++----------------------+--------------+--------------------------------------------------+ +| wrap | String | list wrap tags for each menu item | ++----------------------+--------------+--------------------------------------------------+ + + +Fields MenuDTO +"""""""""""""" + +#. Integer menuIndex; +#. Integer docId; +#. List menuItems; +#. boolean nested; - possible display menu items like nested +#. String typeSort; - sort type need to for client side + + + diff --git a/docs/API-documentation/service-beans/phoneService.rst b/docs/API-documentation/service-beans/phoneService.rst new file mode 100644 index 0000000000..9584e85686 --- /dev/null +++ b/docs/API-documentation/service-beans/phoneService.rst @@ -0,0 +1,34 @@ +PhoneService +============ + +In order to init PhoneService bean need to use - ``Imcms.getServices().getManagedBean(PhoneService.class)`` + + +Use API +------- + +.. code-block:: jsp + + void updateUserPhones(List phones, int userId); + + List getUserPhones(int userId); + + +Fields Phone +"""""""""""" +#. Integer phoneId; +#. String number; +#. User user; +#. PhoneTypeDTO phoneType; + +Fields PhoneTypeDTO +""""""""""""""""""" +#. Integer id; +#. String name; + +``PhoneTypes`` +#. OTHER(0, "Other"), +#. HOME(1, "Home"), +#. WORK(2, "Work"), +#. MOBILE(3, "Mobile"), +#. FAX(4, "Fax") diff --git a/docs/API-documentation/service-beans/propertyService.rst b/docs/API-documentation/service-beans/propertyService.rst new file mode 100644 index 0000000000..cb5b0125aa --- /dev/null +++ b/docs/API-documentation/service-beans/propertyService.rst @@ -0,0 +1,19 @@ +PropertyService +=============== + + +In order to init PropertyService bean need to use - ``Imcms.getServices().getManagedBean(PropertyService.class)`` + +.. code-block:: jsp + + Property getByDocIdAndName(int docId, String name); + + Integer getDocIdByAlias(String alias); + + List findAllAliases(); + + List findByDocId(int docId); + + Boolean existsByAlias(String alias); + + diff --git a/docs/API-documentation/service-beans/roleService.rst b/docs/API-documentation/service-beans/roleService.rst new file mode 100644 index 0000000000..2d7dad0eaf --- /dev/null +++ b/docs/API-documentation/service-beans/roleService.rst @@ -0,0 +1,27 @@ +RoleService +=========== + + +In order to init RoleService bean need to use - ``Imcms.getServices().getManagedBean(RoleService.class)`` + +Use API +------- + +.. code-block:: jsp + + Role getById(int id); + + List getAll(); + + Role save(Role saveMe); + + Role saveNewRole(Role role); + + void delete(int roleID); + +Description about API +""""""""""""""""""""" + +``save(Role role)`` - update injected role + +``saveNewRole(Role role)`` - create new role diff --git a/docs/API-documentation/service-beans/searchDocumentService.rst b/docs/API-documentation/service-beans/searchDocumentService.rst new file mode 100644 index 0000000000..ef0879cb87 --- /dev/null +++ b/docs/API-documentation/service-beans/searchDocumentService.rst @@ -0,0 +1,26 @@ +SearchDocumentService +===================== + + +In order to init SearchDocumentService bean need to use - ``Imcms.getServices().getManagedBean(SearchDocumentService.class)`` + +Use API +------- + +.. code-block:: jsp + + List searchDocuments(SearchQueryDTO searchQuery); + + List searchDocuments(String searchQuery); + + +Description how to use SearchQueryDTO +""""""""""""""""""""""""""""""""""""" + +.. code-block:: jsp + + final SearchQueryDTO searchQueryDTO = new SearchQueryDTO(); + final String headlineValue = "Headline_Testing_Value_Remove_Added"; + searchQueryDTO.setTerm(headlineValue); + searchDocumentService.searchDocuments(searchQueryDTO); + diff --git a/docs/API-documentation/service-beans/systemPropertyService.rst b/docs/API-documentation/service-beans/systemPropertyService.rst new file mode 100644 index 0000000000..89aa505381 --- /dev/null +++ b/docs/API-documentation/service-beans/systemPropertyService.rst @@ -0,0 +1,35 @@ +SystemPropertyService +===================== + +In order to init SystemPropertyService bean need to use - ``Imcms.getServices().getManagedBean(SystemPropertyService.class)`` + +Use API +------- + +.. code-block:: jsp + + List findAll(); + + SystemProperty findByName(String name); + + SystemProperty update(SystemProperty systemProperty); + + void deleteById(Integer id); + + SystemProperty findById(Integer id); + + +Example usages +"""""""""""""" + +.. code-block:: jsp + + SystemPropertyService systemPropertyService = Imcms.getServices().getManagedBean(SystemPropertyService.class); + + SystemProperty systemPropertyName = systemPropertyService.findByName("systemPropertyName"); + + systemPropertyName.setValue("false"); + + systemPropertyService.update(systemPropertyName); + + List allProps = systemPropertyService.findAll(); \ No newline at end of file diff --git a/docs/API-documentation/service-beans/templateGroupService.rst b/docs/API-documentation/service-beans/templateGroupService.rst new file mode 100644 index 0000000000..2417f9d83f --- /dev/null +++ b/docs/API-documentation/service-beans/templateGroupService.rst @@ -0,0 +1,27 @@ +TemplateGroupService +==================== + + +.. warning:: +In the future Imcms won't be support template group service! + + + +In order to init TemplateGroupService bean need to use - Imcms.getServices().getManagedBean(TemplateGroupService.class) + +Use API +------- + +.. code-block:: jsp + + List getAll(); + + TemplateGroup save(TemplateGroup templateGroup); + + TemplateGroup edit(TemplateGroup templateGroup); + + TemplateGroup get(String name); + + TemplateGroup get(Integer groupId); + + void remove(Integer id); \ No newline at end of file diff --git a/docs/API-documentation/service-beans/templateService.rst b/docs/API-documentation/service-beans/templateService.rst new file mode 100644 index 0000000000..4240541cc2 --- /dev/null +++ b/docs/API-documentation/service-beans/templateService.rst @@ -0,0 +1,33 @@ +TemplateService +=============== + +Init or get instance TemplateService over global Imcms.getServices ``Imcms.getServices().getTemplateService();`` + +.. code-block:: jsp + + TemplateService templateService = Imcms.getServices().getTemplateService(); + + List