Giter Club home page Giter Club logo

java-library-glpi's Introduction

GLPI API Library for Java

GLPI banner

License Follow twitter Project Status: WIP Telegram Group Conventional Commits Greenkeeper badge

GLPI (Gestionnaire Libre de Parc Informatique) is a free IT Asset Management, issue tracking system and service desk solution. This open source software is written in PHP.

It helps companies to manage their information system, since it's able to build an inventory of all the organization's assets and to manage administrative and financial tasks.

Table of Contents

Synopsis

This library created in Java features several functionalities common to all GLPI APIs, for example:

  • HTTP transport to APIs.
  • Error handling
  • Authentication
  • JSON parsing
  • Custom Item Types
  • Media download/upload
  • Batching.

You will be able to call all the methods that belong to the GLPI REST API, for more information visit the project's website.

Build Status

LTS Bleeding Edge
Circle CI build Circle CI build

Installation

External Library Manager

Maven

<dependency>
  <groupId>org.glpi</groupId>
  <artifactId>api</artifactId>
  <version>1.0.0</version>
  <type>pom</type>
</dependency>

Gradle

compile 'org.glpi:api:1.0.0@jar'

Apache Ivy

<dependency org='org.glpi' name='api' rev='1.0.0'>
  <artifact name='api' ext='pom' ></artifact>
</dependency>

You can also find us on Bintray repository.

Manually

In your setting.gradle add the following line:

include ':my-project', ':java-library-glpi'

And in your build.gradle add:

implementation project(':java-library-glpi')

Matrix

Library 1.0.0
Android API
Library 1.0.0
Java

Documentation

We maintain a detailed documentation of the project on the website.

Versioning

In order to provide transparency on our release cycle and to maintain backward compatibility, GLPI is maintained under the Semantic Versioning guidelines. We are committed to following and complying with the rules, the best we can.

See the release section of our GitHub project for changelogs for each release version. Release announcement posts on the official Teclib' blog contain summaries of the most noteworthy changes made in each release.

Contact

For notices about major changes and general discussion of GLPI development, subscribe to the /r/glpi subreddit. You can also chat with us via IRC in #GLPI on freenode or @glpien on Telegram.

Contribute

Want to file a bug, contribute some code, or improve documentation? Excellent! Read up on our guidelines for contributing and then check out one of our issues in the Issues Dashboard.

Professional Services

The GLPI Network services are available through our Partner's Network. We provide special training, bug fixes with editor subscription, contributions for new features, and more.

Obtain a personalized service experience, associated with benefits and opportunities.

Copying

  • Name: GLPI is a registered trademark of Teclib'.
  • Code: you can redistribute it and/or modify it under the terms of the GNU General Public License (GPLv3).
  • Documentation: released under Attribution 4.0 International (CC BY 4.0).

java-library-glpi's People

Contributors

ajsb85 avatar greenkeeper[bot] avatar naylin15 avatar rafaelje avatar teclib-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

java-library-glpi's Issues

HTTP requests File location

Hello my name is Mamun. I'm looking for the file where the HTTP requests are. Could someone help me find it?
Thank you

Illegal Argument Exception: Illegal URL

