com.aspose.words

Class WebExtensionReference

  • java.lang.Object
    • com.aspose.words.WebExtensionReference
public class WebExtensionReference 
extends java.lang.Object

Represents the reference to a web extension. The reference is used to identify the provider location and version of the extension.

Constructor Summary
 
Property Getters/Setters Summary
java.lang.StringgetId()
void
setId(java.lang.Stringvalue)
           Identifier associated with the web extension within a catalog provider.
java.lang.StringgetStore()
void
setStore(java.lang.Stringvalue)
           Specifies the instance of the marketplace where the web extension is stored.
intgetStoreType()
void
setStoreType(intvalue)
           Specifies the type of marketplace. The value of the property is WebExtensionStoreType integer constant.
java.lang.StringgetVersion()
void
setVersion(java.lang.Stringvalue)
           Specifies the version of the web extension.
 

    • Constructor Detail

      • WebExtensionReference

        public WebExtensionReference()
    • Property Getters/Setters Detail

      • getId/setId

        public java.lang.String getId() / public void setId(java.lang.String value)
        
        Identifier associated with the web extension within a catalog provider.

        Example:

        Shows how to create add-ins inside the document.
        Document doc = new Document();
        
        // Create taskpane with "MyScript" add-in which will be used by the document
        TaskPane myScriptTaskPane = new TaskPane();
        doc.getWebExtensionTaskPanes().add(myScriptTaskPane);
        
        // Define task pane location when the document opens
        myScriptTaskPane.setDockState(TaskPaneDockState.RIGHT);
        myScriptTaskPane.isVisible(true);
        myScriptTaskPane.setWidth(300.0);
        myScriptTaskPane.isLocked(true);
        // Use this option if you have several task panes
        myScriptTaskPane.setRow(1);
        
        // Add "MyScript Math Sample" add-in which will be displayed inside task pane
        WebExtension webExtension = myScriptTaskPane.getWebExtension();
        
        // Application Id from store
        webExtension.getReference().setId("WA104380646");
        // The current version of the application used
        webExtension.getReference().setVersion("1.0.0.0");
        // Type of marketplace
        webExtension.getReference().setStoreType(WebExtensionStoreType.OMEX);
        // Marketplace based on your locale
        webExtension.getReference().setStore(Locale.getDefault().getDisplayName());
        
        webExtension.getProperties().add(new WebExtensionProperty("MyScript", "MyScript Math Sample"));
        webExtension.getBindings().add(new WebExtensionBinding("MyScript", WebExtensionBindingType.TEXT, "104380646"));
        
        // Use this option if you need to block web extension from any action
        webExtension.isFrozen(false);
        
        doc.save(getArtifactsDir() + "Document.WebExtension.docx");
      • getStore/setStore

        public java.lang.String getStore() / public void setStore(java.lang.String value)
        
        Specifies the instance of the marketplace where the web extension is stored.

        Example:

        Shows how to create add-ins inside the document.
        Document doc = new Document();
        
        // Create taskpane with "MyScript" add-in which will be used by the document
        TaskPane myScriptTaskPane = new TaskPane();
        doc.getWebExtensionTaskPanes().add(myScriptTaskPane);
        
        // Define task pane location when the document opens
        myScriptTaskPane.setDockState(TaskPaneDockState.RIGHT);
        myScriptTaskPane.isVisible(true);
        myScriptTaskPane.setWidth(300.0);
        myScriptTaskPane.isLocked(true);
        // Use this option if you have several task panes
        myScriptTaskPane.setRow(1);
        
        // Add "MyScript Math Sample" add-in which will be displayed inside task pane
        WebExtension webExtension = myScriptTaskPane.getWebExtension();
        
        // Application Id from store
        webExtension.getReference().setId("WA104380646");
        // The current version of the application used
        webExtension.getReference().setVersion("1.0.0.0");
        // Type of marketplace
        webExtension.getReference().setStoreType(WebExtensionStoreType.OMEX);
        // Marketplace based on your locale
        webExtension.getReference().setStore(Locale.getDefault().getDisplayName());
        
        webExtension.getProperties().add(new WebExtensionProperty("MyScript", "MyScript Math Sample"));
        webExtension.getBindings().add(new WebExtensionBinding("MyScript", WebExtensionBindingType.TEXT, "104380646"));
        
        // Use this option if you need to block web extension from any action
        webExtension.isFrozen(false);
        
        doc.save(getArtifactsDir() + "Document.WebExtension.docx");
      • getStoreType/setStoreType

        public int getStoreType() / public void setStoreType(int value)
        
        Specifies the type of marketplace. The value of the property is WebExtensionStoreType integer constant.

        Example:

        Shows how to create add-ins inside the document.
        Document doc = new Document();
        
        // Create taskpane with "MyScript" add-in which will be used by the document
        TaskPane myScriptTaskPane = new TaskPane();
        doc.getWebExtensionTaskPanes().add(myScriptTaskPane);
        
        // Define task pane location when the document opens
        myScriptTaskPane.setDockState(TaskPaneDockState.RIGHT);
        myScriptTaskPane.isVisible(true);
        myScriptTaskPane.setWidth(300.0);
        myScriptTaskPane.isLocked(true);
        // Use this option if you have several task panes
        myScriptTaskPane.setRow(1);
        
        // Add "MyScript Math Sample" add-in which will be displayed inside task pane
        WebExtension webExtension = myScriptTaskPane.getWebExtension();
        
        // Application Id from store
        webExtension.getReference().setId("WA104380646");
        // The current version of the application used
        webExtension.getReference().setVersion("1.0.0.0");
        // Type of marketplace
        webExtension.getReference().setStoreType(WebExtensionStoreType.OMEX);
        // Marketplace based on your locale
        webExtension.getReference().setStore(Locale.getDefault().getDisplayName());
        
        webExtension.getProperties().add(new WebExtensionProperty("MyScript", "MyScript Math Sample"));
        webExtension.getBindings().add(new WebExtensionBinding("MyScript", WebExtensionBindingType.TEXT, "104380646"));
        
        // Use this option if you need to block web extension from any action
        webExtension.isFrozen(false);
        
        doc.save(getArtifactsDir() + "Document.WebExtension.docx");
      • getVersion/setVersion

        public java.lang.String getVersion() / public void setVersion(java.lang.String value)
        
        Specifies the version of the web extension.

        Example:

        Shows how to create add-ins inside the document.
        Document doc = new Document();
        
        // Create taskpane with "MyScript" add-in which will be used by the document
        TaskPane myScriptTaskPane = new TaskPane();
        doc.getWebExtensionTaskPanes().add(myScriptTaskPane);
        
        // Define task pane location when the document opens
        myScriptTaskPane.setDockState(TaskPaneDockState.RIGHT);
        myScriptTaskPane.isVisible(true);
        myScriptTaskPane.setWidth(300.0);
        myScriptTaskPane.isLocked(true);
        // Use this option if you have several task panes
        myScriptTaskPane.setRow(1);
        
        // Add "MyScript Math Sample" add-in which will be displayed inside task pane
        WebExtension webExtension = myScriptTaskPane.getWebExtension();
        
        // Application Id from store
        webExtension.getReference().setId("WA104380646");
        // The current version of the application used
        webExtension.getReference().setVersion("1.0.0.0");
        // Type of marketplace
        webExtension.getReference().setStoreType(WebExtensionStoreType.OMEX);
        // Marketplace based on your locale
        webExtension.getReference().setStore(Locale.getDefault().getDisplayName());
        
        webExtension.getProperties().add(new WebExtensionProperty("MyScript", "MyScript Math Sample"));
        webExtension.getBindings().add(new WebExtensionBinding("MyScript", WebExtensionBindingType.TEXT, "104380646"));
        
        // Use this option if you need to block web extension from any action
        webExtension.isFrozen(false);
        
        doc.save(getArtifactsDir() + "Document.WebExtension.docx");