public UploadExample() { InitializeComponent(); AuthenticationUtils.startSession("admin", "sametsis"); // Get the repository service this.repoService = WebServiceFactory.getRepositoryService(); }
public ImageUploadExample() { InitializeComponent(); AuthenticationUtils.startSession("admin", "sametsis"); // Create the repo service and set the authentication credentials this.repoService = WebServiceFactory.getRepositoryService(); }
/// <summary> /// The form load event handler /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Browse_Load(object sender, EventArgs e) { // Ensure the user has been authenticated if (AuthenticationUtils.IsSessionValid == false) AuthenticationUtils.startSession("admin", "sametsis"); // Get a repository and content service from the web service factory this.repoService = WebServiceFactory.getRepositoryService(); this.contentService = WebServiceFactory.getContentService(); this.authoringService = WebServiceFactory.getAuthoringService(); // Populate the list box populateListBox(); }
//********************************************************** // Function: OpenScript() // Scope: internal // Overview: Script initialization point. Perform any // necessary initialization such as logging // in to a remote data source, allocated any // necessary resources, etc. // Params: none // Returns: One of the following: // KFX_REL_SUCCESS, KFX_REL_ERROR // Called By: The Batch Release Manager. Called once // when the script object is loaded. //********************************************************** public AscentRelease.KfxReturnValue OpenScript() { // Start the Alfresco session try { string repository = ReleaseUtils.getCustomProperty(this.releaseData.CustomProperties, ReleaseConstants.CUSTOM_REPOSITORY); WebServiceFactory.setEndpointAddress(repository); string userName = ReleaseUtils.getCustomProperty(this.releaseData.CustomProperties, ReleaseConstants.CUSTOM_USERNAME); string password = ReleaseUtils.getCustomProperty(this.releaseData.CustomProperties, ReleaseConstants.CUSTOM_PASSWORD); AuthenticationUtils.startSession(userName, password); this.repoService = WebServiceFactory.getRepositoryService(); // the uuid of the location to be saved this.locationUuid = ReleaseUtils.getCustomProperty(this.releaseData.CustomProperties, ReleaseConstants.CUSTOM_LOCATION_UUID); this.contentType = ReleaseUtils.getCustomProperty(this.releaseData.CustomProperties, ReleaseConstants.CUSTOM_CONTENT_TYPE); this.imageContentProp = ReleaseUtils.getCustomProperty(this.releaseData.CustomProperties, ReleaseConstants.CUSTOM_IMAGE); this.ocrContentProp = ReleaseUtils.getCustomProperty(this.releaseData.CustomProperties, ReleaseConstants.CUSTOM_OCR); this.pdfContentProp = ReleaseUtils.getCustomProperty(this.releaseData.CustomProperties, ReleaseConstants.CUSTOM_PDF); // Initialise the reference to the spaces store this.spacesStore = new Alfresco.RepositoryWebService.Store(); spacesStore.scheme = Alfresco.RepositoryWebService.StoreEnum.workspace; spacesStore.address = "SpacesStore"; return AscentRelease.KfxReturnValue.KFX_REL_SUCCESS; } catch (Exception) { return AscentRelease.KfxReturnValue.KFX_REL_ERROR; } }
private void displayLocationTree(String selectedUuid) { try { this.repoService = WebServiceFactory.getRepositoryService(); this.browse = new frmTreeViewBrowse(selectedUuid); this.browse.Owner = this; this.browse.RepoService = this.repoService; this.Cursor = Cursors.WaitCursor; this.browse.TopLevel = false; this.locationPanel.Controls.Add(browse); this.browse.Location = new Point(-18, -37); this.browse.Show(); } catch (Exception e) { MessageBox.Show("Error displaying repository spaces"); Log log = new Log(); log.ErrorLog(".\\log\\", "frmAlfrescoSetUp method displayLocationTree " + e.Message, e.StackTrace); } }
/// <summary> /// Get the repository service /// </summary> /// <param name="endPointAddress"></param> /// <returns></returns> public static RepositoryService getRepositoryService(String endPointAddress) { RepositoryService repositoryService = new RepositoryService(); repositoryService.Url = endPointAddress + REPOSITORY_SERVICE_ADDRESS; addSecurityHeader(repositoryService); return repositoryService; }