问题描述
我有一个带有文件夹和文件目录的露天数据库。 我希望能够通过单击按钮从一个特定文件移动到另一个文件夹,所以我使用了 winForms 来处理我的过程 您需要使用 PortCMIS 库才能在 C# 代码中测试这些操作,如果您使用的是 Java,您还可以使用名为“OpenCMIS”的版本。
'''
private void btnMove_Click(object sender,EventArgs e)
{
Dictionary<string,string> parameters = new Dictionary<string,string>();
//Creates instance where I can access
//my private Alfresco sandBox database.
parameters[SessionParameter.BindingType] = BindingType.Atompub;
parameters[SessionParameter.AtompubUrl] = txtLink.Text;
parameters[SessionParameter.User] = txtUser.Text;
parameters[SessionParameter.Password] = txtPass.Text;
SessionFactory factory = SessionFactory.NewInstance();
session = factory.GetRepositories(parameters)[0].CreateSession();
//Error here,can't convert the string to
//"PortCMIS.Client.IFolder or IDocument".
IFolder sourcefolder = @"Rootfolder/folderWithFile";
IFolder targetFolder = @"Rootfolder/folderToPutFileIn";
IDocument doc = "fileTest.txt";
//Supposed to move the document from source folder to
//the target folder.
doc.Move(sourceFolder,targetFolder);
}
'''
Example Picture of the Folder directory
我也尝试过使用“IFolder sourcefolder = session.GetRootFolder(@"Rootfolder/folderWithFile");”但它仍然不起作用,我不确定该怎么做
我的问题是我称之为“IFolder”和“IDocument”的变量。我该怎么做才能让它做我想做的事?我需要找到一种方法将字符串目录转换为我想要的吗?是否应该使用特定函数来帮助移动这些文件?
另外,不要找借口,但我对使用 CMIS 和 Alfresco 以及一般编程非常陌生(此时我有近 1 年的编码经验)。 也就是说,如果我说的有什么地方可能是错的,或者我正在做的事情没有意义,请指出,这样我就可以学习并因此变得更好。如果您有任何问题需要回答才能正确回答我的问题(必要的详细信息和信息),请告诉我。
谢谢!
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)