{"id":78926,"date":"2024-08-01T09:34:53","date_gmt":"2024-08-01T09:34:53","guid":{"rendered":"https:\/\/owncloud.com\/?p=78926"},"modified":"2024-08-09T06:51:42","modified_gmt":"2024-08-09T06:51:42","slug":"understanding-web-applications-in-ocis","status":"publish","type":"post","link":"https:\/\/owncloud.com\/de\/blogs\/understanding-web-applications-in-ocis\/","title":{"rendered":"Understanding Web Applications in oCIS"},"content":{"rendered":"<h3>Part 1: Overview and How to Load Extensions<\/h3>\n<h4>Introduction to Web Applications in oCIS<\/h4>\n<p>In today&#8217;s fast-paced digital world, web applications play a crucial role in enhancing user experience and functionality. Infinite Scale comes with a world-class web interface to manage file resources, but it can be extended by utilizing ownCloud Infinite Scale (oCIS) as a construction set for custom web apps.<\/p>\n<p>For organizations using oCIS, understanding how to leverage web applications can significantly enhance their productivity and user engagement.<\/p>\n<p>In this series, we will delve into the world of web applications in oCIS, focusing on how extensions are loaded and utilized.<\/p>\n<h4>Use Cases and Benefits of Custom Extensions<\/h4>\n<p>The ability to provide custom extensions in oCIS opens up myriad possibilities for organizations. Here are some key use cases and benefits:<\/p>\n<ol>\n<li><strong>Tailored User Experience:<\/strong><br \/>\nCustom extensions allow organizations to create a unique user experience that aligns with their specific needs. For instance, a company can develop a custom dashboard that displays relevant metrics and reports, enhancing productivity and decision-making.<\/li>\n<li><strong>Third-party Integrations:\u2028<\/strong><br \/>\nWeb applications enable seamless integration with third-party services and tools, enhancing overall functionality. Organizations can integrate CRM systems, marketing automation tools, or custom data visualization tools directly into their oCIS environment, providing a seamless workflow for users.<\/li>\n<li><strong>Enhanced Security and Compliance:\u2028<\/strong><br \/>\nCustom extensions can help organizations adhere to specific security and compliance requirements by adding features like custom authentication mechanisms, data encryption tools, or compliance reporting modules.<\/li>\n<li><strong>Branding and Identity:\u2028<\/strong><br \/>\nBy customizing the look and feel of the web applications, organizations can ensure their brand identity is consistently represented across their digital platforms. This can include custom themes, logos, and color schemes.<\/li>\n<li><strong>Innovative Features:\u2028<\/strong><br \/>\nCustom extensions allow organizations to experiment with new features and functionalities that are not available in the default setup. This can include AI-powered tools, advanced analytics, or unique collaboration features.<\/li>\n<\/ol>\n<p>The ability to provide custom extensions makes oCIS a powerful and flexible platform that can adapt to the evolving needs of any organization. It empowers operators of the cloud to craft solutions that are not only functional but also aligned with their strategic goals.<\/p>\n<h4>Loading Extensions in oCIS<\/h4>\n<p>In oCIS, extensions can be loaded at both build time and runtime. Understanding the difference between these two methods is key to effectively managing and utilizing extensions.<\/p>\n<ul>\n<li><strong>Build Time Extensions:\u2028<\/strong><br \/>\nThese are integrated into the binary during the build process. They are part of the core system and cannot be altered without rebuilding the system. This ensures a stable and consistent environment where critical applications are always available.<\/li>\n<li><strong>Runtime Extensions:\u2028<\/strong><br \/>\nThese are loaded dynamically at runtime, providing greater flexibility. They can be placed in a designated directory and are automatically picked up by the system. This allows you to easily add, update, or remove extensions as needed, without the need for a system rebuild.<\/li>\n<\/ul>\n<p>Extensions, also known as apps, are written in JavaScript, but we use TypeScript because of all its benefits. TypeScript enhances the development process with features such as static typing, which helps catch errors early and improves code maintainability and scalability.<\/p>\n<h4>How to Load Extensions<\/h4>\n<ol>\n<li><strong>Build Time Extensions:<\/strong>\n<ul>\n<li>Located in\u00a0<code>&lt;ocis_repo&gt;\/services\/web\/assets\/apps.<\/code><\/li>\n<li>Integrated into the system during the build process.<\/li>\n<li>These extensions are part of the binary and cannot be modified at runtime.<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<ol>\n<li><strong>Runtime Extensions:<\/strong>\n<ul>\n<li>Stored in the directory specified by the\u00a0<code class=\"inline\">WEB_ASSET_APPS_PATH<\/code> environment variable.<\/li>\n<li>By default, this path is\u00a0<code class=\"inline\">$OCIS_BASE_DATA_PATH\/web\/apps<\/code>, but it can be customized.<\/li>\n<li>Runtime extensions are automatically loaded from this directory, making it easy to add or remove extensions without rebuilding the system.<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p>The ability to load extensions at runtime is particularly powerful, as it allows for a high degree of customization and flexibility. You can quickly respond to changing needs by adding new functionality or removing outdated extensions.<\/p>\n<h4>Manifest File<\/h4>\n<p>Each web application must include a\u00a0<code class=\"inline\">manifest.json<\/code>\u00a0or\u00a0<code class=\"inline\">manifest.yaml<\/code>\u00a0file. This file contains essential information about the application, including its entry point and configuration details.<\/p>\n<p><strong>Example of a manifest.json file:<\/strong><br \/>\n<code>{&nbsp;\"entrypoint\": \"index.js\",<br \/>\n&nbsp;\"config\": {<br \/>\n&nbsp;&nbsp;\"maxWidth\": 1280,<br \/>\n&nbsp;&nbsp;\"maxHeight\": 1280<br \/>\n&nbsp;}<br \/>\n}<br \/>\n<\/code><br \/>\nThe manifest file ensures that the system correctly recognizes and integrates the extension. It is a crucial component for defining how the web application should be loaded and what configurations it requires.<\/p>\n<h4>Custom Configuration and Overwriting Options<\/h4>\n<p>You can provide custom configurations in the\u00a0<code class=\"inline\">$OCIS_BASE_DATA_PATH\/config\/apps.yaml<\/code>\u00a0file. This allows for fine-tuning of each extension&#8217;s behavior and settings.<br \/>\nThe\u00a0<code class=\"inline\">apps.yaml<\/code>\u00a0file can contain custom settings that overwrite the default configurations specified in the extension&#8217;s\u00a0<code class=\"inline\">manifest.json<\/code>\u00a0file.<\/p>\n<p><strong>Example of apps.yaml file:<\/strong><br \/>\n<code>image-viewer-obj:<br \/>\n&nbsp;config:<br \/>\n&nbsp;&nbsp;maxHeight: 640<br \/>\n&nbsp;&nbsp;maxSize: 512<br \/>\n<\/code><br \/>\nIn this example, the\u00a0maxHeight\u00a0value specified in the\u00a0<code class=\"inline\">apps.yaml<\/code>\u00a0file will overwrite the value from the\u00a0<code class=\"inline\">manifest.json<\/code>\u00a0file.<br \/>\n&nbsp;<br \/>\nThis provides you with the flexibility to customize extensions to better meet the specific needs of their environment.<\/p>\n<h4>Using Custom Assets<\/h4>\n<p>Besides configuration, you might need to customize certain assets within an extension, such as logos or images.<br \/>\nThis can be achieved by placing the custom assets in the path defined by\u00a0<code class=\"inline\">WEB_ASSET_APPS_PATH<\/code>.<br \/>\nFor instance, if the default\u00a0<code class=\"inline\">image-viewer-dfx<\/code>\u00a0application includes a logo that an organization wants to replace, they can place the new logo in a directory structured like\u00a0<code class=\"inline\">WEB_ASSET_APPS_PATH\/image-viewer-dfx\/logo.png<\/code>.<\/p>\n<p>The system will load this custom asset, replacing the default one. This method allows for easy and effective customization without altering the core application code.<\/p>\n<h4>Configuration Example<\/h4>\n<p>To illustrate how custom configurations and assets work together, consider the following scenario:<br \/>\n<strong>Default Configuration:<\/strong><br \/>\n<code>&nbsp;\"entrypoint\": \"index.js\",<br \/>\n&nbsp;\"config\": {<br \/>\n&nbsp;&nbsp;\"maxWidth\": 1280,<br \/>\n&nbsp;&nbsp;\"maxHeight\": 1280<br \/>\n&nbsp;}<br \/>\n}<br \/>\n<\/code><br \/>\n<strong>Custom Configuration in apps.yaml:<\/strong><br \/>\n<code>image-viewer-obj:<br \/>\n&nbsp;config:<br \/>\n&nbsp;&nbsp;maxHeight: 640<br \/>\n&nbsp;&nbsp;maxSize: 512<br \/>\n<\/code><br \/>\n<strong>Final Merged Configuration:<\/strong><br \/>\n<code>{<br \/>\n&nbsp;\"external_apps\": [<br \/>\n&nbsp;&nbsp;{<br \/>\n&nbsp;&nbsp;&nbsp;\"id\": \"image-viewer-obj\",<br \/>\n&nbsp;&nbsp;&nbsp;\"path\": \"index.js\",<br \/>\n&nbsp;&nbsp;&nbsp;\"config\": {<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;\"maxWidth\": 1280,<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;\"maxHeight\": 640,<br \/>\n&nbsp;&nbsp;&nbsp;&nbsp;\"maxSize\": 512<br \/>\n&nbsp;&nbsp;&nbsp;}<br \/>\n&nbsp;&nbsp;}<br \/>\n&nbsp;]<br \/>\n}<br \/>\n<\/code><br \/>\nThis example demonstrates how the system merges default and custom configurations to create the final settings used by the application.<\/p>\n<h4>Conclusion<\/h4>\n<p>In this first part of our series, we&#8217;ve covered the basics of web applications in oCIS, focusing on the importance of web applications, how extensions are loaded, and how you can customize these extensions through configuration and asset overwriting.<\/p>\n<p>Understanding these fundamentals is crucial for effectively managing and leveraging web applications in oCIS.<\/p>\n<p>In the next post, we will dive deeper into the process of writing and running a basic extension.<\/p>\n<p>Stay tuned for detailed instructions and tips on getting started with your first web extension in oCIS.<\/p>\n<h5>Resources:<\/h5>\n<ul>\n<li><a href=\"https:\/\/github.com\/owncloud\/ocis\/tree\/master\/services\/web\" rel=\"noopener nofollow\" target=\"_blank\">Web Readme<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/owncloud\/awesome-ocis\" rel=\"noopener nofollow\" target=\"_blank\">Overview of Available Extensions<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/owncloud\/ocis\/pull\/8523\" rel=\"noopener nofollow\" target=\"_blank\">Introduction PR<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/owncloud\/ocis\/issues\/8392\" rel=\"noopener nofollow\" target=\"_blank\">Design Document and Requirements<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>In today\u2019s fast-paced digital world, web applications play a crucial role in enhancing user experience and functionality. Infinite Scale comes with a world-class web interface to manage file resources, but it can be extended by utilizing ownCloud Infinite Scale (oCIS) as a construction set for custom web apps.<\/p>\n","protected":false},"author":38,"featured_media":78934,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","inline_featured_image":false,"footnotes":""},"categories":[603,43,509],"tags":[],"class_list":["post-78926","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-apps","category-blog","category-infinite-scale"],"acf":[],"_links":{"self":[{"href":"https:\/\/owncloud.com\/de\/wp-json\/wp\/v2\/posts\/78926","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/owncloud.com\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/owncloud.com\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/owncloud.com\/de\/wp-json\/wp\/v2\/users\/38"}],"replies":[{"embeddable":true,"href":"https:\/\/owncloud.com\/de\/wp-json\/wp\/v2\/comments?post=78926"}],"version-history":[{"count":11,"href":"https:\/\/owncloud.com\/de\/wp-json\/wp\/v2\/posts\/78926\/revisions"}],"predecessor-version":[{"id":78947,"href":"https:\/\/owncloud.com\/de\/wp-json\/wp\/v2\/posts\/78926\/revisions\/78947"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/owncloud.com\/de\/wp-json\/wp\/v2\/media\/78934"}],"wp:attachment":[{"href":"https:\/\/owncloud.com\/de\/wp-json\/wp\/v2\/media?parent=78926"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/owncloud.com\/de\/wp-json\/wp\/v2\/categories?post=78926"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/owncloud.com\/de\/wp-json\/wp\/v2\/tags?post=78926"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}