🔍 Code Extractor

class SPWOPIFrameAction

Maturity: 41

An enumeration class that defines distinct WOPI (Web Application Open Platform Interface Protocol) frame action types for SharePoint list items.

File:
/tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/utilities/wopi_frame_action.py
Lines:
1 - 10
Complexity:
simple

Purpose

This class serves as a constant enumeration to specify the type of operation to be performed on a SharePoint list item through the WOPI protocol. It provides two distinct action types: View (for read-only browser-based viewing) and Edit (for browser-based editing). This is typically used when integrating with SharePoint's WOPI framework to determine how documents or list items should be opened in a browser.

Source Code

class SPWOPIFrameAction:
    """
    Specifies distinct operations that are available for the list item.
    """

    View = 0
    """Requests a browser-based viewing experience."""

    Edit = 1
    """Requests a browser-based editing experience."""

Parameters

Name Type Default Kind
bases - -

Parameter Details

bases: This class does not have explicit __init__ parameters. It inherits from the default object base class and serves as a container for class-level constants.

Return Value

Instantiating this class returns an SPWOPIFrameAction object, though it is designed to be used as a static enumeration rather than being instantiated. The class attributes (View and Edit) return integer values (0 and 1 respectively) that represent different WOPI frame actions.

Class Interface

Attributes

Name Type Description Scope
View int Constant value (0) that requests a browser-based viewing experience for read-only access to the list item class
Edit int Constant value (1) that requests a browser-based editing experience for modifying the list item class

Usage Example

# Using SPWOPIFrameAction as an enumeration
# Typically used without instantiation

# Check which action to perform
action_type = SPWOPIFrameAction.View

if action_type == SPWOPIFrameAction.View:
    print("Opening in view mode")
    # Open document in read-only mode
elif action_type == SPWOPIFrameAction.Edit:
    print("Opening in edit mode")
    # Open document in edit mode

# Using in a function parameter
def open_sharepoint_document(document_id, action):
    if action == SPWOPIFrameAction.View:
        return f"Viewing document {document_id}"
    elif action == SPWOPIFrameAction.Edit:
        return f"Editing document {document_id}"

result = open_sharepoint_document("doc123", SPWOPIFrameAction.Edit)
print(result)  # Output: Editing document doc123

Best Practices

  • Use this class as a static enumeration; do not instantiate it with SPWOPIFrameAction()
  • Access the action types directly via class attributes: SPWOPIFrameAction.View or SPWOPIFrameAction.Edit
  • Use these constants when working with SharePoint WOPI protocol implementations to ensure consistent action type values
  • Consider using Python's enum.Enum for more robust enumeration if extending this functionality
  • These integer values (0 and 1) are likely part of a protocol specification and should not be modified

Similar Components

AI-powered semantic similarity - components with related functionality:

  • class SPWOPIAction 87.1% similar

    A simple class that defines constants for SharePoint WOPI (Web Application Open Platform Interface Protocol) action types.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/types/wopi_action.py
  • class WopiWebAppProperties 61.5% similar

    WopiWebAppProperties is a data class that represents properties of a WOPI (Web Application Open Platform Interface) web application, inheriting from ClientValue for serialization support.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/utilities/wopi_web_app_properties.py
  • class WopiProperties 59.8% similar

    WopiProperties is an internal-use-only class that extends ClientValue, likely used for representing WOPI (Web Application Open Platform Interface Protocol) properties in Office 365 integrations.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/utilities/wopi_properties.py
  • class PageType 57.3% similar

    An enumeration class that defines constants representing different SharePoint page types as specified in the MS-WSSFO3 protocol specification.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/pages/page_type.py
  • class SpoOperation 52.1% similar

    Represents an operation on a SharePoint Online (SPO) site collection, providing status tracking and polling capabilities for long-running operations.

    From: /tf/active/vicechatdev/SPFCsync/venv/lib64/python3.11/site-packages/office365/sharepoint/tenant/administration/spo_operation.py
← Back to Browse