Normalizing files' titles in a Plone instance does not update views - plone

We have uploaded tons of files via FTP to a Plone intranet we're deploying. This step does not set the titles of the files; so searching for a file called: "invoice_policy.odt" it won't show up in a search by "invoice policy" (two words); cause the index for id's is a field index.
Moreover, the default plone lexicon does not split words by underscores, so setting the title to be just the id won't help either.
So, in order to improve our search recall, we have scripted (taken from several sources including some answers in StackOverflow) a quite simple normalization script: https://gist.github.com/3701401
However, after applying it to near 8000 files I see that the titles have changed, but the files still appear in the navigation with the id "invoice_policy.odt"; I have to edit the file and then save it in order for it to appear with its title in the navigation.
I have uploaded three images to flickr to show the process:
Image 1. The (last) file in its folder.
Image 2. When I click the file you may see it has a title (normalized with our script)
Image 3. I just clicked the title and the click the Save and went back to its containing folder. Now it's been shown properly.
Do I need to do (or undo) something in my script for it to work properly. Furthermore, although I (think I) enclosed each rename in its own transaction, I don't see any transaction in the Undo tab of the ZMI. I guess it's because it's not associate to a real request, is that so? Can I fix it?
Best regards,
Manuel.

You need to reindex the items, either one by one in your script, or in batch at the end. http://collective-docs.readthedocs.org/en/latest/searching_and_indexing/indexing.html will probably help.

Related

How to open 100000 different websites manually

I need to click in 100000 different url from websites to scrape different data about the website. The data has to be manually extracted because it is different on each website and it doesn't follow a pattern.
My question is, is there any program or script where I can paste the 100000 URL and it just open/preload some urls in tabs/windows so when I close one tab the next url opens in a new tab? This way I work in the main website tab that takes me 10 seconds to review and I click control+w and go to the next url.
This way I could save so much time instead of just clicking manually on each link and waiting for it to load.
You can use python web scraping or RPA(if you don't know basic python) and by logical steps, users can automate n number of tasks to be done.
Or you can also make use of 'pyautogui library' of python to click on visual things.
Thumbs up. If helped...

Scene7 URL parameters

Our business uses Adobe Scene7. One of the things we need to be able to do is share the URL of an image, to a vendor for all of the products with an image.
We have identified the construct of the URL to predict the link, and then we ping the image URL to ensure it is valid and available for viewing.
As of late, we've come into a problem where many of the images are not rendering...
Most images:
http://s7d5.scene7.com/is/image/LuckyBrandJeans/7W64372_960_1
Some images:
https://s7d9.scene7.com/is/image/LuckyBrandJeans/7Q64372_960_1
The only difference appears to be the s7d5 becomes s7d9 on some images. What drives that?
How do we get a list of all of those URL's if we can't predict the d9 vs d5?
I'm not sure it matters. I think all you need is the filename. It looks like if you take the filename "7W64372_960_1" it works on both s7d5 and s7d3:
http://s7d5.scene7.com/is/image/LuckyBrandJeans/7W64372_960_1
http://s7d9.scene7.com/is/image/LuckyBrandJeans/7W64372_960_1
In fact, you can change it to s7d1, s7d2, s7d3, etc. and it still works.
So, I think if you were to build some sort of template you could just pick whatever URL you wanted and just append the filename on the end like:
http://s7d5.scene7.com/is/image/LuckyBrandJeans/{{imageFileName}}
We have the same thing with our company.
One domain serves the images for the lower "sandbox" environment (d5) and the other serves the images to your live environment (d9).

Is there a way to obfuscate Wordpress file download URLs

Im using ACF to associate a custom file field to WooCommerce on my site. That field will receive the customers invoice PDF once the order is completed. My problem is the files have a sequence numbering, which is helpful to keep so I can quickly identify them in the admin interface, but I don't want my customers to able to guess the numbering and easily open other invoices.
Is there any way to add a small obfuscation so that the URLs don't show any sequence any obvious sequence pattern?

DPF portfolio with fillable dependable pdf forms

I have pdf portfolio with some fillable pdf forms in it. This portfolio is generated via LiveCycle services.
All of these pdf forms have equivalent fields. For example: portfolio consists of pdfX, pdfY, pfdZ. And every pdf have fillable field "userName".
And it is not convenient for a user to put the same data to every pdf form.
User wants to put data only to the first one pdf. So, other pdf forms must be filled with data automatically.
And, there is one restriction: user can't send portfilio back to the server, so all automated changes must be done on the client side.
So, is there any way to solve such task?
If there is, please describe some algorithm\strategy of how this can be done.
Thank you.
You seem to be looking for a way to programmatically access or change the content of a portfolio element from another portfolio element. This requires the first element to be aware of the other element.
This is what I found on The PDF Developer Junkie Blog when I investigated in the possibilites of scripting portfolios. Take a look at the last paragraph. Maybe it'll point you in the right direction.
Dennis Smith | April 07, 2010 3:13 PM |
I hope you can help me. I have two pdf files combined into 1 portfolio. File 1 has a field “name” and File 2 has a field “lastname”. When someone enters a value into the field “name” in File 1, I want File 2 to contain the same value in the field “lastname”. This would be for files that are distributed to the public, so I really can’t change the security levels of the user’s computers. Right now I am combining File 1 and File 2 into a larger File 3 and just handling all of this with javascript.
getField(“lastname”).value=getField(“name”).value;
Joel Geraci | April 07, 2010 3:28 PM |
Thanks for the comment: Unfortunately, that’s not possible without adding a folder level JavaScript that can add a menu item to synchronize the fields or by disabling the navigator (Flash UI) of the Portfolio.
If you disabled the navigator, you could add a button to the “Cover Sheet” that synchronized the fields.
The main issue is that items in a Portfolio cannot communicate directly with their peers and don’t know anything about their parent. The root PDF (cover sheet) does know about it’s children which is why a button placed there will be able to synch the fields.

Visio 2013: Limit displayed lines in a shape

Visio 2013: Create scrollbar for hidden overflow
.
I have a list of over 112 items. Which, is extensive for a simple diagram. I would like to have only 4 lines viewable and have a scroll bar to view the overflow.ties.
e.g.
I have a list of sites that are hosted on each server. To have all the sites for all servers displayed will decrease diagram readability. I need to set the max displayed lines to 4. The rest needs to be hidden. You should be able to view these by using a scroll bar.
This is a common practice in HTML. Hoping to find a way to do this with Visio 2013 also.
For example:
domain1.com
domain2.com
domain3.com
domain4.com
--Overflow--
domain5.com
domain6.com
andmanymore.com
Instead of doing the filtering in visio, provide already filtered data. ie: fill the list field already with a string, where the domains are separated by CHR(10).
This operation is easier to realise in excel/access/VBA.
I would send a draft, but I don't see a possibility to add attachments to answers.
HTH, otherwise don't hesitate to ask for details.
I guess that you have the list of domains in a user defined field.
Now add another field with the following formula mid(prop.yourlist,controls.start,prop.numberOfCharactersToDisplay)
where:
controls.start would be a control added to scroll your list and
prop.numberof.. the number of characters to display.
Insert now the new field to be displayed in your shape. Done.
These formulas will of course truncate your domains at any place in the string. If you want it to show always full lines, you should look for the line breaks (find(char(10), yourList)
HTH

Resources