Describe the bug
When I try to call the GLPI class it gives this error.
image

    void start(String url) {

        OkHttpClient okHttpClient = new OkHttpClient().newBuilder()
                .connectTimeout(CONNECT_TIMEOUT, TimeUnit.SECONDS)
                .readTimeout(READ_TIMEOUT, TimeUnit.SECONDS)
                .writeTimeout(WRITE_TIMEOUT, TimeUnit.SECONDS)
                .build();

        retrofit = new Retrofit.Builder()
                .baseUrl(url)
                .client(okHttpClient)
                .addConverterFactory(GsonConverterFactory.create())
                .addCallAdapterFactory(RxJava2CallAdapterFactory.create())
                .build();

    }
}
2018-12-21 11:01:24.027 12537-12537/? E/AndroidRuntime: FATAL EXCEPTION: main
    Process: org.flyve.admin.dashboard, PID: 12537
    java.lang.RuntimeException: Unable to start activity ComponentInfo{org.flyve.admin.dashboard/org.flyve.admin.dashboard.login.LoginActivity}: java.lang.IllegalArgumentException: Illegal URL: 
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3194)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3302)
        at android.app.ActivityThread.-wrap12(Unknown Source:0)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1891)
        at android.os.Handler.dispatchMessage(Handler.java:108)
        at android.os.Looper.loop(Looper.java:166)
        at android.app.ActivityThread.main(ActivityThread.java:7425)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:921)
     Caused by: java.lang.IllegalArgumentException: Illegal URL: 
        at retrofit2.Retrofit$Builder.baseUrl(Retrofit.java:454)
        at org.glpi.api.ServiceGenerator.start(ServiceGenerator.java:58)
        at org.glpi.api.GLPI.<init>(GLPI.java:79)
        at org.flyve.admin.dashboard.login.LoginActivity.onCreate(LoginActivity.java:67)
        at android.app.Activity.performCreate(Activity.java:7372)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1218)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3147)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3302) 
        at android.app.ActivityThread.-wrap12(Unknown Source:0) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1891) 
        at android.os.Handler.dispatchMessage(Handler.java:108) 
        at android.os.Looper.loop(Looper.java:166) 
        at android.app.ActivityThread.main(ActivityThread.java:7425) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:921) 
2018-12-21 11:01:24.054 751-2461/? E/iMonitor: FaultDetect: DUMPTOOL_PRINTF return.
final GLPI glpi = new GLPI(MainActivity.this, BuildConfig.GLPI_URL);

Create documentation

Hi, @Naylin15

Please, create these files in this repository

  • README in markdown file format
  • LICENSE in markdown file format (GPL 3.0)
  • GitHub templates for issues and PRs
  • Contribute Guidelines

Thank you.

An in-range update of conventional-github-releaser is breaking the build 🚨

The dependency conventional-github-releaser was updated from 3.1.2 to 3.1.3.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

conventional-github-releaser is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details
  • ci/circleci: build: Your tests failed on CircleCI (Details).

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Handle multiple request to download files

Is your feature request related to a problem? Please describe.
Is required download multiple files.

Describe the solution you'd like
Include a handler to multiple download of files.

Parameters (query string) for Get All Items endpoint

Hi, @rafaelje

Could you add support in the library for these options?

Parameters: (query string)

  • expand_dropdowns (default: false): show dropdown name instead of id. Optional.
  • get_hateoas (default: true): Show relation of item in a links attribute. Optional.
  • only_id (default: false): keep only id keys in returned data. Optional.
  • range (default: 0-50): a string with a couple of number for start and end of pagination separated by a '-'. Ex: 150-200. Optional.
  • sort (default 1): id of the searchoption to sort by. Optional.
  • order (default ASC): ASC - Ascending sort / DESC Descending sort. Optional.
  • searchText (default NULL): array of filters to pass on the query (with key = field and value the text to search)
  • is_deleted (default: false): Return deleted element. Optional.

Project site

Hi, @Gianfranco97

Could you create the project site of this repository?

Use the same design of the Inventory Library for Android

Thanks.

DevOps tasks

  • Continuous integration
  • Continuous deployment
  • Changelog
  • Test reports
  • Coverage reports
  • Code documentation
  • Artifacts for downloads and release description

Migrate project site information to glpi-project.org

Observed Results:

As requested, the information in the project sites will be migrated to the main site of GLPI Project (glpi-project.org)

Expected behavior:

  • Wordpress plugin to sync the content with GitHub
  • Migrate How tos section
    • Installation
    • Getting started
    • How it works
    • Use cases
    • How to contribute
  • Migrate development section
    • Code Documentation
    • Coverage
    • Test reports
  • Screenshots (When applied)
  • Versioning

Avoid answers with HTML

Observed Results:

sometimes the library returns answers with HTML

Expected behavior:

Validate type of response

Handle HTTP Request to the Session

Is your feature request related to a problem? Please describe.
Some session-related requests are missing

Describe the solution you'd like
Handle the requests for this

License Header

Hi, @rafaelje

Please, use this header for the copyright information.

/* 
 *  LICENSE
 *
 *  This file is part of the GLPI API Client Library for Java,
 *  a subproject of GLPI. GLPI is a free IT Asset Management.
 *
 *  GLPI is free software: you can redistribute it and/or
 *  modify it under the terms of the GNU General Public License
 *  as published by the Free Software Foundation; either version 3
 *  of the License, or (at your option) any later version.
 *
 *  GLPI 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 General Public License for more details.
 *  --------------------------------------------------------------------
 *  @author    Rafael Hernandez - <[email protected]>
 *  @copyright (C) 2017 Teclib' and contributors.
 *  @license   GPLv3 https://www.gnu.org/licenses/gpl-3.0.html
 *  @link      https://github.com/glpi-project/angularjs-glpi
 *  @link      http://www.glpi-project.org/
 *  --------------------------------------------------------------------  */

Test instrumentation with Firebase

Is your feature request related to a problem? Please describe.
Now the library requires to implement test instrumentation during CI

Describe the solution you'd like
Find the way in that Firebase does the test with the library

Client API REST for GLPI

Hi, @rafaelje

This is the main task, create the Gradle plugin for the GLPI API REST.
Generic for any project in the future.

This is an example.
https://github.com/google/google-api-java-client/
https://developers.google.com/api-client-library/java/

  • killSession
  • getMyProfiles
  • getActiveProfile
  • changeActiveProfile
  • getMyEntities
  • getActiveEntities
  • changeActiveEntities
  • getFullSession
  • getAnItem
  • getAllItems
  • getSubItems
  • getMultipleItems
  • listSearchOptions
  • searchItems
  • addItem
  • addItems
  • lostPassword
  • updateItem
  • updateItems
  • deleteItem
  • deleteItems

Code documentation

Hi, @Naylin15

Could you write the documentation of the code?
And please share with us the feedback to merge in all client libraries common error messages.

Thanks.

Parameters (query string) for Get Sub Items endpoint

Hi, @rafaelje

Could you add support in the library for these options?

Parameters: (query string)

  • id: unique identifier of the parent itemtype. Mandatory.
  • expand_dropdowns (default: false): show dropdown name instead of id. Optional.
  • get_hateoas (default: true): Show item's relations in a links attribute. Optional.
  • only_id (default: false): keep only id keys in returned data. Optional.
  • range (default: 0-50): a string with a couple of number for start and end of pagination separated by a '-' char. Ex: 150-200. Optional.
  • sort (default 1): id of the "searchoption" to sort by. Optional.
  • order (default ASC): ASC - Ascending sort / DESC Descending sort. Optional.

Test app

Hi, @rafaelje

Could you provide an apk, to test the GLPI API Client?

Thanks

Is the project dead ?

Hey guys,

I see that there are no releases available on bintray and the project seems to not have seen any commit since a long time. Is it completely dead ?

Parameters (query string) for Get An Item endpoint

Hi, @rafaelje

Could you add support in the library for these options?

Parameters: (query string)

  • id: unique identifier of the itemtype. Mandatory.
  • expand_dropdowns (default: false): show dropdown name instead of id. Optional.
  • get_hateoas (default: true): Show relations of the item in a links attribute. Optional.
  • get_sha1 (default: false): Get a sha1 signature instead of the full answer. Optional.
  • with_devices: Only for [Computer, NetworkEquipment, Peripheral, Phone, Printer], retrieve the associated components. Optional.
  • with_disks: Only for Computer, retrieve the associated file-systems. Optional.
  • with_softwares: Only for Computer, retrieve the associated software's installations. Optional.
  • with_connections: Only for Computer, retrieve the associated direct connections (like peripherals and printers) .Optional.
  • with_networkports: Retrieve all network's connections and advanced network's informations. Optional.
  • with_infocoms: Retrieve financial and administrative informations. Optional.
  • with_contracts: Retrieve associated contracts. Optional.
  • with_documents: Retrieve associated external documents. Optional.
  • with_tickets: Retrieve associated itil tickets. Optional.
  • with_problems: Retrieve associated itil problems. Optional.
  • with_changes: Retrieve associated itil changes. Optional.
  • with_notes: Retrieve Notes. Optional.
  • with_logs: Retrieve historical. Optional.

