mercredi 7 octobre 2015

Alfresco ECM - magique ! quelques commandes pour tester l'Upload de documents depuis z/os

Alfresco ECM - magique !

mes débuts avec CURL pour tester l'API Rest en vue de Upload de documents sur le site de test dans le cloud

il faut  un login pour récupérer un ticlet (alf_ticket)

curl -k --proxy http://10.180.180.248:80  "https://365a1c.trial.alfresco.com/alfresco/service/api/login?pw=Klesia2015&u=kls-jean"

réponse:
TICKET_2d203be6b0c6cface6c2af60872a3f39fa8e8237

(re)validation du ticket si on est pas sûr du time out
curl -k --proxy http://10.180.180.248:80  "https://365a1c.trial.alfresco.com/alfresco/service/api/login/ticket/TICKET_2d203be6b0c6cface6c2af60872a3f39fa8e8237?alf_ticket=TICKET_2d203be6b0c
6cface6c2af60872a3f39fa8e8237"

TICKET_2d203be6b0c6cface6c2af60872a3f39fa8e8237


signature du serveur (juste pour savoir s'il est là !!)

curl -k --proxy http://10.180.180.248:80  "https://365a1c.trial.alfresco.com/alfresco/service/api/server"


 Liste des sites
 https://365a1c.trial.alfresco.com/alfresco/service/api/admin-sites?alf_ticket=TICKET_2d203be6b0c6cface6c2af60872a3f39fa8e8237
  idem
 https://365a1c.trial.alfresco.com/alfresco/service/api/sites?alf_ticket=TICKET_2d203be6b0c6cface6c2af60872a3f39fa8e8237

 liste d'un site
 https://365a1c.trial.alfresco.com/alfresco/service/api/sites/sitedetestklesia?alf_ticket=TICKET_2d203be6b0c6cface6c2af60872a3f39fa8e8237

 {
        "url": "\/alfresco\/service\/api\/sites\/sitedetestklesia",
        "sitePreset": "site-dashboard",
        "shortName": "sitedetestklesia",
        "title": "SiteDeTestKlesia",
        "description": "site pour test Klesia",
        "node": "\/alfresco\/service\/api\/node\/workspace\/SpacesStore\/88125f29-57ff-492f-acd7-d2afffde0a57",
        "tagScope": "\/alfresco\/service\/api\/tagscopes\/workspace\/SpacesStore\/88125f29-57ff-492f-acd7-d2afffde0a57",
        "siteManagers":
        [
                        "kls-jean",
                        "bdipoi@club-internet.fr",
                        "kls-nathalie",
                        "kls-denis"
        ],
                "isMemberOfGroup": false,
        "isPublic": true,
        "visibility": "PUBLIC"
}



 upload document
curl -k --proxy http://10.180.180.248:80  --form filedata=@SL12.S269.AD17076.txt --form siteid=sitedetestklesia --form containerid=documentLibrary
--form uploaddirectory=TestjRO "https://365a1c.trial.alfresco.com/alfresco/service/api/upload?alf_ticket=TICKET_2d203be6b0c6cface6c2af60872a3f39fa8e8237"
{
   "nodeRef": "workspace://SpacesStore/1c1a32dc-d60b-4a7a-a3a6-408dccca0488",
   "fileName": "SL12.S269.AD17076.txt",
   "status":
   {
      "code": 200,
      "name": "OK",
      "description": "File uploaded successfully"
   }
}

curl -k --proxy http://10.180.180.248:80  --form filedata=@SL12.S269.AD17076.txt --form filename=Test_de_tags --form siteid=sitedetestklesia --form containerid=documentLibrary --form uploa
ddirectory=TestjRO "https://365a1c.trial.alfresco.com/alfresco/service/api/upload?alf_ticket=TICKET_2d203be6b0c6cface6c2af60872a3f39fa8e8237"
{
   "nodeRef": "workspace://SpacesStore/7ed531b5-f8cd-4aa3-aefd-5480d50c1252",
   "fileName": "Test_de_tags",
   "status":
   {
      "code": 200,
      "name": "OK",
      "description": "File uploaded successfully"
   }
}

liste all tags
curl -k --proxy http://10.180.180.248:80  "https://365a1c.trial.alfresco.com/alfresco/service/api/tags/workspace/SpacesStore?alf_ticket=TICKET_2d203be6b0c6cface6c2af60872a3f39fa8e8237"

[
      "code infog",
      "date de traitement"
]

upload
curl -k --proxy http://10.180.180.248:80  --form filedata=@SL12.S269.AD17076.txt --form filename=Test_de_tags.txt --form siteid=sitedetestklesia --form containerid=documentLibrary --form uploaddirectory=TestjRO "https://365a1c.trial.alfresco.com/alfresco/service/api/upload?alf_ticket=TICKET_eff62d08eaa8ae1e1a70e9622f1bd8edaa53450b"
{
   "nodeRef": "workspace://SpacesStore/5516a7b1-5370-4604-b181-28a04362730c",
   "fileName": "Test_de_tags.txt",
   "status":
   {
      "code": 200,
      "name": "OK",
      "description": "File uploaded successfully"
   }
}
Add Tag (marche pas)
curl -k --proxy http://10.180.180.248:80 --form essai_de_tag "https://365a1c.trial.alfresco.com/alfresco/service/api/tags/workspace/SpacesStore/5516a7b1-5370-4604-b181-28a04362730c/tags?alf_ticket=TICKET_eff62d08eaa8ae1e1a70e9622f1bd8edaa53450b"

Get nodes for tag
curl -k --proxy http://10.180.180.248:80  "https://365a1c.trial.alfresco.com/alfresco/service/api/tags/workspace/SpacesStore/essaidetag/nodes?alf_ticket=TICKET_0d4bb8e4eaf0a8508bcba0237a55
5c3cd1e1cdb6"
[
                {
                        "nodeRef" : "workspace:\/\/SpacesStore\/94d684e1-7ccb-4fde-91c5-c90c3c2c8c9d",
                        "url" : "\/alfresco\/service\/api\/node\/workspace\/SpacesStore\/94d684e1-7ccb-4fde-91c5-c90c3c2c8c9d"
                }
]

create new tag

get authentication
curl -k --proxy http://10.180.180.248:80  "https://365a1c.trial.alfresco.com/alfresco/service/api/authentication?alf_ticket=TICKET_d281d76427ae7d105ae9e524c0e225fdaa6fd7d0
{
        "data":
        {
                "creationAllowed": true
        }
}

 get nodes tags
curl -k --proxy http://10.180.180.248:80 "https://365a1c.trial.alfresco.com/alfresco/service/api/node/workspace/SpacesStore/94d684e1-7ccb-4fde-91c5-c90c3c2c8c9d/tags?alf_ticket=TICKET_d281
d76427ae7d105ae9e524c0e225fdaa6fd7d0
[
                        "essaidetag"
]

dimanche 29 mars 2015

How to become a data-centric company

The mainstream adoption of big data is just now starting. Now, it’s time to figure out what to do with all this data – and how to exploit it for competitive advantage.
Ultimately, companies use data – big or not – to solve business problems. The data-centric company, however, doesn’t just treat data as an asset – it treats data as gold – and they’re willing to pay for it, too. In fact, many data-centric companies don’t even look like data-centric companies at first glance, rather they masquerade as “service providers” – like Google’s search engine or Amazon’s online retail platform –, providing services with the end goal of simply collecting data. In fact, Amazon pioneered this strategy of collecting and exploiting data by layering user data on top of open ISBN data to create new value. Other companies design loyalty programs to drive data collection, like, for example, customer rewards programs at grocery stores or gas stations. By offering discounts on seemingly random products or savings at the pump, they are literally paying customers to provide data through enrolling in their user loyalty programs. (Conversely, you could look at opting-out – or, not signing up for the saver card – as incurring a privacy tax: you’re paying full price to keep your data to yourself.)
It’s a bold statement to say that data-centric equates to competitive advantage. However, there are competitive advantages earned by data-centric companies that have truly revolutionized the business intelligence (BI) industry.
Here’s how they do it:
They are Data Harvesters
Data-centric companies collect and harvest data from everywhere. One of the “old ways” of thinking in BI was to ask what data was already available, and how to integrate the data to define metrics or map it to an already pre-defined metric. Data-centric companies tackle that question another way – instead of figuring out how to use what data is already available to answer metrics, they begin with first addressing the business problem that needs to be solved, then imagine the data needed – and then go out and find it or create it through new apps (like mobile) or collection agents.
Data-centric companies leverage external public and purchased data, big data, … – whatever data through whatever means necessary, including internal sources, mobile apps, wearables, sensors, and so on. Even a weather app can bring in untapped value. Being a data harvester is simply the willingness to collect every piece of data about your customers and people any way you can in order to gain insights about existing customers and relate that to future customers.
They Live an Analytic Culture
Data-centric companies create (and live and breathe) within an analytic culture – and they make it look easy, too. This analytic culture can be broken down into three categories.
  • Insight: mining, clustering, and using segmentation to understand customers, their networks, and – more important – their influence --, as well as product insights.
  • Optimization: of business functions, processes, and models through the use of analytics.
  • Innovation: Discover new and disruptive business models that stay true to company brand but provide pathways to foster the evolution and growth of customer base.
One of the mainstays of the data-centric culture is to drop biases. Look for the data, and derive correlations from there. Or, ask not what you can do for your data, but what your data can do for you.
They Think Long Term
Data-centric companies find way to perpetuate lifetime value through the acquisition of new, multi-generational customers. Remember: the data you have now only shows a current snapshot of your environment. Thinking data-centric is thinking long-term. It’s looking for patterns in the data to see where your company is, sure, but more important to look at where it’s going, and then developing a plan to work towards getting there.
To data-centric companies, thinking long-term means thinking about customer engagement. They maintain a high brand-to-customer focus, where the brand itself is largely defined by the customer’s sentiment and influence. For the customer, the relationship to the brand is a connection assembled through experience. This, for example, is why I buy books from Amazon (for practicality and selection), but I spend weekend days curled up at Barnes and Nobles flipping through stacks of books and sipping coffee – it’s an experience.
They Take Action
Finally, data-centric companies act on analytics. Data without action holds no value on its own: it’s the action that drives the business value. Acting on analytics isn’t a one-time thing either, but instead a continuous process of experimentation and improvement. Improving analytic models is as important as the data underneath is continually changing, too.
For a quick example, refer back to my earlier comment on the untapped value of the weather app. At a recent client event in Reno, Nevada we asked attendees how many weather apps they had on their smartphones. Many – at least a quarter of the room – noted they had more than one. The rub: having multiple analytic engines drives competition, and competition drives improvement.
Lastly: Don’t Forget About Mobile
Becoming a data-centric company requires an inevitable cultural change to achieve competitive advantage. Through competing on analytic abilities, companies can build deeper understandings of customers and relationships. Think about the data you collect today – and then realize that the activity you capture today (probably) isn’t enough. Being data-centric means going the extra mile in the way you interact with your data.
And, think mobile – and think about mobility as a way to instrument customers, too. Today, through mobile apps, customer’s “public personas” are available through APIs. And, mobile is a “me”-phenomenon: it’s a direct line to a customer’s most selfish desires – what they like, what they hate, what they want, and what they’re willing to say about it all. This social data tells us exactly who our customers are, and the best ways to make them happy. Remember, too, that mobile is a two-way phenomenon: companies think about pushing information and services to customers, but they also need to think (selfishly) about how to pull data back and learn from customer activity.