This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
render : function() { | |
var that = this; | |
TemplateManager.get(this.template, function(template) { | |
$(that.el).html(template({ | |
"canEdit" : that.canEdit, | |
"innerId" : that.options.innerId, | |
"innerType" : that.model.innerObjectType +'s', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
save:function (nousevar,settings) { | |
//var url = this.parentType + '/' + this.parentId + '/' + this.innerObjectType + 's' + '/add/' + innerObjectId | |
url = this.urlRoot(); | |
//var url = "keyword/" + this.id + "/superKeywords/add/" + superId | |
console.log('add relation between ' + this.parentId + ' and ' + this.id); | |
var self = this; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.jpp.api.controller; | |
import org.apache.log4j.Logger; | |
import org.jpp.domain.Keyword; | |
import org.jpp.service.domain.KeywordService; | |
import org.junit.Assert; | |
import org.junit.Before; | |
import org.junit.Test; | |
import org.junit.runner.RunWith; | |
import org.springframework.beans.factory.annotation.Autowired; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
render : function(args) { | |
/* | |
* using template manager we can allow object use diffrent | |
* templates. | |
*/ | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (keywords.size() > 0) { | |
SetJoin<Report, Keyword> keyword = report.join(Report_.keywords); | |
Expression<Long> keywordExpr = keyword.get(Keyword_.id); | |
Predicate pred = keywordExpr.in(keywords); | |
preds.add(pred); | |
query.having(cb.equal(cb.countDistinct(keyword.get(Keyword_.id)), | |
keywords.size())); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MvcResult result = (MvcResult) mockMvc.perform(post("/api/search/report/advanced").contentType(TestUtil.APPLICATION_JSON_UTF8) | |
.content(pageRequest.getBytes())) | |
.andExpect(status().isOk()) | |
.andExpect(content().contentType(TestUtil.APPLICATION_JSON_UTF8)) | |
.andExpect(jsonPath("$[0].page").value(page.intValue())) | |
.andExpect(jsonPath("$[0].page").exists()).andReturn(); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
booolView.render().$el.find('img').one('load', function(event) { | |
/* make sure to cancel timeout first */ | |
model.trigger('boool:load-event'); | |
self.collection.trigger('boool:load-event'); | |
console.log('loaded'); | |
}).one('error', function(event) { | |
console.log('error loading the img'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
connect: { | |
options: { | |
port: 9000, | |
// // change this to '0.0.0.0' to access the server from outside | |
// // hostname: 'localhost' | |
hostname: '0.0.0.0' | |
}, | |
livereload: { | |
options: { | |
middleware: function (connect) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* | |
* add bind to function prototype example | |
* model.on('click',myobject.somefunction.bind(this)); | |
* | |
*/ | |
Function.prototype.bind = function(context) { | |
var fn = this; // correlates to this.onTimeout | |
return function() { // what gets passed: an anonymous function |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* this WORKS */ | |
@RequestMapping(value = "{field}/image/{name}.jpg", method = RequestMethod.GET) | |
public void getImage(HttpServletResponse response, @PathVariable("field") String field,@PathVariable("name") String name) | |
throws NoSuchImageException, BadFieldNameException, IOException, PathTraversalException { | |
model.uploadMagdirImageFile(MagdirPrecondition.fieldNameOk(field),name, response); | |
OlderNewer