Import the library into the Android MDM Dashboard

Describe the bug
I try to import the library and i try in many different ways,
First, I create a package with the name library in the MDM dashboard project and copy and paste the library inside the package, then i include it in the build.gradle putting this sentence
in the build gradle=> implementations ':library:glpi'
in the setting gradle =>include ':library:glpi?
and it gives me this error

Could not find method buildConfigField() for arguments [String, GLPI_USER, BuildType_Decorated{name=glpi_user, debuggable=false, testCoverageEnabled=false, jniDebuggable=false, pseudoLocalesEnabled=false, renderscriptDebuggable=false, renderscriptOptimLevel=3, minifyEnabled=false, zipAlignEnabled=true, signingConfig=null, embedMicroApp=true, mBuildConfigFields={}, mResValues={}, mProguardFiles=[], mConsumerProguardFiles=[], mManifestPlaceholders={}}] on BuildType_Decorated{name=debug, debuggable=true, testCoverageEnabled=false, jniDebuggable=false, pseudoLocalesEnabled=false, renderscriptDebuggable=false, renderscriptOptimLevel=3, minifyEnabled=false, zipAlignEnabled=true, signingConfig=SigningConfig_Decorated{name=debug, storeFile=C:\Users\erikc\.android\debug.keystore, storePassword=android, keyAlias=AndroidDebugKey, keyPassword=android, storeType=C:\Users\erikc\.android\debug.keystore, v1SigningEnabled=true, v2SigningEnabled=true}, embedMicroApp=false, mBuildConfigFields={}, mResValues={}, mProguardFiles=[], mConsumerProguardFiles=[], mManifestPlaceholders={}} of type com.android.build.gradle.internal.dsl.BuildType.
Open File

Second, i try including the example sentences but it doesnt work, it gives me this error

Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve org.glpi:api:0.1.0.
Open File
Show Details


Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve org.glpi:api:0.1.0.
Open File
Show Details


Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not resolve org.glpi:api:0.1.0.
Open File
Show Details


Unable to resolve dependency for ':app@release/compileClasspath': Could not resolve org.glpi:api:0.1.0.
Open File
Show Details


Unable to resolve dependency for ':app@releaseUnitTest/compileClasspath': Could not resolve org.glpi:api:0.1.0.
Open File
Show Details

Also, we should change in the documentation of the java-library-glpi/example/README.md
compile 'org.glpi:api:0.1.0'@aar
for
implementation 'org.glpi:api:0.1.0'@arr

Change view Example and add fake model

Is your feature request related to a problem? Please describe.
Actually the view example no-show if it was success or error request, also no have data about connection about the user

Describe the solution you'd like
Show a list if it was a success or error the request with the library and create fake data about make the request about the user

Compatibility Matrix

Hi, @Naylin15

Could you add a compatibility matrix to the README file?

Similar to this format:

GLPI 9.1.1 9.1.2 9.1.3 9.2.0
GLPI API Client 1.x.x 1.x.x 1.x.x 2.0.0-dev

Handle HTTP Request to the Files

Is your feature request related to a problem? Please describe.
Missing requests to the handle of the files

Describe the solution you'd like
Include requests to the handle of the files

New Group ID, Artifact ID and Maven repository

Hi, @rafaelje

We transferred the ownership to @glpi-project
So, we need to change the groupId and artifactId

My proposal:

<dependency>
   <groupId>org.glpi</groupId>
   <artifactId>api</artifactId>
   <version>0.2.0</version>
   <type>pom</type>
</dependency>

groupId: org.glpi or org.glpi_project

Reference:
https://docs.oracle.com/javase/tutorial/java/package/namingpkgs.html

Here is the new repository to publish the library:
https://bintray.com/glpi-project/maven-repository/

Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.