Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
9 replies
Subscribers
5 subscribers
Views
2904 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
Plug-Ins
Hi, I built a plugin and want to send it a document. So I use the &qu
olivierl
over 11 years ago
Hi,
I built a plugin and want to send it a document. So I use the "@document" type, I get the file Long value in my smart service but there is an error when calling _cs.getInternalFilename(file);
private ContentService _cs;
try {
log("Start");
log("file no "+file);
docPath = _cs.getInternalFilename(file);
log("file " + docPath);
} catch (Exception e) {
log("Error " + e.getMessage() );
log write to a file and I get this
Start
file no 409
Error null
So it seems that getinternal filname throws an error that don't catch.
Thanks for help.
...
OriginalPostID-58406
OriginalPostID-58406
Discussion posts and replies are publicly visible
0
gartemiou
over 11 years ago
Hello olivierl, try this:
Document doc = cs.download(baseDocument, ContentConstants.VERSION_CURRENT, true)[0];
String documentPath = doc.getInternalFilename();
FileInputStream fis = new FileInputStream(documentPath);
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
olivierl
over 11 years ago
Hi gartemiou, thanks for this answer which type is "Document" I find dozens ?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
gartemiou
over 11 years ago
import com.appiancorp.suiteapi.knowledge.Document; Is this what you need?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
olivierl
over 11 years ago
Yes. I tried, exactly the same problem. Program exit without any message at cs. There are no "catch" unless I set only (exception e) and in this case, I get a null error message. During this time, input file number change 409, 412, 416...
I get it with :
@Input(required = Required.ALWAYS)
@Name("file")
@DocumentDataType <== could the problem be there ?
public void setFichier(Long val) {
this.file = val;
}
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
gartemiou
over 11 years ago
Can you please share more? I do not see an issue with the above code
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
olivierl
over 11 years ago
Well, I have not much more to share, my process have only 2 task, user input task and my mart service. User input select a 'document' which is an entry point for the smart. This seems to be ok because a get a "long" that the smart can write to a file to check. After is this cs. line which doesn't return unless with catch (exception e) with e.getmessage empty. Is there a way to check which file the long value is pointing to ?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
gartemiou
over 11 years ago
Are you hard-wiring your ContentService?
public YourConstructor(SmartServiceContext smartServiceCtx, ContentService cs) {
super();
this.smartServiceCtx = smartServiceCtx;
this.cs = cs;
}
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
olivierl
over 11 years ago
Thanks very much, You got it ! I'm not enough used to smart services, this is my first one.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
gartemiou
over 11 years ago
Glad to help...
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel