I am no dummy I promise, and actually I am a bit embarrassed that I have to ask for help on something that should be so simple so I apologize in advance, but since I have spent two days trying to find a solution on my own without success I must ask for help.
So I am having problems doing something that would seem to be very simple. Basically I am trying to allow my user to navigate their folder tree, and publish documents to it via LAPI, but I can't figure out how to let them do it. Here is a method from the LLSessionManager that lets them got to their PWS.
1. I can access their personal workspace just fine:
public void accessPersonalWorkspace() throws Exception
{
// Access the user's Personal Workspace
this.status = documents.AccessPersonalWS( this.pwsInfo );
if ( this.status == 0 )
{
this.parentVol = this.pwsInfo.toInteger( "VolumeID" );
this.parentID = this.pwsInfo.toInteger( "ID" );
int createdby = this.pwsInfo.toInteger("CreatedBy");
String name = this.pwsInfo.toString("Name");
debug ( "Accessed Personal Workspace:"+name );
}
else
handelError();
}
So you can imagine what is next, a user wants to navigate down to one of the child folders and add a document: We have given them the id of the folder that they now want to access, and allow them to pass it to the function that *should* change the directory. But it doesn't.
//set directory by id *DOES NOT WORK*
public void accessDirectoryById(int id) throws Exception
{
debug("accessDirectoryById:"+id);
// Access directory
LLValue dirInfo = new LLValue().setAssocNotSet();
dirInfo.add("ID", id);
dirInfo.add("VolumeID", this.parentID);
//I would think this would do it, GetObject doesn't work for me either.
//and the API is opaque at best.
this.status = this.documents.AccessPersonalWS(dirInfo);
if ( this.status == 0 )
{
this.pwsInfo = dirInfo;
debug("it worked.");
String name = this.pwsInfo.toString( "Name" );
this.parentVol = this.pwsInfo.toInteger( "VolumeID" );
this.parentID = pwsInfo.toInteger( "ID" );
debug ( "Accessed Directory:"+name );
}
else
handelError();
}
I know this comes from not understanding the API but honestly in all the code samples and posts I have seen no one is trying to do this.
If you have a lead I would appreciate it.
Clay
So I am having problems doing something that would seem to be very simple. Basically I am trying to allow my user to navigate their folder tree, and publish documents to it via LAPI, but I can't figure out how to let them do it. Here is a method from the LLSessionManager that lets them got to their PWS.
1. I can access their personal workspace just fine:
public void accessPersonalWorkspace() throws Exception
{
// Access the user's Personal Workspace
this.status = documents.AccessPersonalWS( this.pwsInfo );
if ( this.status == 0 )
{
this.parentVol = this.pwsInfo.toInteger( "VolumeID" );
this.parentID = this.pwsInfo.toInteger( "ID" );
int createdby = this.pwsInfo.toInteger("CreatedBy");
String name = this.pwsInfo.toString("Name");
debug ( "Accessed Personal Workspace:"+name );
}
else
handelError();
}
So you can imagine what is next, a user wants to navigate down to one of the child folders and add a document: We have given them the id of the folder that they now want to access, and allow them to pass it to the function that *should* change the directory. But it doesn't.
//set directory by id *DOES NOT WORK*
public void accessDirectoryById(int id) throws Exception
{
debug("accessDirectoryById:"+id);
// Access directory
LLValue dirInfo = new LLValue().setAssocNotSet();
dirInfo.add("ID", id);
dirInfo.add("VolumeID", this.parentID);
//I would think this would do it, GetObject doesn't work for me either.
//and the API is opaque at best.
this.status = this.documents.AccessPersonalWS(dirInfo);
if ( this.status == 0 )
{
this.pwsInfo = dirInfo;
debug("it worked.");
String name = this.pwsInfo.toString( "Name" );
this.parentVol = this.pwsInfo.toInteger( "VolumeID" );
this.parentID = pwsInfo.toInteger( "ID" );
debug ( "Accessed Directory:"+name );
}
else
handelError();
}
I know this comes from not understanding the API but honestly in all the code samples and posts I have seen no one is trying to do this.
If you have a lead I would appreciate it.
Clay