Package er.ajax.example2

Examples of er.ajax.example2.Application


     * @return the <code>UnitActionPackage</code>
     * @throws XmlException if an error ocurrs.
     */
    public static UnitActionPackage parseWADL(final String wadl) throws XmlException {
        ApplicationDocument applicationDocument = ApplicationDocument.Factory.parse(wadl);
        Application application = applicationDocument.getApplication();
        return Converter.convertWADLtoUnitActionPackage(application);
    }
View Full Code Here


public class WADLGenerator {   
    public static String generateWADLForMashupRESTService(String myCocktailPath, int mashupId) throws DAOException, IOException {
        Mashup mashup = getMashup(mashupId);
       
        ApplicationDocument applicationDocument = ApplicationDocument.Factory.newInstance();
        Application application = applicationDocument.addNewApplication();
        Resources resources = application.addNewResources();
        resources.setBase(myCocktailPath);
       
        Resource resource = resources.addNewResource();
        resource.setPath("RESTService/mashupId="+mashupId);
       
View Full Code Here

   
    public static String generateWADLForMashupRESTServiceJSON(String myCocktailPath, int mashupId) throws DAOException, IOException {
        Mashup mashup = getMashup(mashupId);
       
        ApplicationDocument applicationDocument = ApplicationDocument.Factory.newInstance();
        Application application = applicationDocument.addNewApplication();
        Resources resources = application.addNewResources();
        resources.setBase(myCocktailPath);
       
        Resource resource = resources.addNewResource();
        resource.setPath("RESTService/mashupId="+mashupId);
       
View Full Code Here

  public static String timestampString(NSTimestamp timestamp, boolean includeTime) {
    String timestampString;
    if (includeTime) {
      if (timestamp != null) {
        timestampString = new NSTimestampHelper().format(timestamp);
      }
      else {
        timestampString = "";
      }
    }
    else {
      if (timestamp != null) {
        timestampString = new NSTimestampHelper().mdy(timestamp);
      }
      else {
        timestampString = "";
      }
    }
View Full Code Here

import er.ajax.example2.helper.StringHelper;

public class DurationNamer {
  public static String timeFrom(NSTimestamp time, NSTimestamp baseTime) {
  StringBuilder results = new StringBuilder();
    StringHelper helper = new StringHelper();

    int years = DateUtils.difference(time, baseTime, Calendar.YEAR) - 1;
    int months;
    int days;
    int hours;
    int minutes;

    if (years > 1) {
      String year_label = helper.pluralize("year", years);
      results.append(years + " " + year_label);
    }
    else {
      months = DateUtils.difference(time, baseTime, Calendar.MONTH) - 1;
      if (months > 11) {
        results.append("about 1 year ago");
      }
      else if (months > 1) {
        String month_label = helper.pluralize("month", months);
        results.append(months + " " + month_label);
      }
      else {
        days = DateUtils.difference(time, baseTime, Calendar.DAY_OF_YEAR) - 1;
        if (days > 25) {
          results.append("about 1 month");
        }
        else if (days > 7) {
          int weeks = days / 7;
          String weeks_label = helper.pluralize("week", weeks);
          results.append(weeks + " " + weeks_label);
        }
        else if (days > 1) {
          if (days <= 2) {
            hours = DateUtils.difference(time, baseTime, Calendar.HOUR_OF_DAY) - 1;
            if (hours < 30) {
              results.append("about 1 day");
            }
            else {
              String days_label = helper.pluralize("day", days);
              results.append(days + " " + days_label);
            }
          }
          else {
            String days_label = helper.pluralize("day", days);
            results.append(days + " " + days_label);
          }
        }
        else {
          hours = DateUtils.difference(time, baseTime, Calendar.HOUR_OF_DAY) - 1;
          if (hours >= 20) {
            results.append("about 1 day");
          }
          else if (hours > 1) {
            String hours_label = helper.pluralize("hour", hours);
            results.append(hours + " " + hours_label);
          }
          else {
            minutes = DateUtils.difference(time, baseTime, Calendar.MINUTE) - 1;
            if (minutes >= 45) {
              results.append("about an hour");
            }
            else if (minutes > 20 && minutes < 45) {
              results.append("about half an hour");
            }
            else if (minutes > 1) {
              String minutes_label = helper.pluralize("minute", minutes);
              results.append(minutes + " " + minutes_label);
            }
            else {
              return "this very minute";
            }
View Full Code Here

  public ExpensiveUpdates(WOContext context) {
    super(context);
    _comments = new NSMutableArray<Comment>();
    for (int i = 0; i < 5; i++) {
      Comment c = new Comment();
      c.setText(ERXLoremIpsumGenerator.sentences(1));
      _comments.addObject(c);
    }
  }
View Full Code Here

  public Object cacheKey() {
    return Integer.valueOf(_comments.count());
  }

  public WOActionResults addComment() {
    Comment comment = new Comment();
    comment.setText(_newComment);
    _newComment = null;
    _comments.addObject(comment);
    return null;
  }
View Full Code Here

                if (authentication instanceof PreAuthenticatedAuthenticationToken) {
                    PreAuthenticatedAuthenticationToken authToken = (PreAuthenticatedAuthenticationToken) authentication;
                    final Object credentials = authToken.getCredentials();
                    if (credentials instanceof AuthorizationToken) {
                        AuthorizationToken token = (AuthorizationToken) credentials;
                        final Application applicationForToken = oAuth2MgmtService.getApplicationForToken(token);
                        String addConnectorCallbackURL = applicationForToken.addConnectorCallbackURL;
                        if (addConnectorCallbackURL !=null) {
                            String connectorName = location.substring(location.lastIndexOf("/")+1);
                            addConnectorCallbackURL += addConnectorCallbackURL.indexOf("?")==-1
                                                     ? "?connectorName=" + connectorName
View Full Code Here

    EntityManager em;

    @Override
    @Transactional(readOnly=false)
    public void createApplication(final long guestId, String organization, final String name, final String description, final String website) {
        Application app = new Application(guestId, organization, name, description, website);
        em.persist(app);
    }
View Full Code Here

    }

    @Override
    @Transactional(readOnly=false)
    public void deleteApplication(final long guestId, final String uid) {
        final Application app = getApplication(guestId, uid);
        if (app!=null)
            em.remove(app);
    }
View Full Code Here

TOP

Related Classes of er.ajax.example2.Application

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.