Tabnine Logo
Resource.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
juzu.Resource
constructor

Best Java code snippets using juzu.Resource.<init> (Showing top 15 results out of 315)

origin: exoplatform/platform

@Ajax
@Resource
public Response.Content incDate(String nbClick) throws Exception {
  int clickNumber = Integer.parseInt(nbclick);
  clickNumber++;
  nbclick = new Integer(clickNumber).toString();
  return calendarHome();
}
origin: exoplatform/platform

@Ajax
@Resource
public Response.Content decDate(String nbClick) throws Exception {
  int clickNumber = Integer.parseInt(nbclick);
  clickNumber--;
  nbclick = new Integer(clickNumber).toString();
  return calendarHome();
}
origin: exoplatform/platform

@Ajax
@Resource
public Response.Content getSearchResult(String key) {
  Iterator itr = null;
  if (calendarNonDisplayedList != null) itr = calendarNonDisplayedList.iterator();
  searchResult.clear();
  while (itr.hasNext()) {
    org.exoplatform.calendar.service.Calendar c = (org.exoplatform.calendar.service.Calendar) itr.next();
    if (c.getName().toLowerCase().contains(key.toLowerCase())) searchResult.add(c);
  }
  // String label = "Default Personal Calendar";
  return search.with().set("searchResultList", searchResult).ok().withCharset(Tools.UTF_8);
}
origin: exoplatform/platform

@Ajax
@Resource
public Response.Content addCalendar(String calendarId) throws Exception {
    StringBuilder cals = new StringBuilder();
    int i = 0;
    nonDisplayedCalendarList = (String[]) ArrayUtils.removeElement(nonDisplayedCalendarList, calendarId);
    while (i < nonDisplayedCalendarList.length) {
      if (!nonDisplayedCalendarList[i].equals(calendarId))
        cals.append(nonDisplayedCalendarList[i]).append(",");
      i++;
    }
    settingService_.remove(Context.USER, Scope.APPLICATION, CalendarPortletUtils.HOME_PAGE_CALENDAR_SETTINGS);
    settingService_.set(Context.USER, Scope.APPLICATION, CalendarPortletUtils.HOME_PAGE_CALENDAR_SETTINGS, SettingValue.create("NonDisplayedCalendar:" + cals.toString()));
  return setting();
}
origin: exoplatform/platform

@Ajax
@Resource
public Response.Content deleteCalendar(String calendarId) throws Exception {
  nonDisplayedCalendarList = (String[]) ArrayUtils.add(nonDisplayedCalendarList, calendarId);
  StringBuffer cal = new StringBuffer();
  int i = 0;
  while (i < nonDisplayedCalendarList.length) {
      cal.append(nonDisplayedCalendarList[i]).append(",");
    i++;
  }
  settingService_.remove(Context.USER, Scope.APPLICATION, CalendarPortletUtils.HOME_PAGE_CALENDAR_SETTINGS);
  settingService_.set(Context.USER, Scope.APPLICATION, CalendarPortletUtils.HOME_PAGE_CALENDAR_SETTINGS, SettingValue.create("NonDisplayedCalendar:" + cal.toString()));
  return setting();
}
origin: exoplatform/platform

@Ajax
@Resource
public Response.Content delete() throws Exception {
  //set Delete
  String userId = null;
  SessionProvider sProvider = null;
  try {
    userId = RequestContext.getCurrentInstance().getRemoteUser();
    sProvider = SessionProvider.createSystemProvider();
    Node userPrivateNode = nodeHierarchyCreator_.getUserNode(sProvider, userId).getNode(GettingStartedUtils.JCR_APPLICATION_NODE);
    if (userPrivateNode.hasNode(GettingStartedUtils.JCR_GS_NODE)) {
      Node gettingStartedNode = userPrivateNode.getNode(GettingStartedUtils.JCR_GS_NODE);
      if (gettingStartedNode.hasProperty(GettingStartedUtils.JCR_DELETE_GADGET_PROPERTY_NAME)) {
        gettingStartedNode.setProperty(GettingStartedUtils.JCR_DELETE_GADGET_PROPERTY_NAME, true);
        gettingStartedNode.save();
      }
    }
  } catch (Exception E) {
    LOG.error("GettingStarted Portlet : Can not delete Portlet from ApplicationRegistry", E.getLocalizedMessage(), E);
  } finally {
    if (sProvider != null) {
      sProvider.close();
    }
  }
  return gettingStarted.ok();
}
origin: exoplatform/platform

@Resource
public Response.Content onlineFriends() {
  String userId = ConversationState.getCurrent().getIdentity().getUserId();
  JSONArray json = getOnlineFriends(userId);
  return Response.ok(json.toString()).withMimeType("application/json; charset=UTF-8").withHeader("Cache-Control", "no-cache");
}
origin: exoplatform/platform

/**
 * return the object data contains the url of logo and the bar navigation
 * 
 * @param httpContext
 * @return Resource
 */
@Ajax
@Resource
public Response.Content getResource(HttpContext httpContext) {
 JSONObject json = new JSONObject();
 String style = "Dark";
 if (settingService.get(Context.GLOBAL, Scope.GLOBAL, BAR_NAVIGATION_STYLE_KEY) != null) {
  style = (String) settingService.get(Context.GLOBAL, Scope.GLOBAL, BAR_NAVIGATION_STYLE_KEY)
                  .getValue();
 }
 try {
  json.put("error", "0");
  json.put("style", style);
  json.put("logoUrl", getLogoUrl(httpContext, true));
 } catch (JSONException ex) {
  if (LOG.isErrorEnabled()) {
   LOG.error("Can not put json value", ex);
  }
 }
 return Response.ok(json.toString()).with(PropertyType.MIME_TYPE, "application/json");
}
origin: exoplatform/platform

@Ajax
@Resource
public Response saveActivePlugin(String pluginId, String inputs) {
 JSON data = new JSON();
 try {
  Map<String, String> datas = parserParams(inputs);
  for (String channelId : datas.keySet()) {
   pluginSettingService.saveActivePlugin(channelId, pluginId, Boolean.valueOf(datas.get(channelId)));
  }
  data.set("status", "ok");
  data.set("result", datas);
 } catch (Exception e) {
  LOG.error("Failed to save settings", e);
  data.set("status", "false");
  data.set("error", "Exception: " + e.getMessage());
 }
 return Response.ok(data.toString()).withMimeType("application/json");
}

origin: exoplatform/platform

@Ajax
@Resource
public Response.Content setting() throws Exception {
  calendarDisplayedList.clear();
  calendarNonDisplayedList.clear();
  String username = RequestContext.getCurrentInstance().getRemoteUser();
  String defaultCalendarLabel = "Default";
  Iterator itr1 = getAllCal(username).iterator();
  while (itr1.hasNext()) {
    org.exoplatform.calendar.service.Calendar c = (org.exoplatform.calendar.service.Calendar) itr1.next();
    if(c.getGroups()==null) {
      if (c.getId().equals(Utils.getDefaultCalendarId(username)) && c.getName().equals(calendarService_.getDefaultCalendarName())) {
        c.setName(defaultCalendarLabel);
      }
    }
    if (CalendarPortletUtils.contains(nonDisplayedCalendarList, c.getId())) {
      calendarNonDisplayedList.add(c);
    } else {
      calendarDisplayedList.add(c);
    }
  }
  return setting.with().set("displayedCalendar", calendarDisplayedList).
      set("nonDisplayedCalendar", calendarNonDisplayedList).ok().withCharset(Tools.UTF_8);
}
origin: exoplatform/platform

@Ajax
@Resource
public Response.Content calendarHome() throws Exception {
origin: exoplatform/platform

@Resource
public Response.Content uploadFile(HttpContext httpContext, FileItem file, String browser) throws IOException {
 if (browser != null && browser.equals("html5")) {
origin: exoplatform/platform

@Resource
public Response.Content save(String style, String isChangeLogo, HttpContext httpContext) {
 if (isAdmin()) {
origin: exoplatform/platform

@Ajax
@Resource
public Response getGsList(String reload) throws Exception {
  HashMap bundle = new HashMap();
origin: exoplatform/platform

@Ajax
@Resource
public Response saveSender(String name, String email) {
 JSON data = new JSON();
 data.set("name", name);
 data.set("email",email);
 if(name != null && name.length() > 0 && NotificationUtils.isValidEmailAddresses(email)) {
  settingService.set(org.exoplatform.commons.api.settings.data.Context.GLOBAL, Scope.GLOBAL,
            NotificationPluginUtils.NOTIFICATION_SENDER_NAME, SettingValue.create(name));
  settingService.set(org.exoplatform.commons.api.settings.data.Context.GLOBAL, Scope.GLOBAL,
            NotificationPluginUtils.NOTIFICATION_SENDER_EMAIL, SettingValue.create(email));
  data.set("status","OK");
 } else {
  data.set("status","NOK");
 }
 return Response.ok(data.toString()).withMimeType("application/json");
}
juzuResource<init>

Popular methods of Resource

  • id
  • method

Popular in Java

  • Making http post requests using okhttp
  • runOnUiThread (Activity)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • setContentView (Activity)
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now