Hi devs,
I'd like to quickly add a new ApplicationReadyEvent and send when we initialize the XWiki class the first time:
Index: ../xwiki-commons/xwiki-commons-core/xwiki-commons-observation/xwiki-commons-observation-api/src/main/java/org/xwiki/observation/event/ApplicationReadyEvent.java
===================================================================
--- ../xwiki-commons/xwiki-commons-core/xwiki-commons-observation/xwiki-commons-observation-api/src/main/java/org/xwiki/observation/event/ApplicationReadyEvent.java (revision )
+++ ../xwiki-commons/xwiki-commons-core/xwiki-commons-observation/xwiki-commons-observation-api/src/main/java/org/xwiki/observation/event/ApplicationReadyEvent.java (revision )
@@ -0,0 +1,35 @@
+/*
+ * See the NOTICE file distributed with this work for additional
+ * information regarding copyright ownership.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.xwiki.observation.event;
+
+/**
+ * An event triggered when the XWiki application is ready to service requests.
+ *
+ * @version $Id$
+ * @since 4.0M2
+ */
+public class ApplicationReadyEvent implements Event
+{
+ @Override
+ public boolean matches(Object otherEvent)
+ {
+ return this.getClass().isAssignableFrom(otherEvent.getClass());
+ }
+}
Index: xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java
===================================================================
--- xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java (revision 6ddfc45a6aa807ac4b6a9bc9e101c042d0f0dd3d)
+++ xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/XWiki.java (revision )
@@ -109,6 +109,7 @@
import org.xwiki.model.reference.WikiReference;
import org.xwiki.observation.EventListener;
import org.xwiki.observation.ObservationManager;
+import org.xwiki.observation.event.ApplicationReadyEvent;
import org.xwiki.observation.event.Event;
import org.xwiki.query.QueryException;
import org.xwiki.rendering.macro.wikibridge.WikiMacroInitializer;
@@ -808,7 +809,12 @@
// that we need DB access to be available (at component initialization) to make this possible.
registerWikiMacros();
- Utils.<ObservationManager> getComponent((Type) ObservationManager.class).addListener(this);
+ ObservationManager observationManager =
+ Utils.<ObservationManager> getComponent((Type) ObservationManager.class);
+ observationManager.addListener(this);
+
+ // Send Event to signal that the application is ready to service requests.
+ observationManager.notify(new ApplicationReadyEvent(), this);
}
/**
The rationale is that a lot of code require to know when the application is ready for servicing and need to listen to this event and right now we're postponing implementing several refactorings in XWiki because of this missing event.
WDYT?
Thanks
-Vincent
Hi Devs/Thomas,
I've just realized that we now have a new job module in commons….
I don't recall seeing a proposal/vote on this but I may just have missed it.
I would like to be sure we have considered existing libraries before deciding to full recode it.
I've done a very quick google search and I can see for example:
* http://www.eclipse.org/articles/Article-Concurrency/jobs-api.html for example
* http://stackoverflow.com/questions/8738160/eclipse-jobs-api-for-a-stand-alo… says it can be used standalone
Also there are lots of job/scheduling apis at:
* http://java-source.net/open-source/job-schedulers
I think having our own interface is ok (to be independent of any underlying implementation) but we also have our own implementation now too.
Something to consider for example is that right now our Scheduler module uses the Quartz API and when we rewrite it I guess the idea will be to use this new job module, right? Thus I assume we'll need to write a "Quartz bridge" to transform XWiki Job instances into Quartz Job instances so that we can execute them with Quartz. Or maybe the integration would be at a different level, in the Job Manager?
In any case I'd like to see a bit more information on this job module and be confident that we have thought about all this and documented it on extensions.xwiki.org.
Thanks
-Vincent
Hi Prankur,
Please subscribe to the devs(a)xwiki.org mailing list and continue the
discussion there. That is the appropriate place to discuss GSoC related
topics.
Thanks,
Eduard
P.S.: I`ve forwarded this mail to the devs list for you.
On Tue, Mar 20, 2012 at 8:28 PM, prankur gupta <prankur.07(a)gmail.com> wrote:
> Hi,
>
> I am currently doing Masters in Computer Science from SUNY, New York.
>
> I want to participate in GSOC 2012 and so I went through the projects list
> offered by XWiki.
> I wanted to ask about the project named "Issue tracking and time tracking
> extensions". This project sounds interesting so I would definitely would
> like to work on that.
> So I wanted to know is there any previous work done on this project so that
> I could make my base out of it or it has to be started as a new project.
> And what are the pre-requisites required for carrying out this project.
> And any more information regarding this project will really be helpful.
>
> Thanks and regards.
>
> PRANKUR GUPTA
>
> Masters Student (CSE)
> State University of New York
> Stony Brook University
> _______________________________________________
> users mailing list
> users(a)xwiki.org
> http://lists.xwiki.org/mailman/listinfo/users
>
Interestingly, I am now researching in state- oriented- programming.
https://docs.google.com/drawings/pub?id=1sh6D3ZZn_C9beAEpp0ccZLkJ5LnimxeqWu…
Workflows are best visualized by 'workflow diagrams' as shown by the
above linked image. And that diagram corresponds to the following JSON
structure:
'article workflow':
{
'entry': //reserved name
{
'user edits article',
},
'newly edited':
{
action:
{
'request approval from administrators'
},
event:
{ // event : to
'approval received' : 'approved edit'
}
},
'approved edit':
{
action:
{
'update articles for public access'
},
event:
{
'article updated' : 'exit'
}
}
}
JSON is an easy to read structure so it is good for the server program
to 'run' a workflow. (XML is also okay as it is easy to convert
between XML and JSON.) It is also good for implementing a GUI for
workflow editing. Plus, JSON is easy to read with a GUI.
Just some speculations, we should formalize the whole thing before any work.
Hi devs,
I've already sent a proposal for EqualsBuilder and HashCodeBuilder (see http://markmail.org/message/ewbizvcx4zj432il) but only Sergiu answered. So resending as a VOTE and adding ToStringBuilder
For ToStringBuilder the idea is to create a XWikiStyle (see https://gist.github.com/2164507 )
And then to use it as in:
@Override
public String toString()
{
ToStringBuilder builder = new ToStringBuilder(this, new XWikiStyle());
builder = builder.append("Typed", isTyped())
.append("Type", getType().getScheme());
if (getReference() != null) {
builder = builder.append("Reference", getReference());
}
if (!getBaseReferences().isEmpty()) {
builder = builder.append("Base References", getBaseReferences());
}
Map<String, String> params = getParameters();
if (!params.isEmpty()) {
builder = builder.append("Parameters", params);
}
return builder.toString();
}
For the record this generates stuff like the following which is based on our current practices:
"Typed = [true] Type = [doc] Reference = [reference] Base References = [[baseref1], [baseref2]] Parameters = [[name1] = [value1], [name2] = [value2]]"
The rationale for using ToStringBuilder is:
* It reduces our boilerplate code by at least 50%
* It makes all our toString implementation consistent and easy to write
Now all that remains is to decide where to put the XWikiStyle class. Of course it has to go in XWiki Commons somewhere but where?
I'm proposing several possibilities:
* xwiki-commons-logging (existing module): the rationale would be that the toString() is usually used for logging. The package would be org.xwiki.logging.text. I'm wondering if we should make this class internal too.
* xwiki-commons-text (new module): I'm not sure what else we would put in there
* xwiki-commons-util (new module): I don't like to have a module with no specific domain but it could be temporary till there are more stuff that make a domain
So here's my +1. My only doubt is where to put it. Right now I'd be tempted to put it in xwiki-commons-logging so that we don't create a new module.
Thanks
-Vincent
Hi, all,
I followed this link:
http://platform.xwiki.org/xwiki/bin/DevGuide/WritingComponents
created a component which return xml data.
Also I created a hellotest page inside the main space, and wrote the
following velocity code:
{{velocity output='false'}}
$response.setContentType('application/xml')
#set ($xmldata= $services.hello.getHelloXML())
$xmldata
##$context.setFinished(true)
#set ($out = $response.getOutputStream())
$out.write($xmldata)
$out.flush()
{{/velocity}}
I tested this code, I can get the xml data, now I use this ajax code to
retrieve the xml data:
var xmlhttp = GetXmlHttp();
if (xmlhttp) {
xmlhttp.open("GET", url, true);
xmlhttp.onreadystatechange = function () {
if (xmlhttp.readyState == 4) {
xmlResult = xmlhttp.responseText;
......
xmlhttp.send(null);
}
The url I used is:
url = '
http://localhost:8080/xwikim/bin/view/Main/hellotest?outputSyntax=plain'
when I debug with firefox to see the data inside xmlhttp either
responseText or response, they were all a html document for the hellotest
with the tags like body, div, etc, it is basically helltest.html file if
you view the source code of this html page. I tried to change the output to
true, the result is the same.
Question: how can I get the xml data? where am I wrong?
Thanks very much in advance.
Dave
Hi devs,
Whenever we create Threads we need to initialize an Execution Context. Here's the code that we need to write in run():
ExecutionContext context = execution.getContext();
if (context == null) {
// Create a clean Execution Context
context = new ExecutionContext();
try {
executionContextManager.initialize(context);
} catch (ExecutionContextException e) {
throw new RuntimeException("Failed to initialize IRC Bot's execution context", e);
}
// Bridge with old XWiki Context, required for old code.
XWikiContext xwikiContext = stubContextProvider.createStubContext();
context.setProperty(XWikiContext.EXECUTIONCONTEXT_KEY, xwikiContext);
execution.pushContext(context);
}
I'm thus proposing to do this:
* Create a xwiki-platform-container-deamon module
* Introduce a ContextualizedThread which extends Thread and which adds an initializeExecutionContext() method
Thus when we need to create threads we extend ContextualizedThread and in our run() method we start by calling initializeExecutionContext().
Implementation detail:
* This new module will depend on xwiki-platform-oldcore since it needs to use XWikiStubContextProvider
* This means that this new module cannot be used from within xwiki-platform-oldcore but that should be ok since I don't see why we would need to create threads in there
Rationale:
* The reason I need this is because I've recoded the code snippet I've put above in the new IRC Bot application and now I'm finding that the Link Checker feature (which uses a Thread) is also missing this and I need to add it there too. Thus we really need to put this code in a common place, hence the suggestion for the new deamon module.
Here's my +1
Thanks
-Vincent
Hi,
I am Vikas Singh , pursuing my BTech in Computer Science & Engg. from
Institute of technology , Banaras Hindu University , India.
I have profound knowledge of Javascript,Php, Html, Java.
I want to work on "Mobile Skin /DashBoard for wiki Enterprises" and want to
contribute in it.
I already gone through the existing module related to Project.
--
Vikas Singh
Dear Team XWiki,
I am very excited to contribute in open source community through the
platform of GSoC 2012. Last year, I contributed "Debugger Visualizers" to
MonoDevelop which had successfully become a part of Mono Develop.
I have seen project ideas for GSoC 2012 at
http://dev.xwiki.org/xwiki/bin/view/GoogleSummerOfCode/WebHome. I am
interested in "*Poll/Survey Application*". The reason for my interest is
that I have good working experience of HTML, Javascript, Java and related
technologies. I also checked out XWiki to start understanding it.
My understanding of the requirements is as follows:
1. Create a Poll widget to include within a web page.
2. Show Poll results within the Poll widget.
3. Use AppWithinMinutes XWiki to create surveys.
4. Develop the look and feel of such surveys (GUI).
5. At the end of survey, show the results of survey.
Have you got a template for the survey GUI or we need to brain storm on
this?
What database/file storage would be used to store Poll/Survey results?
Your kind feedback would help me in better recognising the core project
requirements and develop a good proposal.
Regards,
Rauf
Regent's College London
Contact information
- Angel Guevara
- angeldelcaos(a)gmail.com
- IRC channel #xwiki nickname faryshta
Project
- *Project name* Responsive skin based on
Foundation<http://dev.xwiki.org/xwiki/bin/view/GoogleSummerOfCode/WebHome#HResponsives…>
- *Description* Creating an interactive skin for xwiki.
- *Other projects* Integrating bootstraps, lesscss or another front end
library.
- *Why this project?* The xwiki front end is very unpolished, heavy to
modify and personalize with several items to be redefined. I
- tentative approach Creating skins, templates and CSS/JS libraries that
help making the visualization more appealing.
Technical skills
- 5 years experience in web development. Languages php, java, sql, html,
javascript, css. Frameworks drupal, jquery, bootstraps, html 4 y 5, extJS
- 5 years MySQL experience.
- I have been a freelance web developer with several sites created from
scratch. ludisa.comsferea.combistrobec.com
Open Source
- *Please describe any previous Open Source development experience* Linux
user for 6 years, helping on translation at the game Battle of Wesnoth.
Creator of mathCarousel a JS library to create mathematics animations
- *Why are you interested in Open Source development ?* I have
ideological reason to like opensource. Mostly because as scientist and
developer its better to have the knowledge accessible and understandable
for everyone.
Background & education
- *University:* UNAM: Universidad Nacional Autonoma de México.
- *Major *Mathematics
- *Years* 5
Summer plans
- Mexico
- *How much time do you expect to have for this project?* 6 hours a day
from monday to saturday
- *Please list jobs, summer classes, and/or vacations that you'll need
to work around* Middle time job.
GSoC Experience
- No previous experience.
- *Why did you decide to apply for the Google Summer of Code ?* As an
opportunity to get more into the opensource development and getting my
job known.
- *Why did you decide to apply for an XWiki project ?* Its a project I
have seen before and I think I have skill that you might find useful.
And finally...
- I am hard working, versatile and goal oriented. Unlike other
developers I can work with teams and. Once I start always see my job
through.