Hi devs,
Finally, i've had the time to put up a small demo of the drawing API using
Tatami(http://tatami.googlecode.com), i would like to commit it to the
sandbox, but in order to do that i need write permitions for the user
mjbento.
Now, regarding the demo, i've only implemented the basic objects and object
operations. Right now it's more of a case show of the Tatami performance
than the real deal, because, in order to do that it would have to be ported
into a API with all the functionalities implemented.
User tip: After you finish the drawing of an object, the Select tool is
automatically selected. In order to move the objects, simply click them in
Select mode.
So, finally, please check it out if you have some time, I would really
apreciate some feedback on this.
Best regards,
Miguel Bento.
I have created a new panel in xwiki. And i want to apply a separate class
for that particular panel.
Where i have to give that class.
In the panel creator window or in the macros.vm file.
--
Prathap
I was trying to figure out how to dynamically create a panel so I was looking
at create.vm
shown here:
#if($tocreate=="panel")
#set($docname=$title.replaceAll("/", "%2F"))
#if(!$template || $template == "")
#set($template="Panels.PanelTemplate")
#end
#set($newdoc=$xwiki.getDocument($docname))
#if($newdoc.isNew())
#set($pcontent = "#")
#set($pcontent =
$pcontent.concat("panelheader('${title}')${xwiki.getNl()}${xwiki.getNl()}#"))
#set($pcontent = $pcontent.concat("panelfooter()"))
#set($pcontent = $util.encodeURL($pcontent))
$response.sendRedirect($newdoc.getURL("inline",
"template=${template}&Panels.PanelClass_0_name=${title}&Panels.PanelClass_0_content=$pcontent"))
#else
$response.sendRedirect($newdoc.getURL("view",
"xpage=docalreadyexists"))
#end #end
.
.
and I quickly got lost. It looks like you first create a document from in
panels space something like
XWikiDocument doc = context.getWiki().getDocument("XWiki.MyPanell",
context);
Then it looks like $pcontent concatenates some calls to velocity macros
together. Then it looks like it is url encoded so it can be passed as http
response. Then I am completely lost with the sendRedirect statement. Does
it redirect to process the templates and then return the response?
Is there a better example for me to look at or perhaps someone generous
enough to provide me with even more help? You guys have been very generous
with help and I would like to Thank you! BTW congratulations on the "Big
News"
Glenn Everitt
--
View this message in context: http://www.nabble.com/How-can-I-dynamically-create-a-panel--tp16406339p1640…
Sent from the XWiki- Dev mailing list archive at Nabble.com.
How to change the "Redirects to the Main.WebHome" to some other page.
Need to change in the web.xml file.
<welcome-file-list>
<welcome-file>*SpaceName/PageName*</welcome-file>
</welcome-file-list>
--
Prathap
Hi list,
I am trying to use the addAttachment call to add an attachment to a page via
xmlrpc.
So far I have used groovy and python (code further down), both give me the
same error message:
xmlrpclib.Fault: <Fault 0: 'No method matching arguments: java.lang.String,
java.lang.String, java.util.HashMap, [B'>
After digging into the src I found addAttachment in:
XWikiXmlRpcClient.java (part of -core)
/**
* Add a new attachment.
*
* @param contentId Ignored. (It is here because the Confluence API signature declares it)
* @param attachment The Attachment object describing the attachment.
* @param attachmentData The actual attachment data.
* @return An Attachment object describing the newly added attachment.
* @throws XmlRpcException
* @category ConfluenceAPI
*/
public Attachment addAttachment(Integer contentId, Attachment attachment,
byte[] attachmentData) throws XmlRpcException
{
Object object =
invokeRpc("addAttachment", token, contentId, attachment.toMap(), attachmentData);
return (Attachment) new Attachment((Map<String, Object>) object);
}
As you can see contentId is defined as Integer not String. When using an integer
in the rpc call I get this error message:
xmlrpclib.Fault: <Fault 0: 'Failed to invoke method addAttachment in class
com.xpn.xwiki.xmlrpc.XWikiXmlRpcHandler: An XWiki id must be in the form
Space.Page[?param=value¶m=value&...]'>
When looking at the server log I can see:
Caused by:
java.lang.IllegalArgumentException: An XWiki id must be in the form
Space.Page[?param=value¶m=value&...]
at org.xwiki.xmlrpc.model.XWikiExtendedId.<init>(XWikiExtendedId.java:37)
at com.xpn.xwiki.xmlrpc.XWikiXmlRpcHandler.addAttachment(XWikiXmlRpcHandler.java:929)
...
And when looking at that method:
public XWikiExtendedId(String string)
{
if (string.indexOf(".") == -1) {
throw new IllegalArgumentException(
"An XWiki id must be in the form Space.Page[?param=value¶m=value&...]");
}
So question is, how do I actually add an attachment to a page?
Stefan
------ python -------8<----------------------
#!/usr/bin/python
import xmlrpclib
f = open('images/foo.jpg', 'rb') #Open file as a binary file
file = f.read()
data = xmlrpclib.Binary(file) #Make the byte array
server_url = 'http://localhost:8080/xwiki/xmlrpc/confluence';
s = xmlrpclib.Server(server_url);
token = s.confluence1.login('login', 'pass');
page_list = s.confluence1.getPages(token, 'MySpace') #Get the pages in the space
new_attachment = dict(id = '', pageId = '', title = '', fileName = 'filename', fileSize = '', contentType = 'content type', created = '', creator = '', url = '', comment = 'Some comment') #Make a attachment container
for page in page_list:
if page['title'] == 'AttachMe':
s.confluence1.addAttachment(token, page['id'], new_attachment, data)
------ python ------->8----------------------
------ groovy -------8<----------------------
import groovy.net.xmlrpc.XMLRPCServerProxy
import java.io.File
server = "localhost:8080";
username = "user";
password = "pass";
serverProxy = new XMLRPCServerProxy("http://${server}/xwiki/xmlrpc/confluence")
try {
println "Logging in...";
token = serverProxy.confluence1.login(username, password)
} catch (Exception e) {
println "Cannot login! Check username or password..."
throw e;
}
println "Logged in";
try {
def attach = [:];
# load file with PAGENAME<SPACE>IMAGETOATTACH per line
println "Loading image list";
new File("images.txt").eachLine { line ->
array = line.split(" ");
attach.put(array[0], array[1]);
attachment = [id : '', pageId : '', title : '', fileName : 'filename', fileSize : '', contentType : 'content type', created : '', creator : '', url : '', comment : 'Some comment'];
bytes = new File(array[1]).readBytes();
page = serverProxy.confluence1.getPage(token, "MySpace.${array[0]}");
serverProxy.confluence1.addAttachment(token, page.id, attachment, bytes);
}
} finally {
serverProxy.confluence1.logout(token);
}
------ groovy ------->8----------------------
regards
Stefan
--
I did it just to piss you off. :-P
-- Branden Robinson in a message to debian-devel
Hi all
I have deployed the new xwiki-enterprise-wiki-1.5-milestone-2.war in my
tomcat with mysql database.
I can't able to find the Administration page link in the xwiki.
Can any tell, where can i get that link in xwiki.
--
Prathap
Hi Fabio,
Now I'm working on the costume implementation of the IDocumentPartitioner
which uses the XDOM parser.
I have also look at the FastPartitioner implementation in-oder to get
understand how the partitioning work.
As far as I can understand, to register partitions with the IDocument,
requires the offset and the length of each token retured by the partitione.
But currently that information is not avalable in the Blocks returend by the
parser.
WDUT ?
Is ther any other way of doing this ? I need help on this
I aslo look try to run the org.xwiki.xdomexplorer you gave to me.After mvn
compile and run the project as a eclipse plugin it gives a errer sayying
Error opening the editor.
org.xwiki.xdomexplorer.editors.XWikiEditor.I'm working on Eclipce JEE 3.3.2
version.Should I need to run this in different eclipse package ?
Cheers
-- Malaka Ekanayake
CSE UOM
Dear Dev,
Curriki now has three volunteer developers working with our code base. We
also have quite a few Curriki specific dev topics to cover. Since we are
looking to release the Curriki code at http://curriki.xwiki.org, folks have
quested a Curriki specific mailing list. This message requests Ludovic to
make such a list and also invites all of you to join the Curriki mailing
list. We will, of course, continue to use Devs for all issues of relevance
to the larger XWiki community.
Best,
Joshua Marks
CTO
Curriki: The Global Education and Learning Community
jmarks(a)curriki.org
www.curriki.org
US 831-685-3511
Hi devs,
I posted here http://tinyurl.com/43z5q4 a roadmap for the new WYSIWYG
editor. I hope we'll have a first version at the end of July and a second
one at the end of August. Comments are welcome.
Thanks,
Marius
After creating a new user he didn't get any registration confirmation mail.
Even after i have configured the Outgoing SMTP Server also in preferences.
Anyone know the reason.
--
Prathap